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

Commita414d96

Browse files
committed
Simplify GetLockNameFromTagType.
The old code is wrong, because it returns a pointer to an automaticvariable. And it's also more clever than we really need to beconsidering that the case it's worrying about should never happen.
1 parentc94f0c2 commita414d96

File tree

1 file changed

+3
-13
lines changed
  • src/backend/storage/lmgr

1 file changed

+3
-13
lines changed

‎src/backend/storage/lmgr/lmgr.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,17 +1003,7 @@ DescribeLockTag(StringInfo buf, const LOCKTAG *tag)
10031003
constchar*
10041004
GetLockNameFromTagType(uint16locktag_type)
10051005
{
1006-
constchar*locktypename;
1007-
chartnbuf[32];
1008-
1009-
if (locktag_type <=LOCKTAG_LAST_TYPE)
1010-
locktypename=LockTagTypeNames[locktag_type];
1011-
else
1012-
{
1013-
snprintf(tnbuf,sizeof(tnbuf),"unknown %d",
1014-
(int)locktag_type);
1015-
locktypename=tnbuf;
1016-
}
1017-
1018-
returnlocktypename;
1006+
if (locktag_type>LOCKTAG_LAST_TYPE)
1007+
return"???";
1008+
returnLockTagTypeNames[locktag_type];
10191009
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp