[Bast-commits] r5806 - SQL-Abstract/1.x/trunk/lib/SQL

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Tue Mar 24 07:13:34 GMT 2009


Author: ribasushi
Date: 2009-03-24 07:13:34 +0000 (Tue, 24 Mar 2009)
New Revision: 5806

Modified:
   SQL-Abstract/1.x/trunk/lib/SQL/Abstract.pm
Log:
Sanify patch by arcanez - we do not gobble any -X op, just -and/-or

Modified: SQL-Abstract/1.x/trunk/lib/SQL/Abstract.pm
===================================================================
--- SQL-Abstract/1.x/trunk/lib/SQL/Abstract.pm	2009-03-23 22:22:00 UTC (rev 5805)
+++ SQL-Abstract/1.x/trunk/lib/SQL/Abstract.pm	2009-03-24 07:13:34 UTC (rev 5806)
@@ -499,11 +499,17 @@
     $self->_debug("ARRAY($k) means distribute over elements");
 
     # put apart first element if it is an operator (-and, -or)
-    my $op = $v[0] =~ /^-/ ? shift @v : undef;
-    $self->_debug("OP($op) reinjected into the distributed array") if $op;
+    my $op = ($v[0] =~ /^ - (?: AND|OR ) $/ix
+      ? shift @v
+      : ''
+    );
+    my @distributed = map { {$k =>  $_} } @v;
 
-    my @distributed = map { {$k =>  $_} } @v;
-    unshift @distributed, $op if $op;
+    if ($op) {
+      $self->_debug("OP($op) reinjected into the distributed array");
+      unshift @distributed, $op;
+    }
+
     my $logic = $op ? substr($op, 1) : '';
 
     return $self->_recurse_where(\@distributed, $logic);




More information about the Bast-commits mailing list