MySQL: Remove dedicated view for replication status
This commit is contained in:
parent
0b824dad29
commit
70aef8a55a
|
@ -977,14 +977,6 @@ if (!defined("DRIVER")) {
|
||||||
return get_key_vals("SHOW STATUS");
|
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
|
/** Convert field in select and edit
|
||||||
* @param array one element from fields()
|
* @param array one element from fields()
|
||||||
* @return string
|
* @return string
|
||||||
|
|
|
@ -17,7 +17,6 @@ function connect_error() {
|
||||||
'processlist' => lang('Process list'),
|
'processlist' => lang('Process list'),
|
||||||
'variables' => lang('Variables'),
|
'variables' => lang('Variables'),
|
||||||
'status' => lang('Status'),
|
'status' => lang('Status'),
|
||||||
'replication' => lang('Replication'),
|
|
||||||
) as $key => $val) {
|
) as $key => $val) {
|
||||||
if (support($key)) {
|
if (support($key)) {
|
||||||
echo "<a href='" . h(ME) . "$key='>$val</a>\n";
|
echo "<a href='" . h(ME) . "$key='>$val</a>\n";
|
||||||
|
@ -78,7 +77,7 @@ if (isset($_GET["import"])) {
|
||||||
$_GET["sql"] = $_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"]) {
|
if (DB != "" || $_GET["refresh"]) {
|
||||||
restart_session();
|
restart_session();
|
||||||
set_session("dbs", null);
|
set_session("dbs", null);
|
||||||
|
|
|
@ -65,8 +65,6 @@ if (isset($_GET["download"])) {
|
||||||
include "./user.inc.php";
|
include "./user.inc.php";
|
||||||
} elseif (isset($_GET["processlist"])) {
|
} elseif (isset($_GET["processlist"])) {
|
||||||
include "./processlist.inc.php";
|
include "./processlist.inc.php";
|
||||||
} elseif (isset($_GET["replication"])) {
|
|
||||||
include "./replication.inc.php";
|
|
||||||
} elseif (isset($_GET["select"])) {
|
} elseif (isset($_GET["select"])) {
|
||||||
include "./select.inc.php";
|
include "./select.inc.php";
|
||||||
} elseif (isset($_GET["variables"])) {
|
} elseif (isset($_GET["variables"])) {
|
||||||
|
|
|
@ -46,10 +46,6 @@ $translations = array(
|
||||||
'Variables' => 'Proměnné',
|
'Variables' => 'Proměnné',
|
||||||
'Status' => 'Stav',
|
'Status' => 'Stav',
|
||||||
|
|
||||||
'Replication' => 'Replikace',
|
|
||||||
'Master status' => 'Master status',
|
|
||||||
'Slave status' => 'Slave status',
|
|
||||||
|
|
||||||
'SQL command' => 'SQL příkaz',
|
'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.'),
|
'%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ů.'),
|
'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 dropped.' => 'Typ byl odstraněn.',
|
||||||
'Type has been created.' => 'Typ byl vytvořen.',
|
'Type has been created.' => 'Typ byl vytvořen.',
|
||||||
'Alter type' => 'Pozměnit typ',
|
'Alter type' => 'Pozměnit typ',
|
||||||
|
|
||||||
'Replication' => null,
|
|
||||||
'Master status' => null,
|
|
||||||
'Slave status' => null,
|
|
||||||
);
|
);
|
||||||
|
|
|
@ -269,9 +269,6 @@ $translations = array(
|
||||||
'Materialized view' => 'Материализованное представление',
|
'Materialized view' => 'Материализованное представление',
|
||||||
'Vacuum' => 'Вакуум',
|
'Vacuum' => 'Вакуум',
|
||||||
'Selected' => 'Выбранные',
|
'Selected' => 'Выбранные',
|
||||||
'Replication' => 'Репликация',
|
|
||||||
'Master status' => 'состояние мастер-сервера',
|
|
||||||
'Slave status' => 'состояние ведомого сервера',
|
|
||||||
'File must be in UTF-8 encoding.' => 'Файл должен быть в кодировке UTF-8.',
|
'File must be in UTF-8 encoding.' => 'Файл должен быть в кодировке UTF-8.',
|
||||||
'Modify' => 'Изменить',
|
'Modify' => 'Изменить',
|
||||||
'Loading' => 'Загрузка',
|
'Loading' => 'Загрузка',
|
||||||
|
|
|
@ -46,10 +46,6 @@ $translations = array(
|
||||||
'Variables' => 'Xx',
|
'Variables' => 'Xx',
|
||||||
'Status' => 'Xx',
|
'Status' => 'Xx',
|
||||||
|
|
||||||
'Replication' => 'Xx',
|
|
||||||
'Master status' => 'Xx',
|
|
||||||
'Slave status' => 'Xx',
|
|
||||||
|
|
||||||
'SQL command' => 'Xx',
|
'SQL command' => 'Xx',
|
||||||
'%d query(s) executed OK.' => array('Xx.', 'Xx.'),
|
'%d query(s) executed OK.' => array('Xx.', 'Xx.'),
|
||||||
'Query executed OK, %d row(s) affected.' => array('Xx.', 'Xx.'),
|
'Query executed OK, %d row(s) affected.' => array('Xx.', 'Xx.'),
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
<?php
|
|
||||||
page_header(lang('Replication'));
|
|
||||||
|
|
||||||
echo "<h3>" . lang('Master status') . doc_link(array("sql" => "show-master-status.html")) . "</h3>\n";
|
|
||||||
$master_replication_status = replication_status("MASTER");
|
|
||||||
if (!$master_replication_status) {
|
|
||||||
echo "<p class='message'>" . lang('No rows.') . "\n";
|
|
||||||
} else {
|
|
||||||
echo "<table cellspacing='0'>\n";
|
|
||||||
foreach ($master_replication_status[0] as $key => $val) {
|
|
||||||
echo "<tr>";
|
|
||||||
echo "<th>" . h($key);
|
|
||||||
echo "<td>" . nbsp($val);
|
|
||||||
}
|
|
||||||
echo "</table>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$slave_replication_status = replication_status("SLAVE");
|
|
||||||
if ($slave_replication_status) {
|
|
||||||
echo "<h3>" . lang('Slave status') . doc_link(array("sql" => "show-slave-status.html")) . "</h3>\n";
|
|
||||||
foreach ($slave_replication_status[0] as $slave) {
|
|
||||||
echo "<table cellspacing='0'>\n";
|
|
||||||
foreach ($slave as $key => $val) {
|
|
||||||
echo "<tr>";
|
|
||||||
echo "<th>" . h($key);
|
|
||||||
echo "<td>" . nbsp($val);
|
|
||||||
}
|
|
||||||
echo "</table>\n";
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,4 +1,5 @@
|
||||||
Adminer 4.3.2-dev:
|
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)
|
PostgreSQL: Sort table names (regression from 4.3.1)
|
||||||
|
|
||||||
Adminer 4.3.1 (released 2017-04-14):
|
Adminer 4.3.1 (released 2017-04-14):
|
||||||
|
|
|
@ -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/pdo.inc.php";
|
||||||
include dirname(__FILE__) . "/adminer/include/driver.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
|
$lang_ids = array(); // global variable simplifies usage in a callback function
|
||||||
$file = file_get_contents(dirname(__FILE__) . "/$project/index.php");
|
$file = file_get_contents(dirname(__FILE__) . "/$project/index.php");
|
||||||
if ($driver) {
|
if ($driver) {
|
||||||
|
|
Loading…
Reference in a new issue