pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: In transformRowExpr(), check for too many columns in the row.
7+ messages / 1 participants
[nested] [flat]

* pgsql: In transformRowExpr(), check for too many columns in the row.
@ 2022-07-29 17:31  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2022-07-29 17:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In transformRowExpr(), check for too many columns in the row.

A RowExpr with more than MaxTupleAttributeNumber columns would fail at
execution anyway, since we cannot form a tuple datum with more than that
many columns.  While heap_form_tuple() has a check for too many columns,
it emerges that there are some intermediate bits of code that don't
check and can be driven to failure with sufficiently many columns.
Checking this at parse time seems like the most appropriate place to
install a defense, since we already check SELECT list length there.

While at it, make the SELECT-list-length error use the same errcode
(TOO_MANY_COLUMNS) as heap_form_tuple does, rather than the generic
PROGRAM_LIMIT_EXCEEDED.

Per bug #17561 from Egor Chindyaskin.  The given test case crashes
in all supported branches (and probably a lot further back),
so patch all.

Discussion: https://postgr.es/m/17561-80350151b9ad2ad4@postgresql.org

Branch
------
master

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

Modified Files
--------------
src/backend/parser/parse_expr.c | 8 ++++++++
src/backend/parser/parse_node.c | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)



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

* pgsql: In transformRowExpr(), check for too many columns in the row.
@ 2022-07-29 17:31  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2022-07-29 17:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In transformRowExpr(), check for too many columns in the row.

A RowExpr with more than MaxTupleAttributeNumber columns would fail at
execution anyway, since we cannot form a tuple datum with more than that
many columns.  While heap_form_tuple() has a check for too many columns,
it emerges that there are some intermediate bits of code that don't
check and can be driven to failure with sufficiently many columns.
Checking this at parse time seems like the most appropriate place to
install a defense, since we already check SELECT list length there.

While at it, make the SELECT-list-length error use the same errcode
(TOO_MANY_COLUMNS) as heap_form_tuple does, rather than the generic
PROGRAM_LIMIT_EXCEEDED.

Per bug #17561 from Egor Chindyaskin.  The given test case crashes
in all supported branches (and probably a lot further back),
so patch all.

Discussion: https://postgr.es/m/17561-80350151b9ad2ad4@postgresql.org

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8df167baa7c76685cde43611df7026b5ad2e708e

Modified Files
--------------
src/backend/parser/parse_expr.c | 8 ++++++++
src/backend/parser/parse_node.c | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)



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

* pgsql: In transformRowExpr(), check for too many columns in the row.
@ 2022-07-29 17:31  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2022-07-29 17:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In transformRowExpr(), check for too many columns in the row.

A RowExpr with more than MaxTupleAttributeNumber columns would fail at
execution anyway, since we cannot form a tuple datum with more than that
many columns.  While heap_form_tuple() has a check for too many columns,
it emerges that there are some intermediate bits of code that don't
check and can be driven to failure with sufficiently many columns.
Checking this at parse time seems like the most appropriate place to
install a defense, since we already check SELECT list length there.

While at it, make the SELECT-list-length error use the same errcode
(TOO_MANY_COLUMNS) as heap_form_tuple does, rather than the generic
PROGRAM_LIMIT_EXCEEDED.

Per bug #17561 from Egor Chindyaskin.  The given test case crashes
in all supported branches (and probably a lot further back),
so patch all.

Discussion: https://postgr.es/m/17561-80350151b9ad2ad4@postgresql.org

Branch
------
REL_13_STABLE

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

Modified Files
--------------
src/backend/parser/parse_expr.c | 8 ++++++++
src/backend/parser/parse_node.c | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)



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

* pgsql: In transformRowExpr(), check for too many columns in the row.
@ 2022-07-29 17:31  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2022-07-29 17:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In transformRowExpr(), check for too many columns in the row.

A RowExpr with more than MaxTupleAttributeNumber columns would fail at
execution anyway, since we cannot form a tuple datum with more than that
many columns.  While heap_form_tuple() has a check for too many columns,
it emerges that there are some intermediate bits of code that don't
check and can be driven to failure with sufficiently many columns.
Checking this at parse time seems like the most appropriate place to
install a defense, since we already check SELECT list length there.

While at it, make the SELECT-list-length error use the same errcode
(TOO_MANY_COLUMNS) as heap_form_tuple does, rather than the generic
PROGRAM_LIMIT_EXCEEDED.

Per bug #17561 from Egor Chindyaskin.  The given test case crashes
in all supported branches (and probably a lot further back),
so patch all.

Discussion: https://postgr.es/m/17561-80350151b9ad2ad4@postgresql.org

Branch
------
REL_10_STABLE

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

