Page MenuHomePhabricator

SQL error on trunk SocialProfile
Closed, ResolvedPublic

Description

Author: g33kdyoo

Description:
Example: http://fanon.clubpenguinwiki.info/wiki/User:Railfan1

The error:

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 "UserBoard::getUserBoardMessages". Database 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 'OR (ub_user_id=543 AND ub_user_id_from=2) ) ORDER BY ub_id DESC LIMIT 10,0' at line 1 (mysql.clubpenguinwiki.info)".


Version: unspecified
Severity: normal

Details

Reference
bz28251
TitleReferenceAuthorSource BranchDest Branch
Update function-schemata sub-module to HEAD (5db8cea)repos/abstract-wiki/wikifunctions/function-orchestrator!158apinesync-function-schematamain
test_data/errors/canonical_Z2.yaml: Update PHP-expected errors for one caserepos/abstract-wiki/wikifunctions/function-schemata!109jforrestertest-split-outmain
Customize query in GitLab

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:33 PM
bzimport added a project: SocialProfile.
bzimport set Reference to bz28251.

g33kdyoo wrote:

Meh, updated trunk and it works.

This was caused by r84617, which I've reverted in r84806.

To clarify, MediaWiki was generating invalid SQL, something like SELECT ... FROM user_board WHERE ub_type = '0' AND ub_user_id = something AND ( OR (ub_user_id=543 AND ub_user_id_from=2) ) ORDER BY ... -- it should have been just OR, without any useless ANDs. I don't know how to do that though, so I just ended up reverting the commit that broke it.