]> git.joonet.de Git - adminer.git/commitdiff
Do not cast date/timestamp exact searches in PostgreSQL to text
authorMatěj Humpál <finwe@finwe.info>
Wed, 28 Feb 2018 15:17:12 +0000 (16:17 +0100)
committerJakub Vrana <jakub@vrana.cz>
Thu, 1 Mar 2018 10:21:50 +0000 (11:21 +0100)
adminer/drivers/pgsql.inc.php

index 638468440c61b8ffe5b579162874697b2771f839..8f121322f6f6feb263c8bee2d7cbe62b44a0ec91 100644 (file)
@@ -195,8 +195,7 @@ if (isset($_GET["pgsql"])) {
 
                function convertSearch($idf, $val, $field) {
                        return (preg_match('~char|text'
-                                       . (is_numeric($val["val"]) && !preg_match('~LIKE~', $val["op"]) ? '|' . number_type() : '')
-                                       . (!preg_match('~LIKE~', $val["op"]) ? '|date|timestamp' : '')
+                                       . (!preg_match('~LIKE~', $val["op"]) ? '|date|timestamp' . (is_numeric($val["val"]) ? '|' . number_type() : '') : '')
                                        . '~', $field["type"])
                                ? $idf
                                : "CAST($idf AS text)"