r62981 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62980‎ | r62981 | r62982 >
Date:23:06, 25 February 2010
Author:tstarling
Status:ok
Tags:
Comment:
Fix for MySQL 4.0
Modified paths:
  • /trunk/phase3/maintenance/storage/fixBug20757.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/storage/fixBug20757.php
@@ -31,6 +31,16 @@
3232
3333 $totalRevs = $dbr->selectField( 'text', 'MAX(old_id)', false, __METHOD__ );
3434
 35+ if ( $dbr->getType() == 'mysql'
 36+ && version_compare( $dbr->getServerVersion(), '4.1.0', '>=' ) )
 37+ {
 38+ // In MySQL 4.1+, the binary field old_text has a non-working LOWER() function
 39+ $lowerLeft = 'LOWER(CONVERT(LEFT(old_text,22) USING latin1))';
 40+ } else {
 41+ // No CONVERT() in MySQL 4.0
 42+ $lowerLeft = 'LOWER(LEFT(old_text,22))';
 43+ }
 44+
3545 while ( true ) {
3646 print "ID: $startId / $totalRevs\r";
3747
@@ -40,7 +50,7 @@
4151 array(
4252 'old_id > ' . intval( $startId ),
4353 'old_flags LIKE \'%object%\' AND old_flags NOT LIKE \'%external%\'',
44 - 'LOWER(CONVERT(LEFT(old_text,22) USING latin1)) = \'o:15:"historyblobstub"\'',
 54+ "$lowerLeft = 'o:15:\"historyblobstub\"'",
4555 ),
4656 __METHOD__,
4757 array(

Follow-up revisions

RevisionCommit summaryAuthorDate
r62982MFT r62981.tstarling23:12, 25 February 2010

Status & tagging log