Order table list by name (bug #3613974)
This commit is contained in:
parent
5eb3eaa06e
commit
1dc9044ff4
|
@ -293,7 +293,7 @@ if (isset($_GET["mssql"])) {
|
||||||
|
|
||||||
function table_status($name = "") {
|
function table_status($name = "") {
|
||||||
$return = array();
|
$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 != "") {
|
if ($name != "") {
|
||||||
return $row;
|
return $row;
|
||||||
}
|
}
|
||||||
|
|
|
@ -373,7 +373,7 @@ if (!defined("DRIVER")) {
|
||||||
global $connection;
|
global $connection;
|
||||||
$return = array();
|
$return = array();
|
||||||
foreach (get_rows($fast && $connection->server_info >= 5
|
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, "%_\\")) : "")
|
: "SHOW TABLE STATUS" . ($name != "" ? " LIKE " . q(addcslashes($name, "%_\\")) : "")
|
||||||
) as $row) {
|
) as $row) {
|
||||||
if ($row["Engine"] == "InnoDB") {
|
if ($row["Engine"] == "InnoDB") {
|
||||||
|
|
|
@ -181,7 +181,8 @@ if (isset($_GET["oracle"])) {
|
||||||
|
|
||||||
function tables_list() {
|
function tables_list() {
|
||||||
return get_key_vals("SELECT table_name, 'table' FROM all_tables WHERE tablespace_name = " . q(DB) . "
|
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
|
); //! views don't have schema
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,7 +194,8 @@ UNION SELECT view_name, 'view' FROM user_views"
|
||||||
$return = array();
|
$return = array();
|
||||||
$search = q($name);
|
$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" : "") . "
|
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) {
|
) as $row) {
|
||||||
if ($name != "") {
|
if ($name != "") {
|
||||||
return $row;
|
return $row;
|
||||||
|
|
|
@ -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\"
|
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
|
FROM pg_class
|
||||||
WHERE relkind IN ('r','v')
|
WHERE relkind IN ('r','v')
|
||||||
AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema())"
|
AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema())
|
||||||
. ($name != "" ? " AND relname = " . q($name) : " ORDER BY relname")
|
" . ($name != "" ? "AND relname = " . q($name) : "ORDER BY relname")
|
||||||
) as $row) { //! Index_length, Auto_increment
|
) as $row) { //! Index_length, Auto_increment
|
||||||
$return[$row["Name"]] = $row;
|
$return[$row["Name"]] = $row;
|
||||||
}
|
}
|
||||||
|
|
|
@ -253,7 +253,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
||||||
function table_status($name = "") {
|
function table_status($name = "") {
|
||||||
global $connection;
|
global $connection;
|
||||||
$return = array();
|
$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["Oid"] = 1;
|
||||||
$row["Auto_increment"] = "";
|
$row["Auto_increment"] = "";
|
||||||
$row["Rows"] = $connection->result("SELECT COUNT(*) FROM " . idf_escape($row["Name"]));
|
$row["Rows"] = $connection->result("SELECT COUNT(*) FROM " . idf_escape($row["Name"]));
|
||||||
|
|
|
@ -2,7 +2,7 @@ Adminer 3.7.1-dev:
|
||||||
Increase click target for checkboxes
|
Increase click target for checkboxes
|
||||||
Use shadow for highlighting default button
|
Use shadow for highlighting default button
|
||||||
Don't use LIMIT 1 if inline updating unique row
|
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
|
PostgreSQL: Fix detecting oid column in PDO
|
||||||
|
|
||||||
Adminer 3.7.0 (released 2013-05-19):
|
Adminer 3.7.0 (released 2013-05-19):
|
||||||
|
|
Loading…
Reference in a new issue