From: Michael Date: Tue, 22 Nov 2016 16:47:08 +0000 (+0000) Subject: Bugfix: We should only search in the current database for MyISAM tables X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=edbdd0e34a90612349001fbfc4f2246f23ab36ab;p=friendica.git Bugfix: We should only search in the current database for MyISAM tables --- diff --git a/include/dba.php b/include/dba.php index 082a54bd49..16d2dc54d9 100644 --- a/include/dba.php +++ b/include/dba.php @@ -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 * diff --git a/mod/admin.php b/mod/admin.php index 7114ca7be7..f4cc0cf6fb 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -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)) {