I've seen this posted here before (found in the archives), but never saw a solution. I first tried installing an RC of 1.4, and hit this same problem. I installed the last 1.3 release, and that went ok. Just trying to upgrade to 1.4 final now, and hitting this again. Installation went ok, no errors, but now when saving changes to a page, getting... Database error Internal error
The page actually *does* save ok, and the change appears in RecentChanges. Creating a new page gives the same error, and again the page is created, but the interesting thing in this case is that the link on the referring page (where the new page link was created) *stays red* and still links to '...action=edit', even if the page is refreshed.
Looks like whatever is referred to to find out if the page exists hasn't been updated. I've tried reading through the code, but it's really stretching my PHP abilities - I'm only really up to copy 'n' paste PHP, not understanding this complicated stuff ;)
Running... Apache/1.3.33 (Unix) PHP/4.3.10 MySQL 3.23.33-log
Any suggestions would be much appreciated.
Thanks...
On Apr 9, 2005, at 7:58pm, Michael Randall wrote:
(where the new page link was created) *stays red* and still links to '...action=edit', even if the page is refreshed.
Have you tried tacking an "action=purge" on the end of the URL, in place of the "action =edit", to purge the server cache?
John Blumel
Have you tried tacking an "action=purge" on the end of the URL, in place of the "action =edit", to purge the server cache? John Blumel
Just tried now, thanks, John. I had a new page TestPage, linked from MainPage. The link to TestPage on MainPage was red. Tacking ?action=edit onto TestPage made no difference. Tacking it onto MainPage (As I assume you intended) did make the link go blue, and the page link then worked ok. Edits still give the database errors, though.
If it's the cache that's not getting updated, is that in the database, or is it a file? Have I got the permissions wrong somewhere?
Thanks again,
On Apr 9, 2005, at 8:18pm, Michael Randall wrote:
did make the link go blue, and the page link then worked ok. Edits still give the database errors, though.
If it's the cache that's not getting updated, is that in the database, or is it a file? Have I got the permissions wrong somewhere?
Unfortunately, this question goes beyond my knowledge of MediaWiki.
John Blumel
Unfortunately, this question goes beyond my knowledge of MediaWiki. John Blumel
OK - thanks for your help.
I've put the Wiki live with this version now in the hope of getting it fixed, so it's available at... http://pigpog.com/wiki/ ...and the link to TestPage is at the bottom of the Main Page if anyone wants to experiment.
Thanks again,
Michael Randall wrote:
I've seen this posted here before (found in the archives), but never saw a solution. I first tried installing an RC of 1.4, and hit this same problem. I installed the last 1.3 release, and that went ok. Just trying to upgrade to 1.4 final now, and hitting this again. Installation went ok, no errors, but now when saving changes to a page, getting... Database error Internal error
Turn on SQL error display (see DefaultSettings.php for all configurable settings).
Most likely you have a table that's marked in the crashed state; this can happen if the MySQL server crashed while it was open. Use MySQL's REPAIR TABLE command on any such tables to clear it up.
-- brion vibber (brion @ pobox.com)
Turn on SQL error display (see DefaultSettings.php for all configurable settings).
Excellent - thanks, Brion - Found it. Added a line to the bottom of LocalSettings.php...
$wgShowSQLErrors = true;
...and now get the real error...
===--- 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)". ===---
1081 is the id for the page I was editing in the 'cur' table - I found that last night. After creating a link from page ID 5 to page ID 1081, there wasn't an entry in the 'links' table with l_to == '1081', which I guessed there should be. I tried adding one manually, but that didn't work, and I figured playing with the SQL data directly like that might not be the smartest thing to be doing - especially at 02:00 ;)
Thanks,
===--- 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,
It looks like a MySQL upgrade from v3.23.33 will help a lot.
From a MySQL Reference Manual:
D.4.24. Changes in release 3.23.36 (27 Mar 2001) ... Added SELECT ... FOR UPDATE. ...
-- Zigger
On Sun, 10 Apr 2005 15:45:21 +0100, Michael Randall wrote:
... ...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 ...
D.4.24. Changes in release 3.23.36 (27 Mar 2001) ... Added SELECT ... FOR UPDATE. -- Zigger
Thanks, Zigger - looks like you've hit the problem. I'm surprised it's such an old version on there - it's a hosted account. On the other hand, I've had it since then, and they may well have just figured it's better not to change it as long as things are working. I've submitted a request to get it updated a bit.
Thanks again to everyone who gave me advice on this, and helped with finding the actual error.
mediawiki-l@lists.wikimedia.org