Bug report #19926

Editing the expression for a SQL layer corrupts the SQL expression

Added by Lars Kellogg-Stedman about 6 years ago. Updated about 6 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:DB Manager
Affected QGIS version:3.2.3 Regression?:No
Operating System:Linux (fedora 28) Easy fix?:No
Pull Request or Patch supplied:No Resolution:duplicate
Crashes QGIS or corrupts data:No Copied to github as #:27750

Description

I have created a layer from a SQL expression. The layer source looks like:


Source
dbname='lic.db' table="(SELECT * FROM \"locations\" join \"pubacc_en\" using (unique_system_identifier) join \"pubacc_am\" using (unique_system_identifier) )" (geom) sql=

If I attempt to edit this layer (right click -> "Update SQL Layer..."), I get the error:

no such table: SELECT * FROM "locations" join "pubacc_en" using (unique_system_identifier) join "pubacc_am" using (unique_system_identifier)

And after acknowledging the error, the SQL expression has been modified to look like:

SELECT * FROM "SELECT * FROM ""locations"" join ""pubacc_en"" using (unique_system_identifier) join ""pubacc_am"" using (unique_system_identifier)
"

This is obviously invalid.


Related issues

Duplicates QGIS Application - Bug report #19843: Update SQL Layer converts query to table name Closed 2018-09-13

History

#1 Updated by Alessandro Pasotti about 6 years ago

#2 Updated by Giovanni Manghi about 6 years ago

  • Resolution set to duplicate
  • Status changed from Open to Closed

Also available in: Atom PDF