summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-01-15 16:32:37 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2021-01-27 15:45:39 +0200
commitb32f057da78adb88ebca66708c5ff6c6cfde753b (patch)
tree8a85936298f0640dd20349bc4d8ea25c43db9d05
parent462cb66662c761500a80d2e26b2c98320dc82a4d (diff)
downloadmariadb-git-b32f057da78adb88ebca66708c5ff6c6cfde753b.tar.gz
Cleanup: Remove ib_lock_t::type_mode_string()
-rw-r--r--storage/innobase/include/lock0priv.h85
-rw-r--r--storage/innobase/include/lock0types.h4
2 files changed, 34 insertions, 55 deletions
diff --git a/storage/innobase/include/lock0priv.h b/storage/innobase/include/lock0priv.h
index 6da5e0f1402..6db12b30177 100644
--- a/storage/innobase/include/lock0priv.h
+++ b/storage/innobase/include/lock0priv.h
@@ -64,61 +64,44 @@ operator<<(std::ostream& out, const lock_table_t& lock)
return(lock.print(out));
}
-/** Convert the member 'type_mode' into a human readable string.
-@return human readable string */
-inline
-std::string
-ib_lock_t::type_mode_string() const
-{
- std::ostringstream sout;
- sout << type_string();
- static_assert(LOCK_MODE_MASK == 7, "compatibility");
- static_assert(LOCK_IS == 0, "compatibility");
- static_assert(LOCK_IX == 1, "compatibility");
- static_assert(LOCK_S == 2, "compatibility");
- static_assert(LOCK_X == 3, "compatibility");
- static_assert(LOCK_AUTO_INC == 4, "compatibility");
- static_assert(LOCK_NONE == 5, "compatibility");
- static_assert(LOCK_NONE_UNSET == 7, "compatibility");
- const char * const modes[8] = {
- "IS", "IX", "S", "X", "AUTO_INC", "NONE", "?", "NONE_UNSET"
- };
-
- sout << " | LOCK_" << modes[mode()];
-
- if (is_record_not_gap()) {
- sout << " | LOCK_REC_NOT_GAP";
- }
-
- if (is_waiting()) {
- sout << " | LOCK_WAIT";
- }
-
- if (is_gap()) {
- sout << " | LOCK_GAP";
- }
-
- if (is_insert_intention()) {
- sout << " | LOCK_INSERT_INTENTION";
- }
- return(sout.str());
-}
-
inline
std::ostream&
ib_lock_t::print(std::ostream& out) const
{
- out << "[lock_t: type_mode=" << type_mode << "("
- << type_mode_string() << ")";
-
- if (is_record_lock()) {
- out << un_member.rec_lock;
- } else {
- out << un_member.tab_lock;
- }
-
- out << "]";
- return(out);
+ static_assert(LOCK_MODE_MASK == 7, "compatibility");
+ static_assert(LOCK_IS == 0, "compatibility");
+ static_assert(LOCK_IX == 1, "compatibility");
+ static_assert(LOCK_S == 2, "compatibility");
+ static_assert(LOCK_X == 3, "compatibility");
+ static_assert(LOCK_AUTO_INC == 4, "compatibility");
+ static_assert(LOCK_NONE == 5, "compatibility");
+ static_assert(LOCK_NONE_UNSET == 7, "compatibility");
+ const char *const modes[8]=
+ { "IS", "IX", "S", "X", "AUTO_INC", "NONE", "?", "NONE_UNSET" };
+
+ out << "[lock_t: type_mode=" << type_mode << "(" << type_string()
+ << " | LOCK_" << modes[mode()];
+
+ if (is_record_not_gap())
+ out << " | LOCK_REC_NOT_GAP";
+ if (is_waiting())
+ out << " | LOCK_WAIT";
+
+ if (is_gap())
+ out << " | LOCK_GAP";
+
+ if (is_insert_intention())
+ out << " | LOCK_INSERT_INTENTION";
+
+ out << ")";
+
+ if (is_record_lock())
+ out << un_member.rec_lock;
+ else
+ out << un_member.tab_lock;
+
+ out << "]";
+ return out;
}
inline
diff --git a/storage/innobase/include/lock0types.h b/storage/innobase/include/lock0types.h
index f8bd308a8cc..b830fe10104 100644
--- a/storage/innobase/include/lock0types.h
+++ b/storage/innobase/include/lock0types.h
@@ -225,10 +225,6 @@ struct ib_lock_t
@return the given output stream. */
std::ostream& print(std::ostream& out) const;
- /** Convert the member 'type_mode' into a human readable string.
- @return human readable string */
- std::string type_mode_string() const;
-
const char* type_string() const
{
switch (type_mode & LOCK_TYPE_MASK) {