mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +03:00
Remove redundant IndexTupleDSize macro.
Use IndexTupleSize everywhere, instead. Also, remove IndexTupleSize's internal typecast, as that's not really needed and might mask coding errors. Change some pointer variable datatypes in the call sites to compensate for that and make it clearer what we're assuming. Ildar Musin, Robert Haas, Stephen Frost Discussion: https://postgr.es/m/0274288e-9e88-13b6-c61c-7b36928bf221@postgrespro.ru
This commit is contained in:
@@ -558,7 +558,7 @@ _bt_findinsertloc(Relation rel,
|
||||
|
||||
lpageop = (BTPageOpaque) PageGetSpecialPointer(page);
|
||||
|
||||
itemsz = IndexTupleDSize(*newtup);
|
||||
itemsz = IndexTupleSize(newtup);
|
||||
itemsz = MAXALIGN(itemsz); /* be safe, PageAddItem will do this but we
|
||||
* need to be consistent */
|
||||
|
||||
@@ -755,7 +755,7 @@ _bt_insertonpg(Relation rel,
|
||||
elog(ERROR, "cannot insert to incompletely split page %u",
|
||||
BufferGetBlockNumber(buf));
|
||||
|
||||
itemsz = IndexTupleDSize(*itup);
|
||||
itemsz = IndexTupleSize(itup);
|
||||
itemsz = MAXALIGN(itemsz); /* be safe, PageAddItem will do this but we
|
||||
* need to be consistent */
|
||||
|
||||
@@ -914,7 +914,7 @@ _bt_insertonpg(Relation rel,
|
||||
sizeof(IndexTupleData));
|
||||
}
|
||||
else
|
||||
XLogRegisterBufData(0, (char *) itup, IndexTupleDSize(*itup));
|
||||
XLogRegisterBufData(0, (char *) itup, IndexTupleSize(itup));
|
||||
|
||||
recptr = XLogInsert(RM_BTREE_ID, xlinfo);
|
||||
|
||||
|
Reference in New Issue
Block a user