MDL-50633 dml: deprecated var replaced in mysql 5.7
authorMarina Glancy <marina@moodle.com>
Mon, 2 Nov 2015 09:52:59 +0000 (17:52 +0800)
committerMarina Glancy <marina@moodle.com>
Mon, 2 Nov 2015 13:05:20 +0000 (21:05 +0800)
Thanks to Charles Verge for providing a patch

lib/dml/mysqli_native_moodle_database.php

index 70e8a6e..1874481 100644 (file)
@@ -180,13 +180,13 @@ class mysqli_native_moodle_database extends moodle_database {
             return $engine;
         }
 
             return $engine;
         }
 
-        // get the default database engine
-        $sql = "SELECT @@storage_engine";
+        // Get the default database engine.
+        $sql = "SELECT @@default_storage_engine engine";
         $this->query_start($sql, NULL, SQL_QUERY_AUX);
         $result = $this->mysqli->query($sql);
         $this->query_end($result);
         if ($rec = $result->fetch_assoc()) {
         $this->query_start($sql, NULL, SQL_QUERY_AUX);
         $result = $this->mysqli->query($sql);
         $this->query_end($result);
         if ($rec = $result->fetch_assoc()) {
-            $engine = $rec['@@storage_engine'];
+            $engine = $rec['engine'];
         }
         $result->close();
 
         }
         $result->close();