Index: branches/wmf-deployment/maintenance/storage/fixBug20757.php |
— | — | @@ -31,6 +31,16 @@ |
32 | 32 | |
33 | 33 | $totalRevs = $dbr->selectField( 'text', 'MAX(old_id)', false, __METHOD__ ); |
34 | 34 | |
| 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 | + |
35 | 45 | while ( true ) { |
36 | 46 | print "ID: $startId / $totalRevs\r"; |
37 | 47 | |
— | — | @@ -40,7 +50,7 @@ |
41 | 51 | array( |
42 | 52 | 'old_id > ' . intval( $startId ), |
43 | 53 | '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\"'", |
45 | 55 | ), |
46 | 56 | __METHOD__, |
47 | 57 | array( |
Property changes on: branches/wmf-deployment/maintenance/storage/fixBug20757.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
48 | 58 | Merged /trunk/phase3/maintenance/storage/fixBug20757.php:r62981 |
Property changes on: branches/wmf-deployment/maintenance/storage |
___________________________________________________________________ |
Added: svn:mergeinfo |
49 | 59 | Merged /branches/REL1_15/phase3/maintenance/storage:r51646 |
50 | 60 | Merged /trunk/phase3/maintenance/storage:r56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,56862,56867,57154-57447,57541,57916,58151,58219,58633,58816,59478,62981 |