pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix Assert failure in XMLTABLE parser
4+ messages / 1 participants
[nested] [flat]

* pgsql: Fix Assert failure in XMLTABLE parser
@ 2025-05-15 08:09 Richard Guo <rguo@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Richard Guo @ 2025-05-15 08:09 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix Assert failure in XMLTABLE parser

In an XMLTABLE expression, columns can be marked NOT NULL, and the
parser internally fabricates an option named "is_not_null" to
represent this.  However, the parser also allows users to specify
arbitrary option names.  This creates a conflict: a user can
explicitly use "is_not_null" as an option name and assign it a
non-Boolean value, which violates internal assumptions and triggers an
assertion failure.

To fix, this patch checks whether a user-supplied name collides with
the internally reserved option name and raises an error if so.
Additionally, the internal name is renamed to "__pg__is_not_null" to
further reduce the risk of collision with user-defined names.

Reported-by: Евгений Горбанев <gorbanyoves@basealt.ru>
Author: Richard Guo <guofenglinux@gmail.com>
Reviewed-by: Alvaro Herrera <alvherre@kurilemu.de>
Discussion: https://postgr.es/m/6bac9886-65bf-4cec-96bd-e304159f28db@basealt.ru
Backpatch-through: 15

Branch
------
master

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

Modified Files
--------------
src/backend/parser/gram.y           | 15 +++++++++++----
src/test/regress/expected/xml.out   |  4 ++++
src/test/regress/expected/xml_1.out |  4 ++++
src/test/regress/expected/xml_2.out |  4 ++++
src/test/regress/sql/xml.sql        |  2 ++
5 files changed, 25 insertions(+), 4 deletions(-)



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

* pgsql: Fix Assert failure in XMLTABLE parser
@ 2025-05-15 08:13 Richard Guo <rguo@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Richard Guo @ 2025-05-15 08:13 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix Assert failure in XMLTABLE parser

In an XMLTABLE expression, columns can be marked NOT NULL, and the
parser internally fabricates an option named "is_not_null" to
represent this.  However, the parser also allows users to specify
arbitrary option names.  This creates a conflict: a user can
explicitly use "is_not_null" as an option name and assign it a
non-Boolean value, which violates internal assumptions and triggers an
assertion failure.

To fix, this patch checks whether a user-supplied name collides with
the internally reserved option name and raises an error if so.
Additionally, the internal name is renamed to "__pg__is_not_null" to
further reduce the risk of collision with user-defined names.

Reported-by: Евгений Горбанев <gorbanyoves@basealt.ru>
Author: Richard Guo <guofenglinux@gmail.com>
Reviewed-by: Alvaro Herrera <alvherre@kurilemu.de>
Discussion: https://postgr.es/m/6bac9886-65bf-4cec-96bd-e304159f28db@basealt.ru
Backpatch-through: 15

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2f48b4f075fb6672e1acbc3707cb0ef82030f2bf

Modified Files
--------------
src/backend/parser/gram.y           | 15 +++++++++++----
src/test/regress/expected/xml.out   |  4 ++++
src/test/regress/expected/xml_1.out |  4 ++++
src/test/regress/expected/xml_2.out |  4 ++++
src/test/regress/sql/xml.sql        |  2 ++
5 files changed, 25 insertions(+), 4 deletions(-)



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

* pgsql: Fix Assert failure in XMLTABLE parser
@ 2025-05-15 08:24 Richard Guo <rguo@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Richard Guo @ 2025-05-15 08:24 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix Assert failure in XMLTABLE parser

In an XMLTABLE expression, columns can be marked NOT NULL, and the
parser internally fabricates an option named "is_not_null" to
represent this.  However, the parser also allows users to specify
arbitrary option names.  This creates a conflict: a user can
explicitly use "is_not_null" as an option name and assign it a
non-Boolean value, which violates internal assumptions and triggers an
assertion failure.

To fix, this patch checks whether a user-supplied name collides with
the internally reserved option name and raises an error if so.
Additionally, the internal name is renamed to "__pg__is_not_null" to
further reduce the risk of collision with user-defined names.

Reported-by: Евгений Горбанев <gorbanyoves@basealt.ru>
Author: Richard Guo <guofenglinux@gmail.com>
Reviewed-by: Alvaro Herrera <alvherre@kurilemu.de>
Discussion: https://postgr.es/m/6bac9886-65bf-4cec-96bd-e304159f28db@basealt.ru
Backpatch-through: 15

Branch
------
REL_16_STABLE

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

Modified Files
--------------
src/backend/parser/gram.y           | 15 +++++++++++----
src/test/regress/expected/xml.out   |  4 ++++
src/test/regress/expected/xml_1.out |  4 ++++
src/test/regress/expected/xml_2.out |  4 ++++
src/test/regress/sql/xml.sql        |  2 ++
5 files changed, 25 insertions(+), 4 deletions(-)



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

* pgsql: Fix Assert failure in XMLTABLE parser
@ 2025-05-15 08:28 Richard Guo <rguo@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Richard Guo @ 2025-05-15 08:28 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix Assert failure in XMLTABLE parser

In an XMLTABLE expression, columns can be marked NOT NULL, and the
parser internally fabricates an option named "is_not_null" to
represent this.  However, the parser also allows users to specify
arbitrary option names.  This creates a conflict: a user can
explicitly use "is_not_null" as an option name and assign it a
non-Boolean value, which violates internal assumptions and triggers an
assertion failure.

To fix, this patch checks whether a user-supplied name collides with
the internally reserved option name and raises an error if so.
Additionally, the internal name is renamed to "__pg__is_not_null" to
further reduce the risk of collision with user-defined names.

Reported-by: Евгений Горбанев <gorbanyoves@basealt.ru>
Author: Richard Guo <guofenglinux@gmail.com>
Reviewed-by: Alvaro Herrera <alvherre@kurilemu.de>
Discussion: https://postgr.es/m/6bac9886-65bf-4cec-96bd-e304159f28db@basealt.ru
Backpatch-through: 15

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/666103090f1d18e26388aef1ee5840d86cb8604b

Modified Files
--------------
src/backend/parser/gram.y           | 15 +++++++++++----
src/test/regress/expected/xml.out   |  4 ++++
src/test/regress/expected/xml_1.out |  4 ++++
src/test/regress/expected/xml_2.out |  4 ++++
src/test/regress/sql/xml.sql        |  2 ++
5 files changed, 25 insertions(+), 4 deletions(-)



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


end of thread, other threads:[~2025-05-15 08:28 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-05-15 08:09 pgsql: Fix Assert failure in XMLTABLE parser Richard Guo <rguo@postgresql.org>
2025-05-15 08:13 pgsql: Fix Assert failure in XMLTABLE parser Richard Guo <rguo@postgresql.org>
2025-05-15 08:24 pgsql: Fix Assert failure in XMLTABLE parser Richard Guo <rguo@postgresql.org>
2025-05-15 08:28 pgsql: Fix Assert failure in XMLTABLE parser Richard Guo <rguo@postgresql.org>

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