Allocate proper length for sprintf string, from Tatsuo.
This commit is contained in:
parent
ea0b5c8569
commit
46f4ed4921
@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* pending.c
|
* pending.c
|
||||||
* $Id: pending.c,v 1.9 2002/11/22 16:25:29 tgl Exp $
|
* $Id: pending.c,v 1.10 2002/11/26 03:08:00 momjian Exp $
|
||||||
*
|
*
|
||||||
* This file contains a trigger for Postgresql-7.x to record changes to tables
|
* This file contains a trigger for Postgresql-7.x to record changes to tables
|
||||||
* to a pending table for mirroring.
|
* to a pending table for mirroring.
|
||||||
@ -95,11 +95,11 @@ recordchange(PG_FUNCTION_ARGS)
|
|||||||
#ifndef NOSCHEMAS
|
#ifndef NOSCHEMAS
|
||||||
schemaname = get_namespace_name(RelationGetNamespace(trigdata->tg_relation));
|
schemaname = get_namespace_name(RelationGetNamespace(trigdata->tg_relation));
|
||||||
fullyqualtblname = SPI_palloc(strlen(tblname) +
|
fullyqualtblname = SPI_palloc(strlen(tblname) +
|
||||||
strlen(schemaname) + 4);
|
strlen(schemaname) + 6);
|
||||||
sprintf(fullyqualtblname,"\"%s\".\"%s\"",
|
sprintf(fullyqualtblname,"\"%s\".\"%s\"",
|
||||||
schemaname,tblname);
|
schemaname,tblname);
|
||||||
#else
|
#else
|
||||||
fullyqualtblname = SPI_palloc(strlen(tblname+3));
|
fullyqualtblname = SPI_palloc(strlen(tblname + 3));
|
||||||
sprintf(fullyqualtblname,"\"%s\"",tblname);
|
sprintf(fullyqualtblname,"\"%s\"",tblname);
|
||||||
#endif
|
#endif
|
||||||
tupdesc = trigdata->tg_relation->rd_att;
|
tupdesc = trigdata->tg_relation->rd_att;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user