pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix behavior of ecpg's "EXEC SQL elif name".
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix behavior of ecpg's "EXEC SQL elif name".
@ 2020-08-03 13:46 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2020-08-03 13:46 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix behavior of ecpg's "EXEC SQL elif name".

This ought to work much like C's "#elif defined(name)"; but the code
implemented it in a way equivalent to endif followed by ifdef, so that
it didn't matter whether any previous branch of the IF construct had
succeeded.  Fix that; add some test cases covering elif and nested IFs;
and improve the documentation, which also seemed a bit confused.

AFAICS the code has been like this since the feature was added in 1999
(commit b57b0e044).  So while it's surely wrong, there might be code
out there relying on the current behavior.  Hence, don't back-patch
into stable branches.  It seems all right to fix it in v13 though.

Per report from Ashutosh Sharma.  Reviewed by Ashutosh Sharma and
Michael Meskes.

Discussion: https://postgr.es/m/CAE9k0P=dQk9X0cU2tN49S7a9tv733-e1pVdpB1P-pWJ5PdTktg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5f28b21eb3c5c2fb72c24608bc686acd7c9b113c

Modified Files
--------------
doc/src/sgml/ecpg.sgml                             |  50 +++++---
src/interfaces/ecpg/preproc/pgc.l                  | 128 ++++++++++++++-------
src/interfaces/ecpg/test/expected/preproc-define.c |  79 ++++++++-----
.../ecpg/test/expected/preproc-define.stderr       |  48 ++++----
src/interfaces/ecpg/test/preproc/define.pgc        |  17 +++
5 files changed, 211 insertions(+), 111 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix behavior of ecpg's "EXEC SQL elif name".
@ 2020-08-03 13:46 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2020-08-03 13:46 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix behavior of ecpg's "EXEC SQL elif name".

This ought to work much like C's "#elif defined(name)"; but the code
implemented it in a way equivalent to endif followed by ifdef, so that
it didn't matter whether any previous branch of the IF construct had
succeeded.  Fix that; add some test cases covering elif and nested IFs;
and improve the documentation, which also seemed a bit confused.

AFAICS the code has been like this since the feature was added in 1999
(commit b57b0e044).  So while it's surely wrong, there might be code
out there relying on the current behavior.  Hence, don't back-patch
into stable branches.  It seems all right to fix it in v13 though.

Per report from Ashutosh Sharma.  Reviewed by Ashutosh Sharma and
Michael Meskes.

Discussion: https://postgr.es/m/CAE9k0P=dQk9X0cU2tN49S7a9tv733-e1pVdpB1P-pWJ5PdTktg@mail.gmail.com

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/44cd434ec4a70d2dfbc460492fc0574d08440250

Modified Files
--------------
doc/src/sgml/ecpg.sgml                             |  50 +++++---
src/interfaces/ecpg/preproc/pgc.l                  | 128 ++++++++++++++-------
src/interfaces/ecpg/test/expected/preproc-define.c |  79 ++++++++-----
.../ecpg/test/expected/preproc-define.stderr       |  48 ++++----
src/interfaces/ecpg/test/preproc/define.pgc        |  17 +++
5 files changed, 211 insertions(+), 111 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2020-08-03 13:46 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-08-03 13:46 pgsql: Fix behavior of ecpg's "EXEC SQL elif name". Tom Lane <tgl@sss.pgh.pa.us>
2020-08-03 13:46 pgsql: Fix behavior of ecpg's "EXEC SQL elif name". Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox