pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix crash when using COLLATE in partition bound expressions
Date: Wed, 08 Apr 2020 06:05:27 +0000
Message-ID: <E1jM3q3-0004pF-2D@gemulon.postgresql.org> (raw)

Fix crash when using COLLATE in partition bound expressions

Attempting to use a COLLATE clause with a type that it not collatable in
a partition bound expression could crash the server.  This commit fixes
the code by adding more checks similar to what is done when computing
index or partition attributes by making sure that there is a collation
iff the type is collatable.

Backpatch down to 12, as 7c079d7 introduced this problem.

Reported-by: Alexander Lakhin
Author: Dmitry Dolgov
Discussion: https://postgr.es/m/16325-809194cf742313ab@postgresql.org
Backpatch-through: 12

Branch
------
master

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

Modified Files
--------------
src/backend/parser/parse_utilcmd.c         | 24 ++++++++++++++++++++++++
src/test/regress/expected/create_table.out |  6 ++++++
src/test/regress/sql/create_table.sql      |  2 ++
3 files changed, 32 insertions(+)



view thread (2+ messages)

Message-ID: <E1jM3q3-0004pF-2D@gemulon.postgresql.org>
Permalink:  ../E1jM3q3-0004pF-2D@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jM3q3-0004pF-2D@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Fix crash when using COLLATE in partition bound expressions
  In-Reply-To: <E1jM3q3-0004pF-2D@gemulon.postgresql.org>
  References: <E1jM3q3-0004pF-2D@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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