*/
class DatabaseMysqli extends DatabaseMysqlBase {
/**
- * @param $sql string
+ * @param string $sql
* @return resource
*/
protected function doQuery( $sql ) {
return $ret;
}
+ /**
+ * @param string $realServer
+ * @return bool|mysqli
+ * @throws DBConnectionError
+ */
protected function mysqlConnect( $realServer ) {
global $wgDBmysql5;
# Fail now
}
/**
+ * @param string $charset
* @return bool
*/
protected function mysqlSetCharset( $charset ) {
}
/**
- * @param $db
+ * @param string $db
* @return bool
*/
function selectDB( $db ) {
return $this->mConn->server_info;
}
+ /**
+ * @param mysqli $res
+ * @return bool
+ */
protected function mysqlFreeResult( $res ) {
$res->free_result();
return true;
}
+ /**
+ * @param mysqli $res
+ * @return bool
+ */
protected function mysqlFetchObject( $res ) {
$object = $res->fetch_object();
if ( $object === null ) {
return $object;
}
+ /**
+ * @param mysqli $res
+ * @return bool
+ */
protected function mysqlFetchArray( $res ) {
$array = $res->fetch_array();
if ( $array === null ) {
return $array;
}
+ /**
+ * @param mysqli $res
+ * @return mixed
+ */
protected function mysqlNumRows( $res ) {
return $res->num_rows;
}
+ /**
+ * @param mysqli $res
+ * @return mixed
+ */
protected function mysqlNumFields( $res ) {
return $res->field_count;
}
+ /**
+ * @param mysqli $res
+ * @param int $n
+ * @return mixed
+ */
protected function mysqlFetchField( $res, $n ) {
$field = $res->fetch_field_direct( $n );
$field->not_null = $field->flags & MYSQLI_NOT_NULL_FLAG;
return $field;
}
+ /**
+ * @param resource|ResultWrapper $res
+ * @param int $n
+ * @return mixed
+ */
protected function mysqlFieldName( $res, $n ) {
$field = $res->fetch_field_direct( $n );
return $field->name;
}
+ /**
+ * @param resource|ResultWrapper $res
+ * @param int $n
+ * @return mixed
+ */
protected function mysqlFieldType( $res, $n ) {
$field = $res->fetch_field_direct( $n );
+
return $field->type;
}
+ /**
+ * @param resource|ResultWrapper $res
+ * @param int $row
+ * @return mixed
+ */
protected function mysqlDataSeek( $res, $row ) {
return $res->data_seek( $row );
}
+ /**
+ * @param mysqli $conn Optional connection object
+ * @return string
+ */
protected function mysqlError( $conn = null ) {
if ( $conn === null ) {
return mysqli_connect_error();
}
}
+ /**
+ * Escapes special characters in a string for use in an SQL statement
+ * @param string $s
+ * @return string
+ */
protected function mysqlRealEscapeString( $s ) {
+ if ( is_integer( $s ) ) {
+ // HHVM fatals passing numbers to real_escape_string
+ $s = (string) $s;
+ }
return $this->mConn->real_escape_string( $s );
}