pgsql: Fix possible incorrect column reference in ERROR message - Mailing list pgsql-committers

From David Rowley
Subject pgsql: Fix possible incorrect column reference in ERROR message
Date
Msg-id E1vdy5h-005NPv-15@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix possible incorrect column reference in ERROR message

When creating a partition for a RANGE partitioned table, the reporting
of errors relating to converting the specified range values into
constant values for the partition key's type could display the name of a
previous partition key column when an earlier range was specified as
MINVALUE or MAXVALUE.

This was caused by the code not correctly incrementing the index that
tracks which partition key the foreach loop was working on after
processing MINVALUE/MAXVALUE ranges.

Fix by using foreach_current_index() to ensure the index variable is
always set to the List element being worked on.

Author: myzhen <zhenmingyang@yeah.net>
Reviewed-by: zhibin wang <killerwzb@gmail.com>
Discussion: https://postgr.es/m/273cab52.978.19b96fc75e7.Coremail.zhenmingyang@yeah.net
Backpatch-through: 14

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/349107537d22a04c94c6fec5b993461178b39c13

Modified Files
--------------
src/backend/parser/parse_utilcmd.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Create btree_gist v1.9, in which inet/cidr opclasses aren't defa
Next
From: David Rowley
Date:
Subject: pgsql: Fix possible incorrect column reference in ERROR message