From: Dagfinn Ilmari Mannsåker Date: Tue, 9 Nov 2010 11:40:31 +0000 (+0000) Subject: Fix parsing of foo.* in SQLA::Tree X-Git-Tag: v1.72~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=257ecc8a4f33c53c658100982c39f27c736e4423;p=dbsrgits%2FSQL-Abstract.git Fix parsing of foo.* in SQLA::Tree --- diff --git a/Changes b/Changes index 89d3b94..2d02973 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ Revision history for SQL::Abstract + - Fix parsing of foo.* in SQLA::Tree + revision 1.71 2010-11-09 ---------------------------- - Add EXECUTING for clarity of long running SQL diff --git a/lib/SQL/Abstract/Tree.pm b/lib/SQL/Abstract/Tree.pm index b9815dc..9536ce9 100644 --- a/lib/SQL/Abstract/Tree.pm +++ b/lib/SQL/Abstract/Tree.pm @@ -122,8 +122,8 @@ sub _binary_op_re { $binary_op_re } my $all_known_re = join("\n\t|\n", $expr_start_re, $binary_op_re, - "$op_look_behind (?i: AND|OR|NOT ) $op_look_ahead", - (map { quotemeta $_ } qw/, ( ) */), + "$op_look_behind (?i: AND|OR|NOT|\\* ) $op_look_ahead", + (map { quotemeta $_ } qw/, ( )/), $placeholder_re, ); diff --git a/t/11unparse.t b/t/11unparse.t index e61416b..f45b5e4 100644 --- a/t/11unparse.t +++ b/t/11unparse.t @@ -7,7 +7,7 @@ use SQL::Abstract::Tree; my $sqlat = SQL::Abstract::Tree->new; -cmp_deeply($sqlat->parse("SELECT a, b, c FROM foo WHERE foo.a =1 and foo.b LIKE 'station'"), [ +cmp_deeply($sqlat->parse("SELECT a, b.*, * FROM foo WHERE foo.a =1 and foo.b LIKE 'station'"), [ [ [ "SELECT", @@ -24,13 +24,13 @@ cmp_deeply($sqlat->parse("SELECT a, b, c FROM foo WHERE foo.a =1 and foo.b LIKE [ "LITERAL", [ - "b" + "b.*" ] ], [ "LITERAL", [ - "c" + "*" ] ] ]