Page MenuHomePhabricator

API Exception - internal_api_error_DBQueryError
Closed, ResolvedPublic

Description

Visiting the above link gives

<api>

<error code="internal_api_error_DBQueryError" info="Exception Caught: A database error has occurred
Query: SELECT page_id,page_title,page_namespace,page_is_redirect,pl_title,pl_namespace FROM page,pagelinks WHERE (pl_from=page_id) AND ((pl_title = 'Twisday' AND pl_namespace = '0') OR (pl_title = 'Tiwes_dæg' AND pl_namespace = '0') OR (pl_title = 'Martis_dies' AND pl_namespace = '0') OR (pl_title = 'Tiu's_Day' AND pl_namespace = '0') OR (pl_title = 'Tuefday' AND pl_namespace = '0')) ORDER BY pl_namespace, pl_title, pl_from LIMIT 501
Function: ApiQueryBacklinks::run
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 's_Day' AND pl_namespace = '0') OR (pl_title = 'Tuefday' AND pl_ (10.0.0.236)
">

#0 /usr/local/apache/common-local/php-1.5/includes/Database.php(573): Database->reportQueryError('You have an err...', 1064, 'SELECT page_id...', 'ApiQueryBacklin...', false)
#1 /usr/local/apache/common-local/php-1.5/includes/Database.php(982): Database->query('SELECT page_id...', 'ApiQueryBacklin...')
#2 /usr/local/apache/common-local/php-1.5/includes/api/ApiQueryBase.php(214): Database->select(Array, Array, Array, 'ApiQueryBacklin...', Array, Array)
#3 /usr/local/apache/common-local/php-1.5/includes/api/ApiQueryBacklinks.php(202): ApiQueryBase->select('ApiQueryBacklin...')
#4 /usr/local/apache/common-local/php-1.5/includes/api/ApiQueryBacklinks.php(90): ApiQueryBacklinks->run()
#5 /usr/local/apache/common-local/php-1.5/includes/api/ApiQuery.php(211): ApiQueryBacklinks->execute()
#6 /usr/local/apache/common-local/php-1.5/includes/api/ApiMain.php(373): ApiQuery->execute()
#7 /usr/local/apache/common-local/php-1.5/includes/api/ApiMain.php(236): ApiMain->executeAction()
#8 /usr/local/apache/common-local/php-1.5/includes/api/ApiMain.php(220): ApiMain->executeActionWithErrorHandling()
#9 /usr/local/apache/common-local/php-1.5/api.php(77): ApiMain->execute()
#10 /usr/local/apache/common-local/live-1.5/api.php(3): require('/usr/local/apac...')
#11 {main}

</error>
</api>

But is fine for other articles (ie Monday)


Version: 1.13.x
Severity: critical
URL: http://en.wikipedia.org/w/api.php?action=query&list=backlinks&bltitle=Tuesday&format=xml&bllimit=500&blredirect

Details

Reference
bz14526

Event Timeline

bzimport raised the priority of this task from to Unbreak Now!.Nov 21 2014, 10:09 PM
bzimport set Reference to bz14526.

Monday is fine, Tuesday is the erroring page listed above, Wednesday Errors, Thursday, Friday, Saturday and Sunday are all fine

http://en.wikipedia.org/w/api.php?action=query&list=backlinks&bltitle=Wednesday&format=xml&bllimit=500&blredirect

Works fine without the "&blredirect" on Tuesday and Wednesday

Unescaped SQL, and naked query displayed to end user in addition to all...

Bryan.TongMinh wrote:

Fixed in r36257 and synched to Wikimedia. I should remember to backport this when I have time.

Bryan.TongMinh wrote:

Also don't we have something like LinkBatch or similar to construct sql from a title array?

After some further investigation this slipped in in r31260 which did luckily not get in any previous release.