mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
[dbmanager] Fix Update SQL Layer converts query to table name
Fixes #19843
This commit is contained in:
parent
f208191824
commit
a8bf1b8f05
@ -152,7 +152,8 @@ class DlgSqlLayerWindow(QWidget, Ui_Dialog):
|
||||
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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user