[Bast-commits] r5825 - SQL-Abstract/1.x/trunk/lib/SQL
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Sat Mar 28 02:00:46 GMT 2009
Author: ribasushi
Date: 2009-03-28 02:00:46 +0000 (Sat, 28 Mar 2009)
New Revision: 5825
Modified:
SQL-Abstract/1.x/trunk/lib/SQL/Abstract.pm
Log:
Warn about deprecation of and/or/nestX
Modified: SQL-Abstract/1.x/trunk/lib/SQL/Abstract.pm
===================================================================
--- SQL-Abstract/1.x/trunk/lib/SQL/Abstract.pm 2009-03-28 01:16:01 UTC (rev 5824)
+++ SQL-Abstract/1.x/trunk/lib/SQL/Abstract.pm 2009-03-28 02:00:46 UTC (rev 5825)
@@ -442,11 +442,17 @@
sub _where_op_in_hash {
- my ($self, $op, $v) = @_;
+ my ($self, $op_str, $v) = @_;
- $op =~ /^(AND|OR|NEST)[_\d]*/i
- or puke "unknown operator: -$op";
- $op = uc($1); # uppercase, remove trailing digits
+ $op_str =~ /^ (AND|OR|NEST) ( \_? \d* ) $/xi
+ or puke "unknown operator: -$op_str";
+
+ my $op = uc($1); # uppercase, remove trailing digits
+ if ($2) {
+ belch 'Use of [and|or|nest]_N modifiers is deprecated and will be removed in SQLA v2.0. '
+ . "You probably wanted ...-and => [ $op_str => COND1, $op_str => COND2 ... ]";
+ }
+
$self->_debug("OP(-$op) within hashref, recursing...");
$self->_SWITCH_refkind($v, {
More information about the Bast-commits
mailing list