dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "database: Make LoadBalancer not yield DB objects that hopelessly lost the...
[lhc/web/wiklou.git]
/
includes
/
db
/
DatabaseMysql.php
diff --git
a/includes/db/DatabaseMysql.php
b/includes/db/DatabaseMysql.php
index
823d9b6
..
b69efac
100644
(file)
--- a/
includes/db/DatabaseMysql.php
+++ b/
includes/db/DatabaseMysql.php
@@
-33,10
+33,12
@@
class DatabaseMysql extends DatabaseMysqlBase {
* @return resource False on error
*/
protected function doQuery( $sql ) {
* @return resource False on error
*/
protected function doQuery( $sql ) {
+ $conn = $this->getBindingHandle();
+
if ( $this->bufferResults() ) {
if ( $this->bufferResults() ) {
- $ret = mysql_query( $sql, $
this->mC
onn );
+ $ret = mysql_query( $sql, $
c
onn );
} else {
} else {
- $ret = mysql_unbuffered_query( $sql, $
this->mC
onn );
+ $ret = mysql_unbuffered_query( $sql, $
c
onn );
}
return $ret;
}
return $ret;
@@
-48,8
+50,7
@@
class DatabaseMysql extends DatabaseMysqlBase {
* @throws DBConnectionError
*/
protected function mysqlConnect( $realServer ) {
* @throws DBConnectionError
*/
protected function mysqlConnect( $realServer ) {
- # Fail now
- # Otherwise we get a suppressed fatal error, which is very hard to track down
+ # Avoid a suppressed fatal error, which is very hard to track down
if ( !extension_loaded( 'mysql' ) ) {
throw new DBConnectionError(
$this,
if ( !extension_loaded( 'mysql' ) ) {
throw new DBConnectionError(
$this,
@@
-93,8
+94,10
@@
class DatabaseMysql extends DatabaseMysqlBase {
* @return bool
*/
protected function mysqlSetCharset( $charset ) {
* @return bool
*/
protected function mysqlSetCharset( $charset ) {
+ $conn = $this->getBindingHandle();
+
if ( function_exists( 'mysql_set_charset' ) ) {
if ( function_exists( 'mysql_set_charset' ) ) {
- return mysql_set_charset( $charset, $
this->mC
onn );
+ return mysql_set_charset( $charset, $
c
onn );
} else {
return $this->query( 'SET NAMES ' . $charset, __METHOD__ );
}
} else {
return $this->query( 'SET NAMES ' . $charset, __METHOD__ );
}
@@
-104,14
+107,18
@@
class DatabaseMysql extends DatabaseMysqlBase {
* @return bool
*/
protected function closeConnection() {
* @return bool
*/
protected function closeConnection() {
- return mysql_close( $this->mConn );
+ $conn = $this->getBindingHandle();
+
+ return mysql_close( $conn );
}
/**
* @return int
*/
function insertId() {
}
/**
* @return int
*/
function insertId() {
- return mysql_insert_id( $this->mConn );
+ $conn = $this->getBindingHandle();
+
+ return mysql_insert_id( $conn );
}
/**
}
/**
@@
-129,7
+136,9
@@
class DatabaseMysql extends DatabaseMysqlBase {
* @return int
*/
function affectedRows() {
* @return int
*/
function affectedRows() {
- return mysql_affected_rows( $this->mConn );
+ $conn = $this->getBindingHandle();
+
+ return mysql_affected_rows( $conn );
}
/**
}
/**
@@
-137,9
+146,11
@@
class DatabaseMysql extends DatabaseMysqlBase {
* @return bool
*/
function selectDB( $db ) {
* @return bool
*/
function selectDB( $db ) {
+ $conn = $this->getBindingHandle();
+
$this->mDBname = $db;
$this->mDBname = $db;
- return mysql_select_db( $db, $
this->mC
onn );
+ return mysql_select_db( $db, $
c
onn );
}
protected function mysqlFreeResult( $res ) {
}
protected function mysqlFreeResult( $res ) {
@@
-183,10
+194,14
@@
class DatabaseMysql extends DatabaseMysqlBase {
}
protected function mysqlRealEscapeString( $s ) {
}
protected function mysqlRealEscapeString( $s ) {
- return mysql_real_escape_string( $s, $this->mConn );
+ $conn = $this->getBindingHandle();
+
+ return mysql_real_escape_string( $s, $conn );
}
protected function mysqlPing() {
}
protected function mysqlPing() {
- return mysql_ping( $this->mConn );
+ $conn = $this->getBindingHandle();
+
+ return mysql_ping( $conn );
}
}
}
}