From: Matt S Trout Date: Tue, 11 Sep 2018 22:24:13 +0000 (+0000) Subject: ensure ident no longer uses the old code X-Git-Tag: v2.000000~3^2~486 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e339494aa075ff7326925ad2ab820845fc8ccf8a;p=dbsrgits%2FSQL-Abstract.git ensure ident no longer uses the old code --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index dfdfb24..ce48f4a 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -39,7 +39,7 @@ our $AUTOLOAD; my @BUILTIN_SPECIAL_OPS = ( {regex => qr/^ (?: not \s )? between $/ix, handler => sub { die "NOPE" }}, {regex => qr/^ (?: not \s )? in $/ix, handler => sub { die "NOPE" }}, - {regex => qr/^ ident $/ix, handler => '_where_op_IDENT'}, + {regex => qr/^ ident $/ix, handler => sub { die "NOPE" }}, {regex => qr/^ value $/ix, handler => '_where_op_VALUE'}, {regex => qr/^ is (?: \s+ not )? $/ix, handler => '_where_field_IS'}, ); @@ -691,6 +691,16 @@ sub _expand_expr_hashpair { \@rhs ] }; } + if ($vk eq 'ident') { + if (! defined $vv or ref $vv) { + puke "-$vk requires a single plain scalar argument (a quotable identifier)"; + } + return +{ -op => [ + $self->{cmp}, + { -ident => $k }, + { -ident => $vv } + ] }; + } } if (ref($v) eq 'ARRAY') { return $self->{sqlfalse} unless @$v;