mirror of https://github.com/postgres/postgres
From: Maurice Gittens <mgittens@david.gits.nl>
After applying the following patch there remain two probable buffer overruns detected by Electric Fence during the regression test. I'll try find out what causes the remain two ones. This patch also corrects a typo in smgr.c.
This commit is contained in:
parent
0a0bd3d646
commit
896a42a5a7
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.13 1998/02/26 04:30:40 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.14 1998/04/01 15:35:01 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
@ -78,6 +78,7 @@ AggregateCreate(char *aggName,
|
|||
Oid xret2 = InvalidOid;
|
||||
Oid fret = InvalidOid;
|
||||
Oid fnArgs[8];
|
||||
NameData aname;
|
||||
TupleDesc tupDesc;
|
||||
|
||||
MemSet(fnArgs, 0, 8 * sizeof(Oid));
|
||||
|
@ -202,7 +203,8 @@ AggregateCreate(char *aggName,
|
|||
nulls[i] = ' ';
|
||||
values[i] = (Datum) NULL;
|
||||
}
|
||||
values[Anum_pg_aggregate_aggname - 1] = PointerGetDatum(aggName);
|
||||
namestrcpy(&aname, aggName);
|
||||
values[Anum_pg_aggregate_aggname - 1] = NameGetDatum(&aname);
|
||||
values[Anum_pg_aggregate_aggowner - 1] =
|
||||
Int32GetDatum(GetUserId());
|
||||
values[Anum_pg_aggregate_aggtransfn1 - 1] =
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.22 1998/02/26 04:30:41 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.23 1998/04/01 15:35:04 scrappy Exp $
|
||||
*
|
||||
* NOTES
|
||||
* these routines moved here from commands/define.c and somewhat cleaned up.
|
||||
|
@ -19,6 +19,7 @@
|
|||
#include <catalog/pg_proc.h>
|
||||
#include <utils/syscache.h>
|
||||
#include <utils/tqual.h>
|
||||
#include <utils/builtins.h>
|
||||
#include <access/heapam.h>
|
||||
#include <catalog/catname.h>
|
||||
#include <catalog/pg_operator.h>
|
||||
|
@ -229,6 +230,7 @@ OperatorShellMakeWithOpenRelation(Relation pg_operator_desc,
|
|||
Datum values[Natts_pg_operator];
|
||||
char nulls[Natts_pg_operator];
|
||||
Oid operatorObjectId;
|
||||
NameData oname;
|
||||
TupleDesc tupDesc;
|
||||
|
||||
/* ----------------
|
||||
|
@ -246,7 +248,8 @@ OperatorShellMakeWithOpenRelation(Relation pg_operator_desc,
|
|||
* ----------------
|
||||
*/
|
||||
i = 0;
|
||||
values[i++] = PointerGetDatum(operatorName);
|
||||
namestrcpy(&oname, operatorName);
|
||||
values[i++] = NameGetDatum(&oname);
|
||||
values[i++] = Int32GetDatum(GetUserId());
|
||||
values[i++] = (Datum) (uint16) 0;
|
||||
|
||||
|
@ -474,6 +477,7 @@ OperatorDef(char *operatorName,
|
|||
char *name[4];
|
||||
Oid typeId[8];
|
||||
int nargs;
|
||||
NameData oname;
|
||||
TupleDesc tupDesc;
|
||||
|
||||
static ScanKeyData opKey[3] = {
|
||||
|
@ -608,7 +612,8 @@ OperatorDef(char *operatorName,
|
|||
* ----------------
|
||||
*/
|
||||
i = 0;
|
||||
values[i++] = PointerGetDatum(operatorName);
|
||||
namestrcpy(&oname, operatorName);
|
||||
values[i++] = NameGetDatum(&oname);
|
||||
values[i++] = Int32GetDatum(GetUserId());
|
||||
values[i++] = UInt16GetDatum(precedence);
|
||||
values[i++] = leftTypeName ? (rightTypeName ? 'b' : 'r') : 'l';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.15 1998/02/26 04:30:43 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.16 1998/04/01 15:35:05 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
@ -71,6 +71,7 @@ ProcedureCreate(char *procedureName,
|
|||
Oid relid;
|
||||
Oid toid;
|
||||
text *prosrctext;
|
||||
NameData procname;
|
||||
TupleDesc tupDesc;
|
||||
|
||||
/* ----------------
|
||||
|
@ -229,7 +230,8 @@ ProcedureCreate(char *procedureName,
|
|||
}
|
||||
|
||||
i = 0;
|
||||
values[i++] = PointerGetDatum(procedureName);
|
||||
namestrcpy(&procname, procedureName);
|
||||
values[i++] = NameGetDatum(&procname);
|
||||
values[i++] = Int32GetDatum(GetUserId());
|
||||
values[i++] = ObjectIdGetDatum(languageObjectId);
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.21 1998/03/30 17:46:45 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.22 1998/04/01 15:35:08 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
@ -160,6 +160,7 @@ TypeShellMakeWithOpenRelation(Relation pg_type_desc, char *typeName)
|
|||
Datum values[Natts_pg_type];
|
||||
char nulls[Natts_pg_type];
|
||||
Oid typoid;
|
||||
NameData name;
|
||||
TupleDesc tupDesc;
|
||||
|
||||
/* ----------------
|
||||
|
@ -177,7 +178,8 @@ TypeShellMakeWithOpenRelation(Relation pg_type_desc, char *typeName)
|
|||
* ----------------
|
||||
*/
|
||||
i = 0;
|
||||
values[i++] = (Datum) typeName; /* 1 */
|
||||
namestrcpy(&name, typeName);
|
||||
values[i++] = NameGetDatum(&name); /* 1 */
|
||||
values[i++] = (Datum) InvalidOid; /* 2 */
|
||||
values[i++] = (Datum) (int16) 0; /* 3 */
|
||||
values[i++] = (Datum) (int16) 0; /* 4 */
|
||||
|
@ -315,11 +317,9 @@ TypeCreate(char *typeName,
|
|||
char *procs[4];
|
||||
bool defined;
|
||||
ItemPointerData itemPointerData;
|
||||
NameData name;
|
||||
TupleDesc tupDesc;
|
||||
|
||||
Oid argList[8];
|
||||
NameData name;
|
||||
|
||||
|
||||
static ScanKeyData typeKey[1] = {
|
||||
{0, Anum_pg_type_typname, NameEqualRegProcedure}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.13 1998/01/07 21:05:45 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.14 1998/04/01 15:35:33 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
@ -132,7 +132,7 @@ smgrcreate(int16 which, Relation reln)
|
|||
int fd;
|
||||
|
||||
if ((fd = (*(smgrsw[which].smgr_create)) (reln)) < 0)
|
||||
elog(ERROR, "cannot open %s",
|
||||
elog(ERROR, "cannot create %s",
|
||||
&(reln->rd_rel->relname.data[0]));
|
||||
|
||||
return (fd);
|
||||
|
|
Loading…
Reference in New Issue