summaryrefslogtreecommitdiff
path: root/storage/innobase/btr/btr0cur.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-02-16 09:16:11 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2017-02-16 09:16:11 +0200
commit7a5288015c8afeaaef4d5dd04057f78c7978eeee (patch)
tree107120e3de276204b25412f0cf7b2c9002173632 /storage/innobase/btr/btr0cur.cc
parent37925c6ccc61bd4d5af4956dbd877c69983c09f3 (diff)
downloadmariadb-git-7a5288015c8afeaaef4d5dd04057f78c7978eeee.tar.gz
MDEV-12072 Do not unnecessarily construct rec_printer objects
I introduced the rec_printer object in MySQL to pretty-print raw InnoDB records and index tuples in diagnostic messages. These objects are being constructed unconditionally, even though the DBUG_PRINT is not enabled. The unnecessary work is avoided by simply passing rec_printer(…).str() to the DBUG_LOG macro that was introduced in MDEV-11713.
Diffstat (limited to 'storage/innobase/btr/btr0cur.cc')
-rw-r--r--storage/innobase/btr/btr0cur.cc54
1 files changed, 17 insertions, 37 deletions
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index 9033c399ce2..bdf3bd2eca7 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -3012,18 +3012,10 @@ fail_err:
page_cursor = btr_cur_get_page_cur(cursor);
-#ifdef UNIV_DEBUG
- {
- rec_printer p(entry);
- DBUG_PRINT("ib_cur", ("insert %s (" IB_ID_FMT ") by " IB_ID_FMT " %s",
- index->name(), index->id,
- thr != NULL
- ? trx_get_id_for_print(thr_get_trx(thr))
- : 0,
- p.str().c_str()));
- }
-#endif
-
+ DBUG_LOG("ib_cur",
+ "insert " << index->name << " (" << index->id << ") by "
+ << ib::hex(thr ? trx_get_id_for_print(thr_get_trx(thr)) : 0)
+ << ' ' << rec_printer(entry).str());
DBUG_EXECUTE_IF("do_page_reorganize",
btr_page_reorganize(page_cursor, index, mtr););
@@ -3635,14 +3627,10 @@ btr_cur_update_in_place(
ut_ad(fil_page_index_page_check(btr_cur_get_page(cursor)));
ut_ad(btr_page_get_index_id(btr_cur_get_page(cursor)) == index->id);
-#ifdef UNIV_DEBUG
- {
- rec_printer p(rec, offsets);
- DBUG_PRINT("ib_cur", ("update-in-place %s (" IB_ID_FMT ") by " IB_ID_FMT ": %s",
- index->name(), index->id, trx_id,
- p.str().c_str()));
- }
-#endif
+ DBUG_LOG("ib_cur",
+ "update-in-place " << index->name << " (" << index->id
+ << ") by " << ib::hex(trx_id) << ": "
+ << rec_printer(rec, offsets).str());
block = btr_cur_get_block(cursor);
page_zip = buf_block_get_page_zip(block);
@@ -3842,14 +3830,10 @@ any_extern:
}
}
-#ifdef UNIV_DEBUG
- {
- rec_printer p(rec, *offsets);
- DBUG_PRINT("ib_cur", ("update %s (" IB_ID_FMT ") by " IB_ID_FMT ": %s",
- index->name(), index->id, trx_id,
- p.str().c_str()));
- }
-#endif
+ DBUG_LOG("ib_cur",
+ "update " << index->name << " (" << index->id << ") by "
+ << ib::hex(trx_id) << ": "
+ << rec_printer(rec, *offsets).str());
page_cursor = btr_cur_get_page_cur(cursor);
@@ -4669,15 +4653,11 @@ btr_cur_del_mark_set_clust_rec(
ut_ad(trx_state_eq(trx, TRX_STATE_ACTIVE));
ut_ad(!trx->in_rollback);
-#ifdef UNIV_DEBUG
- {
- rec_printer p(rec, offsets);
- DBUG_PRINT("ib_cur", ("delete-mark clust %s (" IB_ID_FMT ") by " IB_ID_FMT ": %s",
- index->table_name, index->id,
- trx_get_id_for_print(trx),
- p.str().c_str()));
- }
-#endif
+ DBUG_LOG("ib_cur",
+ "delete-mark clust " << index->table->name
+ << " (" << index->id << ") by "
+ << ib::hex(trx_get_id_for_print(trx)) << ": "
+ << rec_printer(rec, offsets).str());
if (dict_index_is_online_ddl(index)) {
row_log_table_delete(rec, entry, index, offsets, NULL);