Commit ffb4b1f4 authored by Andy Yates's avatar Andy Yates
Browse files

Incorrect passing of the DBConnection object to the execute update closure...

Incorrect passing of the DBConnection object to the execute update closure which meant we attempted to call out to attributes which did not exist on that object.
parent 76e7faf6
...@@ -558,7 +558,7 @@ issued i.e. ...@@ -558,7 +558,7 @@ issued i.e.
$helper->execute_update( $helper->execute_update(
-SQL => 'insert into tab (name) values(?)', -SQL => 'insert into tab (name) values(?)',
-CALLBACK => sub { -CALLBACK => sub {
my ($sth, $dbc) = @_; my ($sth, $dbh) = @_;
$obj->{id} = $dbh->{mysql_insertid); $obj->{id} = $dbh->{mysql_insertid);
}, },
-PARAMS => [$obj->name()] -PARAMS => [$obj->name()]
...@@ -578,7 +578,7 @@ sub execute_update { ...@@ -578,7 +578,7 @@ sub execute_update {
$sth = $self->db_connection()->prepare($sql); $sth = $self->db_connection()->prepare($sql);
$self->_bind_params($sth, $params); $self->_bind_params($sth, $params);
$rv = $sth->execute(); $rv = $sth->execute();
$callback->($sth, $self->db_connection()) if $callback; $callback->($sth, $self->db_connection()->db_handle()) if $callback;
}; };
my $error = $@; my $error = $@;
$self->_finish_sth($sth); $self->_finish_sth($sth);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment