summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2020-12-24 20:47:21 +0300
committerAleksey Midenkov <midenok@gmail.com>2020-12-24 21:01:28 +0300
commit8e16c885a860a987eab4f3689e28288e0594e708 (patch)
treeddcb9b391161cda44ad7e8931d8035df38bc1087
parentf87737db0424a981926868b50b383ad741b40803 (diff)
downloadmariadb-git-8e16c885a860a987eab4f3689e28288e0594e708.tar.gz
MDEV-24476 Overloaded functions dbug_print_rec break compilation in 10.3
dbug_print_rec() functions used to print data inside GDB.
-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 6d2b84625f7..d331beb9230 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
@@ -627,4 +630,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 */