- Fix parsing of NOT EXISTS
- Fix deep recursion warnings while parsing obnoxiously long sql statements
+ - Fix incorrect comparison of malformed lists
revision 1.72 2010-12-21
----------------------------
elsif ($token =~ /^ (?: OR | AND | \, ) $/xi ) {
my $op = ($token eq ',') ? 'LIST' : uc $token;
- my $right = $self->_recurse_parse($tokens, PARSE_IN_EXPR);
+ my $right = $self->_recurse_parse($tokens, PARSE_IN_EXPR) || [];
# Merge chunks if logic matches
- if (ref $right and $op eq $right->[0]) {
- $left = [ (shift @$right ), [$left||(), map { @$_ } @$right] ];
+ if (ref $right and @$right and $op eq $right->[0]) {
+ $left = [ (shift @$right ), [$left||[], map { @$_ } @$right] ];
}
else {
- $left = [$op => [ $left||(), $right||() ]];
+ $left = [$op => [ $left||[], $right ]];
}
}
# binary operator keywords
'SELECT * FROM foo WHERE a IN (3,2,1)',
]
},
+
+ # list consistency
+ {
+ equal => 0,
+ statements => [
+ 'SELECT a,b FROM foo',
+ 'SELECT a,,b FROM foo',
+ 'SELECT a,b, FROM foo',
+ 'SELECT ,a,b, FROM foo',
+ 'SELECT ,a,,b, FROM foo',
+ ],
+ },
+
+ # misc func
{
equal => 0,
statements => [
'SELECT count(1) FROM foo',
]
},
- # misc func
{
equal => 1,
statements => [