1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-14 08:21:07 +03:00

Don't trash input list structure in does_not_exist_skipping().

The trigger and rule cases need to split up the input name list, but
they mustn't corrupt the passed-in data structure, since it could be part
of a cached utility-statement parsetree.  Per bug #7641.
This commit is contained in:
Tom Lane
2012-11-08 11:34:37 -05:00
parent 9eb80f2ca7
commit 03787f6392

View File

@ -203,13 +203,13 @@ does_not_exist_skipping(ObjectType objtype, List *objname, List *objargs)
case OBJECT_TRIGGER:
msg = gettext_noop("trigger \"%s\" for table \"%s\" does not exist, skipping");
name = strVal(llast(objname));
args = NameListToString(list_truncate(objname,
args = NameListToString(list_truncate(list_copy(objname),
list_length(objname) - 1));
break;
case OBJECT_RULE:
msg = gettext_noop("rule \"%s\" for relation \"%s\" does not exist, skipping");
name = strVal(llast(objname));
args = NameListToString(list_truncate(objname,
args = NameListToString(list_truncate(list_copy(objname),
list_length(objname) - 1));
break;
case OBJECT_FDW: