Skip to content
Permalink
Browse files

[dbmanager] Fix Update SQL Layer converts query to table name

Fixes #19843
  • Loading branch information
elpaso committed Sep 20, 2018
1 parent f208191 commit a8bf1b8f05ac2d569fd58bdf9951e8a756344a5e
Showing with 2 additions and 1 deletion.
  1. +2 −1 python/plugins/db_manager/dlg_sql_layer_window.py
@@ -152,7 +152,8 @@ def __init__(self, iface, layer, parent=None):
match = re.search('^\((SELECT .+ FROM .+)\)$', sql, re.S)
if match:
sql = match.group(1)
if not sql.startswith('(') and not sql.endswith(')'):
# Need to check on table() since the parentheses were removed by the regexp
if not uri.table().startswith('(') and not uri.table().endswith(')'):
schema = uri.schema()
if schema and schema.upper() != 'PUBLIC':
sql = 'SELECT * FROM {0}.{1}'.format(self.db.connector.quoteId(schema), self.db.connector.quoteId(sql))

0 comments on commit a8bf1b8

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