Fixes missing ok issue

pull/7240/head
gindibay 2023-10-24 15:12:08 +03:00
parent f779947b2b
commit b5cbc048b7
1 changed files with 4 additions and 4 deletions

View File

@ -388,9 +388,9 @@ PreprocessDropDatabaseStmt(Node *node, const char *queryString,
static ObjectAddress * static ObjectAddress *
GetDatabaseAddressFromDatabaseName(char *databaseName) GetDatabaseAddressFromDatabaseName(char *databaseName, bool missingOk)
{ {
Oid databaseOid = get_database_oid(databaseName, false); Oid databaseOid = get_database_oid(databaseName, missingOk);
ObjectAddress *dbAddress = palloc0(sizeof(ObjectAddress)); ObjectAddress *dbAddress = palloc0(sizeof(ObjectAddress));
ObjectAddressSet(*dbAddress, DatabaseRelationId, databaseOid); ObjectAddressSet(*dbAddress, DatabaseRelationId, databaseOid);
return dbAddress; return dbAddress;
@ -401,7 +401,7 @@ List *
DropDatabaseStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess) DropDatabaseStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess)
{ {
DropdbStmt *stmt = castNode(DropdbStmt, node); DropdbStmt *stmt = castNode(DropdbStmt, node);
ObjectAddress *dbAddress = GetDatabaseAddressFromDatabaseName(stmt->dbname); ObjectAddress *dbAddress = GetDatabaseAddressFromDatabaseName(stmt->dbname, stmt->missing_ok);
return list_make1(dbAddress); return list_make1(dbAddress);
} }
@ -410,6 +410,6 @@ List *
CreateDatabaseStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess) CreateDatabaseStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess)
{ {
CreatedbStmt *stmt = castNode(CreatedbStmt, node); CreatedbStmt *stmt = castNode(CreatedbStmt, node);
ObjectAddress *dbAddress = GetDatabaseAddressFromDatabaseName(stmt->dbname); ObjectAddress *dbAddress = GetDatabaseAddressFromDatabaseName(stmt->dbname,stmt->missing_ok);
return list_make1(dbAddress); return list_make1(dbAddress);
} }