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
Version: unspecified
Severity: normal