mirror of
https://github.com/vrana/adminer.git
synced 2025-08-06 06:37:33 +02:00
PostgreSQL: Allow comparing json columns (fix #1107)
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
- PostgreSQL: Display index expressions
|
- PostgreSQL: Display index expressions
|
||||||
- PostgreSQL: Add SQL operator to select
|
- PostgreSQL: Add SQL operator to select
|
||||||
- PostgreSQL: Hide only partitions, not all inherited tables from menu
|
- PostgreSQL: Hide only partitions, not all inherited tables from menu
|
||||||
|
- PostgreSQL: Allow comparing json columns (bug #1107)
|
||||||
- PostgreSQL 11-: Avoid duplicate oid in table status (bug #1089)
|
- PostgreSQL 11-: Avoid duplicate oid in table status (bug #1089)
|
||||||
- Elasticsearch: Support dropping aliases
|
- Elasticsearch: Support dropping aliases
|
||||||
- Plugins: Methods processList() and killProcess()
|
- Plugins: Methods processList() and killProcess()
|
||||||
|
@@ -264,9 +264,10 @@ function where(array $where, array $fields = array()): string {
|
|||||||
$field_type = $field["type"];
|
$field_type = $field["type"];
|
||||||
$return[] = $column
|
$return[] = $column
|
||||||
. (JUSH == "sql" && $field_type == "json" ? " = CAST(" . q($val) . " AS JSON)"
|
. (JUSH == "sql" && $field_type == "json" ? " = CAST(" . q($val) . " AS JSON)"
|
||||||
|
: (JUSH == "pgsql" && preg_match('~^json~', $field_type) ? "::jsonb = " . q($val) . "::jsonb"
|
||||||
: (JUSH == "sql" && is_numeric($val) && preg_match('~\.~', $val) ? " LIKE " . q($val) // LIKE because of floats but slow with ints
|
: (JUSH == "sql" && is_numeric($val) && preg_match('~\.~', $val) ? " LIKE " . q($val) // LIKE because of floats but slow with ints
|
||||||
: (JUSH == "mssql" && strpos($field_type, "datetime") === false ? " LIKE " . q(preg_replace('~[_%[]~', '[\0]', $val)) // LIKE because of text but it does not work with datetime
|
: (JUSH == "mssql" && strpos($field_type, "datetime") === false ? " LIKE " . q(preg_replace('~[_%[]~', '[\0]', $val)) // LIKE because of text but it does not work with datetime
|
||||||
: " = " . unconvert_field($field, q($val)))))
|
: " = " . unconvert_field($field, q($val))))))
|
||||||
; //! enum and set
|
; //! enum and set
|
||||||
if (JUSH == "sql" && preg_match('~char|text~', $field_type) && preg_match("~[^ -@]~", $val)) { // not just [a-z] to catch non-ASCII characters
|
if (JUSH == "sql" && preg_match('~char|text~', $field_type) && preg_match("~[^ -@]~", $val)) { // not just [a-z] to catch non-ASCII characters
|
||||||
$return[] = "$column = " . q($val) . " COLLATE " . charset(connection()) . "_bin";
|
$return[] = "$column = " . q($val) . " COLLATE " . charset(connection()) . "_bin";
|
||||||
|
Reference in New Issue
Block a user