Koha/t/db_dependent
Galen Charlton dd36a1ffa1 Bug 11137: fix certain types of searches run using QueryParser
QueryParser was loading redundant search aliases, which in turn resulted
in certain queries involving two or more clauses joined by a Boolean
operator getting parsed in correctly.

To test:

[1] Enable QueryParser.
[2] Arrange your database so that some some bib records contain
    the keyword 'history' while a smaller subset contain
    both 'history' and 'earth'.  (The exact words used don't
    matter.)
[3] Run the following search from the OPAC global search bar:

    kw:history && kw:earth

[4] Observe that the records that are returned include *all* bibs
    in the database with the keyword 'history'.  In other words, the
    restriction  that the records must also contain 'earth' is not
    observed.
[5] Apply the patch and rerun the search.
[6] This time, the results that are returned should include only those
    that contain both 'history' and 'earth'.
[7] Verify that prove -v t/QueryParser.t passes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes test plans, all tests and QA script.
Also checked the db_dependent/Search.t tests.
Tried some other searches, all seems to be working correctly.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
I reproduce the bug and I confirm this patch fixes it.
Without the patch, kw:history && kw:earth, I got:
  Search biblios OK 4 1 1+0 RPN @attrset Bib-1 @attr 4=6 @attr 1=1016 history
