From 6b9c0dee14b1d369579152931d12ad50b0eaeecb Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Thu, 1 Feb 2018 12:00:34 +0100 Subject: [PATCH] Use pg_last_notice only with pgsql --- adminer/drivers/pgsql.inc.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/adminer/drivers/pgsql.inc.php b/adminer/drivers/pgsql.inc.php index 0768acc3..06beae8a 100644 --- a/adminer/drivers/pgsql.inc.php +++ b/adminer/drivers/pgsql.inc.php @@ -89,6 +89,10 @@ if (isset($_GET["pgsql"])) { } return pg_fetch_result($result->_result, 0, $field); } + + function warnings() { + return h(pg_last_notice($this->_link)); // second parameter is available since PHP 7.1.0 + } } class Min_Result { @@ -143,6 +147,10 @@ if (isset($_GET["pgsql"])) { return ($adminer->database() == $database); } + function warnings() { + return ''; // not implemented in PDO_PgSQL as of PHP 7.2.1 + } + function close() { } } @@ -174,7 +182,7 @@ if (isset($_GET["pgsql"])) { } function warnings() { - return h(pg_last_notice($this->_conn->_link)); + return $this->_conn->warnings(); } }