Return correct values and types
authorSiebrand Mazeland <s.mazeland@xs4all.nl>
Mon, 6 Jan 2014 18:32:50 +0000 (19:32 +0100)
committerSiebrand <siebrand@wikimedia.org>
Mon, 6 Jan 2014 18:47:58 +0000 (18:47 +0000)
Change-Id: Ia069856160aae1ab937daee2da0d6800fe89698f

includes/db/DatabaseMysqlBase.php
includes/db/DatabaseOracle.php
includes/db/DatabasePostgres.php
includes/db/DatabaseSqlite.php

index 587d727..273cd8f 100644 (file)
@@ -1023,7 +1023,8 @@ abstract class DatabaseMysqlBase extends DatabaseBase {
                $newName = $this->addIdentifierQuotes( $newName );
                $oldName = $this->addIdentifierQuotes( $oldName );
                $query = "CREATE $tmp TABLE $newName (LIKE $oldName)";
-               $this->query( $query, $fname );
+
+               return $this->query( $query, $fname );
        }
 
        /**
index bb901b1..b1a8f66 100644 (file)
@@ -723,7 +723,7 @@ class DatabaseOracle extends DatabaseBase {
                        oci_commit( $this->mConn );
                }
 
-               oci_free_statement( $stmt );
+               return oci_free_statement( $stmt );
        }
 
        function insertSelect( $destTable, $srcTable, $varMap, $conds, $fname = __METHOD__,
@@ -1497,7 +1497,7 @@ class DatabaseOracle extends DatabaseBase {
                        oci_commit( $this->mConn );
                }
 
-               oci_free_statement( $stmt );
+               return oci_free_statement( $stmt );
        }
 
        function bitNot( $field ) {
index 3e58c66..9f96ccb 100644 (file)
@@ -381,7 +381,7 @@ class DatabasePostgres extends DatabaseBase {
                global $wgDBport;
 
                if ( !strlen( $user ) ) { # e.g. the class is being loaded
-                       return;
+                       return null;
                }
 
                $this->mServer = $server;
index 6d2693f..5f14aef 100644 (file)
@@ -150,8 +150,10 @@ class DatabaseSqlite extends DatabaseBase {
                        # Enforce LIKE to be case sensitive, just like MySQL
                        $this->query( 'PRAGMA case_sensitive_like = 1' );
 
-                       return true;
+                       return $this->mConn;
                }
+
+               return false;
        }
 
        /**