From: Matt S Trout Date: Mon, 1 Apr 2019 04:07:47 +0000 (+0000) Subject: stop treating old special ops normally X-Git-Tag: v2.000000~3^2~295 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=629e3a1aa827ec93babff15024ae73fefe463155;p=dbsrgits%2FSQL-Abstract.git stop treating old special ops normally --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index cce1eb8..acadcaf 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -168,9 +168,6 @@ sub new { # special operators $opt{special_ops} ||= []; - # regexes are applied in order, thus push after user-defines - push @{$opt{special_ops}}, @BUILTIN_SPECIAL_OPS; - if ($class->isa('DBIx::Class::SQLMaker')) { $opt{warn_once_on_nest} = 1; $opt{disable_old_special_ops} = 1; @@ -734,8 +731,13 @@ sub _expand_expr_hashpair_op { if ( (our $Expand_Depth) == 1 - and $self->{disable_old_special_ops} - and List::Util::first { $op =~ $_->{regex} } @{$self->{special_ops}} + and ( + List::Util::first { $op =~ $_->{regex} } @{$self->{special_ops}} + or ( + $self->{disable_old_special_ops} + and List::Util::first { $op =~ $_->{regex} } @BUILTIN_SPECIAL_OPS + ) + ) ) { puke "Illegal use of top-level '-$op'" }