summaryrefslogtreecommitdiff
path: root/storage/innobase/ut/ut0ut.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2021-01-06 10:53:00 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2021-01-06 10:53:00 +0100
commit02e7bff882c5169ba3e1ce7e9a93d4c28fe3afd1 (patch)
tree4a6a8d578fedb4c2b1f437ab39c2d7430ad95163 /storage/innobase/ut/ut0ut.cc
parent5f10870c8a8c2448bfc26d990110390d48000b84 (diff)
parent478b83032b170b2ae030fa77fe4bed60a7910472 (diff)
downloadmariadb-git-02e7bff882c5169ba3e1ce7e9a93d4c28fe3afd1.tar.gz
Merge commit '10.4' into 10.5
Diffstat (limited to 'storage/innobase/ut/ut0ut.cc')
-rw-r--r--storage/innobase/ut/ut0ut.cc48
1 files changed, 48 insertions, 0 deletions
diff --git a/storage/innobase/ut/ut0ut.cc b/storage/innobase/ut/ut0ut.cc
index 3376698dba1..fa04af6de13 100644
--- a/storage/innobase/ut/ut0ut.cc
+++ b/storage/innobase/ut/ut0ut.cc
@@ -38,6 +38,9 @@ Created 5/11/1994 Heikki Tuuri
#include <string>
#include "log.h"
#include "my_cpu.h"
+#ifndef DBUG_OFF
+#include "rem0rec.h"
+#endif
/**********************************************************//**
Returns the number of milliseconds since some epoch. The
@@ -597,4 +600,49 @@ fatal_or_error::~fatal_or_error()
} // namespace ib
+#ifndef DBUG_OFF
+static char dbug_print_buf[1024];
+
+const char * dbug_print_rec(const rec_t* rec, const rec_offs* offsets)
+{
+ rec_printer r(rec, offsets);
+ strmake(dbug_print_buf, r.str().c_str(), sizeof(dbug_print_buf) - 1);
+ return dbug_print_buf;
+}
+
+const char * dbug_print_rec(const rec_t* rec, ulint info, const rec_offs* offsets)
+{
+ rec_printer r(rec, info, offsets);
+ strmake(dbug_print_buf, r.str().c_str(), sizeof(dbug_print_buf) - 1);
+ return dbug_print_buf;
+}
+
+const char * dbug_print_rec(const dtuple_t* tuple)
+{
+ rec_printer r(tuple);
+ strmake(dbug_print_buf, r.str().c_str(), sizeof(dbug_print_buf) - 1);
+ return dbug_print_buf;
+}
+
+const char * dbug_print_rec(const dfield_t* field, ulint n)
+{
+ rec_printer r(field, n);
+ strmake(dbug_print_buf, r.str().c_str(), sizeof(dbug_print_buf) - 1);
+ return dbug_print_buf;
+}
+
+const char * dbug_print_rec(const rec_t* rec, dict_index_t* index)
+{
+ rec_offs offsets_[REC_OFFS_NORMAL_SIZE];
+ rec_offs* offsets = offsets_;
+ rec_offs_init(offsets_);
+ mem_heap_t* tmp_heap = NULL;
+ offsets = rec_get_offsets(rec, index, offsets, true,
+ ULINT_UNDEFINED, &tmp_heap);
+ rec_printer r(rec, offsets);
+ strmake(dbug_print_buf, r.str().c_str(), sizeof(dbug_print_buf) - 1);
+ return dbug_print_buf;
+}
+#endif /* !DBUG_OFF */
+
#endif /* !UNIV_INNOCHECKSUM */