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, ...), ...)
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();
<?php
-$VERSION = "4.2.4";
+$VERSION = "4.2.5-dev";
if (support("kill") && $_POST && !$error) {
$killed = 0;
foreach ((array) $_POST["kill"] as $val) {
- if (queries("KILL " . number($val))) {
+ if (kill_process($val)) {
$killed++;
}
}
}
echo "</thead>\n";
}
-
- echo "<tr" . odd() . ">" . (support("kill") ? "<td>" . checkbox("kill[]", $row["Id"], 0) : "");
+ echo "<tr" . odd() . ">" . (support("kill") ? "<td>" . checkbox("kill[]", $row[$id_name], 0) : "");
foreach ($row as $key => $val) {
echo "<td>" . (
($jush == "sql" && $key == "Info" && preg_match("~Query|Killed~", $row["Command"]) && $val != "") ||
<p>
<?php
if (support("kill")) {
- echo ($i + 1) . "/" . lang('%d in total', $connection->result("SELECT @@max_connections"));
+ echo ($i + 1) . "/" . lang('%d in total', max_connections());
echo "<p><input type='submit' value='" . lang('Kill') . "'>\n";
}
?>
+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