Commit b32f057d authored by Marko Mäkelä's avatar Marko Mäkelä

Cleanup: Remove ib_lock_t::type_mode_string()

parent 462cb666
...@@ -64,14 +64,10 @@ operator<<(std::ostream& out, const lock_table_t& lock) ...@@ -64,14 +64,10 @@ operator<<(std::ostream& out, const lock_table_t& lock)
return(lock.print(out)); return(lock.print(out));
} }
/** Convert the member 'type_mode' into a human readable string.
@return human readable string */
inline inline
std::string std::ostream&
ib_lock_t::type_mode_string() const ib_lock_t::print(std::ostream& out) const
{ {
std::ostringstream sout;
sout << type_string();
static_assert(LOCK_MODE_MASK == 7, "compatibility"); static_assert(LOCK_MODE_MASK == 7, "compatibility");
static_assert(LOCK_IS == 0, "compatibility"); static_assert(LOCK_IS == 0, "compatibility");
static_assert(LOCK_IX == 1, "compatibility"); static_assert(LOCK_IX == 1, "compatibility");
...@@ -80,45 +76,32 @@ ib_lock_t::type_mode_string() const ...@@ -80,45 +76,32 @@ ib_lock_t::type_mode_string() const
static_assert(LOCK_AUTO_INC == 4, "compatibility"); static_assert(LOCK_AUTO_INC == 4, "compatibility");
static_assert(LOCK_NONE == 5, "compatibility"); static_assert(LOCK_NONE == 5, "compatibility");
static_assert(LOCK_NONE_UNSET == 7, "compatibility"); static_assert(LOCK_NONE_UNSET == 7, "compatibility");
const char * const modes[8] = { const char *const modes[8]=
"IS", "IX", "S", "X", "AUTO_INC", "NONE", "?", "NONE_UNSET" { "IS", "IX", "S", "X", "AUTO_INC", "NONE", "?", "NONE_UNSET" };
};
sout << " | LOCK_" << modes[mode()]; out << "[lock_t: type_mode=" << type_mode << "(" << type_string()
<< " | LOCK_" << modes[mode()];
if (is_record_not_gap()) { if (is_record_not_gap())
sout << " | LOCK_REC_NOT_GAP"; out << " | LOCK_REC_NOT_GAP";
} if (is_waiting())
out << " | LOCK_WAIT";
if (is_waiting()) { if (is_gap())
sout << " | LOCK_WAIT"; out << " | LOCK_GAP";
}
if (is_gap()) { if (is_insert_intention())
sout << " | LOCK_GAP"; out << " | LOCK_INSERT_INTENTION";
}
if (is_insert_intention()) {
sout << " | LOCK_INSERT_INTENTION";
}
return(sout.str());
}
inline out << ")";
std::ostream&
ib_lock_t::print(std::ostream& out) const
{
out << "[lock_t: type_mode=" << type_mode << "("
<< type_mode_string() << ")";
if (is_record_lock()) { if (is_record_lock())
out << un_member.rec_lock; out << un_member.rec_lock;
} else { else
out << un_member.tab_lock; out << un_member.tab_lock;
}
out << "]"; out << "]";
return(out); return out;
} }
inline inline
......
...@@ -225,10 +225,6 @@ struct ib_lock_t ...@@ -225,10 +225,6 @@ struct ib_lock_t
@return the given output stream. */ @return the given output stream. */
std::ostream& print(std::ostream& out) const; 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 const char* type_string() const
{ {
switch (type_mode & LOCK_TYPE_MASK) { switch (type_mode & LOCK_TYPE_MASK) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment