innodb_ruby 0.9.16 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +5 -6
- data/bin/innodb_log +13 -18
- data/bin/innodb_space +377 -757
- data/lib/innodb.rb +4 -5
- data/lib/innodb/checksum.rb +26 -24
- data/lib/innodb/data_dictionary.rb +490 -550
- data/lib/innodb/data_type.rb +362 -326
- data/lib/innodb/field.rb +102 -89
- data/lib/innodb/fseg_entry.rb +22 -26
- data/lib/innodb/history.rb +21 -21
- data/lib/innodb/history_list.rb +72 -76
- data/lib/innodb/ibuf_bitmap.rb +36 -36
- data/lib/innodb/ibuf_index.rb +6 -2
- data/lib/innodb/index.rb +245 -276
- data/lib/innodb/inode.rb +154 -155
- data/lib/innodb/list.rb +191 -183
- data/lib/innodb/log.rb +139 -110
- data/lib/innodb/log_block.rb +100 -91
- data/lib/innodb/log_group.rb +53 -64
- data/lib/innodb/log_reader.rb +97 -96
- data/lib/innodb/log_record.rb +328 -279
- data/lib/innodb/lsn.rb +86 -81
- data/lib/innodb/page.rb +417 -414
- data/lib/innodb/page/blob.rb +82 -83
- data/lib/innodb/page/fsp_hdr_xdes.rb +174 -165
- data/lib/innodb/page/ibuf_bitmap.rb +34 -34
- data/lib/innodb/page/index.rb +964 -943
- data/lib/innodb/page/index_compressed.rb +34 -34
- data/lib/innodb/page/inode.rb +103 -112
- data/lib/innodb/page/sys.rb +13 -15
- data/lib/innodb/page/sys_data_dictionary_header.rb +81 -59
- data/lib/innodb/page/sys_ibuf_header.rb +45 -42
- data/lib/innodb/page/sys_rseg_header.rb +88 -82
- data/lib/innodb/page/trx_sys.rb +204 -182
- data/lib/innodb/page/undo_log.rb +106 -92
- data/lib/innodb/record.rb +121 -160
- data/lib/innodb/record_describer.rb +66 -68
- data/lib/innodb/space.rb +380 -418
- data/lib/innodb/stats.rb +33 -35
- data/lib/innodb/system.rb +149 -171
- data/lib/innodb/undo_log.rb +129 -107
- data/lib/innodb/undo_record.rb +255 -247
- data/lib/innodb/util/buffer_cursor.rb +81 -79
- data/lib/innodb/util/read_bits_at_offset.rb +2 -1
- data/lib/innodb/version.rb +2 -2
- data/lib/innodb/xdes.rb +144 -142
- metadata +80 -11
@@ -1,45 +1,48 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Innodb
|
4
|
+
class Page
|
5
|
+
class SysIbufHeader < Page
|
6
|
+
Header = Struct.new(
|
7
|
+
:fseg,
|
8
|
+
keyword_init: true
|
9
|
+
)
|
10
|
+
|
11
|
+
def pos_ibuf_header
|
12
|
+
pos_page_body
|
13
|
+
end
|
14
|
+
|
15
|
+
def size_ibuf_header
|
16
|
+
Innodb::FsegEntry::SIZE
|
17
|
+
end
|
18
|
+
|
19
|
+
def ibuf_header
|
20
|
+
cursor(pos_ibuf_header).name("ibuf_header") do |c|
|
21
|
+
Header.new(
|
22
|
+
fseg: c.name("fseg") { Innodb::FsegEntry.get_inode(space, c) }
|
23
|
+
)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def each_region(&block)
|
28
|
+
return enum_for(:each_region) unless block_given?
|
29
|
+
|
30
|
+
super(&block)
|
31
|
+
|
32
|
+
yield Region.new(
|
33
|
+
offset: pos_ibuf_header,
|
34
|
+
length: size_ibuf_header,
|
35
|
+
name: :ibuf_header,
|
36
|
+
info: "Insert Buffer Header"
|
37
|
+
)
|
38
|
+
end
|
39
|
+
|
40
|
+
def dump
|
41
|
+
super
|
42
|
+
|
43
|
+
puts "ibuf header:"
|
44
|
+
pp ibuf_header
|
45
|
+
end
|
29
46
|
end
|
30
|
-
|
31
|
-
yield({
|
32
|
-
:offset => pos_ibuf_header,
|
33
|
-
:length => size_ibuf_header,
|
34
|
-
:name => :ibuf_header,
|
35
|
-
:info => "Insert Buffer Header",
|
36
|
-
})
|
37
|
-
end
|
38
|
-
|
39
|
-
def dump
|
40
|
-
super
|
41
|
-
|
42
|
-
puts "ibuf header:"
|
43
|
-
pp ibuf_header
|
44
47
|
end
|
45
48
|
end
|
@@ -1,99 +1,105 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Innodb
|
4
|
+
class Page
|
5
|
+
class SysRsegHeader < Page
|
6
|
+
Header = Struct.new(
|
7
|
+
:max_size,
|
8
|
+
:history_size,
|
9
|
+
:history_list,
|
10
|
+
:fseg,
|
11
|
+
keyword_init: true
|
12
|
+
)
|
13
|
+
|
14
|
+
# The number of undo log slots in the page.
|
15
|
+
UNDO_SEGMENT_SLOTS = 1024
|
16
|
+
|
17
|
+
# The position of the rollback segment header within the page.
|
18
|
+
def pos_rseg_header
|
19
|
+
pos_page_body
|
20
|
+
end
|
16
21
|
|
17
|
-
|
18
|
-
|
19
|
-
|
22
|
+
# The size of the rollback segment header.
|
23
|
+
def size_rseg_header
|
24
|
+
4 + 4 + Innodb::List::BASE_NODE_SIZE + Innodb::FsegEntry::SIZE
|
25
|
+
end
|
20
26
|
|
21
|
-
|
22
|
-
|
23
|
-
|
27
|
+
def pos_undo_segment_array
|
28
|
+
pos_rseg_header + size_rseg_header
|
29
|
+
end
|
24
30
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
{
|
29
|
-
:max_size => c.name("max_size") { c.get_uint32 },
|
30
|
-
:history_size => c.name("history_size") { c.get_uint32 },
|
31
|
-
:history_list => c.name("history_list") {
|
32
|
-
Innodb::List::History.new(@space, Innodb::List.get_base_node(c))
|
33
|
-
},
|
34
|
-
:fseg => c.name("fseg") { Innodb::FsegEntry.get_inode(@space, c) },
|
35
|
-
}
|
36
|
-
end
|
37
|
-
end
|
31
|
+
def size_undo_segment_slot
|
32
|
+
4
|
33
|
+
end
|
38
34
|
|
39
|
-
|
40
|
-
|
41
|
-
|
35
|
+
# Parse the rollback segment header from the page.
|
36
|
+
def rseg_header
|
37
|
+
cursor(pos_rseg_header).name("rseg_header") do |c|
|
38
|
+
Header.new(
|
39
|
+
max_size: c.name("max_size") { c.read_uint32 },
|
40
|
+
history_size: c.name("history_size") { c.read_uint32 },
|
41
|
+
history_list: c.name("history_list") do
|
42
|
+
Innodb::List::History.new(@space, Innodb::List.get_base_node(c))
|
43
|
+
end,
|
44
|
+
fseg: c.name("fseg") { Innodb::FsegEntry.get_inode(@space, c) }
|
45
|
+
)
|
46
|
+
end
|
47
|
+
end
|
42
48
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
end
|
49
|
+
def history_list
|
50
|
+
Innodb::HistoryList.new(rseg_header.history_list)
|
51
|
+
end
|
47
52
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
53
|
+
def each_undo_segment
|
54
|
+
return enum_for(:each_undo_segment) unless block_given?
|
55
|
+
|
56
|
+
cursor(pos_undo_segment_array).name("undo_segment_array") do |c|
|
57
|
+
(0...UNDO_SEGMENT_SLOTS).each do |slot|
|
58
|
+
page_number = c.name("slot[#{slot}]") do
|
59
|
+
Innodb::Page.maybe_undefined(c.read_uint32)
|
60
|
+
end
|
61
|
+
yield slot, page_number
|
62
|
+
end
|
63
|
+
end
|
54
64
|
end
|
55
|
-
end
|
56
|
-
end
|
57
65
|
|
58
|
-
|
59
|
-
|
60
|
-
return enum_for(:each_region)
|
61
|
-
end
|
66
|
+
def each_region(&block)
|
67
|
+
return enum_for(:each_region) unless block_given?
|
62
68
|
|
63
|
-
|
64
|
-
yield region
|
65
|
-
end
|
69
|
+
super(&block)
|
66
70
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
(0...UNDO_SEGMENT_SLOTS).each do |slot|
|
75
|
-
yield({
|
76
|
-
:offset => pos_undo_segment_array + (slot * size_undo_segment_slot),
|
77
|
-
:length => size_undo_segment_slot,
|
78
|
-
:name => :undo_segment_slot,
|
79
|
-
:info => "Undo Segment Slot",
|
80
|
-
})
|
81
|
-
end
|
71
|
+
yield Region.new(
|
72
|
+
offset: pos_rseg_header,
|
73
|
+
length: size_rseg_header,
|
74
|
+
name: :rseg_header,
|
75
|
+
info: "Rollback Segment Header"
|
76
|
+
)
|
82
77
|
|
83
|
-
|
84
|
-
|
78
|
+
(0...UNDO_SEGMENT_SLOTS).each do |slot|
|
79
|
+
yield Region.new(
|
80
|
+
offset: pos_undo_segment_array + (slot * size_undo_segment_slot),
|
81
|
+
length: size_undo_segment_slot,
|
82
|
+
name: :undo_segment_slot,
|
83
|
+
info: "Undo Segment Slot"
|
84
|
+
)
|
85
|
+
end
|
85
86
|
|
86
|
-
|
87
|
-
|
87
|
+
nil
|
88
|
+
end
|
89
|
+
|
90
|
+
def dump
|
91
|
+
super
|
88
92
|
|
89
|
-
|
90
|
-
|
91
|
-
|
93
|
+
puts
|
94
|
+
puts "rollback segment header:"
|
95
|
+
pp rseg_header
|
92
96
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
+
puts
|
98
|
+
puts "undo segment array:"
|
99
|
+
each_undo_segment do |slot, page_number|
|
100
|
+
puts " #{slot}: #{page_number}"
|
101
|
+
end
|
102
|
+
end
|
97
103
|
end
|
98
104
|
end
|
99
105
|
end
|
data/lib/innodb/page/trx_sys.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "forwardable"
|
2
4
|
|
3
5
|
# A specialized class for TRX_SYS pages, which contain various information
|
4
6
|
# about the transaction system within InnoDB. Only one TRX_SYS page exists in
|
@@ -9,207 +11,227 @@
|
|
9
11
|
# empty space, master binary log information, empty space, local binary
|
10
12
|
# log information, empty space, doublewrite information (repeated twice),
|
11
13
|
# empty space, and FIL trailer.
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
module Innodb
|
15
|
+
class Page
|
16
|
+
class TrxSys < Page
|
17
|
+
extend Forwardable
|
18
|
+
|
19
|
+
specialization_for :TRX_SYS
|
20
|
+
|
21
|
+
RsegSlot = Struct.new(
|
22
|
+
:offset,
|
23
|
+
:space_id,
|
24
|
+
:page_number,
|
25
|
+
keyword_init: true
|
26
|
+
)
|
27
|
+
|
28
|
+
MysqlLogInfo = Struct.new(
|
29
|
+
:magic_n,
|
30
|
+
:offset,
|
31
|
+
:name,
|
32
|
+
keyword_init: true
|
33
|
+
)
|
34
|
+
|
35
|
+
DoublewritePageInfo = Struct.new(
|
36
|
+
:magic_n,
|
37
|
+
:page_number,
|
38
|
+
keyword_init: true
|
39
|
+
)
|
40
|
+
|
41
|
+
DoublewriteInfo = Struct.new(
|
42
|
+
:fseg,
|
43
|
+
:page_info,
|
44
|
+
:space_id_stored,
|
45
|
+
keyword_init: true
|
46
|
+
)
|
47
|
+
|
48
|
+
Header = Struct.new(
|
49
|
+
:trx_id,
|
50
|
+
:fseg,
|
51
|
+
:rsegs,
|
52
|
+
:binary_log,
|
53
|
+
:master_log,
|
54
|
+
:doublewrite,
|
55
|
+
keyword_init: true
|
56
|
+
)
|
57
|
+
|
58
|
+
# The TRX_SYS header immediately follows the FIL header.
|
59
|
+
def pos_trx_sys_header
|
60
|
+
pos_page_body
|
61
|
+
end
|
17
62
|
|
18
|
-
|
19
|
-
|
20
|
-
|
63
|
+
def size_trx_sys_header
|
64
|
+
8 + Innodb::FsegEntry::SIZE
|
65
|
+
end
|
21
66
|
|
22
|
-
|
23
|
-
|
24
|
-
|
67
|
+
def pos_rsegs_array
|
68
|
+
pos_trx_sys_header + size_trx_sys_header
|
69
|
+
end
|
25
70
|
|
26
|
-
|
27
|
-
|
28
|
-
|
71
|
+
def size_mysql_log_info
|
72
|
+
4 + 8 + 100
|
73
|
+
end
|
29
74
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
75
|
+
# The master's binary log information is located 2000 bytes from the end of
|
76
|
+
# the page.
|
77
|
+
def pos_mysql_master_log_info
|
78
|
+
size - 2_000
|
79
|
+
end
|
35
80
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
81
|
+
# The local binary log information is located 1000 bytes from the end of
|
82
|
+
# the page.
|
83
|
+
def pos_mysql_binary_log_info
|
84
|
+
size - 1_000
|
85
|
+
end
|
41
86
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
87
|
+
# The doublewrite buffer information is located 200 bytes from the end of
|
88
|
+
# the page.
|
89
|
+
def pos_doublewrite_info
|
90
|
+
size - 200
|
91
|
+
end
|
47
92
|
|
48
|
-
|
49
|
-
|
50
|
-
|
93
|
+
def size_doublewrite_info
|
94
|
+
Innodb::FsegEntry::SIZE + (2 * (4 + 4 + 4)) + 4
|
95
|
+
end
|
51
96
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
}
|
69
|
-
|
70
|
-
|
71
|
-
|
97
|
+
# A magic number present in each MySQL binary log information structure,
|
98
|
+
# which helps identify whether the structure is populated or not.
|
99
|
+
MYSQL_LOG_MAGIC_N = 873_422_344
|
100
|
+
|
101
|
+
# A magic number present in each doublewrite buffer information structure,
|
102
|
+
# which helps identify whether the structure is populated or not.
|
103
|
+
DOUBLEWRITE_MAGIC_N = 536_853_855
|
104
|
+
|
105
|
+
# A magic number present in the overall doublewrite buffer structure,
|
106
|
+
# which identifies whether the space id is stored.
|
107
|
+
DOUBLEWRITE_SPACE_ID_STORED_MAGIC_N = 1_783_657_386
|
108
|
+
|
109
|
+
N_RSEGS = 128
|
110
|
+
|
111
|
+
def rsegs_array(cursor)
|
112
|
+
@rsegs_array ||= N_RSEGS.times.each_with_object([]) do |n, a|
|
113
|
+
cursor.name("slot[#{n}]") do |c|
|
114
|
+
slot = RsegSlot.new(
|
115
|
+
offset: c.position,
|
116
|
+
space_id: c.name("space_id") { Innodb::Page.maybe_undefined(c.read_uint32) },
|
117
|
+
page_number: c.name("page_number") { Innodb::Page.maybe_undefined(c.read_uint32) }
|
118
|
+
)
|
119
|
+
a << slot if slot.space_id && slot.page_number
|
120
|
+
end
|
72
121
|
end
|
73
122
|
end
|
74
|
-
a
|
75
|
-
end
|
76
|
-
end
|
77
123
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
124
|
+
# Read a MySQL binary log information structure from a given position.
|
125
|
+
def mysql_log_info(cursor, offset)
|
126
|
+
cursor.peek(offset) do |c|
|
127
|
+
magic_n = c.name("magic_n") { c.read_uint32 } == MYSQL_LOG_MAGIC_N
|
128
|
+
break unless magic_n
|
129
|
+
|
130
|
+
MysqlLogInfo.new(
|
131
|
+
magic_n: magic_n,
|
132
|
+
offset: c.name("offset") { c.read_uint64 },
|
133
|
+
name: c.name("name") { c.read_bytes(100) }
|
134
|
+
)
|
135
|
+
end
|
86
136
|
end
|
87
|
-
end
|
88
|
-
end
|
89
137
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
# Read a single doublewrite buffer information structure from a given cursor.
|
95
|
-
def doublewrite_page_info(cursor)
|
96
|
-
{
|
97
|
-
:magic_n => cursor.name("magic_n") { cursor.get_uint32 },
|
98
|
-
:page_number => [
|
99
|
-
cursor.name("page[0]") { cursor.get_uint32 },
|
100
|
-
cursor.name("page[1]") { cursor.get_uint32 },
|
101
|
-
],
|
102
|
-
}
|
103
|
-
end
|
138
|
+
# Read a single doublewrite buffer information structure from a given cursor.
|
139
|
+
def doublewrite_page_info(cursor)
|
140
|
+
magic_n = cursor.name("magic_n") { cursor.read_uint32 }
|
104
141
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
# Read the overall doublewrite buffer structures
|
110
|
-
def doublewrite_info(cursor)
|
111
|
-
cursor.peek(pos_doublewrite_info) do |c_doublewrite|
|
112
|
-
c_doublewrite.name("doublewrite") do |c|
|
113
|
-
{
|
114
|
-
:fseg => c.name("fseg") { Innodb::FsegEntry.get_inode(@space, c) },
|
115
|
-
:page_info => [
|
116
|
-
c.name("group[0]") { doublewrite_page_info(c) },
|
117
|
-
c.name("group[1]") { doublewrite_page_info(c) },
|
118
|
-
],
|
119
|
-
:space_id_stored =>
|
120
|
-
(c.name("space_id_stored") { c.get_uint32 } ==
|
121
|
-
DOUBLEWRITE_SPACE_ID_STORED_MAGIC_N),
|
122
|
-
}
|
142
|
+
DoublewritePageInfo.new(
|
143
|
+
magic_n: magic_n,
|
144
|
+
page_number: [0, 1].map { |n| cursor.name("page[#{n}]") { cursor.read_uint32 } }
|
145
|
+
)
|
123
146
|
end
|
124
|
-
end
|
125
|
-
end
|
126
147
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
mysql_log_info(c, pos_mysql_binary_log_info)
|
140
|
-
},
|
141
|
-
:master_log => c.name("master_log") {
|
142
|
-
mysql_log_info(c, pos_mysql_master_log_info)
|
143
|
-
},
|
144
|
-
:doublewrite => doublewrite_info(c),
|
145
|
-
}
|
146
|
-
end
|
147
|
-
end
|
148
|
-
|
149
|
-
def trx_id; trx_sys[:trx_id]; end
|
150
|
-
def fseg; trx_sys[:fseg]; end
|
151
|
-
def rsegs; trx_sys[:rsegs]; end
|
152
|
-
def binary_log; trx_sys[:binary_log]; end
|
153
|
-
def master_log; trx_sys[:master_log]; end
|
154
|
-
def doublewrite; trx_sys[:doublewrite]; end
|
155
|
-
|
156
|
-
def each_region
|
157
|
-
unless block_given?
|
158
|
-
return enum_for(:each_region)
|
159
|
-
end
|
148
|
+
# Read the overall doublewrite buffer structures
|
149
|
+
def doublewrite_info(cursor)
|
150
|
+
cursor.peek(pos_doublewrite_info) do |c_doublewrite|
|
151
|
+
c_doublewrite.name("doublewrite") do |c|
|
152
|
+
DoublewriteInfo.new(
|
153
|
+
fseg: c.name("fseg") { Innodb::FsegEntry.get_inode(@space, c) },
|
154
|
+
page_info: [0, 1].map { |n| c.name("group[#{n}]") { doublewrite_page_info(c) } },
|
155
|
+
space_id_stored: (c.name("space_id_stored") { c.read_uint32 } == DOUBLEWRITE_SPACE_ID_STORED_MAGIC_N)
|
156
|
+
)
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|
160
160
|
|
161
|
-
|
162
|
-
|
163
|
-
|
161
|
+
# Read the TRX_SYS headers and other information.
|
162
|
+
def trx_sys
|
163
|
+
@trx_sys ||= cursor(pos_trx_sys_header).name("trx_sys") do |c|
|
164
|
+
Header.new(
|
165
|
+
trx_id: c.name("trx_id") { c.read_uint64 },
|
166
|
+
fseg: c.name("fseg") { Innodb::FsegEntry.get_inode(@space, c) },
|
167
|
+
rsegs: c.name("rsegs") { rsegs_array(c) },
|
168
|
+
binary_log: c.name("binary_log") { mysql_log_info(c, pos_mysql_binary_log_info) },
|
169
|
+
master_log: c.name("master_log") { mysql_log_info(c, pos_mysql_master_log_info) },
|
170
|
+
doublewrite: doublewrite_info(c)
|
171
|
+
)
|
172
|
+
end
|
173
|
+
end
|
164
174
|
|
165
|
-
|
166
|
-
:
|
167
|
-
:
|
168
|
-
:
|
169
|
-
:
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
175
|
+
def_delegator :trx_sys, :trx_id
|
176
|
+
def_delegator :trx_sys, :fseg
|
177
|
+
def_delegator :trx_sys, :rsegs
|
178
|
+
def_delegator :trx_sys, :binary_log
|
179
|
+
def_delegator :trx_sys, :master_log
|
180
|
+
def_delegator :trx_sys, :doublewrite
|
181
|
+
|
182
|
+
def each_region(&block)
|
183
|
+
return enum_for(:each_region) unless block_given?
|
184
|
+
|
185
|
+
super(&block)
|
186
|
+
|
187
|
+
yield Region.new(
|
188
|
+
offset: pos_trx_sys_header,
|
189
|
+
length: size_trx_sys_header,
|
190
|
+
name: :trx_sys_header,
|
191
|
+
info: "Transaction System Header"
|
192
|
+
)
|
193
|
+
|
194
|
+
rsegs.each do |rseg|
|
195
|
+
yield Region.new(
|
196
|
+
offset: rseg[:offset],
|
197
|
+
length: 4 + 4,
|
198
|
+
name: :rseg,
|
199
|
+
info: "Rollback Segment"
|
200
|
+
)
|
201
|
+
end
|
180
202
|
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
203
|
+
yield Region.new(
|
204
|
+
offset: pos_mysql_binary_log_info,
|
205
|
+
length: size_mysql_log_info,
|
206
|
+
name: :mysql_binary_log_info,
|
207
|
+
info: "Binary Log Info"
|
208
|
+
)
|
209
|
+
|
210
|
+
yield Region.new(
|
211
|
+
offset: pos_mysql_master_log_info,
|
212
|
+
length: size_mysql_log_info,
|
213
|
+
name: :mysql_master_log_info,
|
214
|
+
info: "Master Log Info"
|
215
|
+
)
|
216
|
+
|
217
|
+
yield Region.new(
|
218
|
+
offset: pos_doublewrite_info,
|
219
|
+
length: size_doublewrite_info,
|
220
|
+
name: :doublewrite_info,
|
221
|
+
info: "Double Write Buffer Info"
|
222
|
+
)
|
223
|
+
|
224
|
+
nil
|
225
|
+
end
|
204
226
|
|
205
|
-
|
206
|
-
|
207
|
-
|
227
|
+
# Dump the contents of a page for debugging purposes.
|
228
|
+
def dump
|
229
|
+
super
|
208
230
|
|
209
|
-
|
210
|
-
|
211
|
-
|
231
|
+
puts "trx_sys:"
|
232
|
+
pp trx_sys
|
233
|
+
puts
|
234
|
+
end
|
235
|
+
end
|
212
236
|
end
|
213
237
|
end
|
214
|
-
|
215
|
-
Innodb::Page::SPECIALIZED_CLASSES[:TRX_SYS] = Innodb::Page::TrxSys
|