Skip to content

Commit 94ded32

Browse files
committedSep 27, 2018
[db-manager] Allow multiline filters in sql window
Fixes #19956 - Update SQL layer results in invalid SQL expression
1 parent a1d130a commit 94ded32

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎python/plugins/db_manager/dlg_sql_layer_window.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ def __init__(self, iface, layer, parent=None):
145145
# First the SQL from QgsDataSourceUri table
146146
sql = uri.table()
147147
if uri.keyColumn() == '_uid_':
148-
match = re.search('^\(SELECT .+ AS _uid_,\* FROM \((.*)\) AS _subq_.+_\s*\)$', sql, re.S)
148+
match = re.search(r'^\(SELECT .+ AS _uid_,\* FROM \((.*)\) AS _subq_.+_\s*\)$', sql, re.S | re.X)
149149
if match:
150150
sql = match.group(1)
151151
else:
152-
match = re.search('^\((SELECT .+ FROM .+)\)$', sql, re.S)
152+
match = re.search(r'^\((SELECT .+ FROM .+)\)$', sql, re.S | re.X)
153153
if match:
154154
sql = match.group(1)
155155
# Need to check on table() since the parentheses were removed by the regexp

0 commit comments

Comments
 (0)
Please sign in to comment.