mirror of
https://github.com/postgres/postgres.git
synced 2025-10-15 05:46:52 +03:00
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
This commit is contained in:
@@ -506,7 +506,7 @@ bt_page_print_tuples(ua_page_items *uargs)
|
|||||||
|
|
||||||
j = 0;
|
j = 0;
|
||||||
memset(nulls, 0, sizeof(nulls));
|
memset(nulls, 0, sizeof(nulls));
|
||||||
values[j++] = DatumGetInt16(offset);
|
values[j++] = Int16GetDatum(offset);
|
||||||
values[j++] = ItemPointerGetDatum(&itup->t_tid);
|
values[j++] = ItemPointerGetDatum(&itup->t_tid);
|
||||||
values[j++] = Int32GetDatum((int) IndexTupleSize(itup));
|
values[j++] = Int32GetDatum((int) IndexTupleSize(itup));
|
||||||
values[j++] = BoolGetDatum(IndexTupleHasNulls(itup));
|
values[j++] = BoolGetDatum(IndexTupleHasNulls(itup));
|
||||||
|
@@ -174,7 +174,7 @@ gist_page_items_bytea(PG_FUNCTION_ARGS)
|
|||||||
|
|
||||||
memset(nulls, 0, sizeof(nulls));
|
memset(nulls, 0, sizeof(nulls));
|
||||||
|
|
||||||
values[0] = DatumGetInt16(offset);
|
values[0] = Int16GetDatum(offset);
|
||||||
values[1] = ItemPointerGetDatum(&itup->t_tid);
|
values[1] = ItemPointerGetDatum(&itup->t_tid);
|
||||||
values[2] = Int32GetDatum((int) IndexTupleSize(itup));
|
values[2] = Int32GetDatum((int) IndexTupleSize(itup));
|
||||||
|
|
||||||
@@ -281,7 +281,7 @@ gist_page_items(PG_FUNCTION_ARGS)
|
|||||||
|
|
||||||
memset(nulls, 0, sizeof(nulls));
|
memset(nulls, 0, sizeof(nulls));
|
||||||
|
|
||||||
values[0] = DatumGetInt16(offset);
|
values[0] = Int16GetDatum(offset);
|
||||||
values[1] = ItemPointerGetDatum(&itup->t_tid);
|
values[1] = ItemPointerGetDatum(&itup->t_tid);
|
||||||
values[2] = Int32GetDatum((int) IndexTupleSize(itup));
|
values[2] = Int32GetDatum((int) IndexTupleSize(itup));
|
||||||
values[3] = BoolGetDatum(ItemIdIsDead(id));
|
values[3] = BoolGetDatum(ItemIdIsDead(id));
|
||||||
|
@@ -123,7 +123,7 @@ printsimple(TupleTableSlot *slot, DestReceiver *self)
|
|||||||
|
|
||||||
case OIDOID:
|
case OIDOID:
|
||||||
{
|
{
|
||||||
Oid num = ObjectIdGetDatum(value);
|
Oid num = DatumGetObjectId(value);
|
||||||
char str[10]; /* 10 digits */
|
char str[10]; /* 10 digits */
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
|
@@ -555,7 +555,7 @@ btcharcmp(PG_FUNCTION_ARGS)
|
|||||||
static Datum
|
static Datum
|
||||||
char_decrement(Relation rel, Datum existing, bool *underflow)
|
char_decrement(Relation rel, Datum existing, bool *underflow)
|
||||||
{
|
{
|
||||||
uint8 cexisting = UInt8GetDatum(existing);
|
uint8 cexisting = DatumGetUInt8(existing);
|
||||||
|
|
||||||
if (cexisting == 0)
|
if (cexisting == 0)
|
||||||
{
|
{
|
||||||
@@ -571,7 +571,7 @@ char_decrement(Relation rel, Datum existing, bool *underflow)
|
|||||||
static Datum
|
static Datum
|
||||||
char_increment(Relation rel, Datum existing, bool *overflow)
|
char_increment(Relation rel, Datum existing, bool *overflow)
|
||||||
{
|
{
|
||||||
uint8 cexisting = UInt8GetDatum(existing);
|
uint8 cexisting = DatumGetUInt8(existing);
|
||||||
|
|
||||||
if (cexisting == UCHAR_MAX)
|
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
|
* work correctly, it is critical that sessionBackupState is only updated
|
||||||
* after this block is over.
|
* 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;
|
bool gotUniqueStartpoint = false;
|
||||||
DIR *tblspcdir;
|
DIR *tblspcdir;
|
||||||
@@ -9250,7 +9250,7 @@ do_pg_backup_start(const char *backupidstr, bool fast, List **tablespaces,
|
|||||||
|
|
||||||
state->starttime = (pg_time_t) time(NULL);
|
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;
|
state->started_in_recovery = backup_started_in_recovery;
|
||||||
|
|
||||||
@@ -9590,7 +9590,7 @@ register_persistent_abort_backup_handler(void)
|
|||||||
|
|
||||||
if (already_done)
|
if (already_done)
|
||||||
return;
|
return;
|
||||||
before_shmem_exit(do_pg_abort_backup, DatumGetBool(false));
|
before_shmem_exit(do_pg_abort_backup, BoolGetDatum(false));
|
||||||
already_done = true;
|
already_done = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user