]> git.mxchange.org Git - friendica.git/commitdiff
Bugfix: We should only search in the current database for MyISAM tables
authorMichael <heluecht@pirati.ca>
Tue, 22 Nov 2016 16:47:08 +0000 (16:47 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 22 Nov 2016 16:47:08 +0000 (16:47 +0000)
include/dba.php
mod/admin.php

index 082a54bd496694875cb7756974f049c2f065a179..16d2dc54d9cc1a362028699c974f41a8299174fb 100644 (file)
@@ -109,6 +109,17 @@ class dba {
                return $return;
        }
 
+       /**
+        * @brief Returns the selected database name
+        *
+        * @return string
+        */
+       public function database_name() {
+               $r = $this->q("SELECT DATABASE() AS `db`");
+
+               return $r[0]['db'];
+       }
+
        /**
         * @brief Returns the number of rows
         *
index 7114ca7be7731673aa008dd9ffa6d86e5edd745a..f4cc0cf6fb55f8c717317cdeec86ad1e01145cbf 100644 (file)
@@ -430,7 +430,8 @@ function admin_page_queue(&$a) {
 function admin_page_summary(&$a) {
        global $db;
        // are there MyISAM tables in the DB? If so, trigger a warning message
-       $r = q("SELECT `engine` FROM `information_schema`.`tables` WHERE `engine`='myisam' LIMIT 1");
+       $r = q("SELECT `engine` FROM `information_schema`.`tables` WHERE `engine` = 'myisam' AND `table_schema` = '%s' LIMIT 1",
+               dbesc($db->database_name()));
        $showwarning = false;
        $warningtext = array();
        if (dbm::is_result($r)) {