Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions plugin/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ def onLoad(self):
if self.cursor.fetchone() is None:
with open('init_db.sql') as f:
for stmnt in f.read().split(';'):
self.cursor.execute(stmnt)
self.connection.commit()
# Change: Remove whitespace and check for empty strings
clean_stmnt = stmnt.strip()
if clean_stmnt: # only if the string is not empty
self.cursor.execute(clean_stmnt)
self.connection.commit()

self.cursor.close()

Expand Down