Revision history for SQL::Abstract
- Fix order clauses with bind parameters in ->where
+ - Teach ::Tree that ILIKE (PostgreSQL) and REGEXP (MySQL) are binary ops
revision 1.81 2014-10-25
----------------------------
);
$alphanum_cmp_op_re = qr/$alphanum_cmp_op_re/x;
-my $binary_op_re = '(?: NOT \s+)? (?:' . join ('|', qw/IN BETWEEN R?LIKE/) . ')';
+my $binary_op_re = '(?: NOT \s+)? (?:' . join ('|', qw/IN BETWEEN [RI]?LIKE REGEXP/) . ')';
$binary_op_re = join "\n\t|\n",
"$op_look_behind (?i: $binary_op_re | AS ) $op_look_ahead",
$alphanum_cmp_op_re,
"SELECT [me].[id], ROW_NUMBER() OVER (ORDER BY (SELECT 1)) AS [rno__row__index] FROM ( SELECT [me].[id] FROM [LogParents] [me]) [me]",
# deliberate batshit insanity
"SELECT foo FROM bar WHERE > 12",
+ 'SELECT ilike_any_or FROM bar WHERE ( baz ILIKE ANY(?) OR bat ILIKE ANY(?) )',
+ 'SELECT regexp_or FROM bar WHERE ( baz REGEXP ? OR bat REGEXP ? )',
);
# FIXME FIXME FIXME