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-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f77784744959af688cba964a256eac87d6b9108f;p=scpubgit%2FQ-Branch.git ensure ident no longer uses the old code --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index f187516..0f412aa 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;