pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix parsetree representation of XMLTABLE(XMLNAMESPACES(DEFAULT .
3+ messages / 1 participants
[nested] [flat]

* pgsql: Fix parsetree representation of XMLTABLE(XMLNAMESPACES(DEFAULT .
@ 2018-09-17 17:16 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2018-09-17 17:16 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix parsetree representation of XMLTABLE(XMLNAMESPACES(DEFAULT ...)).

The original coding for XMLTABLE thought it could represent a default
namespace by a T_String Value node with a null string pointer.  That's
not okay, though; in particular outfuncs.c/readfuncs.c are not on board
with such a representation, meaning you'll get a null pointer crash
if you try to store a view or rule containing this construct.

To fix, change the parsetree representation so that we have a NULL
list element, instead of a bogus Value node.

This isn't really a functional limitation since default XML namespaces
aren't yet implemented in the executor; you'd just get "DEFAULT
namespace is not supported" anyway.  But crashes are not nice, so
back-patch to v10 where this syntax was added.  Ordinarily we'd consider
a parsetree representation change to be un-backpatchable; but since
existing releases would crash on the way to storing such constructs,
there can't be any existing views/rules to be incompatible with.

Per report from Andrey Lepikhov.

Discussion: https://postgr.es/m/3690074f-abd2-56a9-144a-aa5545d7a291@postgrespro.ru

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/07a3af0ff81d8ac6d2e787e13ca10de36313aa51

Modified Files
--------------
src/backend/executor/nodeTableFuncscan.c |  6 +++++-
src/backend/parser/parse_clause.c        | 15 ++++++++-------
src/backend/utils/adt/ruleutils.c        |  6 +++---
src/include/nodes/execnodes.h            |  4 ++--
src/include/nodes/primnodes.h            |  7 +++++--
5 files changed, 23 insertions(+), 15 deletions(-)



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

* pgsql: Fix parsetree representation of XMLTABLE(XMLNAMESPACES(DEFAULT .
@ 2018-09-17 17:16 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2018-09-17 17:16 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix parsetree representation of XMLTABLE(XMLNAMESPACES(DEFAULT ...)).

The original coding for XMLTABLE thought it could represent a default
namespace by a T_String Value node with a null string pointer.  That's
not okay, though; in particular outfuncs.c/readfuncs.c are not on board
with such a representation, meaning you'll get a null pointer crash
if you try to store a view or rule containing this construct.

To fix, change the parsetree representation so that we have a NULL
list element, instead of a bogus Value node.

This isn't really a functional limitation since default XML namespaces
aren't yet implemented in the executor; you'd just get "DEFAULT
namespace is not supported" anyway.  But crashes are not nice, so
back-patch to v10 where this syntax was added.  Ordinarily we'd consider
a parsetree representation change to be un-backpatchable; but since
existing releases would crash on the way to storing such constructs,
there can't be any existing views/rules to be incompatible with.

Per report from Andrey Lepikhov.

Discussion: https://postgr.es/m/3690074f-abd2-56a9-144a-aa5545d7a291@postgrespro.ru

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/486cfb3b8ce6e94eaad48038acff51064c070ccb

Modified Files
--------------
src/backend/executor/nodeTableFuncscan.c |  6 +++++-
src/backend/parser/parse_clause.c        | 15 ++++++++-------
src/backend/utils/adt/ruleutils.c        |  6 +++---
src/include/nodes/execnodes.h            |  4 ++--
src/include/nodes/primnodes.h            |  7 +++++--
5 files changed, 23 insertions(+), 15 deletions(-)



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

* pgsql: Fix parsetree representation of XMLTABLE(XMLNAMESPACES(DEFAULT .
@ 2018-09-17 17:16 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2018-09-17 17:16 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix parsetree representation of XMLTABLE(XMLNAMESPACES(DEFAULT ...)).

The original coding for XMLTABLE thought it could represent a default
namespace by a T_String Value node with a null string pointer.  That's
not okay, though; in particular outfuncs.c/readfuncs.c are not on board
with such a representation, meaning you'll get a null pointer crash
if you try to store a view or rule containing this construct.

To fix, change the parsetree representation so that we have a NULL
list element, instead of a bogus Value node.

This isn't really a functional limitation since default XML namespaces
aren't yet implemented in the executor; you'd just get "DEFAULT
namespace is not supported" anyway.  But crashes are not nice, so
back-patch to v10 where this syntax was added.  Ordinarily we'd consider
a parsetree representation change to be un-backpatchable; but since
existing releases would crash on the way to storing such constructs,
there can't be any existing views/rules to be incompatible with.

Per report from Andrey Lepikhov.

Discussion: https://postgr.es/m/3690074f-abd2-56a9-144a-aa5545d7a291@postgrespro.ru

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a552e3bc502ee679b0b8ff19e69b7b69890c0613

Modified Files
--------------
src/backend/executor/nodeTableFuncscan.c |  6 +++++-
src/backend/parser/parse_clause.c        | 15 ++++++++-------
src/backend/utils/adt/ruleutils.c        |  6 +++---
src/include/nodes/execnodes.h            |  4 ++--
src/include/nodes/primnodes.h            |  7 +++++--
5 files changed, 23 insertions(+), 15 deletions(-)



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


end of thread, other threads:[~2018-09-17 17:16 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-09-17 17:16 pgsql: Fix parsetree representation of XMLTABLE(XMLNAMESPACES(DEFAULT . Tom Lane <tgl@sss.pgh.pa.us>
2018-09-17 17:16 pgsql: Fix parsetree representation of XMLTABLE(XMLNAMESPACES(DEFAULT . Tom Lane <tgl@sss.pgh.pa.us>
2018-09-17 17:16 pgsql: Fix parsetree representation of XMLTABLE(XMLNAMESPACES(DEFAULT . 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