Commit 75af5ae9 authored by Tom Lane's avatar Tom Lane

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.
parent a9dad564
...@@ -203,7 +203,7 @@ does_not_exist_skipping(ObjectType objtype, List *objname, List *objargs) ...@@ -203,7 +203,7 @@ does_not_exist_skipping(ObjectType objtype, List *objname, List *objargs)
case OBJECT_TRIGGER: case OBJECT_TRIGGER:
msg = gettext_noop("trigger \"%s\" for table \"%s\" does not exist, skipping"); msg = gettext_noop("trigger \"%s\" for table \"%s\" does not exist, skipping");
name = strVal(llast(objname)); name = strVal(llast(objname));
args = NameListToString(list_truncate(objname, args = NameListToString(list_truncate(list_copy(objname),
list_length(objname) - 1)); list_length(objname) - 1));
break; break;
case OBJECT_EVENT_TRIGGER: case OBJECT_EVENT_TRIGGER:
...@@ -213,7 +213,7 @@ does_not_exist_skipping(ObjectType objtype, List *objname, List *objargs) ...@@ -213,7 +213,7 @@ does_not_exist_skipping(ObjectType objtype, List *objname, List *objargs)
case OBJECT_RULE: case OBJECT_RULE:
msg = gettext_noop("rule \"%s\" for relation \"%s\" does not exist, skipping"); msg = gettext_noop("rule \"%s\" for relation \"%s\" does not exist, skipping");
name = strVal(llast(objname)); name = strVal(llast(objname));
args = NameListToString(list_truncate(objname, args = NameListToString(list_truncate(list_copy(objname),
list_length(objname) - 1)); list_length(objname) - 1));
break; break;
case OBJECT_FDW: case OBJECT_FDW:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment