diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php index 0a919d6d..c9b44ae1 100644 --- a/adminer/drivers/mysql.inc.php +++ b/adminer/drivers/mysql.inc.php @@ -1015,6 +1015,16 @@ if (!defined("DRIVER")) { return !preg_match("~scheme|sequence|type|view_trigger" . ($connection->server_info < 5.1 ? "|event|partitioning" . ($connection->server_info < 5 ? "|routine|trigger|view" : "") : "") . "~", $feature); } + function kill_process($val) { + return queries("KILL " . number($val)); + } + + function max_connections() { + global $connection; + return $connection->result("SELECT @@max_connections"); + } + + $id_name = "Id"; $jush = "sql"; ///< @var string JUSH identifier $types = array(); ///< @var array ($type => $maximum_unsigned_length, ...) $structured_types = array(); ///< @var array ($description => array($type, ...), ...) diff --git a/adminer/drivers/pgsql.inc.php b/adminer/drivers/pgsql.inc.php index 22c9142d..87b69b2f 100644 --- a/adminer/drivers/pgsql.inc.php +++ b/adminer/drivers/pgsql.inc.php @@ -631,9 +631,19 @@ AND typelem = 0" function support($feature) { global $connection; - return preg_match('~^(database|table|columns|sql|indexes|comment|view|' . ($connection->server_info >= 9.3 ? 'materializedview|' : '') . 'scheme|processlist|sequence|trigger|type|variables|drop_col)$~', $feature); //! routine| + return preg_match('~^(database|table|columns|sql|indexes|comment|view|' . ($connection->server_info >= 9.3 ? 'materializedview|' : '') . 'scheme|processlist|sequence|trigger|type|variables|drop_col|kill)$~', $feature); //! routine| } + function kill_process($val) { + return queries("SELECT pg_terminate_backend(" . number($val).")"); + } + + function max_connections() { + global $connection; + return $connection->result("SHOW max_connections"); + } + + $id_name = "pid"; $jush = "pgsql"; $types = array(); $structured_types = array(); diff --git a/adminer/include/version.inc.php b/adminer/include/version.inc.php index a6781a30..4eebbcf6 100644 --- a/adminer/include/version.inc.php +++ b/adminer/include/version.inc.php @@ -1,2 +1,2 @@ $row) { } echo "\n"; } - - echo "" . (support("kill") ? "" . checkbox("kill[]", $row["Id"], 0) : ""); + echo "" . (support("kill") ? "" . checkbox("kill[]", $row[$id_name], 0) : ""); foreach ($row as $key => $val) { echo "" . ( ($jush == "sql" && $key == "Info" && preg_match("~Query|Killed~", $row["Command"]) && $val != "") || @@ -49,7 +48,7 @@ foreach (process_list() as $i => $row) {

result("SELECT @@max_connections")); + echo ($i + 1) . "/" . lang('%d in total', max_connections()); echo "

\n"; } ?> diff --git a/changes.txt b/changes.txt index 6f3e30d6..986015f9 100644 --- a/changes.txt +++ b/changes.txt @@ -1,3 +1,6 @@ +Adminer 4.2.5-dev: +PostgreSQL: Support KILL + Adminer 4.2.4 (released 2016-02-06): Fix remote execution in SQLite query MySQL: Support PHP 7