From 47316741c1d7a78dfad45c0b2a50780b19ce28e6 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Sat, 15 Dec 2018 17:48:19 +0100 Subject: [PATCH] Allow only CREATE in indexes --- src/Db/DbCursor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Db/DbCursor.py b/src/Db/DbCursor.py index 464f35b6..d0c57d9c 100644 --- a/src/Db/DbCursor.py +++ b/src/Db/DbCursor.py @@ -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