Subject: | problem with multiple nested parens |
Using ths sql statement:
SELECT a FROM ztable A , ztable M WHERE A.col1 = ? AND ( M.col = A.col OR ( M.col is NULL AND M.col = A.col ) )
I get this error:
SQL ERROR: Bad predicate: '^1^'!
The fix for this is in: sub non_parens_search
this line:
$str =~ s/^\s*\^0\^\s*$/$predicates->[0]/;
should be
$str =~ s/^\s*\^(\d)\^\s*$/$predicates->[$1]/;