]> git.joonet.de Git - adminer.git/commitdiff
PgSQL search operator "SQL" added
authorSartor <sartor@syneforge.com>
Wed, 7 Mar 2018 10:32:53 +0000 (12:32 +0200)
committerJakub Vrana <jakub@vrana.cz>
Sun, 11 Mar 2018 14:48:42 +0000 (15:48 +0100)
adminer/drivers/pgsql.inc.php
changes.txt

index 5b4085ed029e928d2e224fdf57a0b274956b0f05..db962e0241b881bffcbd1b0d93ff9e6a26a8fe39 100644 (file)
@@ -217,7 +217,7 @@ if (isset($_GET["pgsql"])) {
                function convertSearch($idf, $val, $field) {
                        return (preg_match('~char|text'
                                        . (!preg_match('~LIKE~', $val["op"]) ? '|date|time(stamp)?' . (is_numeric($val["val"]) ? '|' . number_type() : '') : '')
-                                       . '~', $field["type"])
+                                       . '~', $field["type"]) || $val["op"] == "SQL"
                                ? $idf
                                : "CAST($idf AS text)"
                        );
@@ -845,7 +845,7 @@ AND typelem = 0"
                $structured_types[$key] = array_keys($val);
        }
        $unsigned = array();
-       $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "ILIKE", "ILIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"); // no "SQL" to avoid SQL injection
+       $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "ILIKE", "ILIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL");
        $functions = array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper");
        $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
        $edit_functions = array(
index ec4227fcced2e9f7ddc2f8f3034b29d7c388eb9c..a603fc799387785b12a716575746287b370f038f 100644 (file)
@@ -6,6 +6,7 @@ Fix displaying info about non-alphabetical objects (bug #599)
 PDO: Support binary fields download
 MySQL: Use CONVERT() only when searching for non-ASCII (bug #603)
 PostgreSQL: Do not cast date/time searches to text
+PostgreSQL: Add SQL operator to search
 
 Adminer 4.6.2 (released 2018-02-20):
 Semi-transparent border on table actions