]> git.joonet.de Git - adminer.git/commitdiff
Use pg_last_notice only with pgsql
authorJakub Vrana <jakub@vrana.cz>
Thu, 1 Feb 2018 11:00:34 +0000 (12:00 +0100)
committerJakub Vrana <jakub@vrana.cz>
Thu, 1 Feb 2018 11:03:11 +0000 (12:03 +0100)
adminer/drivers/pgsql.inc.php

index 0768acc3d55daafb90047fa1921ca7bcb139e99f..06beae8a6c827b48185e9af0cd75e78df85fd0ca 100644 (file)
@@ -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();
                }
 
        }