]> git.joonet.de Git - adminer.git/commitdiff
PostgreSQL: Use separator in limit1
authorJakub Vrana <jakub@vrana.cz>
Sun, 23 May 2021 09:08:29 +0000 (11:08 +0200)
committerJakub Vrana <jakub@vrana.cz>
Sun, 23 May 2021 09:08:29 +0000 (11:08 +0200)
adminer/drivers/pgsql.inc.php
adminer/select.inc.php
changes.txt

index caeda87514faa1814004151eaaf62efd1d58399d..d99efdd108f3d72d4271a5a38fa5289d0781d5da 100644 (file)
@@ -284,7 +284,7 @@ if (isset($_GET["pgsql"])) {
        function limit1($table, $query, $where, $separator = "\n") {
                return (preg_match('~^INTO~', $query)
                        ? limit($query, $where, 1, 0, $separator)
-                       : " $query" . (is_view(table_status1($table)) ? $where : WHERE ctid = (SELECT ctid FROM " . table($table) . $where . $separator . "LIMIT 1)")
+                       : " $query" . (is_view(table_status1($table)) ? $where : $separator . "WHERE ctid = (SELECT ctid FROM " . table($table) . $where . $separator . "LIMIT 1)")
                );
        }
 
index 5a40aeff2e673be73b392fa7a7eb375f7711d454..d213ae9626a84f954ad620d9ea4b73680956abe4 100644 (file)
@@ -382,7 +382,7 @@ if (!$columns && support("table")) {
                                                $key = "MD5(" . ($jush != 'sql' || preg_match("~^utf8~", $fields[$key]["collation"]) ? $key : "CONVERT($key USING " . charset($connection) . ")") . ")";
                                                $val = md5($val);
                                        }
-                                       $unique_idf .= "&" . ($val !== null ? urlencode("where[" . bracket_escape($key) . "]") . "=" . urlencode($val) : "null%5B%5D=" . urlencode($key));
+                                       $unique_idf .= "&" . ($val !== null ? urlencode("where[" . bracket_escape($key) . "]") . "=" . urlencode($val === false ? "f" : $val) : "null%5B%5D=" . urlencode($key));
                                }
                                echo "<tr" . odd() . ">" . (!$group && $select ? "" : "<td>"
                                        . checkbox("check[]", substr($unique_idf, 1), in_array(substr($unique_idf, 1), (array) $_POST["check"]))
index aa8a7cf252c4ecaf5bcc870e850e0f2b72f5b614..d5c4c5f673f1b204ce666618cd4434c048fffe1e 100644 (file)
@@ -1,5 +1,6 @@
 Adminer 4.8.2-dev:
 MySQL: Use ST_SRID() instead of SRID() for MySQL 8 (PR #418)
+PostgreSQL PDO: Allow editing rows identified by boolean column (PR #380)
 
 Adminer 4.8.1 (released 2021-05-14):
 Internet Explorer or PDO in Adminer 4.7.8-4.8.0: Fix XSS in doc_link (bug #797)