Bug report #4911
Query Builder + MySQL syntax error
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||14718|
Trying to build a query on a MySQL (vector) layer an error is generated.
This is because QGis double-quotes the table name in the SQL statement, and this is generates an MySQL syntax error.
Follows an example:
Query builder entry: cat = 5 (I can manually delete double quotes from column name in query builder interface)
produces the following error:
An error occurred when executing the query.
The data provider said:
OGR3 error 1: MySQL error message:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"roads" WHERE cat = 5' at line 1 Description: SELECT * FROM "roads" WHERE cat = 5
As you can see the table name (roads) is double quoted, and I can not change this.
Actually quiery builder is useless with MySQL vector and table data.
#3 Updated by Giovanni Manghi almost 9 years ago
jbogdani - wrote:
I just installed v 1.7.4 and I'm still having the same problem.
What does "fixed in 93266aca" mean? Where can I find in which version '93266aca' will be integrated?
if you are on Windows install the "qgis-dev" package using the "osgeo4w" installer (use the "advanced install")