Last modified: 2011-01-11 23:34:42 UTC
Dear Mr. Krötzsch, using the #ask parser function with a large offset results in a SQL error. On our OpenMedia Wiki http://www.species-id.net we have 15089 images in the category "Dryades Plant Images". If I try the following wiki code on the page http://www.species-id.net/openmedia/Special:ExpandTemplates {{#ask: [[Category:Dryades Plant Images]] | offset=5000 }} it throws the following error: -----8<----- A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was: SELECT DISTINCT t2.smw_id AS id,t2.smw_title AS t,t2.smw_namespace AS ns,t2.smw_iw AS iw,t2.smw_sortkey AS sortkey FROM `smw_ids` AS t2 INNER JOIN `smw_inst2` AS t0 ON t2.smw_id=t0.s_id WHERE (t0.o_id='XXXX') ORDER BY t2.smw_sortkey ASC LIMIT 5000,-2999 from within function "SMW::getQueryResult". Database returned error "1064: 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 '-2999' at line 1 (localhost:PORT)". -----8<----- This error message starts at offset=2002 because the SQL LIMIT 5000,-2999 is composed in a wrong way. We would be glad to have this fixed soon. Thanks in advance. BTW the Special:Ask page works fine instead see http://www.species-id.net/o/index.php?title=Special:Ask&offset=5000&limit=50&q=%5B%5BCategory%3ADryades+Plant+Images%5D%5D&p=format%3Dlist%2Fcolumns%3D1 We are using the Semantic MediaWiki Version 1.5.5 alpha with the svn revision number r79596. Regards Anreas Plank
There was an error in the calculation of the limit value in SMW. The problem has now been fixed in SVN. Recent versions of SMW can also be upgraded selectively by replacing only the file ./includes/storage/SMW_Query.php with the current SVN version http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Query.php.
It's working. Thanks. Andreas