mirror of
https://github.com/vrana/adminer.git
synced 2025-08-13 18:14:07 +02:00
PostgreSQL: Cast to string when searching using LIKE (bug #325)
This commit is contained in:
@@ -277,7 +277,7 @@ if (!defined("DRIVER")) {
|
||||
return queries($prefix . implode(",\n", $values) . $suffix);
|
||||
}
|
||||
|
||||
function convertSearch($idf, $field) {
|
||||
function convertSearch($idf, $val, $field) {
|
||||
return (preg_match('~char|text|enum|set~', $field["type"]) && !preg_match("~^utf8~", $field["collation"])
|
||||
? "CONVERT($idf USING " . charset($this->_conn) . ")"
|
||||
: $idf
|
||||
|
@@ -181,6 +181,13 @@ if (isset($_GET["pgsql"])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function convertSearch($idf, $val, $field) {
|
||||
return (preg_match('~char|text' . (is_numeric($val["val"]) && !preg_match('~LIKE~', $val["op"]) ? '|' . number_type() : '') . '~', $field["type"])
|
||||
? $idf
|
||||
: "CAST($idf AS text)"
|
||||
);
|
||||
}
|
||||
|
||||
function warnings() {
|
||||
return $this->_conn->warnings();
|
||||
}
|
||||
|
Reference in New Issue
Block a user