Last modified: 2007-11-02 11:48:41 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 T13674, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 11674 - Small bug in SMWSQLStore::getPropertiesSpecial()
Small bug in SMWSQLStore::getPropertiesSpecial()
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  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: ---


Attachments

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) {

to

               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.


Navigation
Links