Page MenuHomePhabricator

Database syntax error loading SpecialNewImages
Closed, ResolvedPublic

Description

Author: james.mitchell

Description:
1st off my system is running

MediaWiki: 1.7.1
PHP: 5.1.4-0.1 (cgi-fcgi)
MySQL: 5.0.22-Debian_3-log

I get the following error when loading the Special:Newimages (Gallery of new
files)

"A database query syntax error has occurred. This may indicate a bug in the
software. The last attempted database query was:
(SQL query hidden)
from within function "wfSpecialNewImages". MySQL 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 ') WHERE ug_group IS
NULL ORDER BY img_timestamp DESC LIMIT 1' at line 1 (localhost)"."

Can anyone help as this is a important feature for my wiki site


Version: 1.7.x
Severity: normal
OS: Windows XP
Platform: PC

Details

Reference
bz6956

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:19 PM
bzimport set Reference to bz6956.
bzimport added a subscriber: Unknown Object (MLST).

It would help if we could see the complete query that is being run. Add this
line to your LocalSeetings.php file:

$wgShowSQLErrors = true;

then reload the page and post the SQL here (it will replace the "SQL query
hidden" text above.

james.mitchell wrote:

Thanks for the quick reply here is the info you need

A database query syntax error has occurred. This may indicate
a bug in the software. The last attempted database query was:
SELECT img_timestamp from image LEFT OUTER JOIN
user_groups ON img_user=ug_user AND () WHERE ug_group IS
NULL ORDER BY img_timestamp DESC LIMIT 1
from within function "wfSpecialNewImages". MySQL 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 ') WHERE ug_group IS NULL ORDER BY
img_timestamp DESC LIMIT 1' at line 1 (localhost)".

Looks like you have no bots defined in your group permissions. Adding them back
in should fix this. Add this line to either LocalSettings.php or back into
DefaultSettings.php, where it was:

$wgGroupPermissions['bot' ]['bot'] = true;

I'll commit a patch in a second to more gracefully handle the case in where one
has no bot permissions.

james.mitchell wrote:

Thanks for that want to confirm that was fixed

The bot was in the defaultsettings.php but i had been adding grouppermissions into the localsettings.php to
change them. Bot permissions where not in my edits. I thought that if it is not in localsettings it will use
what is in default settings.

Oh well thanks again for the quick resolution

jimmy.collins wrote:

*** Bug 6959 has been marked as a duplicate of this bug. ***