From 18405a45959bd5aa74caaf3c0fdb0d92a153bd42 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 18 Apr 2014 22:33:11 +0000 Subject: [PATCH] Bug 9578: add regression test This patch adds a regression test for the condition noted in bug 9578, where attempting a sort of a Zebra search that fails because of an invalid query crashes. Signed-off-by: Galen Charlton (cherry picked from commit 70499239ba1780e872499d93fa624574d13fe7ff) Signed-off-by: Fridolin Somers Conflicts: t/db_dependent/Search.t --- t/db_dependent/Search.t | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t index 1233c97dd2..78e75d7aca 100644 --- a/t/db_dependent/Search.t +++ b/t/db_dependent/Search.t @@ -12,7 +12,7 @@ use YAML; use C4::Debug; require C4::Context; -use Test::More tests => 224; +use Test::More tests => 226; use Test::MockModule; use MARC::Record; use File::Spec; @@ -776,6 +776,12 @@ sub run_marc21_search_tests { is($count, 1, 'MARC21 authorities: one hit on match contains "沙士北亞威廉姆" (QP)'); + # verify that we don't attempt to sort if no results were returned + # because of a query error + warning_like {( undef, $results_hashref, $facets_loop ) = + getRecords('ccl=( AND )', '', ['title_az'], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef) + } qr/WARNING: query problem with/, 'got warning instead of crash when attempting to run invalid query (bug 9578)'; + cleanup(); } -- 2.39.5