From: Marc G. Fournier Date: Tue, 9 Jul 1996 06:35:38 +0000 (+0000) Subject: Fix: Can't drop tables with names longer than 16 characters. X-Git-Tag: Release_1_0_2~121 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=25bb71835f1d3c3ab85cfa33dbdf95419d003c2a;p=postgresql Fix: Can't drop tables with names longer than 16 characters. --- diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c index 31aa1336a8..8c3c430981 100644 --- a/src/backend/storage/smgr/md.c +++ b/src/backend/storage/smgr/md.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.1.1.1 1996/07/09 06:21:59 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.2 1996/07/09 06:35:38 scrappy Exp $ * *------------------------------------------------------------------------- */ @@ -146,8 +146,8 @@ mdunlink(Relation reln) int i; MdfdVec *v, *ov; MemoryContext oldcxt; - char fname[20]; /* XXX should have NAMESIZE defined */ - char tname[20]; + char fname[NAMEDATALEN]; + char tname[NAMEDATALEN+10]; /* leave room for overflow suffixes*/ /* On Windows NT you can't unlink a file if it is open so we have ** to do this. @@ -157,8 +157,8 @@ mdunlink(Relation reln) #endif /* WIN32 */ - memset(fname,0,20); - strncpy(fname, RelationGetRelationName(reln)->data, 16); + memset(fname,0, NAMEDATALEN); + strncpy(fname, RelationGetRelationName(reln)->data, NAMEDATALEN); if (FileNameUnlink(fname) < 0) return (SM_FAIL);