Fix mixups of FooGetDatum() vs. DatumGetFoo()

Some of these were accidentally reversed, but there was no ill effect.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/8246d7ff-f4b7-4363-913e-827dadfeb145%40eisentraut.org
pull/239/head
Peter Eisentraut 1 month ago
parent 6551a05d9c
commit 1469e31297
  1. 2
      contrib/pageinspect/btreefuncs.c
  2. 4
      contrib/pageinspect/gistfuncs.c
  3. 2
      src/backend/access/common/printsimple.c
  4. 4
      src/backend/access/nbtree/nbtcompare.c
  5. 6
      src/backend/access/transam/xlog.c

@ -506,7 +506,7 @@ bt_page_print_tuples(ua_page_items *uargs)
j = 0;
memset(nulls, 0, sizeof(nulls));
values[j++] = DatumGetInt16(offset);
values[j++] = Int16GetDatum(offset);
values[j++] = ItemPointerGetDatum(&itup->t_tid);
values[j++] = Int32GetDatum((int) IndexTupleSize(itup));
values[j++] = BoolGetDatum(IndexTupleHasNulls(itup));

@ -174,7 +174,7 @@ gist_page_items_bytea(PG_FUNCTION_ARGS)
memset(nulls, 0, sizeof(nulls));
values[0] = DatumGetInt16(offset);
values[0] = Int16GetDatum(offset);
values[1] = ItemPointerGetDatum(&itup->t_tid);
values[2] = Int32GetDatum((int) IndexTupleSize(itup));
@ -281,7 +281,7 @@ gist_page_items(PG_FUNCTION_ARGS)
memset(nulls, 0, sizeof(nulls));
values[0] = DatumGetInt16(offset);
values[0] = Int16GetDatum(offset);
values[1] = ItemPointerGetDatum(&itup->t_tid);
values[2] = Int32GetDatum((int) IndexTupleSize(itup));
values[3] = BoolGetDatum(ItemIdIsDead(id));

@ -123,7 +123,7 @@ printsimple(TupleTableSlot *slot, DestReceiver *self)
case OIDOID:
{
Oid num = ObjectIdGetDatum(value);
Oid num = DatumGetObjectId(value);
char str[10]; /* 10 digits */
int len;

@ -555,7 +555,7 @@ btcharcmp(PG_FUNCTION_ARGS)
static Datum
char_decrement(Relation rel, Datum existing, bool *underflow)
{
uint8 cexisting = UInt8GetDatum(existing);
uint8 cexisting = DatumGetUInt8(existing);
if (cexisting == 0)
{
@ -571,7 +571,7 @@ char_decrement(Relation rel, Datum existing, bool *underflow)
static Datum
char_increment(Relation rel, Datum existing, bool *overflow)
{
uint8 cexisting = UInt8GetDatum(existing);
uint8 cexisting = DatumGetUInt8(existing);
if (cexisting == UCHAR_MAX)
{

@ -9011,7 +9011,7 @@ do_pg_backup_start(const char *backupidstr, bool fast, List **tablespaces,
* work correctly, it is critical that sessionBackupState is only updated
* after this block is over.
*/
PG_ENSURE_ERROR_CLEANUP(do_pg_abort_backup, DatumGetBool(true));
PG_ENSURE_ERROR_CLEANUP(do_pg_abort_backup, BoolGetDatum(true));
{
bool gotUniqueStartpoint = false;
DIR *tblspcdir;
@ -9250,7 +9250,7 @@ do_pg_backup_start(const char *backupidstr, bool fast, List **tablespaces,
state->starttime = (pg_time_t) time(NULL);
}
PG_END_ENSURE_ERROR_CLEANUP(do_pg_abort_backup, DatumGetBool(true));
PG_END_ENSURE_ERROR_CLEANUP(do_pg_abort_backup, BoolGetDatum(true));
state->started_in_recovery = backup_started_in_recovery;
@ -9590,7 +9590,7 @@ register_persistent_abort_backup_handler(void)
if (already_done)
return;
before_shmem_exit(do_pg_abort_backup, DatumGetBool(false));
before_shmem_exit(do_pg_abort_backup, BoolGetDatum(false));
already_done = true;
}

Loading…
Cancel
Save