Last modified: 2010-05-15 15:38:55 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T5056, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 3056 - many failures regarding special pages (MySQL 1064 errors):
many failures regarding special pages (MySQL 1064 errors):
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
1.5.x
All All
: High normal (vote)
: ---
Assigned To: Nobody - You can work on this!
http://www.dongfangtiger.de/wiki/
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-08-06 00:58 UTC by Lian LuoZ
Modified: 2010-05-15 15:38 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Lian LuoZ 2005-08-06 00:58:28 UTC
I'm using
# MediaWiki: 1.5beta4
# PHP: 4.3.10 (apache2handler)
# MySQL: 3.23.58

when run Special:Random, it shows:

    SELECT page_id,page_title FROM `page` FORCE INDEX (page_random) WHERE
page_namespace=0 AND page_is_redirect=0 AND page_random>0.083694135933 ORDER BY
page_random LIMIT 1

from function "wfSpecialRandompage"。 MySQL returns error "1064: You have an
error in your SQL syntax near 'INDEX (page_random) WHERE page_namespace=0 AND
page_is_redirect=0 AND page_' at line 2 (localhost)"。

when run Special:Contributions

    SELECT page_namespace,page_title,page_is_new,page_latest,
rev_id,rev_timestamp,rev_comment,rev_minor_edit,rev_user_text, rev_deleted FROM
`page`,`revision` FORCE INDEX (usertext_timestamp) WHERE page_id=rev_page AND
rev_user_text='老猪' ORDER BY rev_timestamp DESC LIMIT 50

from function "contribs_finder::find"。 MySQL returns error "1064: You have an
error in your SQL syntax near 'INDEX (usertext_timestamp) WHERE page_id=rev_page
AND rev_user_text='老猪'' at line 5 (localhost)"。

when run Special:Watchlist:

    SELECT page_namespace,page_title,rev_comment, page_id,
rev_user,rev_user_text,rev_timestamp,rev_minor_edit,rev_id,page_is_new,wl_notificationtimestamp
FROM `watchlist`,`page`,`revision` FORCE INDEX (page_timestamp) WHERE wl_user=2
AND wl_namespace=page_namespace AND wl_title=page_title AND page_latest=rev_id
AND rev_timestamp > '20050803005507' ORDER BY rev_timestamp DESC

from function "wfSpecialWatchlist"。 MySQL returns error "1064: You have an
error in your SQL syntax near 'INDEX (page_timestamp) WHERE wl_user=2 AND
wl_namespace=page_namespace ' at line 4 (localhost)"。
Comment 1 Miko 2005-08-09 22:06:39 UTC
I think this comes from the the file includes/Database.php the function
useIndexClause was changed 

from 
        function useIndexClause( $index ) {
                return "USE INDEX ($index)";
        }
to
        function useIndexClause( $index ) {
                return "FORCE INDEX ($index)";
        }

I am running PHP 4.3.11 with Mysql 3.23.58

Reverting to the old form fixes my problem.
Comment 2 Lian LuoZ 2005-08-10 18:21:35 UTC
problem solved! thanks a lot!!!
Comment 3 Antoine "hashar" Musso (WMF) 2005-08-11 02:13:25 UTC
From http://dev.mysql.com/doc/mysql/en/join.html
'From MySQL 4.0.9 on, you can also use FORCE INDEX'

Might not be available in mysql3 :(
Comment 4 Brion Vibber 2005-08-11 11:35:50 UTC
Now using FORCE INDEX only when MySQL 4 extensions are enabled.

Fix committed to HEAD and REL1_5:
* (bug 3056) MySQL 3 compatibility fix: USE INDEX instead of FORCE INDEX
* PHP 4.1 compatibility fix: don't use new_link parameter to mysql_connect
  if running prior to 4.2.0 as it causes the call to fail

r1=1.119&r2=1.120">http://cvs.defau.lt/cvsweb.cgi/phase3/includes/Database.php.diff?r1=1.119&r2=1.120

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links