]> git.joonet.de Git - adminer.git/commitdiff
Order table list by name (bug #3613974)
authorJakub Vrana <jakub@vrana.cz>
Tue, 28 May 2013 18:12:25 +0000 (11:12 -0700)
committerJakub Vrana <jakub@vrana.cz>
Tue, 28 May 2013 18:14:15 +0000 (11:14 -0700)
adminer/drivers/mssql.inc.php
adminer/drivers/mysql.inc.php
adminer/drivers/oracle.inc.php
adminer/drivers/pgsql.inc.php
adminer/drivers/sqlite.inc.php
changes.txt

index bada009c6cfb43833c74fe7fc857351ae4929443..90e639f55d4b5169bc8ac7b617d2e20dc8808a42 100644 (file)
@@ -293,7 +293,7 @@ if (isset($_GET["mssql"])) {
        
        function table_status($name = "") {
                $return = array();
-               foreach (get_rows("SELECT name AS Name, type_desc AS Engine FROM sys.all_objects WHERE schema_id = SCHEMA_ID(" . q(get_schema()) . ") AND type IN ('S', 'U', 'V')" . ($name != "" ? " AND name = " . q($name) : "")) as $row) {
+               foreach (get_rows("SELECT name AS Name, type_desc AS Engine FROM sys.all_objects WHERE schema_id = SCHEMA_ID(" . q(get_schema()) . ") AND type IN ('S', 'U', 'V') " . ($name != "" ? "AND name = " . q($name) : "ORDER BY name")) as $row) {
                        if ($name != "") {
                                return $row;
                        }
index b99e87554644951408276fcbd3aa5b989650aaf5..747a625ba5a698f4b3b09b0f9ca8a65c993e319b 100644 (file)
@@ -373,7 +373,7 @@ 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 = DATABASE()" . ($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) : "ORDER BY Name")
                        : "SHOW TABLE STATUS" . ($name != "" ? " LIKE " . q(addcslashes($name, "%_\\")) : "")
                ) as $row) {
                        if ($row["Engine"] == "InnoDB") {
index ecfdfae9e9246d402122277eba2e23c6fe7cfb30..beae86842ec0365ba762abbee4bce8c41ca632c6 100644 (file)
@@ -181,7 +181,8 @@ if (isset($_GET["oracle"])) {
 
        function tables_list() {
                return get_key_vals("SELECT table_name, 'table' FROM all_tables WHERE tablespace_name = " . q(DB) . "
-UNION SELECT view_name, 'view' FROM user_views"
+UNION SELECT view_name, 'view' FROM user_views
+ORDER BY 1"
                ); //! views don't have schema
        }
 
@@ -193,7 +194,8 @@ UNION SELECT view_name, 'view' FROM user_views"
                $return = array();
                $search = q($name);
                foreach (get_rows('SELECT table_name "Name", \'table\' "Engine", avg_row_len * num_rows "Data_length", num_rows "Rows" FROM all_tables WHERE tablespace_name = ' . q(DB) . ($name != "" ? " AND table_name = $search" : "") . "
-UNION SELECT view_name, 'view', 0, 0 FROM user_views" . ($name != "" ? " WHERE view_name = $search" : "")
+UNION SELECT view_name, 'view', 0, 0 FROM user_views" . ($name != "" ? " WHERE view_name = $search" : "") . "
+ORDER BY 1"
                ) as $row) {
                        if ($name != "") {
                                return $row;
index a6997e2dc2b01f795acd66c031713b0bb4d2da14..e82e2f7b8b7ae3cf0abd37f99f6a623bd8072a5c 100644 (file)
@@ -209,8 +209,8 @@ if (isset($_GET["pgsql"])) {
                foreach (get_rows("SELECT relname AS \"Name\", CASE relkind WHEN 'r' THEN 'table' ELSE 'view' END AS \"Engine\", pg_relation_size(oid) AS \"Data_length\", pg_total_relation_size(oid) - pg_relation_size(oid) AS \"Index_length\", obj_description(oid, 'pg_class') AS \"Comment\", relhasoids::int AS \"Oid\", reltuples as \"Rows\"
 FROM pg_class
 WHERE relkind IN ('r','v')
-AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema())"
-                       . ($name != "" ? " AND relname = " . q($name) : " ORDER BY relname")
+AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema())
+" . ($name != "" ? "AND relname = " . q($name) : "ORDER BY relname")
                ) as $row) { //! Index_length, Auto_increment
                        $return[$row["Name"]] = $row;
                }
index 5bd43edfb039bc48794b0e4147b72f2efab062f2..7c062d17b5ac6f02ec7ecdc669cc0ddc8db298c0 100644 (file)
@@ -253,7 +253,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
        function table_status($name = "") {
                global $connection;
                $return = array();
-               foreach (get_rows("SELECT name AS Name, type AS Engine FROM sqlite_master WHERE type IN ('table', 'view')" . ($name != "" ? " AND name = " . q($name) : "")) as $row) {
+               foreach (get_rows("SELECT name AS Name, type AS Engine FROM sqlite_master WHERE type IN ('table', 'view') " . ($name != "" ? "AND name = " . q($name) : "ORDER BY name")) as $row) {
                        $row["Oid"] = 1;
                        $row["Auto_increment"] = "";
                        $row["Rows"] = $connection->result("SELECT COUNT(*) FROM " . idf_escape($row["Name"]));
index 3dd29ec758ea3c07ae5b8822fa6151d9b6ff6f24..3f67d7aff7f7869038d24d499a89f229525ff705 100644 (file)
@@ -2,7 +2,7 @@ Adminer 3.7.1-dev:
 Increase click target for checkboxes
 Use shadow for highlighting default button
 Don't use LIMIT 1 if inline updating unique row
-PostgreSQL: Order table list by name
+Order table list by name
 PostgreSQL: Fix detecting oid column in PDO
 
 Adminer 3.7.0 (released 2013-05-19):