MDL-34010 Update diagnose() function to query information_schema.tables
authorMichael Aherne <michael.aherne@strath.ac.uk>
Mon, 25 Jun 2012 15:31:30 +0000 (16:31 +0100)
committerPetr Škoda <commits@skodak.org>
Fri, 6 Jul 2012 06:01:33 +0000 (08:01 +0200)
lib/dml/mysqli_native_moodle_database.php

index 93311bd..da9ad4e 100644 (file)
@@ -235,7 +235,7 @@ class mysqli_native_moodle_database extends moodle_database {
     public function diagnose() {
         $sloppymyisamfound = false;
         $prefix = str_replace('_', '\\_', $this->prefix);
-        $sql = "SHOW TABLE STATUS WHERE Name LIKE BINARY '$prefix%'";
+        $sql = "SELECT Engine FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = DATABASE() AND table_name LIKE BINARY '$prefix%'";
         $this->query_start($sql, null, SQL_QUERY_AUX);
         $result = $this->mysqli->query($sql);
         $this->query_end($result);