Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite48433e

Browse files
committed
Lobotomize typmod check in convert_tuples_by_position, back branches only.
convert_tuples_by_position was rejecting attempts to coerce a record fieldwith -1 typmod to the same type with a non-default typmod. This is in factthe "correct" thing to do (since we're just going to do a type relabeling,not invoke any length-conversion cast function); but it results inrejecting valid cases like bug #6020, because the source record's tupdescis built from Params that don't have typmod assigned. Since that's aregression from previous versions, which accepted this code, we have to dosomething about it. In HEAD, I've fixed the problem properly by causingthe Params to receive the correct typmods; but the potential for incidentalbehavioral changes seems high enough to make it unattractive to make thesame change in released branches. (And it couldn't be fixed that way in8.4 anyway...) Hence this patch just modifies convert_tuples_by_positionto not complain if either the input or the output tupdesc has typmod -1.This is still a shade tighter checking than we did before 9.0, since beforethat plpgsql failed to consider typmods at all when checking recordcompatibility. (convert_tuples_by_position is currently used only byplpgsql, so we're not affecting other behavior.)Back-patch to 8.4, since we recently back-ported convert_tuples_by_positioninto that branch.
1 parent7541d32 commite48433e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/backend/access/common/tupconvert.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ convert_tuples_by_position(TupleDesc indesc,
100100
nincols++;
101101
/* Found matching column, check type */
102102
if (atttypid!=att->atttypid||
103-
(atttypmod!=att->atttypmod&&atttypmod >=0))
103+
(atttypmod!=att->atttypmod&&atttypmod >=0&&
104+
att->atttypmod >=0))
104105
ereport(ERROR,
105106
(errcode(ERRCODE_DATATYPE_MISMATCH),
106107
errmsg_internal("%s",_(msg)),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp