Koha/t
Robin Sheat 2341bd876a Bug 8594 - prevent the report system from breaking some subqueries
If you had a report query that had a subquery in the fields list, and
that subquery had a LIMIT specifier, then it would be removed which
could break your query. This patch prevents this case from breaking by
ensuring that only a LIMIT that follows the last WHERE in the query is
removed.

If you don't have a WHERE, then it will behave like it always
did, removing all the cases of LIMIT (which would still break a subquery
but this is a) more rare, and b) would require more intelligent parsing
to deal with.

Also adds test cases and function documentation.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>

Tested with this report:

select biblionumber, (select itemnumber from items where items.biblionumber=biblio.biblionumber LIMIT 1) from biblio where biblionumber<1000;

and it worked like a charm

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-05 10:12:06 +02:00
..
Budgets Bug 7304: More permissions for budgets 2012-06-27 16:25:44 +02:00
data/db_schemas
db_dependent Bug 8594 - prevent the report system from breaking some subqueries 2012-09-05 10:12:06 +02:00
lib Bug 8233 : SearchEngine: Add a Koha::SearchEngine module 2012-07-06 16:51:58 +02:00
searchengine Bug 8233 : SearchEngine: Add a Koha::SearchEngine module 2012-07-06 16:51:58 +02:00
00-checkdatabase-version.t Test to check for XXX in kohaversion.pl or updatedatabase.pl 2011-12-27 17:56:03 +01:00
00-deprecated.t
00-load.t Bug 8233: We can't load test on Koha::SearchEngine::* 2012-08-01 13:52:36 +02:00
00-merge-conflict-markers.t Test suite: ignoring backups from vi (files ending with a ~) 2011-12-07 15:17:54 +01:00
00-testcritic.t Bug 8216: Allow SIP modules to pass critic tests 2012-06-20 11:14:00 +02:00
00-valid-xml.t
AuthoritiesMarc.t
AuthoritiesMarc_MARC21.t Bug 5327 added unit tests for C4/AuthoritiesMarc/MARC21.pm 2012-01-31 17:21:47 +01:00
AuthoritiesMarc_UNIMARC.t Added unit test for AuthoritiesMarc/UNIMARC.pm 2011-12-15 13:41:41 +01:00
Barcodes_annual.t
Barcodes_EAN13.t Bug 6448 [2/3] Barcodes::EAN13 autoBarcode 2012-08-02 18:41:44 +02:00
Barcodes_hbyymmincr.t
Barcodes_incremental.t
Barcodes_PrinterConfig.t Bug 5327 added unit tests for C4/Barcodes_PrinterConfig.pm 2012-01-31 17:21:48 +01:00
Barcodes_ValueBuilder.t Bug 8524 follow-up: fix broken test 2012-08-31 17:42:44 +02:00
Bookseller.t
Boolean.t Added missing reference case to Boolean.t and corrected count 2011-12-15 13:50:41 +01:00
Branch.t
Breeding.t
Budgets.t
Cache.t Bug 8092: Convert Koha::Cache to use CHI 2012-06-09 13:08:13 +02:00
Cache_Memcached.t Bug 7248 Added caching support and and moved Caching into Koha namespace 2012-05-15 18:05:55 +02:00
Calendar.t Bug 8486 - Follow up making the tests db independent 2012-08-01 12:36:56 +02:00
Category.t
Charset.t
Circulation_barcodedecode.t Bug 6448 [1/3] EAN-13/UPC-A itemBarcodeInputFilter 2012-08-02 18:41:40 +02:00
ClassSortRoutine.t
ClassSortRoutine_Dewey.t Bug 5327 Added unit tests for C4/ClassSortRoutine/Dewey.pm 2012-01-17 15:31:55 +01:00
ClassSortRoutine_Generic.t Bug 5327 added unit tests for C4/ClassSortRoutine/Generic 2012-01-17 15:31:55 +01:00
ClassSortRoutine_LCC.t Bug 5327 added unit tests for C4/ClassSortRoutine/LCC 2012-01-31 17:21:48 +01:00
ClassSource.t
Contract.t
Creators.t Bug 7952 - followup to fix t/Creators.t 2012-06-14 15:54:06 +02:00
Dates.t
DateUtils.t Bug 5549 : Format due dates in opac 2012-03-20 13:24:51 +13:00
Debug.t
dummy.t
External_Syndetics.t
Form_MessagingPreferences.t
Heading.t
ILSDI_Services.t
ILSDI_Utility.t
ImportBatch.t
Input.t
Installer_PerlDependencies.t
Installer_PerlModules.t
Installer_pm.t
ItemCirculationAlertPreference.t
ItemType.t
Koha.t
Labels.t Bug 5327 added tests for C4/Labels.pm 2012-01-31 17:21:47 +01:00
Labels_split_ccn.t
Labels_split_ddcn.t
Labels_split_lccn.t
Languages.t Bug 5327 added tests for C4/Languages.pm 2012-01-31 17:21:51 +01:00
Letters.t
Log.t
Maintainance.t
Makefile
Matcher.t
Members_Attributes.t
Members_AttributeTypes.t
Members_Messaging.t
Message.t
NewsChannels.t
Output.t
Output_JSONStream.t Bug 5327 fixing missing number of tests 2011-01-21 11:28:58 +13:00
Overdues.t
Patroncards.t
Patroncards_Batch.t
Patroncards_Layout.t
Patroncards_Lib.t
Patroncards_Patroncard.t
Patroncards_Profile.t
Patroncards_Template.t
perlcriticrc Updating perlcriticrc to allow Modern::Perl to suffice instead of use warnings; and use strict; 2012-01-27 11:33:15 +01:00
Print.t
Review.t
rewrite-config-test.PL
Ris.t bug 5327 added unit tests for C4/Ris.pm 2012-01-31 17:21:49 +01:00
RotatingCollections.t
Scheduler.t Bug 5327 added unit tests for C4/Scheduler.pm 2012-01-31 17:21:49 +01:00
Scrubber.t Added unit tests for Scrubber 2011-12-15 13:41:43 +01:00
Search_PazPar2.t Bug 5327 added unit tests for C4/Search_PazPar2.pm 2012-01-31 17:21:50 +01:00
SIP_Sip.t Added unit tests for Sip Checksum.pm 2011-12-15 13:41:37 +01:00
smolder_smoke_signal
SMS.t
Stats.t
TmplToken.t Bug 5327 added unit tests for C4/TmplToken.pm 2012-01-31 17:21:50 +01:00
Utils.t
VirtualShelves_Merge.t
XSLT.t
Z3950.t