1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

Fix a minor bug introduced by the recent CREATE TABLE AS / WITH OIDS

patch: a 3-value enum was mistakenly assigned directly to a 'bool'
in transformCreateStmt(). Along the way, change makeObjectName()
to be static, as it isn't used outside analyze.c
This commit is contained in:
Neil Conway
2004-01-23 02:13:12 +00:00
parent cd1702dc3a
commit 0bd3606d72
5 changed files with 39 additions and 42 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/parse_clause.c,v 1.126 2004/01/14 23:01:55 tgl Exp $
* $PostgreSQL: pgsql/src/backend/parser/parse_clause.c,v 1.127 2004/01/23 02:13:12 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@ -191,7 +191,33 @@ interpretInhOption(InhOption inhOpt)
case INH_DEFAULT:
return SQL_inheritance;
}
elog(ERROR, "bogus InhOption value");
elog(ERROR, "bogus InhOption value: %d", inhOpt);
return false; /* keep compiler quiet */
}
/*
* Given an enum that indicates whether WITH / WITHOUT OIDS was
* specified by the user, return true iff the specified table/result
* set should be created with OIDs. This needs to be done after
* parsing the query string because the return value can depend upon
* the default_with_oids GUC var.
*/
bool
interpretOidsOption(ContainsOids opt)
{
switch (opt)
{
case MUST_HAVE_OIDS:
return true;
case MUST_NOT_HAVE_OIDS:
return false;
case DEFAULT_OIDS:
return default_with_oids;
}
elog(ERROR, "bogus ContainsOids value: %d", opt);
return false; /* keep compiler quiet */
}