===--- A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:
SELECT cur_id,cur_namespace,cur_title FROM `cur`,`links` WHERE
cur_id=l_to AND l_from=1081 FOR UPDATE
from within function "LinkCache::preFill". MySQL returned error "1064: You have an error in your SQL syntax near 'FOR UPDATE' at line 3 (localhost)". ===---
The code that does this seems to be... ===--- if ( $this->mForUpdate ) { $db =& wfGetDB( DB_MASTER ); $options = 'FOR UPDATE'; } else { $db =& wfGetDB( DB_SLAVE ); $options = ''; }
$cur = $db->tableName( 'cur' ); $links = $db->tableName( 'links' );
$sql = "SELECT cur_id,cur_namespace,cur_title FROM $cur,$links WHERE cur_id=l_to AND l_from=$id $options"; $res = $db->query( $sql, $fname ); while( $s = $db->fetchObject( $res ) ) { $this->addGoodLink( $s->cur_id, Title::makeName( $s->cur_namespace, $s->cur_title ) ); } ===--- ...from includes/LinkCache.php
If I modify 'WHERE cur_id=l_to AND l_from=$id $options";' to remove the '$options' from the end (which puts the 'FOR UPDATE' on the end of the query), it seems to go a step further on, then falls over at another query ending in '...FOR UPDATE'...
===--- SELECT bl_to FROM `brokenlinks` WHERE bl_from='1081' FOR UPDATE
from within function "LinkCache::preFill". MySQL returned error "1064: You have an error in your SQL syntax near 'FOR UPDATE' at line 1 (localhost)". ===---
...which makes it look as if MySQL just really doesn't like the '...FOR UPDATE' bit. I can't see why from the manual, but then again, my experience with MySQL consists of setting up databases for MediaWiki and WordPress, and I used phpMyAdmin to do that - and it looks like I still got something wrong :)
Any further suggestions would be appreciated.
Thanks,