Allow only CREATE in indexes

This commit is contained in:
shortcutme 2018-12-15 17:48:19 +01:00
parent 86dd57d13e
commit 47316741c1
No known key found for this signature in database
GPG Key ID: 5B63BAE6CB9613AE
1 changed files with 3 additions and 1 deletions

View File

@ -114,8 +114,10 @@ class DbCursor:
# Create indexes on table
# Return: True on success
def createIndexes(self, table, indexes):
# indexes.append("CREATE INDEX %s_id ON %s(%s_id)" % (table, table, table)) # Primary key index
for index in indexes:
if not index.strip().upper().startswith("CREATE"):
self.db.log.error("Index command should start with CREATE: %s" % index)
continue
self.execute(index)
# Create table if not exist