[mapserver-users] MyGIS problem after upgrading 5.2.1 -> 5.6.5

Toomas Aas toomas.aas at raad.tartu.ee
Mon Dec 13 03:50:23 EST 2010


Hello!

I have read about MyGIS being deprecated, but I'm hoping for a quick  
fix for this particular problem, which wouldn't involve rewriting a  
lot of queries.

We have a MyGIS layer which stopped working after upgrading Mapserver  
from 5.2.1 to 5.6.5.

The data definition is:
DATA 'geometry from (select * from koht where omavalitsus_id>=-1)  
feature, koht_bin geometry'

When this layer is accessed from PHP/Mapscript, the following errors  
are logged by PHP:

[MapServer Error]: msQueryByPoint(): No matching record(s) found.
  in source_file.php on line 35
[MapServer Error]: msMYGISLayerGetShapeRandom(): GetShape called on  
MYGIS layer with invalid DB query results.
  in source_file.php on line 35
[MapServer Error]: SELECT feature.id,  
feature.vertices,geometry.WKB_GEOMETRY , fe:  mysql query failed
  in source_file.php on line 35
[MapServer Error]: describe (select:  mysql query failed
  in source_file.php on line 35

I turned on query logging in MySQL, and the log shows that the query  
being sent to MySQL is:

describe (select

which certainly *should* fail.

It seems that if I use a subquery in data definition, DESCRIBE is  
being done only on first word of the subquery. If I replace the  
subquery with a table name, things do not break, but this way I can't  
get the result that I actually need. Can anyone suggest a workaround?

-- 
Toomas Aas



More information about the mapserver-users mailing list