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

Commit25bb718

Browse files
committed
Fix: Can't drop tables with names longer than 16 characters.
1 parentd31084e commit25bb718

File tree

1 file changed

+5
-5
lines changed
  • src/backend/storage/smgr

1 file changed

+5
-5
lines changed

‎src/backend/storage/smgr/md.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.1.1.1 1996/07/09 06:21:59 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.2 1996/07/09 06:35:38 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -146,8 +146,8 @@ mdunlink(Relation reln)
146146
inti;
147147
MdfdVec*v,*ov;
148148
MemoryContextoldcxt;
149-
charfname[20];/* XXX should have NAMESIZE defined */
150-
chartname[20];
149+
charfname[NAMEDATALEN];
150+
chartname[NAMEDATALEN+10];/* leave room for overflow suffixes*/
151151

152152
/* On Windows NT you can't unlink a file if it is open so we have
153153
** to do this.
@@ -157,8 +157,8 @@ mdunlink(Relation reln)
157157
#endif/* WIN32 */
158158

159159

160-
memset(fname,0,20);
161-
strncpy(fname,RelationGetRelationName(reln)->data,16);
160+
memset(fname,0,NAMEDATALEN);
161+
strncpy(fname,RelationGetRelationName(reln)->data,NAMEDATALEN);
162162

163163
if (FileNameUnlink(fname)<0)
164164
return (SM_FAIL);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp