Merge "Simplify HTMLTitleTextField::validate"
[lhc/web/wiklou.git] / includes / libs / rdbms / database / DatabaseMysqlBase.php
index bbc656d..0f57551 100644 (file)
@@ -120,15 +120,7 @@ abstract class DatabaseMysqlBase extends Database {
                return 'mysql';
        }
 
-       /**
-        * @param string $server
-        * @param string $user
-        * @param string $password
-        * @param string $dbName
-        * @throws Exception|DBConnectionError
-        * @return bool
-        */
-       public function open( $server, $user, $password, $dbName ) {
+       protected function open( $server, $user, $password, $dbName ) {
                # Close/unset connection handle
                $this->close();
 
@@ -367,7 +359,7 @@ abstract class DatabaseMysqlBase extends Database {
                        $res = $res->result;
                }
                Wikimedia\suppressWarnings();
-               $n = $this->mysqlNumRows( $res );
+               $n = $res ? $this->mysqlNumRows( $res ) : 0;
                Wikimedia\restoreWarnings();
 
                // Unfortunately, mysql_num_rows does not reset the last errno.
@@ -498,7 +490,7 @@ abstract class DatabaseMysqlBase extends Database {
        /**
         * Returns the text of the error message from previous MySQL operation
         *
-        * @param resource $conn Raw connection
+        * @param resource|null $conn Raw connection
         * @return string
         */
        abstract protected function mysqlError( $conn = null );
@@ -1457,7 +1449,7 @@ abstract class DatabaseMysqlBase extends Database {
        /**
         * List all tables on the database
         *
-        * @param string $prefix Only show tables with this prefix, e.g. mw_
+        * @param string|null $prefix Only show tables with this prefix, e.g. mw_
         * @param string $fname Calling function name
         * @return array
         */
@@ -1511,7 +1503,7 @@ abstract class DatabaseMysqlBase extends Database {
        /**
         * Lists VIEWs in the database
         *
-        * @param string $prefix Only show VIEWs with this prefix, eg.
+        * @param string|null $prefix Only show VIEWs with this prefix, eg.
         * unit_test_, or $wgDBprefix. Default: null, would return all views.
         * @param string $fname Name of calling function
         * @return array
@@ -1547,7 +1539,7 @@ abstract class DatabaseMysqlBase extends Database {
         * Differentiates between a TABLE and a VIEW.
         *
         * @param string $name Name of the TABLE/VIEW to test
-        * @param string $prefix
+        * @param string|null $prefix
         * @return bool
         * @since 1.22
         */