- New attribute 'escape_char' allowing for proper escape of quote_chars
present in an identifier
- Treat { -value => undef } as plain undef in all cases
+ - Explicitly throw on { -ident => undef }
revision 1.78 2014-05-28
----------------------------
sub _where_op_IDENT {
my $self = shift;
my ($op, $rhs) = splice @_, -2;
- if (ref $rhs) {
- puke "-$op takes a single scalar argument (a quotable identifier)";
+ if (! defined $rhs or length ref $rhs) {
+ puke "-$op requires a single plain scalar argument (a quotable identifier)";
}
# in case we are called as a top level special op (no '=')
use warnings;
use Test::More;
+use Test::Exception;
use SQL::Abstract;
use SQL::Abstract::Test import => [qw/is_same_sql_bind/];
name_sep => $q ? '.' : '',
);
+ throws_ok {
+ $sql_maker->where({ foo => { -ident => undef } })
+ } qr/-ident requires a single plain scalar argument/;
+
my ($sql, @bind) = $sql_maker->select ('artist', '*', { 'artist.name' => { -ident => 'artist.pseudonym' } } );
is_same_sql_bind (
$sql,