[Bast-commits] r5709 - SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Sun Mar 8 22:31:51 GMT 2009


Author: ribasushi
Date: 2009-03-08 22:31:51 +0000 (Sun, 08 Mar 2009)
New Revision: 5709

Modified:
   SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract/Test.pm
Log:
Deal properly with () in is_same_sql_bind

Modified: SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract/Test.pm
===================================================================
--- SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract/Test.pm	2009-03-08 21:25:14 UTC (rev 5708)
+++ SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract/Test.pm	2009-03-08 22:31:51 UTC (rev 5709)
@@ -161,11 +161,15 @@
   my ($left, $right) = @_;
 
   # ignore top-level parentheses 
-  while ($left->[0]  eq 'PAREN') {$left  = $left->[1] }
-  while ($right->[0] eq 'PAREN') {$right = $right->[1]}
+  while ($left->[0] and $left->[0]  eq 'PAREN') {$left  = $left->[1] }
+  while ($right->[0] and $right->[0] eq 'PAREN') {$right = $right->[1]}
 
+  # if both are undef i.e. ()
+  if (not grep { defined $_ } ($left->[0], $right->[0]) ) {
+    return 1;
+  }
   # if operators are different
-  if ($left->[0] ne $right->[0]) { 
+  elsif ($left->[0] ne $right->[0]) { 
     $sql_differ = sprintf "OP [$left->[0]] != [$right->[0]] in\nleft: %s\nright: %s\n",
       unparse($left),
       unparse($right);




More information about the Bast-commits mailing list