summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVadim B. Mikheev <vadim4o@yahoo.com>1997-04-17 01:45:36 +0000
committerVadim B. Mikheev <vadim4o@yahoo.com>1997-04-17 01:45:36 +0000
commita0d63ac98c3144373ddc9c879c574a0bf03f1a32 (patch)
treea135b3c8dca8eb9f4167a32fbad3a8ac6b30b232 /src
parentba697c8c0b1afc3c5aca429088ab8141d90ccf59 (diff)
downloadpostgresql-a0d63ac98c3144373ddc9c879c574a0bf03f1a32.tar.gz
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>.
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/vacuum.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index 2df4d172bd..4779f3eb5b 100644
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -7,7 +7,7 @@
*
*
* 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;
/* vacrel gets de-allocated on transaction commit */
+ if (vacrel)
+ strcpy(VacRel.data,vacrel);
/* initialize vacuum cleaner */
vc_init();
/* vacuum the database */
if (vacrel)
- {
- strcpy(VacRel.data,vacrel);
- vc_vacuum(&VacRel);
- }
+ vc_vacuum(&VacRel);
else
- vc_vacuum(NULL);
+ vc_vacuum(NULL);
/* clean up */
vc_shutdown();