Last modified: 2007-11-02 11:48:41 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
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.
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.