'ORDER \s+ BY',
);
my $unrollable_ops_re = join ' | ', @unrollable_ops;
-$unrollable_ops_re = qr/$unrollable_ops_re/xio;
+$unrollable_ops_re = qr/$unrollable_ops_re/xi;
sub is_same_sql_bind {
my ($sql1, $bind_ref1, $sql2, $bind_ref2, $msg) = @_;
}
# a function binds tighter than a mathop - see if our ancestor is a
- # mathop, and our content is a single non-mathop child with a single
- # PAREN grandchild which would indicate mathop ( nonmathop ( ... ) )
+ # mathop, and our content is:
+ # a single non-mathop child with a single PAREN grandchild which
+ # would indicate mathop ( nonmathop ( ... ) )
+ # or a single non-mathop with a single LITERAL ( nonmathop ? )
elsif (
@{$child->[1]} == 1
and
@{$child->[1][0][1]} == 1
and
- $child->[1][0][1][0][0] eq 'PAREN'
- and
$ast->[0] =~ SQL::Abstract::Tree::_math_op_re()
and
$child->[1][0][0] !~ SQL::Abstract::Tree::_math_op_re
+ and
+ (
+ $child->[1][0][1][0][0] eq 'PAREN'
+ or
+ $child->[1][0][1][0][0] eq 'LITERAL'
+ )
) {
push @children, $child->[1][0];
$changes++;