The patch fixes a rare bug that may occur when one tries to vacuum a single
table. The table name is de-allocated by the CommitTransactionCommand() in vc_init() before it is copied in VacRel.data and sometimes this causes a SIGSEGV. My patch simply moves the strcpy before vc_init. Submitted by Massimo Dal Zotto <dz@cs.unitn.it>.
This commit is contained in:
parent
ba697c8c0b
commit
a0d63ac98c
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.28 1997/04/15 18:18:21 scrappy Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.29 1997/04/17 01:45:36 vadim Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -110,18 +110,17 @@ vacuum(char *vacrel, bool verbose)
|
|||||||
MESSAGE_LEVEL = DEBUG;
|
MESSAGE_LEVEL = DEBUG;
|
||||||
|
|
||||||
/* vacrel gets de-allocated on transaction commit */
|
/* vacrel gets de-allocated on transaction commit */
|
||||||
|
if (vacrel)
|
||||||
|
strcpy(VacRel.data,vacrel);
|
||||||
|
|
||||||
/* initialize vacuum cleaner */
|
/* initialize vacuum cleaner */
|
||||||
vc_init();
|
vc_init();
|
||||||
|
|
||||||
/* vacuum the database */
|
/* vacuum the database */
|
||||||
if (vacrel)
|
if (vacrel)
|
||||||
{
|
vc_vacuum(&VacRel);
|
||||||
strcpy(VacRel.data,vacrel);
|
|
||||||
vc_vacuum(&VacRel);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
vc_vacuum(NULL);
|
vc_vacuum(NULL);
|
||||||
|
|
||||||
/* clean up */
|
/* clean up */
|
||||||
vc_shutdown();
|
vc_shutdown();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user