Modified Files
--------------
src/backend/parser/parse_expr.c | 9 +++++++++
src/backend/parser/parse_node.c | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)



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

* pgsql: In transformRowExpr(), check for too many columns in the row.
@ 2022-07-29 17:31  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2022-07-29 17:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In transformRowExpr(), check for too many columns in the row.

A RowExpr with more than MaxTupleAttributeNumber columns would fail at
execution anyway, since we cannot form a tuple datum with more than that
many columns.  While heap_form_tuple() has a check for too many columns,
it emerges that there are some intermediate bits of code that don't
check and can be driven to failure with sufficiently many columns.
Checking this at parse time seems like the most appropriate place to
install a defense, since we already check SELECT list length there.

While at it, make the SELECT-list-length error use the same errcode
(TOO_MANY_COLUMNS) as heap_form_tuple does, rather than the generic
PROGRAM_LIMIT_EXCEEDED.

Per bug #17561 from Egor Chindyaskin.  The given test case crashes
in all supported branches (and probably a lot further back),
so patch all.

Discussion: https://postgr.es/m/17561-80350151b9ad2ad4@postgresql.org

Branch
------
REL_12_STABLE

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

Modified Files
--------------
src/backend/parser/parse_expr.c | 8 ++++++++
src/backend/parser/parse_node.c | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)



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

* pgsql: In transformRowExpr(), check for too many columns in the row.
@ 2022-07-29 17:31  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2022-07-29 17:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In transformRowExpr(), check for too many columns in the row.

A RowExpr with more than MaxTupleAttributeNumber columns would fail at
execution anyway, since we cannot form a tuple datum with more than that
many columns.  While heap_form_tuple() has a check for too many columns,
it emerges that there are some intermediate bits of code that don't
check and can be driven to failure with sufficiently many columns.
Checking this at parse time seems like the most appropriate place to
install a defense, since we already check SELECT list length there.

While at it, make the SELECT-list-length error use the same errcode
(TOO_MANY_COLUMNS) as heap_form_tuple does, rather than the generic
PROGRAM_LIMIT_EXCEEDED.

Per bug #17561 from Egor Chindyaskin.  The given test case crashes
in all supported branches (and probably a lot further back),
so patch all.

Discussion: https://postgr.es/m/17561-80350151b9ad2ad4@postgresql.org

Branch
------
REL_15_STABLE

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

Modified Files
--------------
src/backend/parser/parse_expr.c | 8 ++++++++
src/backend/parser/parse_node.c | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)



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

* pgsql: In transformRowExpr(), check for too many columns in the row.
@ 2022-07-29 17:31  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2022-07-29 17:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In transformRowExpr(), check for too many columns in the row.

A RowExpr with more than MaxTupleAttributeNumber columns would fail at
execution anyway, since we cannot form a tuple datum with more than that
many columns.  While heap_form_tuple() has a check for too many columns,
it emerges that there are some intermediate bits of code that don't
check and can be driven to failure with sufficiently many columns.
Checking this at parse time seems like the most appropriate place to
install a defense, since we already check SELECT list length there.

While at it, make the SELECT-list-length error use the same errcode
(TOO_MANY_COLUMNS) as heap_form_tuple does, rather than the generic
PROGRAM_LIMIT_EXCEEDED.

Per bug #17561 from Egor Chindyaskin.  The given test case crashes
in all supported branches (and probably a lot further back),
so patch all.

Discussion: https://postgr.es/m/17561-80350151b9ad2ad4@postgresql.org

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8dea18372f555d636503b84aff436d8d8120e236

Modified Files
--------------
src/backend/parser/parse_expr.c | 9 +++++++++
src/backend/parser/parse_node.c | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)



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


end of thread, other threads:[~2022-07-29 17:31 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-07-29 17:31 pgsql: In transformRowExpr(), check for too many columns in the row. Tom Lane <tgl@sss.pgh.pa.us>
2022-07-29 17:31 pgsql: In transformRowExpr(), check for too many columns in the row. Tom Lane <tgl@sss.pgh.pa.us>
2022-07-29 17:31 pgsql: In transformRowExpr(), check for too many columns in the row. Tom Lane <tgl@sss.pgh.pa.us>
2022-07-29 17:31 pgsql: In transformRowExpr(), check for too many columns in the row. Tom Lane <tgl@sss.pgh.pa.us>
2022-07-29 17:31 pgsql: In transformRowExpr(), check for too many columns in the row. Tom Lane <tgl@sss.pgh.pa.us>
2022-07-29 17:31 pgsql: In transformRowExpr(), check for too many columns in the row. Tom Lane <tgl@sss.pgh.pa.us>
2022-07-29 17:31 pgsql: In transformRowExpr(), check for too many columns in the row. 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