Navigation Menu

Skip to content

Commit

Permalink
[dbmanager] Don't trip up when loading a sql layer if sql ends with a ;
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 15, 2014
1 parent ffa431c commit 3bf6f3e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion python/plugins/db_manager/dlg_sql_window.py
Expand Up @@ -173,6 +173,10 @@ def loadSqlLayer(self):
query = self.editSql.text()
if query == "":
return

# remove a trailing ';' from query if present
if query.strip().endswith(';'):
query = query.strip()[:-1]

QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))

Expand Down Expand Up @@ -216,7 +220,11 @@ def fillColumnCombos(self):
if not escaped.search(query):
break
aliasIndex += 1


# remove a trailing ';' from query if present
if query.strip().endswith(';'):
query = query.strip()[:-1]

# get all the columns
cols = []
connector = self.db.connector
Expand Down

0 comments on commit 3bf6f3e

Please sign in to comment.