Skip to content
Permalink
Browse files

[dbmanager] Don't trip up when loading a sql layer if sql ends with a ;

  • Loading branch information
nyalldawson committed Sep 15, 2014
1 parent ffa431c commit 3bf6f3e472a8b0fe19250131ea3d8261ec1d0322
Showing with 9 additions and 1 deletion.
  1. +9 −1 python/plugins/db_manager/dlg_sql_window.py
@@ -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))

@@ -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

0 comments on commit 3bf6f3e

Please sign in to comment.
You can’t perform that action at this time.