@@ -64,61 +64,44 @@ operator<<(std::ostream& out, const lock_table_t& lock)
64
64
return (lock.print (out));
65
65
}
66
66
67
- /* * Convert the member 'type_mode' into a human readable string.
68
- @return human readable string */
69
- inline
70
- std::string
71
- ib_lock_t ::type_mode_string() const
72
- {
73
- std::ostringstream sout;
74
- sout << type_string ();
75
- static_assert (LOCK_MODE_MASK == 7 , " compatibility" );
76
- static_assert (LOCK_IS == 0 , " compatibility" );
77
- static_assert (LOCK_IX == 1 , " compatibility" );
78
- static_assert (LOCK_S == 2 , " compatibility" );
79
- static_assert (LOCK_X == 3 , " compatibility" );
80
- static_assert (LOCK_AUTO_INC == 4 , " compatibility" );
81
- static_assert (LOCK_NONE == 5 , " compatibility" );
82
- static_assert (LOCK_NONE_UNSET == 7 , " compatibility" );
83
- const char * const modes[8 ] = {
84
- " IS" , " IX" , " S" , " X" , " AUTO_INC" , " NONE" , " ?" , " NONE_UNSET"
85
- };
86
-
87
- sout << " | LOCK_" << modes[mode ()];
88
-
89
- if (is_record_not_gap ()) {
90
- sout << " | LOCK_REC_NOT_GAP" ;
91
- }
92
-
93
- if (is_waiting ()) {
94
- sout << " | LOCK_WAIT" ;
95
- }
96
-
97
- if (is_gap ()) {
98
- sout << " | LOCK_GAP" ;
99
- }
100
-
101
- if (is_insert_intention ()) {
102
- sout << " | LOCK_INSERT_INTENTION" ;
103
- }
104
- return (sout.str ());
105
- }
106
-
107
67
inline
108
68
std::ostream&
109
69
ib_lock_t ::print(std::ostream& out) const
110
70
{
111
- out << " [lock_t: type_mode=" << type_mode << " ("
112
- << type_mode_string () << " )" ;
113
-
114
- if (is_record_lock ()) {
115
- out << un_member.rec_lock ;
116
- } else {
117
- out << un_member.tab_lock ;
118
- }
119
-
120
- out << " ]" ;
121
- return (out);
71
+ static_assert (LOCK_MODE_MASK == 7 , " compatibility" );
72
+ static_assert (LOCK_IS == 0 , " compatibility" );
73
+ static_assert (LOCK_IX == 1 , " compatibility" );
74
+ static_assert (LOCK_S == 2 , " compatibility" );
75
+ static_assert (LOCK_X == 3 , " compatibility" );
76
+ static_assert (LOCK_AUTO_INC == 4 , " compatibility" );
77
+ static_assert (LOCK_NONE == 5 , " compatibility" );
78
+ static_assert (LOCK_NONE_UNSET == 7 , " compatibility" );
79
+ const char *const modes[8 ]=
80
+ { " IS" , " IX" , " S" , " X" , " AUTO_INC" , " NONE" , " ?" , " NONE_UNSET" };
81
+
82
+ out << " [lock_t: type_mode=" << type_mode << " (" << type_string ()
83
+ << " | LOCK_" << modes[mode ()];
84
+
85
+ if (is_record_not_gap ())
86
+ out << " | LOCK_REC_NOT_GAP" ;
87
+ if (is_waiting ())
88
+ out << " | LOCK_WAIT" ;
89
+
90
+ if (is_gap ())
91
+ out << " | LOCK_GAP" ;
92
+
93
+ if (is_insert_intention ())
94
+ out << " | LOCK_INSERT_INTENTION" ;
95
+
96
+ out << " )" ;
97
+
98
+ if (is_record_lock ())
99
+ out << un_member.rec_lock ;
100
+ else
101
+ out << un_member.tab_lock ;
102
+
103
+ out << " ]" ;
104
+ return out;
122
105
}
123
106
124
107
inline
0 commit comments