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

Fix crash in ALTER OPERATOR CLASS/FAMILY .. SET SCHEMA.

In the previous coding, the parser emitted a List containing a C string,
which is no good, because copyObject() can't handle it.

Dimitri Fontaine
This commit is contained in:
Robert Haas
2011-01-03 22:08:55 -05:00
parent dc8a14311a
commit 7f60be72b0
4 changed files with 8 additions and 13 deletions

View File

@ -1993,16 +1993,13 @@ AlterOpClassOwner_internal(Relation rel, HeapTuple tup, Oid newOwnerId)
* ALTER OPERATOR CLASS any_name USING access_method SET SCHEMA name
*/
void
AlterOpClassNamespace(List *name, List *argam, const char *newschema)
AlterOpClassNamespace(List *name, char *access_method, const char *newschema)
{
Oid amOid;
char *access_method = linitial(argam);
Relation rel;
Oid oid;
Oid nspOid;
Assert(list_length(argam) == 1);
amOid = get_am_oid(access_method, false);
rel = heap_open(OperatorClassRelationId, RowExclusiveLock);
@ -2185,15 +2182,13 @@ get_am_oid(const char *amname, bool missing_ok)
* ALTER OPERATOR FAMILY any_name USING access_method SET SCHEMA name
*/
void
AlterOpFamilyNamespace(List *name, List *argam, const char *newschema)
AlterOpFamilyNamespace(List *name, char *access_method, const char *newschema)
{
Oid amOid;
char *access_method = linitial(argam);
Relation rel;
Oid nspOid;
Oid oid;
Assert(list_length(argam) == 1);
amOid = get_am_oid(access_method, false);
rel = heap_open(OperatorFamilyRelationId, RowExclusiveLock);