Last modified: 2007-11-02 11:48:41 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 11674 - Small bug in SMWSQLStore::getPropertiesSpecial()
Small bug in SMWSQLStore::getPropertiesSpecial()
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2007-10-15 22:09 UTC by Yaron Koren
Modified: 2007-11-02 11:48 UTC (History)
1 user (show)

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


Description Yaron Koren 2007-10-15 22:09:07 UTC
Line 857 of /includes/storage/SMW_SQLStore.php should be changed from:

               if ($requestoptions->limit >= 0) {


               if ($requestoptions->limit > 0) {

That's because the "= 0" option catches the case where no limit is specified, at least for me, and thus places a "LIMIT " clause at the end of the query, leading to bad SQL. There's no need to allow for a limit of 0 rows, in any case.

Yaron Koren
Comment 1 Yaron Koren 2007-10-18 21:22:46 UTC
Actually, the same thing also holds true for other functions within that same file, specifically lines 888, 917 and 1090. Of those, the first one (in getUnusedPropertiesSpecial()) is the most important for Semantic Forms' purposes.
Comment 2 Markus Krötzsch 2007-11-02 11:48:41 UTC
OK, I made these fixes. 

However, note that unused limits in SMW are usually set to -1, not to 0. A requested limit of 0 is actually used (by different code) for inline queries -- the query will then not print any results, but still check whether there had been any, and react accordingly (e.g. by showing "further results ..."). Normally, the consistent behaviour for SMW would thus be to return an empty array to any request with limit 0.

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