]> git.joonet.de Git - adminer.git/commitdiff
postgresql : ERROR: function connection_id() does not exist
authorsoleuu <soleuu@gmail.com>
Mon, 16 Jan 2017 16:03:02 +0000 (17:03 +0100)
committerJakub Vrana <jakub@vrana.cz>
Sat, 18 Feb 2017 16:32:40 +0000 (17:32 +0100)
adminer/drivers/mysql.inc.php
adminer/drivers/pgsql.inc.php
adminer/include/functions.inc.php

index d400f26f1d4d2574eb7dac174bdc5e2b683cc774..9e49330ed413a8dd423fe4f1bf463e12ff6b41c3 100644 (file)
@@ -1019,6 +1019,10 @@ if (!defined("DRIVER")) {
                return queries("KILL " . number($val));
        }
 
+       function connection_id(){
+               return "SELECT CONNECTION_ID()";
+       }
+
        function max_connections() {
                global $connection;
                return $connection->result("SELECT @@max_connections");
index b70d96cd495c452122b82751340a8fc782eb1046..9425760c93bd11bccf16a64e8152bc87aeb3f87e 100644 (file)
@@ -638,6 +638,10 @@ AND typelem = 0"
                return queries("SELECT pg_terminate_backend(" . number($val).")");
        }
 
+       function connection_id(){
+               return "SELECT pg_backend_pid()";
+       }
+
        function max_connections() {
                global $connection;
                return $connection->result("SHOW max_connections");
index 68be3a0b0c8895501eeb294bba885a19c52c2b5f..e7bdb16247f784d72a4ae622f7fbac3c7a75acc6 100644 (file)
@@ -1215,7 +1215,7 @@ function slow_query($query) {
        $db = $adminer->database();
        $timeout = $adminer->queryTimeout();
        if (support("kill") && is_object($connection2 = connect()) && ($db == "" || $connection2->select_db($db))) {
-               $kill = $connection2->result("SELECT CONNECTION_ID()"); // MySQL and MySQLi can use thread_id but it's not in PDO_MySQL
+               $kill = $connection2->result(connection_id()); // MySQL and MySQLi can use thread_id but it's not in PDO_MySQL
                ?>
 <script type="text/javascript">
 var timeout = setTimeout(function () {