1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-03 15:22:11 +03:00

Fix parse tree of DROP TRANSFORM and COMMENT ON TRANSFORM

The plain C string language name needs to be wrapped in makeString() so
that the parse tree is copyable.  This is detectable by
-DCOPY_PARSE_PLAN_TREES.  Add a test case for the COMMENT case.

Also make the quoting in the error messages more consistent.

discovered by Tom Lane
This commit is contained in:
Peter Eisentraut
2015-05-18 22:55:14 -04:00
parent b82a7be603
commit 0779f2ba2d
6 changed files with 13 additions and 10 deletions

View File

@@ -4112,7 +4112,7 @@ AlterExtensionContentsStmt:
n->action = $4;
n->objtype = OBJECT_TRANSFORM;
n->objname = list_make1($7);
n->objargs = list_make1($9);
n->objargs = list_make1(makeString($9));
$$ = (Node *)n;
}
| ALTER EXTENSION name add_drop TYPE_P Typename
@@ -5773,7 +5773,7 @@ CommentStmt:
CommentStmt *n = makeNode(CommentStmt);
n->objtype = OBJECT_TRANSFORM;
n->objname = list_make1($5);
n->objargs = list_make1($7);
n->objargs = list_make1(makeString($7));
n->comment = $9;
$$ = (Node *) n;
}
@@ -7389,7 +7389,7 @@ DropTransformStmt: DROP TRANSFORM opt_if_exists FOR Typename LANGUAGE name opt_d
DropStmt *n = makeNode(DropStmt);
n->removeType = OBJECT_TRANSFORM;
n->objects = list_make1(list_make1($5));
n->arguments = list_make1(list_make1($7));
n->arguments = list_make1(list_make1(makeString($7)));
n->behavior = $8;
n->missing_ok = $3;
$$ = (Node *)n;