mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +03:00
Remove all uses of the deprecated functions heap_formtuple, heap_modifytuple,
and heap_deformtuple in favor of the newer functions heap_form_tuple et al (which do the same things but use bool control flags instead of arbitrary char values). Eliminate the former duplicate coding of these functions, reducing the deprecated functions to mere wrappers around the newer ones. We can't get rid of them entirely because add-on modules probably still contain many instances of the old coding style. Kris Jurka
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.246 2008/09/30 10:52:11 heikki Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.247 2008/11/02 01:45:27 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -169,7 +169,7 @@ struct typmap
|
||||
static struct typmap **Typ = NULL;
|
||||
static struct typmap *Ap = NULL;
|
||||
|
||||
static char Blanks[MAXATTR];
|
||||
static bool Nulls[MAXATTR];
|
||||
|
||||
Form_pg_attribute attrtypes[MAXATTR]; /* points to attribute info */
|
||||
static Datum values[MAXATTR]; /* corresponding attribute values */
|
||||
@ -488,7 +488,7 @@ BootstrapModeMain(void)
|
||||
for (i = 0; i < MAXATTR; i++)
|
||||
{
|
||||
attrtypes[i] = NULL;
|
||||
Blanks[i] = ' ';
|
||||
Nulls[i] = false;
|
||||
}
|
||||
for (i = 0; i < STRTABLESIZE; ++i)
|
||||
strtable[i] = NULL;
|
||||
@ -797,7 +797,7 @@ InsertOneTuple(Oid objectid)
|
||||
tupDesc = CreateTupleDesc(numattr,
|
||||
RelationGetForm(boot_reldesc)->relhasoids,
|
||||
attrtypes);
|
||||
tuple = heap_formtuple(tupDesc, values, Blanks);
|
||||
tuple = heap_form_tuple(tupDesc, values, Nulls);
|
||||
if (objectid != (Oid) 0)
|
||||
HeapTupleSetOid(tuple, objectid);
|
||||
pfree(tupDesc); /* just free's tupDesc, not the attrtypes */
|
||||
@ -807,10 +807,10 @@ InsertOneTuple(Oid objectid)
|
||||
elog(DEBUG4, "row inserted");
|
||||
|
||||
/*
|
||||
* Reset blanks for next tuple
|
||||
* Reset null markers for next tuple
|
||||
*/
|
||||
for (i = 0; i < numattr; i++)
|
||||
Blanks[i] = ' ';
|
||||
Nulls[i] = false;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
@ -857,7 +857,7 @@ InsertOneNull(int i)
|
||||
elog(DEBUG4, "inserting column %d NULL", i);
|
||||
Assert(i >= 0 || i < MAXATTR);
|
||||
values[i] = PointerGetDatum(NULL);
|
||||
Blanks[i] = 'n';
|
||||
Nulls[i] = true;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
|
Reference in New Issue
Block a user