mirror of https://github.com/postgres/postgres
Fix: Can't drop tables with names longer than 16 characters.
This commit is contained in:
parent
d31084e9d1
commit
25bb71835f
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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;
|
int i;
|
||||||
MdfdVec *v, *ov;
|
MdfdVec *v, *ov;
|
||||||
MemoryContext oldcxt;
|
MemoryContext oldcxt;
|
||||||
char fname[20]; /* XXX should have NAMESIZE defined */
|
char fname[NAMEDATALEN];
|
||||||
char tname[20];
|
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
|
/* On Windows NT you can't unlink a file if it is open so we have
|
||||||
** to do this.
|
** to do this.
|
||||||
|
@ -157,8 +157,8 @@ mdunlink(Relation reln)
|
||||||
#endif /* WIN32 */
|
#endif /* WIN32 */
|
||||||
|
|
||||||
|
|
||||||
memset(fname,0,20);
|
memset(fname,0, NAMEDATALEN);
|
||||||
strncpy(fname, RelationGetRelationName(reln)->data, 16);
|
strncpy(fname, RelationGetRelationName(reln)->data, NAMEDATALEN);
|
||||||
|
|
||||||
if (FileNameUnlink(fname) < 0)
|
if (FileNameUnlink(fname) < 0)
|
||||||
return (SM_FAIL);
|
return (SM_FAIL);
|
||||||
|
|
Loading…
Reference in New Issue