Skip to content

Commit ea7c2af

Browse files
committed
[dbmanager] fixes #17476: QGIS master: update SQL layer error if name contains uppercase chars
1 parent b2c6464 commit ea7c2af

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
@@ -154,9 +154,9 @@ def __init__(self, iface, layer, parent=None):
154154
if not sql.startswith('(') and not sql.endswith(')'):
155155
schema = uri.schema()
156156
if schema and schema.upper() != 'PUBLIC':
157-
sql = 'SELECT * FROM ' + schema + '.' + sql
157+
sql = 'SELECT * FROM {0}.{1}'.format(self.db.connector.quoteId(schema), self.db.connector.quoteId(sql))
158158
else:
159-
sql = 'SELECT * FROM ' + sql
159+
sql = 'SELECT * FROM {0}'.format(self.db.connector.quoteId(sql))
160160
self.editSql.setText(sql)
161161
self.executeSql()
162162

0 commit comments

Comments
 (0)