To test:
[1] Run prove -v t/db_dependent/Reports_Guided.t. Last test should
fail.
[2] Apply the main patch.
[3] Run step 1 again. This time, all tests should pass.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
use Modern::Perl;
-use Test::More tests => 14;
+use Test::More tests => 15;
use C4::Context;
'running a query with a parameter returned the expected result'
);
+# for next test, we want to let execute_query capture any SQL errors
+$dbh->{RaiseError} = 0;
+my $errors;
+($sth, $errors) = execute_query(
+ 'SELECT surname FRM borrowers', # error in the query is intentional
+ 0,
+ 10,
+);
+ok(
+ defined($errors) && exists($errors->{queryerr}),
+ 'attempting to run a report with an SQL syntax error returns error message (Bug 12214)'
+);
+
#End transaction
$dbh->rollback;