diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index af8c2565..ee3ca2f1 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -330,10 +330,7 @@ sub _insert_value { push @all_bind, @bind; }, - # THINK: anything useful to do with a HASHREF ? - HASHREF => sub { # (nothing, but old SQLA passed it through) - #TODO in SQLA >= 2.0 it will die instead - belch "HASH ref as bind value in insert is not supported"; + HASHREF => sub { push @values, '?'; push @all_bind, $self->_bindtype($column, $v); }, diff --git a/t/01generate.t b/t/01generate.t index ebe3aad9..6c07b04d 100644 --- a/t/01generate.t +++ b/t/01generate.t @@ -317,13 +317,12 @@ my @tests = ( stmt_q => 'SELECT * FROM `test` WHERE ( `a` < to_date(?, \'MM/DD/YY\') AND `b` = ? )', bind => ['02/02/02', 8], }, - { #TODO in SQLA >= 2.0 it will die instead (we kept this just because old SQLA passed it through) + { func => 'insert', args => ['test', {a => 1, b => 2, c => 3, d => 4, e => { answer => 42 }}], stmt => 'INSERT INTO test (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)', stmt_q => 'INSERT INTO `test` (`a`, `b`, `c`, `d`, `e`) VALUES (?, ?, ?, ?, ?)', - bind => [qw/1 2 3 4/, { answer => 42}], - warns => qr/HASH ref as bind value in insert is not supported/i, + bind => [qw/1 2 3 4/, { answer => 42}] }, { func => 'update',