pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Check column list length in XMLTABLE/JSON_TABLE alias
8+ messages / 2 participants
[nested] [flat]

* pgsql: Check column list length in XMLTABLE/JSON_TABLE alias
@ 2022-05-18 18:44 Alvaro Herrera <alvherre@alvh.no-ip.org>
  2022-05-18 20:02 ` Re: pgsql: Check column list length in XMLTABLE/JSON_TABLE alias Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 8+ messages in thread

From: Alvaro Herrera @ 2022-05-18 18:44 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check column list length in XMLTABLE/JSON_TABLE alias

We weren't checking the length of the column list in the alias clause of
an XMLTABLE or JSON_TABLE function (a "tablefunc" RTE), and it was
possible to make the server crash by passing an overly long one.  Fix it
by throwing an error in that case, like the other places that deal with
alias lists.

In passing, modify the equivalent test used for join RTEs to look like
the other ones, which was different for no apparent reason.

This bug came in when XMLTABLE was born in version 10; backpatch to all
stable versions.

Reported-by: Wang Ke <krking@zju.edu.cn>
Discussion: https://postgr.es/m/17480-1c9d73565bb28e90@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0fbf0112002355efb2bb525ab88edf891dbfd033

Modified Files
--------------
src/backend/parser/parse_clause.c           | 15 ---------------
src/backend/parser/parse_relation.c         | 19 +++++++++++++++++--
src/test/regress/expected/int2.out          |  4 ++++
src/test/regress/expected/join.out          |  3 +++
src/test/regress/expected/jsonb_sqljson.out |  2 ++
src/test/regress/expected/with.out          |  5 +++++
src/test/regress/expected/xml.out           |  3 +++
src/test/regress/sql/int2.sql               |  4 ++++
src/test/regress/sql/join.sql               |  3 +++
src/test/regress/sql/jsonb_sqljson.sql      |  2 ++
src/test/regress/sql/with.sql               |  3 +++
src/test/regress/sql/xml.sql                |  3 +++
12 files changed, 49 insertions(+), 17 deletions(-)



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

* Re: pgsql: Check column list length in XMLTABLE/JSON_TABLE alias
  2022-05-18 18:44 pgsql: Check column list length in XMLTABLE/JSON_TABLE alias Alvaro Herrera <alvherre@alvh.no-ip.org>
@ 2022-05-18 20:02 ` Tom Lane <tgl@sss.pgh.pa.us>
  2022-05-18 20:05   ` Re: pgsql: Check column list length in XMLTABLE/JSON_TABLE alias Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 1 reply; 8+ messages in thread

From: Tom Lane @ 2022-05-18 20:02 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@alvh.no-ip.org>; +Cc: pgsql-committers@lists.postgresql.org

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> Check column list length in XMLTABLE/JSON_TABLE alias

Per buildfarm, you forgot to update xml_1.out and xml_2.out.

			regards, tom lane





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

* Re: pgsql: Check column list length in XMLTABLE/JSON_TABLE alias
  2022-05-18 18:44 pgsql: Check column list length in XMLTABLE/JSON_TABLE alias Alvaro Herrera <alvherre@alvh.no-ip.org>
  2022-05-18 20:02 ` Re: pgsql: Check column list length in XMLTABLE/JSON_TABLE alias Tom Lane <tgl@sss.pgh.pa.us>
