PostgreSQL: Fix editing data in views (bug #605)
This commit is contained in:
parent
d271d0b481
commit
6ba77b7899
|
@ -217,7 +217,7 @@ if (isset($_GET["pgsql"])) {
|
||||||
function convertSearch($idf, $val, $field) {
|
function convertSearch($idf, $val, $field) {
|
||||||
return (preg_match('~char|text'
|
return (preg_match('~char|text'
|
||||||
. (!preg_match('~LIKE~', $val["op"]) ? '|date|time(stamp)?' . (is_numeric($val["val"]) ? '|' . number_type() : '') : '')
|
. (!preg_match('~LIKE~', $val["op"]) ? '|date|time(stamp)?' . (is_numeric($val["val"]) ? '|' . number_type() : '') : '')
|
||||||
. '~', $field["type"]) || $val["op"] == "SQL"
|
. '~', $field["type"])
|
||||||
? $idf
|
? $idf
|
||||||
: "CAST($idf AS text)"
|
: "CAST($idf AS text)"
|
||||||
);
|
);
|
||||||
|
@ -286,7 +286,7 @@ if (isset($_GET["pgsql"])) {
|
||||||
function limit1($table, $query, $where, $separator = "\n") {
|
function limit1($table, $query, $where, $separator = "\n") {
|
||||||
return (preg_match('~^INTO~', $query)
|
return (preg_match('~^INTO~', $query)
|
||||||
? limit($query, $where, 1, 0, $separator)
|
? limit($query, $where, 1, 0, $separator)
|
||||||
: " $query WHERE ctid = (SELECT ctid FROM " . table($table) . $where . $separator . "LIMIT 1)"
|
: " $query" . (is_view(table_status1($table)) ? $where : " WHERE ctid = (SELECT ctid FROM " . table($table) . $where . $separator . "LIMIT 1)")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -845,7 +845,7 @@ AND typelem = 0"
|
||||||
$structured_types[$key] = array_keys($val);
|
$structured_types[$key] = array_keys($val);
|
||||||
}
|
}
|
||||||
$unsigned = array();
|
$unsigned = array();
|
||||||
$operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "ILIKE", "ILIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL");
|
$operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "ILIKE", "ILIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"); // no "SQL" to avoid SQL injection
|
||||||
$functions = array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper");
|
$functions = array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper");
|
||||||
$grouping = array("avg", "count", "count distinct", "max", "min", "sum");
|
$grouping = array("avg", "count", "count distinct", "max", "min", "sum");
|
||||||
$edit_functions = array(
|
$edit_functions = array(
|
||||||
|
|
|
@ -5,6 +5,7 @@ Decrease timeout for running slow queries from 5 seconds to 2 seconds
|
||||||
Fix displaying info about non-alphabetical objects (bug #599)
|
Fix displaying info about non-alphabetical objects (bug #599)
|
||||||
PDO: Support binary fields download
|
PDO: Support binary fields download
|
||||||
MySQL: Use CONVERT() only when searching for non-ASCII (bug #603)
|
MySQL: Use CONVERT() only when searching for non-ASCII (bug #603)
|
||||||
|
PostgreSQL: Fix editing data in views (bug #605, regression from 4.6.0)
|
||||||
PostgreSQL: Do not cast date/time searches to text
|
PostgreSQL: Do not cast date/time searches to text
|
||||||
PostgreSQL: Add SQL operator to search
|
PostgreSQL: Add SQL operator to search
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue