mirror of
https://github.com/postgres/postgres.git
synced 2025-07-18 17:42:25 +03:00
Fix handling of collations in multi-row VALUES constructs.
Per spec we ought to apply select_common_collation() across the expressions in each column of the VALUES table. The original coding was just taking the first row and assuming it was representative. This patch adds a field to struct RangeTblEntry to carry the resolved collations, so initdb is forced for changes in stored rule representation.
This commit is contained in:
@ -1951,6 +1951,7 @@ _copyRangeTblEntry(RangeTblEntry *from)
|
||||
COPY_NODE_FIELD(funccoltypmods);
|
||||
COPY_NODE_FIELD(funccolcollations);
|
||||
COPY_NODE_FIELD(values_lists);
|
||||
COPY_NODE_FIELD(values_collations);
|
||||
COPY_STRING_FIELD(ctename);
|
||||
COPY_SCALAR_FIELD(ctelevelsup);
|
||||
COPY_SCALAR_FIELD(self_reference);
|
||||
|
@ -2310,6 +2310,7 @@ _equalRangeTblEntry(RangeTblEntry *a, RangeTblEntry *b)
|
||||
COMPARE_NODE_FIELD(funccoltypmods);
|
||||
COMPARE_NODE_FIELD(funccolcollations);
|
||||
COMPARE_NODE_FIELD(values_lists);
|
||||
COMPARE_NODE_FIELD(values_collations);
|
||||
COMPARE_STRING_FIELD(ctename);
|
||||
COMPARE_SCALAR_FIELD(ctelevelsup);
|
||||
COMPARE_SCALAR_FIELD(self_reference);
|
||||
|
@ -2324,6 +2324,7 @@ _outRangeTblEntry(StringInfo str, RangeTblEntry *node)
|
||||
break;
|
||||
case RTE_VALUES:
|
||||
WRITE_NODE_FIELD(values_lists);
|
||||
WRITE_NODE_FIELD(values_collations);
|
||||
break;
|
||||
case RTE_CTE:
|
||||
WRITE_STRING_FIELD(ctename);
|
||||
|
@ -1203,6 +1203,7 @@ _readRangeTblEntry(void)
|
||||
break;
|
||||
case RTE_VALUES:
|
||||
READ_NODE_FIELD(values_lists);
|
||||
READ_NODE_FIELD(values_collations);
|
||||
break;
|
||||
case RTE_CTE:
|
||||
READ_STRING_FIELD(ctename);
|
||||
|
Reference in New Issue
Block a user