From 7f5f2900b28f6235479e5621eb9aab9cb6792d8c Mon Sep 17 00:00:00 2001 From: Dan Staines <dstaines@ebi.ac.uk> Date: Wed, 5 Jul 2017 11:36:20 +0100 Subject: [PATCH] eval SQL statement to catch and report failures to aid debugging --- modules/Bio/EnsEMBL/Test/MultiTestDB.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/Bio/EnsEMBL/Test/MultiTestDB.pm b/modules/Bio/EnsEMBL/Test/MultiTestDB.pm index da171eb..8be57d6 100644 --- a/modules/Bio/EnsEMBL/Test/MultiTestDB.pm +++ b/modules/Bio/EnsEMBL/Test/MultiTestDB.pm @@ -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/; -- GitLab