mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +03:00
Convert index-related tuple handling routines from char 'n'/' ' to bool
convention for isnull flags. Also, remove the useless InsertIndexResult return struct from index AM aminsert calls --- there is no reason for the caller to know where in the index the tuple was inserted, and we were wasting a palloc cycle per insert to deliver this uninteresting value (plus nontrivial complexity in some AMs). I forced initdb because of the change in the signature of the aminsert routines, even though nothing really looks at those pg_proc entries...
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/access/index/indexam.c,v 1.77 2004/12/31 21:59:19 pgsql Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/index/indexam.c,v 1.78 2005/03/21 01:23:58 tgl Exp $
|
||||
*
|
||||
* INTERFACE ROUTINES
|
||||
* index_open - open an index relation by relation OID
|
||||
@@ -211,16 +211,15 @@ index_close(Relation relation)
|
||||
* index_insert - insert an index tuple into a relation
|
||||
* ----------------
|
||||
*/
|
||||
InsertIndexResult
|
||||
bool
|
||||
index_insert(Relation indexRelation,
|
||||
Datum *datums,
|
||||
char *nulls,
|
||||
Datum *values,
|
||||
bool *isnull,
|
||||
ItemPointer heap_t_ctid,
|
||||
Relation heapRelation,
|
||||
bool check_uniqueness)
|
||||
{
|
||||
RegProcedure procedure;
|
||||
InsertIndexResult specificResult;
|
||||
|
||||
RELATION_CHECKS;
|
||||
GET_REL_PROCEDURE(insert, aminsert);
|
||||
@@ -228,17 +227,13 @@ index_insert(Relation indexRelation,
|
||||
/*
|
||||
* have the am's insert proc do all the work.
|
||||
*/
|
||||
specificResult = (InsertIndexResult)
|
||||
DatumGetPointer(OidFunctionCall6(procedure,
|
||||
return DatumGetBool(OidFunctionCall6(procedure,
|
||||
PointerGetDatum(indexRelation),
|
||||
PointerGetDatum(datums),
|
||||
PointerGetDatum(nulls),
|
||||
PointerGetDatum(values),
|
||||
PointerGetDatum(isnull),
|
||||
PointerGetDatum(heap_t_ctid),
|
||||
PointerGetDatum(heapRelation),
|
||||
BoolGetDatum(check_uniqueness)));
|
||||
|
||||
/* must be pfree'ed */
|
||||
return specificResult;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
|
||||
Reference in New Issue
Block a user