Commit 39af8fd0 authored by Frédéric Buclin's avatar Frédéric Buclin Committed by Max Kanat-Alexander

Bug 533363: [PostgreSQL] Using "Bug ID contains foo" in boolean charts or…

Bug 533363: [PostgreSQL] Using "Bug ID contains foo" in boolean charts or "Exclude bug numbered" charts crash PostgreSQL 8.3 and newer (non-character data types are no longer automatically cast to TEXT) Patch by Frédéric Buclin <LpSolit@gmail.com> r/a=mkanat
parent 26426fe8
......@@ -100,13 +100,25 @@ sub sql_group_concat {
return "array_to_string(array_accum($text), $separator)";
}
sub sql_istring {
my ($self, $string) = @_;
return "LOWER(${string}::text)";
}
sub sql_position {
my ($self, $fragment, $text) = @_;
return "POSITION($fragment IN ${text}::text)";
}
sub sql_regexp {
my ($self, $expr, $pattern, $nocheck, $real_pattern) = @_;
$real_pattern ||= $pattern;
$self->bz_check_regexp($real_pattern) if !$nocheck;
return "$expr ~* $pattern";
return "${expr}::text ~* $pattern";
}
sub sql_not_regexp {
......@@ -115,7 +127,7 @@ sub sql_not_regexp {
$self->bz_check_regexp($real_pattern) if !$nocheck;
return "$expr !~* $pattern"
return "${expr}::text !~* $pattern"
}
sub sql_limit {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment