| Index: trunk/phase3/includes/db/DatabaseMysql.php |
| — | — | @@ -114,23 +114,20 @@ |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | if ( $success ) { |
| 118 | | - $version = $this->getServerVersion(); |
| 119 | | - if ( version_compare( $version, '4.1' ) >= 0 ) { |
| 120 | | - // Tell the server we're communicating with it in UTF-8. |
| 121 | | - // This may engage various charset conversions. |
| 122 | | - global $wgDBmysql5; |
| 123 | | - if( $wgDBmysql5 ) { |
| 124 | | - $this->query( 'SET NAMES utf8', __METHOD__ ); |
| 125 | | - } else { |
| 126 | | - $this->query( 'SET NAMES binary', __METHOD__ ); |
| 127 | | - } |
| 128 | | - // Set SQL mode, default is turning them all off, can be overridden or skipped with null |
| 129 | | - global $wgSQLMode; |
| 130 | | - if ( is_string( $wgSQLMode ) ) { |
| 131 | | - $mode = $this->addQuotes( $wgSQLMode ); |
| 132 | | - $this->query( "SET sql_mode = $mode", __METHOD__ ); |
| 133 | | - } |
| | 118 | + // Tell the server we're communicating with it in UTF-8. |
| | 119 | + // This may engage various charset conversions. |
| | 120 | + global $wgDBmysql5; |
| | 121 | + if( $wgDBmysql5 ) { |
| | 122 | + $this->query( 'SET NAMES utf8', __METHOD__ ); |
| | 123 | + } else { |
| | 124 | + $this->query( 'SET NAMES binary', __METHOD__ ); |
| 134 | 125 | } |
| | 126 | + // Set SQL mode, default is turning them all off, can be overridden or skipped with null |
| | 127 | + global $wgSQLMode; |
| | 128 | + if ( is_string( $wgSQLMode ) ) { |
| | 129 | + $mode = $this->addQuotes( $wgSQLMode ); |
| | 130 | + $this->query( "SET sql_mode = $mode", __METHOD__ ); |
| | 131 | + } |
| 135 | 132 | |
| 136 | 133 | // Turn off strict mode if it is on |
| 137 | 134 | } else { |
| — | — | @@ -424,9 +421,7 @@ |
| 425 | 422 | /** |
| 426 | 423 | * Returns slave lag. |
| 427 | 424 | * |
| 428 | | - * On MySQL 4.1.9 and later, this will do a SHOW SLAVE STATUS. On earlier |
| 429 | | - * versions of MySQL, it uses SHOW PROCESSLIST, which requires the PROCESS |
| 430 | | - * privilege. |
| | 425 | + * On MySQL 4.1.9 and later, this will do a SHOW SLAVE STATUS |
| 431 | 426 | * |
| 432 | 427 | * @return int |
| 433 | 428 | */ |
| — | — | @@ -436,11 +431,7 @@ |
| 437 | 432 | return $this->mFakeSlaveLag; |
| 438 | 433 | } |
| 439 | 434 | |
| 440 | | - if ( version_compare( $this->getServerVersion(), '4.1.9', '>=' ) ) { |
| 441 | | - return $this->getLagFromSlaveStatus(); |
| 442 | | - } else { |
| 443 | | - return $this->getLagFromProcesslist(); |
| 444 | | - } |
| | 435 | + return $this->getLagFromSlaveStatus(); |
| 445 | 436 | } |
| 446 | 437 | |
| 447 | 438 | /** |
| — | — | @@ -463,6 +454,8 @@ |
| 464 | 455 | } |
| 465 | 456 | |
| 466 | 457 | /** |
| | 458 | + * @deprecated in 1.19, use getLagFromSlaveStatus |
| | 459 | + * |
| 467 | 460 | * @return bool|int |
| 468 | 461 | */ |
| 469 | 462 | function getLagFromProcesslist() { |
| — | — | @@ -732,29 +725,9 @@ |
| 733 | 726 | |
| 734 | 727 | function duplicateTableStructure( $oldName, $newName, $temporary = false, $fname = 'DatabaseMysql::duplicateTableStructure' ) { |
| 735 | 728 | $tmp = $temporary ? 'TEMPORARY ' : ''; |
| 736 | | - if ( strcmp( $this->getServerVersion(), '4.1' ) < 0 ) { |
| 737 | | - # Hack for MySQL versions < 4.1, which don't support |
| 738 | | - # "CREATE TABLE ... LIKE". Note that |
| 739 | | - # "CREATE TEMPORARY TABLE ... SELECT * FROM ... LIMIT 0" |
| 740 | | - # would not create the indexes we need.... |
| 741 | | - # |
| 742 | | - # Note that we don't bother changing around the prefixes here be- |
| 743 | | - # cause we know we're using MySQL anyway. |
| 744 | | - |
| 745 | | - $res = $this->query( 'SHOW CREATE TABLE ' . $this->addIdentifierQuotes( $oldName ) ); |
| 746 | | - $row = $this->fetchRow( $res ); |
| 747 | | - $oldQuery = $row[1]; |
| 748 | | - $query = preg_replace( '/CREATE TABLE `(.*?)`/', |
| 749 | | - "CREATE $tmp TABLE " . $this->addIdentifierQuotes( $newName ), $oldQuery ); |
| 750 | | - if ($oldQuery === $query) { |
| 751 | | - # Couldn't do replacement |
| 752 | | - throw new MWException( "could not create temporary table $newName" ); |
| 753 | | - } |
| 754 | | - } else { |
| 755 | | - $newName = $this->addIdentifierQuotes( $newName ); |
| 756 | | - $oldName = $this->addIdentifierQuotes( $oldName ); |
| 757 | | - $query = "CREATE $tmp TABLE $newName (LIKE $oldName)"; |
| 758 | | - } |
| | 729 | + $newName = $this->addIdentifierQuotes( $newName ); |
| | 730 | + $oldName = $this->addIdentifierQuotes( $oldName ); |
| | 731 | + $query = "CREATE $tmp TABLE $newName (LIKE $oldName)"; |
| 759 | 732 | $this->query( $query, $fname ); |
| 760 | 733 | } |
| 761 | 734 | |
| Index: trunk/phase3/includes/installer/MysqlInstaller.php |
| — | — | @@ -32,7 +32,7 @@ |
| 33 | 33 | |
| 34 | 34 | public $supportedEngines = array( 'InnoDB', 'MyISAM' ); |
| 35 | 35 | |
| 36 | | - public $minimumVersion = '4.0.14'; |
| | 36 | + public $minimumVersion = '5.0.0'; |
| 37 | 37 | |
| 38 | 38 | public $webUserPrivs = array( |
| 39 | 39 | 'DELETE', |