diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2014-12-27 15:41:37 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2014-12-31 11:43:28 +0100 |
commit | c1f9b1f7b1b77776192048005dcc66dcf3df2bfb (patch) | |
tree | 2b38796e738dd74cb42ecd9bfd151803108386bc /includes/db/DatabaseMysql.php | |
parent | b88ab0086858470dd1f644e64cb4e4f62bb2be9b (diff) |
Update to MediaWiki 1.24.1
Diffstat (limited to 'includes/db/DatabaseMysql.php')
-rw-r--r-- | includes/db/DatabaseMysql.php | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/includes/db/DatabaseMysql.php b/includes/db/DatabaseMysql.php index 956bb694..dc4a67df 100644 --- a/includes/db/DatabaseMysql.php +++ b/includes/db/DatabaseMysql.php @@ -28,10 +28,9 @@ * @see Database */ class DatabaseMysql extends DatabaseMysqlBase { - /** - * @param $sql string - * @return resource + * @param string $sql + * @return resource False on error */ protected function doQuery( $sql ) { if ( $this->bufferResults() ) { @@ -39,14 +38,23 @@ class DatabaseMysql extends DatabaseMysqlBase { } else { $ret = mysql_unbuffered_query( $sql, $this->mConn ); } + return $ret; } + /** + * @param string $realServer + * @return bool|resource MySQL Database connection or false on failure to connect + * @throws DBConnectionError + */ protected function mysqlConnect( $realServer ) { # Fail now # Otherwise we get a suppressed fatal error, which is very hard to track down if ( !extension_loaded( 'mysql' ) ) { - throw new DBConnectionError( $this, "MySQL functions missing, have you compiled PHP with the --with-mysql option?\n" ); + throw new DBConnectionError( + $this, + "MySQL functions missing, have you compiled PHP with the --with-mysql option?\n" + ); } $connFlags = 0; @@ -81,6 +89,18 @@ class DatabaseMysql extends DatabaseMysqlBase { } /** + * @param string $charset + * @return bool + */ + protected function mysqlSetCharset( $charset ) { + if ( function_exists( 'mysql_set_charset' ) ) { + return mysql_set_charset( $charset, $this->mConn ); + } else { + return $this->query( 'SET NAMES ' . $charset, __METHOD__ ); + } + } + + /** * @return bool */ protected function closeConnection() { @@ -113,11 +133,12 @@ class DatabaseMysql extends DatabaseMysqlBase { } /** - * @param $db + * @param string $db * @return bool */ function selectDB( $db ) { $this->mDBname = $db; + return mysql_select_db( $db, $this->mConn ); } @@ -156,6 +177,10 @@ class DatabaseMysql extends DatabaseMysqlBase { return mysql_field_name( $res, $n ); } + protected function mysqlFieldType( $res, $n ) { + return mysql_field_type( $res, $n ); + } + protected function mysqlDataSeek( $res, $row ) { return mysql_data_seek( $res, $row ); } |