diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-02-07 21:08:16 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-02-07 21:08:16 +0000 |
commit | 4af5e12b59eee56df0f15a3013077f628da60135 (patch) | |
tree | 51e4175c716b4fe041c35d73f7e71abae22b607f /src | |
parent | 08cf8603cf88b53ae125cb410395ff02e5100c97 (diff) | |
download | postgresql-4af5e12b59eee56df0f15a3013077f628da60135.tar.gz postgresql-4af5e12b59eee56df0f15a3013077f628da60135.zip |
Some variants of ALTER OWNER tried to make the "object" field of the
statement be a list of bare C strings, rather than String nodes, which is
what they need to be for copyfuncs/equalfuncs to work. Fortunately these
node types never go out to disk (if they did, we'd likely have noticed the
problem sooner), so we can just fix it without creating a need for initdb.
This bug has been there since 8.0, but 8.3 exposes it in a more common
code path (Parse messages) than prior releases did. Per bug #3940 from
Vladimir Kokovic.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/commands/alter.c | 8 | ||||
-rw-r--r-- | src/backend/parser/gram.y | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/backend/commands/alter.c b/src/backend/commands/alter.c index 102dafb8a2a..23cf8bfaa65 100644 --- a/src/backend/commands/alter.c +++ b/src/backend/commands/alter.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/alter.c,v 1.15 2005/10/15 02:49:14 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/commands/alter.c,v 1.15.2.1 2008/02/07 21:08:16 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -196,7 +196,7 @@ ExecAlterOwnerStmt(AlterOwnerStmt *stmt) break; case OBJECT_DATABASE: - AlterDatabaseOwner((char *) linitial(stmt->object), newowner); + AlterDatabaseOwner(strVal(linitial(stmt->object)), newowner); break; case OBJECT_FUNCTION: @@ -215,11 +215,11 @@ ExecAlterOwnerStmt(AlterOwnerStmt *stmt) break; case OBJECT_SCHEMA: - AlterSchemaOwner((char *) linitial(stmt->object), newowner); + AlterSchemaOwner(strVal(linitial(stmt->object)), newowner); break; case OBJECT_TABLESPACE: - AlterTableSpaceOwner((char *) linitial(stmt->object), newowner); + AlterTableSpaceOwner(strVal(linitial(stmt->object)), newowner); break; case OBJECT_TYPE: diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index fd815d6c68e..449b1eec180 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.511.2.2 2006/01/31 22:40:12 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.511.2.3 2008/02/07 21:08:16 tgl Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -4142,7 +4142,7 @@ AlterOwnerStmt: ALTER AGGREGATE func_name '(' aggr_argtype ')' OWNER TO RoleId { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_DATABASE; - n->object = list_make1($3); + n->object = list_make1(makeString($3)); n->newowner = $6; $$ = (Node *)n; } @@ -4185,7 +4185,7 @@ AlterOwnerStmt: ALTER AGGREGATE func_name '(' aggr_argtype ')' OWNER TO RoleId { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_SCHEMA; - n->object = list_make1($3); + n->object = list_make1(makeString($3)); n->newowner = $6; $$ = (Node *)n; } @@ -4201,7 +4201,7 @@ AlterOwnerStmt: ALTER AGGREGATE func_name '(' aggr_argtype ')' OWNER TO RoleId { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_TABLESPACE; - n->object = list_make1($3); + n->object = list_make1(makeString($3)); n->newowner = $6; $$ = (Node *)n; } |