From 70aef8a55afdd87e1fa0bd564eb95781add541b4 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 19 May 2017 11:11:44 +0200 Subject: [PATCH] MySQL: Remove dedicated view for replication status --- adminer/drivers/mysql.inc.php | 8 -------- adminer/include/connect.inc.php | 3 +-- adminer/index.php | 2 -- adminer/lang/cs.inc.php | 8 -------- adminer/lang/ru.inc.php | 3 --- adminer/lang/xx.inc.php | 4 ---- adminer/replication.inc.php | 30 ------------------------------ changes.txt | 1 + compile.php | 2 +- 9 files changed, 3 insertions(+), 58 deletions(-) delete mode 100644 adminer/replication.inc.php diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php index f38853ae..d298b087 100644 --- a/adminer/drivers/mysql.inc.php +++ b/adminer/drivers/mysql.inc.php @@ -977,14 +977,6 @@ if (!defined("DRIVER")) { return get_key_vals("SHOW STATUS"); } - /** Get replication status of master or slave - * @param string - * @return array ($name => $value) - */ - function replication_status($type) { - return get_rows("SHOW $type STATUS"); - } - /** Convert field in select and edit * @param array one element from fields() * @return string diff --git a/adminer/include/connect.inc.php b/adminer/include/connect.inc.php index 538e5210..3efa9ed3 100644 --- a/adminer/include/connect.inc.php +++ b/adminer/include/connect.inc.php @@ -17,7 +17,6 @@ function connect_error() { 'processlist' => lang('Process list'), 'variables' => lang('Variables'), 'status' => lang('Status'), - 'replication' => lang('Replication'), ) as $key => $val) { if (support($key)) { echo "$val\n"; @@ -78,7 +77,7 @@ if (isset($_GET["import"])) { $_GET["sql"] = $_GET["import"]; } -if (!(DB != "" ? $connection->select_db(DB) : isset($_GET["sql"]) || isset($_GET["dump"]) || isset($_GET["database"]) || isset($_GET["processlist"]) || isset($_GET["privileges"]) || isset($_GET["user"]) || isset($_GET["replication"]) || isset($_GET["variables"]) || $_GET["script"] == "connect" || $_GET["script"] == "kill")) { +if (!(DB != "" ? $connection->select_db(DB) : isset($_GET["sql"]) || isset($_GET["dump"]) || isset($_GET["database"]) || isset($_GET["processlist"]) || isset($_GET["privileges"]) || isset($_GET["user"]) || isset($_GET["variables"]) || $_GET["script"] == "connect" || $_GET["script"] == "kill")) { if (DB != "" || $_GET["refresh"]) { restart_session(); set_session("dbs", null); diff --git a/adminer/index.php b/adminer/index.php index c4de21af..ebd2d572 100644 --- a/adminer/index.php +++ b/adminer/index.php @@ -65,8 +65,6 @@ if (isset($_GET["download"])) { include "./user.inc.php"; } elseif (isset($_GET["processlist"])) { include "./processlist.inc.php"; -} elseif (isset($_GET["replication"])) { - include "./replication.inc.php"; } elseif (isset($_GET["select"])) { include "./select.inc.php"; } elseif (isset($_GET["variables"])) { diff --git a/adminer/lang/cs.inc.php b/adminer/lang/cs.inc.php index 832b18dc..42ae2810 100644 --- a/adminer/lang/cs.inc.php +++ b/adminer/lang/cs.inc.php @@ -46,10 +46,6 @@ $translations = array( 'Variables' => 'Proměnné', 'Status' => 'Stav', - 'Replication' => 'Replikace', - 'Master status' => 'Master status', - 'Slave status' => 'Slave status', - 'SQL command' => 'SQL příkaz', '%d query(s) executed OK.' => array('%d příkaz proběhl v pořádku.', '%d příkazy proběhly v pořádku.', '%d příkazů proběhlo v pořádku.'), 'Query executed OK, %d row(s) affected.' => array('Příkaz proběhl v pořádku, byl změněn %d záznam.', 'Příkaz proběhl v pořádku, byly změněny %d záznamy.', 'Příkaz proběhl v pořádku, bylo změněno %d záznamů.'), @@ -340,8 +336,4 @@ $translations = array( 'Type has been dropped.' => 'Typ byl odstraněn.', 'Type has been created.' => 'Typ byl vytvořen.', 'Alter type' => 'Pozměnit typ', - - 'Replication' => null, - 'Master status' => null, - 'Slave status' => null, ); diff --git a/adminer/lang/ru.inc.php b/adminer/lang/ru.inc.php index 8aa7450c..4d7309c4 100644 --- a/adminer/lang/ru.inc.php +++ b/adminer/lang/ru.inc.php @@ -269,9 +269,6 @@ $translations = array( 'Materialized view' => 'Материализованное представление', 'Vacuum' => 'Вакуум', 'Selected' => 'Выбранные', - 'Replication' => 'Репликация', - 'Master status' => 'состояние мастер-сервера', - 'Slave status' => 'состояние ведомого сервера', 'File must be in UTF-8 encoding.' => 'Файл должен быть в кодировке UTF-8.', 'Modify' => 'Изменить', 'Loading' => 'Загрузка', diff --git a/adminer/lang/xx.inc.php b/adminer/lang/xx.inc.php index 7bb29f18..932fc879 100644 --- a/adminer/lang/xx.inc.php +++ b/adminer/lang/xx.inc.php @@ -46,10 +46,6 @@ $translations = array( 'Variables' => 'Xx', 'Status' => 'Xx', - 'Replication' => 'Xx', - 'Master status' => 'Xx', - 'Slave status' => 'Xx', - 'SQL command' => 'Xx', '%d query(s) executed OK.' => array('Xx.', 'Xx.'), 'Query executed OK, %d row(s) affected.' => array('Xx.', 'Xx.'), diff --git a/adminer/replication.inc.php b/adminer/replication.inc.php deleted file mode 100644 index 33a13091..00000000 --- a/adminer/replication.inc.php +++ /dev/null @@ -1,30 +0,0 @@ -" . lang('Master status') . doc_link(array("sql" => "show-master-status.html")) . "\n"; -$master_replication_status = replication_status("MASTER"); -if (!$master_replication_status) { - echo "

" . lang('No rows.') . "\n"; -} else { - echo "\n"; - foreach ($master_replication_status[0] as $key => $val) { - echo ""; - echo "
" . h($key); - echo "" . nbsp($val); - } - echo "
\n"; -} - -$slave_replication_status = replication_status("SLAVE"); -if ($slave_replication_status) { - echo "

" . lang('Slave status') . doc_link(array("sql" => "show-slave-status.html")) . "

\n"; - foreach ($slave_replication_status[0] as $slave) { - echo "\n"; - foreach ($slave as $key => $val) { - echo ""; - echo "
" . h($key); - echo "" . nbsp($val); - } - echo "
\n"; - } -} diff --git a/changes.txt b/changes.txt index 87923456..6abcc94c 100644 --- a/changes.txt +++ b/changes.txt @@ -1,4 +1,5 @@ Adminer 4.3.2-dev: +MySQL: Remove dedicated view for replication status (added in 4.3.0) PostgreSQL: Sort table names (regression from 4.3.1) Adminer 4.3.1 (released 2017-04-14): diff --git a/compile.php b/compile.php index 5aa14c2c..9982cb75 100755 --- a/compile.php +++ b/compile.php @@ -344,7 +344,7 @@ foreach (glob(dirname(__FILE__) . "/adminer/drivers/" . ($driver ? $driver : "*" include dirname(__FILE__) . "/adminer/include/pdo.inc.php"; include dirname(__FILE__) . "/adminer/include/driver.inc.php"; -$features = array("call" => "routine", "dump", "event", "privileges", "procedure" => "routine", "processlist", "routine", "scheme", "sequence", "status", "trigger", "type", "user" => "privileges", "replication", "variables", "view"); +$features = array("call" => "routine", "dump", "event", "privileges", "procedure" => "routine", "processlist", "routine", "scheme", "sequence", "status", "trigger", "type", "user" => "privileges", "variables", "view"); $lang_ids = array(); // global variable simplifies usage in a callback function $file = file_get_contents(dirname(__FILE__) . "/$project/index.php"); if ($driver) {