OGR SQL: incorrect result with more than 2 JOINs and complex expressions
|Reported by:||Even Rouault||Owned by:||Even Rouault|
SQL requests involving at least 2 JOINs and an expression based on a column (for example a CAST), but not directly the column name, return incorrect results : values are not extracted from the right table. More specifically if we have :
SELECT CAST(coltable2) FROM table1 JOIN table2 ON table1.id = table2.id JOIN table3 ON table1.id = table3.id
And coltable2 is the first column of table2.
We would return the value for the first column of table3.
This issue was originally reported as http://lists.osgeo.org/pipermail/gdal-dev/2012-February/031823.html