Last modified: 2011-01-11 23:34:42 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T28622, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 26622 - error in #ask query caused by a large offset value
error in #ask query caused by a large offset value
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: High critical (vote)
: ---
Assigned To: Markus Krötzsch
http://www.species-id.net
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-07 11:19 UTC by Andreas Plank
Modified: 2011-01-11 23:34 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Andreas Plank 2011-01-07 11:19:44 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
Comment 1 Markus Krötzsch 2011-01-07 14:50:12 UTC
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.
Comment 2 Andreas Plank 2011-01-11 23:34:42 UTC
It's working. Thanks.

Andreas

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links