diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 63db87fb5..53d46bf2f 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -24,6 +24,7 @@ - Fixed a bunch of POD errors. - Fixed some errors in the search engine indexer related to the new GUID system. + - Added extra debug to SQL errors on fatality. 6.2.1 diff --git a/lib/WebGUI/SQL.pm b/lib/WebGUI/SQL.pm index 549802bf7..64fa55e14 100644 --- a/lib/WebGUI/SQL.pm +++ b/lib/WebGUI/SQL.pm @@ -306,7 +306,8 @@ A list of values to be used in the placeholders defined in the prepared statemen sub execute { my $self = shift; - $self->{_sth}->execute(@_) or WebGUI::ErrorHandler::fatalError("Couldn't execute prepared statement: ". DBI->errstr); + my $sql = shift; + $self->{_sth}->execute or WebGUI::ErrorHandler::fatalError("Couldn't execute prepared statement: $sql Root cause: ". DBI->errstr); } @@ -734,7 +735,7 @@ sub read { my $sql = shift; my $dbh = shift; my $sth = WebGUI::SQL->prepare($sql, $dbh); - $sth->execute; + $sth->execute($sql); return $sth; }