1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-09 08:06:59 +02:00

Do not cast date/timestamp exact searches in PostgreSQL to text

This commit is contained in:
Matěj Humpál
2018-02-28 16:17:12 +01:00
committed by Jakub Vrana
parent 52d7c38ef1
commit f844fc499e

View File

@@ -194,7 +194,10 @@ if (isset($_GET["pgsql"])) {
} }
function convertSearch($idf, $val, $field) { function convertSearch($idf, $val, $field) {
return (preg_match('~char|text' . (is_numeric($val["val"]) && !preg_match('~LIKE~', $val["op"]) ? '|' . number_type() : '') . '~', $field["type"]) return (preg_match('~char|text'
. (is_numeric($val["val"]) && !preg_match('~LIKE~', $val["op"]) ? '|' . number_type() : '')
. (!preg_match('~LIKE~', $val["op"]) ? '|date|timestamp' : '')
. '~', $field["type"])
? $idf ? $idf
: "CAST($idf AS text)" : "CAST($idf AS text)"
); );