Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit09d1110

Browse files
author
Neil Conway
committed
Trivial dead code removal: in CreateSchemaCommand(), 'owner_name' is
only used in one branch of an if statement, so we can move itsdeclaration to that block. This also avoids an unnecessary syscachelookup.Per Coverity static analysis performed by EnterpriseDB.
1 parent2d4b973 commit09d1110

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

‎src/backend/commands/schemacmds.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/commands/schemacmds.c,v 1.29 2005/04/14 20:03:24 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/commands/schemacmds.c,v 1.30 2005/06/21 00:58:15 neilc Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -42,7 +42,6 @@ CreateSchemaCommand(CreateSchemaStmt *stmt)
4242
OidnamespaceId;
4343
List*parsetree_list;
4444
ListCell*parsetree_item;
45-
constchar*owner_name;
4645
AclIdowner_userid;
4746
AclIdsaved_userid;
4847
AclResultaclresult;
@@ -56,13 +55,11 @@ CreateSchemaCommand(CreateSchemaStmt *stmt)
5655
if (!authId)
5756
{
5857
owner_userid=saved_userid;
59-
owner_name=GetUserNameFromId(owner_userid);
6058
}
6159
elseif (superuser())
6260
{
63-
owner_name=authId;
6461
/* The following will error out if user does not exist */
65-
owner_userid=get_usesysid(owner_name);
62+
owner_userid=get_usesysid(authId);
6663

6764
/*
6865
* Set the current user to the requested authorization so that
@@ -74,6 +71,8 @@ CreateSchemaCommand(CreateSchemaStmt *stmt)
7471
}
7572
else
7673
{
74+
constchar*owner_name;
75+
7776
/* not superuser */
7877
owner_userid=saved_userid;
7978
owner_name=GetUserNameFromId(owner_userid);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp