Skip to content

Commit

Permalink
show the rejected value
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 27, 2018
1 parent 6441450 commit 702d049
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/SQL/Abstract/Pg.pm
Expand Up @@ -87,7 +87,7 @@ sub _pg_parse {
$self->_SWITCH_refkind(
$for => {
SCALAR => sub {
SQL::Abstract::puke('only the SCALAR value "update" is allowed')
SQL::Abstract::puke(qq{SCALAR value "$for" not allowed})
unless $for eq 'update';
$for_sql = $self->_sqlcase('UPDATE');
},
Expand Down
2 changes: 1 addition & 1 deletion t/sql.t
Expand Up @@ -80,7 +80,7 @@ is_deeply \@sql, ['SELECT * FROM "foo" FOR update skip locked'], 'right query';

# FOR (unsupported value)
eval { $abstract->select('foo', '*', undef, {for => 'update skip locked'}) };
like $@, qr/only the SCALAR value "update" is allowed/, 'right error';
like $@, qr/SCALAR value "update skip locked" not allowed/, 'right error';
eval { $abstract->select('foo', '*', undef, {for => []}) };
like $@, qr/ARRAYREF/, 'right error';

Expand Down

0 comments on commit 702d049

Please sign in to comment.