With the path, I get:
   Search biblios OK 2 1 1+0 RPN @attrset Bib-1 @and @attr 4=6 @attr 1=1016 history @attr 4=6 @attr 1=1016 earth

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-11-14 15:50:50 +00:00
..
Acquisition Bug 7688: (follow-up) update test cases to reflect change in NewSubscription() 2013-10-30 02:27:20 +00:00
Circulation Bug 10599: (follow-up) fix incomplete test case 2013-09-18 16:56:23 +00:00
data Bug 7421: add regression tests for UNIMARC authorities DOM indexing 2013-10-10 21:02:04 +00:00
Labels Bug 10333: Labels/t_Batch.t needs to create its own data 2013-09-08 02:07:19 +00:00
LDAP
Members Bug 10481: Unit tests for C4::Members::AddEnrolmentFeeIfNeeded 2013-08-16 15:08:41 +00:00
Record
Reports
Serials Bug 7688: (follow-up) rewrite 'for' loop in unit tests 2013-10-30 00:38:52 +00:00
www
00-strict.t
Accounts.t
Acquisition.t Bug 10403: (follow-up) fix test to use vendor created earlier during test 2013-11-01 02:31:22 +00:00
Amazon.t
Auth.t Bug 9611: (follow-up) move new password hashing routines to separate module 2013-10-09 03:29:22 +00:00
Auth_ParseSearchHistoryCookie.t move Auth_ParseSearchHistoryCookie.t to db_dependent directory 2013-07-28 19:42:51 +00:00
Auth_with_cas.t
AuthoritiesMarc.t
BackgroundJob.t Bug 10601: (follow-up) unit tests for new ->set() and ->get() 2013-09-18 17:21:47 +00:00
Barcodes.t
Biblio.t
Bookseller.t Bug 7688: (follow-up) update test cases to reflect change in NewSubscription() 2013-10-30 02:27:20 +00:00
Borrower_Debarments.t Bug 2720: (follow-up) improve unit tests 2013-10-31 01:55:04 +00:00
Branch.t Bug 10508: (follow-up) remove Perl 5.14 construct 2013-08-28 14:24:34 +00:00
Budgets.t Bug 8037: (follow-up) improve GetBudgetByOrderNumber test 2013-10-31 14:57:18 +00:00
check_sysprefs.t
Circulation.t Bug 7639: (follow-up) add Unit Tests 2013-09-17 15:22:07 +00:00
Circulation_Branch.t Bug 10683: (follow-up) improvements to the unit tests 2013-10-09 03:51:55 +00:00
Circulation_issue.t Bug 10493: (follow-up) fix test errors 2013-10-23 04:25:34 +00:00
Circulation_Issuingrule.t Bug 10767: (follow-up) remove FIXME comments 2013-08-28 14:44:01 +00:00
Circulation_issuingrules.t Bug 10298: Followup: Adapt existing code 2013-08-09 16:35:43 +00:00
Circulation_OfflineOperation.t Bug 10710: (follow-up) perltidy new code 2013-08-28 14:52:43 +00:00
Circulation_transfers.t Bug 10698: (follow-up) remove now-superfluous FIXME comment 2013-10-09 03:48:02 +00:00
ClassSource.t Bug 10644: (follow-up) remove inadvertant dependence on Perl 5.14 2013-08-09 18:53:20 +00:00
Context.t Bug 10927: remove disused C4::Utils module 2013-10-03 14:53:02 +00:00
CourseReserves.t Bug 10332: further improvements to course reserves tests 2013-06-18 16:40:43 -07:00
Csv.t Bug 10853: (follow-up) expand unit tests for C4::Csv 2013-10-11 03:25:42 +00:00
External_BakerTaylor.t
Heading_MARC21.t
Holds.t bug 2394: regression test for canreservefromotherbranches 2013-08-09 17:44:17 +00:00
HoldsQueue.t Bug 10243: (follow-up) add unit tests 2013-10-30 03:13:23 +00:00
Holidays.t
ILSDI_Services.t Bug 10667: (follow-up) fix reference to UT library in test case 2013-09-16 19:22:22 +00:00
Items.t Bug 10872: UT for GetHiddenItemnumbers and POD fix 2013-09-18 15:55:46 +00:00
KitchenSinkPlugin.kpz
Koha.t Bug 10078: (follow-up) add regression test 2013-10-30 05:02:45 +00:00
Koha_Authority.t Bug 5202: merge authorities from the authority file and reservoir 2013-10-10 21:32:27 +00:00
Koha_borrower_modifications.t
Koha_Database.t Bug 8798: moving code to Koha::Database and adding tests 2013-10-14 21:08:02 +00:00
Koha_template_plugin_KohaBranchName.t Bug 10494: test cases for the KohaBranchName plugin 2013-06-30 18:44:57 -07:00
Koha_template_plugin_KohaDates.t
Linker_FirstMatch.t
Log.t
MarcModificationTemplates.t Bug 8015: Add unit tests for SimpleMARC and MarcModificationTemplates routines 2013-10-31 22:50:11 +00:00
Members.t
Members_columns.t Bug 7785: (follow-up) standardize POD 2013-08-13 16:15:30 +00:00
PatronLists.t Bug 10565: (follow-up) don't assume borrowernumber 1 exists in unit test 2013-10-14 21:30:34 +00:00
Plugins.t
Ratings.t
Record.t bug 6201: (follow-up) update unit tests 2013-10-09 05:26:27 +00:00
RecordProcessor_EmbedSeeFromHeadings.t
Reports.t
Reports_Guided.t Bug 10761: (follow-up) remove inadvertant dependence on Perl 5.14 2013-08-21 16:29:18 +00:00
ReportsGuided.t
Reserves.t Bug 10949: restore ability to successfully print hold slips 2013-10-02 14:38:30 +00:00
rollingloans.t
RotatingCollections.t Bug 10653: (follow-up) minor tweaks to RotatingCollections tests 2013-08-16 16:09:13 +00:00
Search.t Bug 11137: fix certain types of searches run using QueryParser 2013-11-14 15:50:50 +00:00
Search_SearchHistory.t Bug 10361: (follow-up) add tests for search history functions 2013-09-04 14:22:50 +00:00
Serials.t Bug 7688: (follow-up) have Serials.t create its test subscription 2013-10-31 05:07:44 +00:00
Serials_2.t Bug 8435: (follow-up) handle lack of userenv gracefully 2013-10-31 15:29:42 +00:00
Service.t
ShelfBrowser.t Bug 10856: Improve the previous and next items on the shelf browser 2013-10-04 15:56:35 +00:00
SIP_ILS.t
SQLHelper.t
SuggestionEngine_ExplodedTerms.t
Suggestions.t
sysprefs.t Bug 10325: (follow-up) add test for overriding system preferences 2013-09-08 02:28:45 +00:00
Tags.t
UploadedFile.t
VirtualShelves.t Bug 10499: VirtualShelves.t - wrap tests in a database transaction 2013-07-16 14:17:27 +00:00
VirtualShelves_Page.t
XISBN.t Bug 10539: Followup for removing KohaTest unit tests 2013-09-05 15:06:05 +00:00
zebra_config.pl Bug 11137: regression tests for QP search field alias bug 2013-11-14 15:50:16 +00:00