LP#1463973: Use dollar-quoting for report literals
authorMike Rylander <mrylander@gmail.com>
Wed, 10 Jun 2015 18:17:37 +0000 (14:17 -0400)
committerBen Shum <bshum@biblio.org>
Thu, 11 Jun 2015 01:41:20 +0000 (21:41 -0400)
commit96149ee662f32b8a3fa2aa04fef44182d4029f10
treeead843802bd1d4d9a0ee463583f585d48fbe76f9
parent21c6ecd083590efd75e11d99d7118517c43da43d
LP#1463973: Use dollar-quoting for report literals

When inserting string literal into SQL for Clark, we quote
apostrophes with a backslash.  That worked fine until Postgres
changed its default for the standard_conforming_strings GUC to "on"
after which it no longer worked fine.

So, we will now use "dollar quoting" for string literals instead
in much the same way we do for our search queries.

Test plan
---------

Pre-patch: Try to run a report where a string value is required as
a filter parameter, and include an apostrophe in that string.  The
report will fail with an SQL error.

Post-patch: Do the same, it will not fail.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Angela Kilsdonk <akilsdonk@esilibrary.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/perlmods/lib/OpenILS/Reporter/SQLBuilder.pm