]> git.joonet.de Git - adminer.git/commitdiff
Fix tables list in Editor
authorJakub Vrana <jakub@vrana.cz>
Wed, 8 May 2013 18:53:53 +0000 (11:53 -0700)
committerJakub Vrana <jakub@vrana.cz>
Wed, 8 May 2013 18:58:21 +0000 (11:58 -0700)
adminer/drivers/mysql.inc.php

index ce584a1aff5631cd050a80a324e288353cbe3f03..d7427172790b54933baa9ea87c71c0470458e21f 100644 (file)
@@ -373,14 +373,14 @@ if (!defined("DRIVER")) {
                global $connection;
                $return = array();
                foreach (get_rows($fast && $connection->server_info >= 5
-                       ? "SELECT table_name AS Name, Engine, TABLE_COMMENT AS Comment FROM information_schema.TABLES WHERE table_schema = " . q(DB) . ($name != "" ? " AND table_name = " . q($name) : "")
+                       ? "SELECT TABLE_NAME AS Name, Engine, TABLE_COMMENT AS Comment FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE()" . ($name != "" ? " AND TABLE_NAME = " . q($name) : "")
                        : "SHOW TABLE STATUS" . ($name != "" ? " LIKE " . q(addcslashes($name, "%_\\")) : "")
                ) as $row) {
                        if ($row["Engine"] == "InnoDB") {
                                // ignore internal comment, unnecessary since MySQL 5.1.21
                                $row["Comment"] = preg_replace('~(?:(.+); )?InnoDB free: .*~', '\\1', $row["Comment"]);
                        }
-                       if (!isset($row["Rows"])) {
+                       if (!isset($row["Engine"])) {
                                $row["Comment"] = "";
                        }
                        if ($name != "") {