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
Revert "Commit of various live hacks"
[lhc/web/wiklou.git]
/
includes
/
db
/
DatabaseMysql.php
diff --git
a/includes/db/DatabaseMysql.php
b/includes/db/DatabaseMysql.php
index
8708608
..
fab0e96
100644
(file)
--- a/
includes/db/DatabaseMysql.php
+++ b/
includes/db/DatabaseMysql.php
@@
-193,7
+193,7
@@
class DatabaseMysql extends DatabaseBase {
/**
* @param $res ResultWrapper
/**
* @param $res ResultWrapper
- * @return object|
stdClass
+ * @return object|
bool
* @throws DBUnexpectedError
*/
function fetchObject( $res ) {
* @throws DBUnexpectedError
*/
function fetchObject( $res ) {
@@
-217,7
+217,7
@@
class DatabaseMysql extends DatabaseBase {
/**
* @param $res ResultWrapper
/**
* @param $res ResultWrapper
- * @return array
+ * @return array
|bool
* @throws DBUnexpectedError
*/
function fetchRow( $res ) {
* @throws DBUnexpectedError
*/
function fetchRow( $res ) {
@@
-361,7
+361,7
@@
class DatabaseMysql extends DatabaseBase {
* @param $options string|array
* @return int
*/
* @param $options string|array
* @return int
*/
- public function estimateRowCount( $table, $vars
='*', $conds=
'', $fname = 'DatabaseMysql::estimateRowCount', $options = array() ) {
+ public function estimateRowCount( $table, $vars
= '*', $conds =
'', $fname = 'DatabaseMysql::estimateRowCount', $options = array() ) {
$options['EXPLAIN'] = true;
$res = $this->select( $table, $vars, $conds, $fname, $options );
if ( $res === false ) {
$options['EXPLAIN'] = true;
$res = $this->select( $table, $vars, $conds, $fname, $options );
if ( $res === false ) {
@@
-393,7
+393,7
@@
class DatabaseMysql extends DatabaseBase {
for( $i = 0; $i < $n; $i++ ) {
$meta = mysql_fetch_field( $res->result, $i );
if( $field == $meta->name ) {
for( $i = 0; $i < $n; $i++ ) {
$meta = mysql_fetch_field( $res->result, $i );
if( $field == $meta->name ) {
- return new MySQLField(
$meta
);
+ return new MySQLField(
$meta
);
}
}
return false;
}
}
return false;
@@
-449,7
+449,7
@@
class DatabaseMysql extends DatabaseBase {
function strencode( $s ) {
$sQuoted = mysql_real_escape_string( $s, $this->mConn );
function strencode( $s ) {
$sQuoted = mysql_real_escape_string( $s, $this->mConn );
- if(
$sQuoted === false
) {
+ if(
$sQuoted === false
) {
$this->ping();
$sQuoted = mysql_real_escape_string( $s, $this->mConn );
}
$this->ping();
$sQuoted = mysql_real_escape_string( $s, $this->mConn );
}
@@
-597,10
+597,9
@@
class DatabaseMysql extends DatabaseBase {
if ( $res && $row = $this->fetchRow( $res ) ) {
wfProfileOut( $fname );
return $row[0];
if ( $res && $row = $this->fetchRow( $res ) ) {
wfProfileOut( $fname );
return $row[0];
- } else {
- wfProfileOut( $fname );
- return false;
}
}
+ wfProfileOut( $fname );
+ return false;
}
/**
}
/**
@@
-686,7
+685,7
@@
class DatabaseMysql extends DatabaseBase {
public function streamStatementEnd( &$sql, &$newLine ) {
if ( strtoupper( substr( $newLine, 0, 9 ) ) == 'DELIMITER' ) {
public function streamStatementEnd( &$sql, &$newLine ) {
if ( strtoupper( substr( $newLine, 0, 9 ) ) == 'DELIMITER' ) {
- preg_match( '/^DELIMITER\s+(\S+)/'
, $newLine, $m );
+ preg_match( '/^DELIMITER\s+(\S+)/', $newLine, $m );
$this->delimiter = $m[1];
$newLine = '';
}
$this->delimiter = $m[1];
$newLine = '';
}
@@
-722,7
+721,7
@@
class DatabaseMysql extends DatabaseBase {
if( $row->lockstatus == 1 ) {
return true;
} else {
if( $row->lockstatus == 1 ) {
return true;
} else {
- wfDebug( __METHOD__
.
" failed to acquire lock\n" );
+ wfDebug( __METHOD__
.
" failed to acquire lock\n" );
return false;
}
}
return false;
}
}
@@
-745,6
+744,7
@@
class DatabaseMysql extends DatabaseBase {
* @param $write array
* @param $method string
* @param $lowPriority bool
* @param $write array
* @param $method string
* @param $lowPriority bool
+ * @return bool
*/
public function lockTables( $read, $write, $method, $lowPriority = true ) {
$items = array();
*/
public function lockTables( $read, $write, $method, $lowPriority = true ) {
$items = array();
@@
-760,13
+760,16
@@
class DatabaseMysql extends DatabaseBase {
}
$sql = "LOCK TABLES " . implode( ',', $items );
$this->query( $sql, $method );
}
$sql = "LOCK TABLES " . implode( ',', $items );
$this->query( $sql, $method );
+ return true;
}
/**
* @param $method string
}
/**
* @param $method string
+ * @return bool
*/
public function unlockTables( $method ) {
$this->query( "UNLOCK TABLES", $method );
*/
public function unlockTables( $method ) {
$this->query( "UNLOCK TABLES", $method );
+ return true;
}
/**
}
/**
@@
-900,7
+903,7
@@
class DatabaseMysql extends DatabaseBase {
$endArray = array();
foreach( $result as $table ) {
$endArray = array();
foreach( $result as $table ) {
- $vars = get_object_vars(
$table
);
+ $vars = get_object_vars(
$table
);
$table = array_pop( $vars );
if( !$prefix || strpos( $table, $prefix ) === 0 ) {
$table = array_pop( $vars );
if( !$prefix || strpos( $table, $prefix ) === 0 ) {