Skip to content
Snippets Groups Projects
Commit 7f5f2900 authored by Dan Staines's avatar Dan Staines
Browse files

eval SQL statement to catch and report failures to aid debugging

parent ffdf6f03
No related branches found
No related tags found
2 merge requests!15eval SQL statement to catch and report failures to aid debugging,!15eval SQL statement to catch and report failures to aid debugging
......@@ -465,7 +465,12 @@ sub load_sql {
my @statements = split( /;/, $sql_com );
$db->do("set foreign_key_checks = 0") if $self->db_conf->{driver} =~ /mysql/;
foreach my $sql (@statements) {
$db->do($sql);
eval {
$db->do($sql);
};
if($@) {
throw "Could not execute SQL: $sql\n";
}
}
$db->do("set foreign_key_checks = 1") if $self->db_conf->{driver} =~ /mysql/;
......
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