@ 2022-05-18 20:05   ` Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 8+ messages in thread

From: Alvaro Herrera @ 2022-05-18 20:05 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers@lists.postgresql.org

On 2022-May-18, Tom Lane wrote:

> Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> > Check column list length in XMLTABLE/JSON_TABLE alias
> 
> Per buildfarm, you forgot to update xml_1.out and xml_2.out.

Sigh.  Will fix.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/
"In Europe they call me Niklaus Wirth; in the US they call me Nickel's worth.
 That's because in Europe they call me by name, and in the US by value!"





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

* pgsql: Check column list length in XMLTABLE/JSON_TABLE alias
@ 2022-05-18 18:44 Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 8+ messages in thread

From: Alvaro Herrera @ 2022-05-18 18:44 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check column list length in XMLTABLE/JSON_TABLE alias

We weren't checking the length of the column list in the alias clause of
an XMLTABLE or JSON_TABLE function (a "tablefunc" RTE), and it was
possible to make the server crash by passing an overly long one.  Fix it
by throwing an error in that case, like the other places that deal with
alias lists.

In passing, modify the equivalent test used for join RTEs to look like
the other ones, which was different for no apparent reason.

This bug came in when XMLTABLE was born in version 10; backpatch to all
stable versions.

Reported-by: Wang Ke <krking@zju.edu.cn>
Discussion: https://postgr.es/m/17480-1c9d73565bb28e90@postgresql.org

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/94edb85d253e5ae066481e4e369ad9e35dea41b5

Modified Files
--------------
src/backend/parser/parse_clause.c   | 15 ---------------
src/backend/parser/parse_relation.c | 12 ++++++++++++
src/test/regress/expected/int2.out  |  4 ++++
src/test/regress/expected/join.out  |  3 +++
src/test/regress/expected/with.out  |  5 +++++
src/test/regress/expected/xml.out   |  3 +++
src/test/regress/sql/int2.sql       |  4 ++++
src/test/regress/sql/join.sql       |  3 +++
src/test/regress/sql/with.sql       |  3 +++
src/test/regress/sql/xml.sql        |  3 +++
10 files changed, 40 insertions(+), 15 deletions(-)



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

* pgsql: Check column list length in XMLTABLE/JSON_TABLE alias
@ 2022-05-18 18:44 Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 8+ messages in thread

From: Alvaro Herrera @ 2022-05-18 18:44 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check column list length in XMLTABLE/JSON_TABLE alias

We weren't checking the length of the column list in the alias clause of
an XMLTABLE or JSON_TABLE function (a "tablefunc" RTE), and it was
possible to make the server crash by passing an overly long one.  Fix it
by throwing an error in that case, like the other places that deal with
alias lists.

In passing, modify the equivalent test used for join RTEs to look like
the other ones, which was different for no apparent reason.

This bug came in when XMLTABLE was born in version 10; backpatch to all
stable versions.

Reported-by: Wang Ke <krking@zju.edu.cn>
Discussion: https://postgr.es/m/17480-1c9d73565bb28e90@postgresql.org

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/80656f00f85668bb828c1eb878876e5bedcbf4c4

Modified Files
--------------
src/backend/parser/parse_clause.c   | 15 ---------------
src/backend/parser/parse_relation.c | 12 ++++++++++++
src/test/regress/expected/int2.out  |  4 ++++
src/test/regress/expected/join.out  |  3 +++
src/test/regress/expected/with.out  |  5 +++++
src/test/regress/expected/xml.out   |  3 +++
src/test/regress/sql/int2.sql       |  4 ++++
src/test/regress/sql/join.sql       |  3 +++
src/test/regress/sql/with.sql       |  3 +++
src/test/regress/sql/xml.sql        |  3 +++
10 files changed, 40 insertions(+), 15 deletions(-)



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

* pgsql: Check column list length in XMLTABLE/JSON_TABLE alias
@ 2022-05-18 18:44 Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 8+ messages in thread

From: Alvaro Herrera @ 2022-05-18 18:44 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check column list length in XMLTABLE/JSON_TABLE alias

We weren't checking the length of the column list in the alias clause of
an XMLTABLE or JSON_TABLE function (a "tablefunc" RTE), and it was
possible to make the server crash by passing an overly long one.  Fix it
by throwing an error in that case, like the other places that deal with
alias lists.

In passing, modify the equivalent test used for join RTEs to look like
the other ones, which was different for no apparent reason.

This bug came in when XMLTABLE was born in version 10; backpatch to all
stable versions.

Reported-by: Wang Ke <krking@zju.edu.cn>
Discussion: https://postgr.es/m/17480-1c9d73565bb28e90@postgresql.org

Branch
------
REL_12_STABLE

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

Modified Files
--------------
src/backend/parser/parse_clause.c   | 15 ---------------
src/backend/parser/parse_relation.c | 12 ++++++++++++
src/test/regress/expected/int2.out  |  4 ++++
src/test/regress/expected/join.out  |  3 +++
src/test/regress/expected/with.out  |  5 +++++
src/test/regress/expected/xml.out   |  3 +++
src/test/regress/sql/int2.sql       |  4 ++++
src/test/regress/sql/join.sql       |  3 +++
src/test/regress/sql/with.sql       |  3 +++
src/test/regress/sql/xml.sql        |  3 +++
10 files changed, 40 insertions(+), 15 deletions(-)



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

* pgsql: Check column list length in XMLTABLE/JSON_TABLE alias
@ 2022-05-18 18:44 Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 8+ messages in thread

From: Alvaro Herrera @ 2022-05-18 18:44 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check column list length in XMLTABLE/JSON_TABLE alias

We weren't checking the length of the column list in the alias clause of
an XMLTABLE or JSON_TABLE function (a "tablefunc" RTE), and it was
possible to make the server crash by passing an overly long one.  Fix it
by throwing an error in that case, like the other places that deal with
alias lists.

In passing, modify the equivalent test used for join RTEs to look like
the other ones, which was different for no apparent reason.

This bug came in when XMLTABLE was born in version 10; backpatch to all
stable versions.

Reported-by: Wang Ke <krking@zju.edu.cn>
Discussion: https://postgr.es/m/17480-1c9d73565bb28e90@postgresql.org

Branch
------
REL_11_STABLE

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

Modified Files
--------------
src/backend/parser/parse_clause.c   | 15 ---------------
src/backend/parser/parse_relation.c | 12 ++++++++++++
src/test/regress/expected/int2.out  |  4 ++++
src/test/regress/expected/join.out  |  3 +++
src/test/regress/expected/with.out  |  5 +++++
src/test/regress/expected/xml.out   |  3 +++
src/test/regress/sql/int2.sql       |  4 ++++
src/test/regress/sql/join.sql       |  3 +++
src/test/regress/sql/with.sql       |  3 +++
src/test/regress/sql/xml.sql        |  3 +++
10 files changed, 40 insertions(+), 15 deletions(-)



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

* pgsql: Check column list length in XMLTABLE/JSON_TABLE alias
@ 2022-05-18 18:44 Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 8+ messages in thread

From: Alvaro Herrera @ 2022-05-18 18:44 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check column list length in XMLTABLE/JSON_TABLE alias

We weren't checking the length of the column list in the alias clause of
an XMLTABLE or JSON_TABLE function (a "tablefunc" RTE), and it was
possible to make the server crash by passing an overly long one.  Fix it
by throwing an error in that case, like the other places that deal with
alias lists.

In passing, modify the equivalent test used for join RTEs to look like
the other ones, which was different for no apparent reason.

This bug came in when XMLTABLE was born in version 10; backpatch to all
stable versions.

Reported-by: Wang Ke <krking@zju.edu.cn>
Discussion: https://postgr.es/m/17480-1c9d73565bb28e90@postgresql.org

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/16cb7db34f3c0a3b6e2973f6efbc6f2afa58c66a

Modified Files
--------------
src/backend/parser/parse_clause.c   | 15 ---------------
src/backend/parser/parse_relation.c | 12 ++++++++++++
src/test/regress/expected/int2.out  |  4 ++++
src/test/regress/expected/join.out  |  3 +++
src/test/regress/expected/with.out  |  5 +++++
src/test/regress/expected/xml.out   |  3 +++
src/test/regress/sql/int2.sql       |  4 ++++
src/test/regress/sql/join.sql       |  3 +++
src/test/regress/sql/with.sql       |  3 +++
src/test/regress/sql/xml.sql        |  3 +++
10 files changed, 40 insertions(+), 15 deletions(-)



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


end of thread, other threads:[~2022-05-18 20:05 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-05-18 18:44 pgsql: Check column list length in XMLTABLE/JSON_TABLE alias Alvaro Herrera <alvherre@alvh.no-ip.org>
2022-05-18 20:02 ` Tom Lane <tgl@sss.pgh.pa.us>
2022-05-18 20:05   ` Alvaro Herrera <alvherre@alvh.no-ip.org>
2022-05-18 18:44 pgsql: Check column list length in XMLTABLE/JSON_TABLE alias Alvaro Herrera <alvherre@alvh.no-ip.org>
2022-05-18 18:44 pgsql: Check column list length in XMLTABLE/JSON_TABLE alias Alvaro Herrera <alvherre@alvh.no-ip.org>
2022-05-18 18:44 pgsql: Check column list length in XMLTABLE/JSON_TABLE alias Alvaro Herrera <alvherre@alvh.no-ip.org>
2022-05-18 18:44 pgsql: Check column list length in XMLTABLE/JSON_TABLE alias Alvaro Herrera <alvherre@alvh.no-ip.org>
2022-05-18 18:44 pgsql: Check column list length in XMLTABLE/JSON_TABLE alias Alvaro Herrera <alvherre@alvh.no-ip.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