mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
[db-manager] Allow multiline filters in sql window
Fixes #19956 - Update SQL layer results in invalid SQL expression
This commit is contained in:
parent
a1d130ac97
commit
94ded32f4e
@ -145,11 +145,11 @@ class DlgSqlLayerWindow(QWidget, Ui_Dialog):
|
||||
# First the SQL from QgsDataSourceUri table
|
||||
sql = uri.table()
|
||||
if uri.keyColumn() == '_uid_':
|
||||
match = re.search('^\(SELECT .+ AS _uid_,\* FROM \((.*)\) AS _subq_.+_\s*\)$', sql, re.S)
|
||||
match = re.search(r'^\(SELECT .+ AS _uid_,\* FROM \((.*)\) AS _subq_.+_\s*\)$', sql, re.S | re.X)
|
||||
if match:
|
||||
sql = match.group(1)
|
||||
else:
|
||||
match = re.search('^\((SELECT .+ FROM .+)\)$', sql, re.S)
|
||||
match = re.search(r'^\((SELECT .+ FROM .+)\)$', sql, re.S | re.X)
|
||||
if match:
|
||||
sql = match.group(1)
|
||||
# Need to check on table() since the parentheses were removed by the regexp
|
||||
|
Loading…
x
Reference in New Issue
Block a user