1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-08 11:42:09 +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:
Tom Lane
2008-11-02 01:45:28 +00:00
parent 492059daba
commit 902d1cb35f
46 changed files with 630 additions and 1013 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.126 2008/10/31 15:05:00 heikki Exp $
* $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.127 2008/11/02 01:45:27 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -1277,8 +1277,8 @@ update_attstats(Oid relid, int natts, VacAttrStats **vacattrstats)
k,
n;
Datum values[Natts_pg_statistic];
char nulls[Natts_pg_statistic];
char replaces[Natts_pg_statistic];
bool nulls[Natts_pg_statistic];
bool replaces[Natts_pg_statistic];
/* Ignore attr if we weren't able to collect stats */
if (!stats->stats_valid)
@ -1289,8 +1289,8 @@ update_attstats(Oid relid, int natts, VacAttrStats **vacattrstats)
*/
for (i = 0; i < Natts_pg_statistic; ++i)
{
nulls[i] = ' ';
replaces[i] = 'r';
nulls[i] = false;
replaces[i] = true;
}
i = 0;
@ -1326,7 +1326,7 @@ update_attstats(Oid relid, int natts, VacAttrStats **vacattrstats)
}
else
{
nulls[i] = 'n';
nulls[i] = true;
values[i++] = (Datum) 0;
}
}
@ -1346,7 +1346,7 @@ update_attstats(Oid relid, int natts, VacAttrStats **vacattrstats)
}
else
{
nulls[i] = 'n';
nulls[i] = true;
values[i++] = (Datum) 0;
}
}
@ -1360,7 +1360,7 @@ update_attstats(Oid relid, int natts, VacAttrStats **vacattrstats)
if (HeapTupleIsValid(oldtup))
{
/* Yes, replace it */
stup = heap_modifytuple(oldtup,
stup = heap_modify_tuple(oldtup,
RelationGetDescr(sd),
values,
nulls,
@ -1371,7 +1371,7 @@ update_attstats(Oid relid, int natts, VacAttrStats **vacattrstats)
else
{
/* No, insert new tuple */
stup = heap_formtuple(RelationGetDescr(sd), values, nulls);
stup = heap_form_tuple(RelationGetDescr(sd), values, nulls);
simple_heap_insert(sd, stup);
}