* Rearranged Special:Movepage form to reduce confusion between destination
title and reason input boxes
* (bug 2527) Always set destination filename when new file is selected
+* (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
=== Caveats ===
*/
var $mLastQuery = '';
- var $mServer, $mUser, $mPassword, $mConn, $mDBname;
+ var $mServer, $mUser, $mPassword, $mConn = null, $mDBname;
var $mOut, $mOpened = false;
var $mFailFunction;
@/**/$this->mConn = mysql_pconnect( $server, $user, $password );
} else {
# Create a new connection...
- @/**/$this->mConn = mysql_connect( $server, $user, $password, true );
+ if( version_compare( PHP_VERSION, '4.2.0', 'ge' ) ) {
+ @/**/$this->mConn = mysql_connect( $server, $user, $password, true );
+ } else {
+ # On PHP 4.1 the new_link parameter is not available. We cannot
+ # guarantee that we'll actually get a new connection, and this
+ # may cause some operations to fail possibly.
+ @/**/$this->mConn = mysql_connect( $server, $user, $password );
+ }
}
if ( $dbName != '' ) {
* PostgreSQL doesn't have them and returns ""
*/
function useIndexClause( $index ) {
- return "FORCE INDEX ($index)";
+ global $wgDBmysql4;
+ return $wgDBmysql4
+ ? "FORCE INDEX ($index)"
+ : "USE INDEX ($index)";
}
/**