postgresql/src
Tom Lane 3dfb1942d9 Avoid premature de-doubling of quote marks in ECPG strings.
If you write the literal 'abc''def' in an EXEC SQL command, that will
come out the other end as 'abc'def', triggering a syntax error in the
backend.  Likewise, "abc""def" is reduced to "abc"def" which is wrong
syntax for a quoted identifier.

The cause is that the lexer thinks it should emit just one quote
mark, whereas what it really should do is keep the string as-is.

Add some docs and test cases, too.

Although this seems clearly a bug, I fear users wouldn't appreciate
changing it in minor releases.  Some may well be working around it
by applying an extra doubling of affected quotes, as for example
sql/dyntest.pgc has been doing.

Per investigation of a report from 1250kv, although this isn't
exactly what he/she was on about.

Discussion: https://postgr.es/m/673825.1603223178@sss.pgh.pa.us
2020-10-22 18:29:46 -04:00
..
backend Extend amcheck to check heap pages. 2020-10-22 08:44:18 -04:00
bin Clean up some unpleasant behaviors in psql's \connect command. 2020-10-22 14:04:28 -04:00
common Fix -Wcast-function-type warnings on Windows/MinGW 2020-10-21 08:17:51 +02:00
fe_utils Standardize the printf format for st_size 2020-09-24 21:04:21 +02:00
include Extend amcheck to check heap pages. 2020-10-22 08:44:18 -04:00
interfaces Avoid premature de-doubling of quote marks in ECPG strings. 2020-10-22 18:29:46 -04:00
makefiles Remove libpq.rc, use win32ver.rc for libpq 2020-01-15 15:06:12 +01:00
pl Fixup some appendStringInfo and appendPQExpBuffer calls 2020-10-15 20:35:17 +13:00
port Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
template Fix compiler warning for ppoll() on Cygwin 2019-12-22 23:20:00 +01:00
test Use croak instead of die in Perl code when appropriate 2020-10-22 13:41:28 +02:00
timezone Update time zone data files to tzdata release 2020c. 2020-10-16 21:53:33 -04:00
tools Extend amcheck to check heap pages. 2020-10-22 08:44:18 -04:00
tutorial Remove support for postfix (right-unary) operators. 2020-09-17 19:38:05 -04:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Split Makefile symbol CFLAGS_VECTOR into two symbols. 2020-09-06 21:28:16 -04:00
Makefile.shlib Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:04:20 +02:00