'SET'
);
- confess 'update: number of columns doesn\'t match values: ' . dump($ast)
+ confess 'update: Number of values does not match columns: ' . dump($ast)
if @{$ast->{columns}} != @{$ast->{values}};
- $DB::single = 1;
my $list = {
-type => 'list',
args => [ map {
method update(Str|ArrayRef|ScalarRef $from,
HashRef $fields, WhereType $where? )
{
- my $ast = $self->update_aste($from,$fields,$where);
+ my $ast = $self->update_ast($from,$fields,$where);
return ($self->visitor->dispatch($ast), @{$self->visitor->binds});
}
use strict;
use warnings;
-use Test::More tests => 6;
+use Test::More tests => 7;
use Test::Exception;
use FindBin;
]
}
)
-} qr/^'values' is required in update AST/, "Invalid clause in update"
+} qr/^'values' is required in update AST/, "Invalid clause in update";
+
+
+throws_ok { $sqla->dispatch(
+ { -type => 'update',
+ tablespec => mk_name('test'),
+ columns => [
+ mk_name(qw/me id/),
+ mk_name(qw/hostname/),
+ ],
+ values => [
+ mk_value('localhost'),
+ ]
+ } )
+} qr/Number of values does not match columns/,
+ "Column/values count mismatch in update";