Bug 11422 - LIMIT $offset, $limit not compatible with PostgreSQL
Summary: LIMIT $offset, $limit not compatible with PostgreSQL
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Galen Charlton
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 7365
  Show dependency treegraph
 
Reported: 2013-12-19 00:24 UTC by Galen Charlton
Modified: 2016-04-16 02:16 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Galen Charlton 2013-12-19 00:24:47 UTC
There are some queries that use "LIMIT $offset, $limit" which PostgreSQL will not accept.  However, PostgreSQL *does* accept "LIMIT $limit OFFSET $offset".  Since MySQL accepts that construct as well, we should use it.

A partial list of code using LIMIT x,y is:


offline_circ/download.pl
reports/borrowers_out.pl
reports/catalogue_out.pl
t/db_dependent/Labels/t_Batch.t
t/db_dependent/Reports/Guided.t
misc/migration_tools/rebuild_zebra.pl
C4/VirtualShelves.pm
C4/Utils/DataTables.pm
C4/Reports/Guided.pm
C4/Review.pm
C4/Serials.pm
C4/NewsChannel.pm (in a comment only)
C4/Koha.pm
C4/Items.pm
C4/Acquisition.pm

Note that because of a quirk in DBI, the technique described at http://www.perlmonks.org/?node_id=837422 needs to be used when using a placeholder for the OFFSET value.
Comment 1 Galen Charlton 2013-12-19 00:26:20 UTC
Also affected is C4/SQLHelper.pm.