From d3c8ac114f1183e54315e64ef697c6588823c4dd Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Thu, 19 Nov 2015 01:25:58 +0100 Subject: [PATCH] Remove function names from some elog() calls in heapam.c. At least one of the names was, due to a function renaming late in the development of ON CONFLICT, wrong. Since including function names in error messages is against the message style guide anyway, remove them from the messages. Discussion: CAM3SWZT8paz=usgMVHm0XOETkQvzjRtAUthATnmaHQQY0obnGw@mail.gmail.com Backpatch: 9.5, where ON CONFLICT was introduced --- src/backend/access/heap/heapam.c | 34 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index 35a2b05aff..9ff7a41e43 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -5809,7 +5809,7 @@ heap_finish_speculative(Relation relation, HeapTuple tuple) lp = PageGetItemId(page, offnum); if (PageGetMaxOffsetNumber(page) < offnum || !ItemIdIsNormal(lp)) - elog(ERROR, "heap_confirm_insert: invalid lp"); + elog(ERROR, "invalid lp"); htup = (HeapTupleHeader) PageGetItem(page, lp); @@ -6050,14 +6050,14 @@ heap_inplace_update(Relation relation, HeapTuple tuple) lp = PageGetItemId(page, offnum); if (PageGetMaxOffsetNumber(page) < offnum || !ItemIdIsNormal(lp)) - elog(ERROR, "heap_inplace_update: invalid lp"); + elog(ERROR, "invalid lp"); htup = (HeapTupleHeader) PageGetItem(page, lp); oldlen = ItemIdGetLength(lp) - htup->t_hoff; newlen = tuple->t_len - tuple->t_data->t_hoff; if (oldlen != newlen || htup->t_hoff != tuple->t_data->t_hoff) - elog(ERROR, "heap_inplace_update: wrong tuple length"); + elog(ERROR, "wrong tuple length"); /* NO EREPORT(ERROR) from here till changes are logged */ START_CRIT_SECTION(); @@ -7987,7 +7987,7 @@ heap_xlog_delete(XLogReaderState *record) lp = PageGetItemId(page, xlrec->offnum); if (PageGetMaxOffsetNumber(page) < xlrec->offnum || !ItemIdIsNormal(lp)) - elog(PANIC, "heap_delete_redo: invalid lp"); + elog(PANIC, "invalid lp"); htup = (HeapTupleHeader) PageGetItem(page, lp); @@ -8078,7 +8078,7 @@ heap_xlog_insert(XLogReaderState *record) page = BufferGetPage(buffer); if (PageGetMaxOffsetNumber(page) + 1 < xlrec->offnum) - elog(PANIC, "heap_insert_redo: invalid max offset number"); + elog(PANIC, "invalid max offset number"); data = XLogRecGetBlockData(record, 0, &datalen); @@ -8103,7 +8103,7 @@ heap_xlog_insert(XLogReaderState *record) if (PageAddItem(page, (Item) htup, newlen, xlrec->offnum, true, true) == InvalidOffsetNumber) - elog(PANIC, "heap_insert_redo: failed to add tuple"); + elog(PANIC, "failed to add tuple"); freespace = PageGetHeapFreeSpace(page); /* needed to update FSM below */ @@ -8213,7 +8213,7 @@ heap_xlog_multi_insert(XLogReaderState *record) else offnum = xlrec->offsets[i]; if (PageGetMaxOffsetNumber(page) + 1 < offnum) - elog(PANIC, "heap_multi_insert_redo: invalid max offset number"); + elog(PANIC, "invalid max offset number"); xlhdr = (xl_multi_insert_tuple *) SHORTALIGN(tupdata); tupdata = ((char *) xlhdr) + SizeOfMultiInsertTuple; @@ -8239,10 +8239,10 @@ heap_xlog_multi_insert(XLogReaderState *record) offnum = PageAddItem(page, (Item) htup, newlen, offnum, true, true); if (offnum == InvalidOffsetNumber) - elog(PANIC, "heap_multi_insert_redo: failed to add tuple"); + elog(PANIC, "failed to add tuple"); } if (tupdata != endptr) - elog(PANIC, "heap_multi_insert_redo: total tuple length mismatch"); + elog(PANIC, "total tuple length mismatch"); freespace = PageGetHeapFreeSpace(page); /* needed to update FSM below */ @@ -8353,7 +8353,7 @@ heap_xlog_update(XLogReaderState *record, bool hot_update) lp = PageGetItemId(page, offnum); if (PageGetMaxOffsetNumber(page) < offnum || !ItemIdIsNormal(lp)) - elog(PANIC, "heap_update_redo: invalid lp"); + elog(PANIC, "invalid lp"); htup = (HeapTupleHeader) PageGetItem(page, lp); @@ -8431,7 +8431,7 @@ heap_xlog_update(XLogReaderState *record, bool hot_update) offnum = xlrec->new_offnum; if (PageGetMaxOffsetNumber(page) + 1 < offnum) - elog(PANIC, "heap_update_redo: invalid max offset number"); + elog(PANIC, "invalid max offset number"); if (xlrec->flags & XLH_UPDATE_PREFIX_FROM_OLD) { @@ -8509,7 +8509,7 @@ heap_xlog_update(XLogReaderState *record, bool hot_update) offnum = PageAddItem(page, (Item) htup, newlen, offnum, true, true); if (offnum == InvalidOffsetNumber) - elog(PANIC, "heap_update_redo: failed to add tuple"); + elog(PANIC, "failed to add tuple"); if (xlrec->flags & XLH_UPDATE_NEW_ALL_VISIBLE_CLEARED) PageClearAllVisible(page); @@ -8564,7 +8564,7 @@ heap_xlog_confirm(XLogReaderState *record) lp = PageGetItemId(page, offnum); if (PageGetMaxOffsetNumber(page) < offnum || !ItemIdIsNormal(lp)) - elog(PANIC, "heap_confirm_redo: invalid lp"); + elog(PANIC, "invalid lp"); htup = (HeapTupleHeader) PageGetItem(page, lp); @@ -8600,7 +8600,7 @@ heap_xlog_lock(XLogReaderState *record) lp = PageGetItemId(page, offnum); if (PageGetMaxOffsetNumber(page) < offnum || !ItemIdIsNormal(lp)) - elog(PANIC, "heap_lock_redo: invalid lp"); + elog(PANIC, "invalid lp"); htup = (HeapTupleHeader) PageGetItem(page, lp); @@ -8650,7 +8650,7 @@ heap_xlog_lock_updated(XLogReaderState *record) lp = PageGetItemId(page, offnum); if (PageGetMaxOffsetNumber(page) < offnum || !ItemIdIsNormal(lp)) - elog(PANIC, "heap_xlog_lock_updated: invalid lp"); + elog(PANIC, "invalid lp"); htup = (HeapTupleHeader) PageGetItem(page, lp); @@ -8689,13 +8689,13 @@ heap_xlog_inplace(XLogReaderState *record) lp = PageGetItemId(page, offnum); if (PageGetMaxOffsetNumber(page) < offnum || !ItemIdIsNormal(lp)) - elog(PANIC, "heap_inplace_redo: invalid lp"); + elog(PANIC, "invalid lp"); htup = (HeapTupleHeader) PageGetItem(page, lp); oldlen = ItemIdGetLength(lp) - htup->t_hoff; if (oldlen != newlen) - elog(PANIC, "heap_inplace_redo: wrong tuple length"); + elog(PANIC, "wrong tuple length"); memcpy((char *) htup + htup->t_hoff, newtup, newlen); -- 2.40.0