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.
Files changed (48) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +5 -6
  3. data/bin/innodb_log +13 -18
  4. data/bin/innodb_space +377 -757
  5. data/lib/innodb.rb +4 -5
  6. data/lib/innodb/checksum.rb +26 -24
  7. data/lib/innodb/data_dictionary.rb +490 -550
  8. data/lib/innodb/data_type.rb +362 -326
  9. data/lib/innodb/field.rb +102 -89
  10. data/lib/innodb/fseg_entry.rb +22 -26
  11. data/lib/innodb/history.rb +21 -21
  12. data/lib/innodb/history_list.rb +72 -76
  13. data/lib/innodb/ibuf_bitmap.rb +36 -36
  14. data/lib/innodb/ibuf_index.rb +6 -2
  15. data/lib/innodb/index.rb +245 -276
  16. data/lib/innodb/inode.rb +154 -155
  17. data/lib/innodb/list.rb +191 -183
  18. data/lib/innodb/log.rb +139 -110
  19. data/lib/innodb/log_block.rb +100 -91
  20. data/lib/innodb/log_group.rb +53 -64
  21. data/lib/innodb/log_reader.rb +97 -96
  22. data/lib/innodb/log_record.rb +328 -279
  23. data/lib/innodb/lsn.rb +86 -81
  24. data/lib/innodb/page.rb +417 -414
  25. data/lib/innodb/page/blob.rb +82 -83
  26. data/lib/innodb/page/fsp_hdr_xdes.rb +174 -165
  27. data/lib/innodb/page/ibuf_bitmap.rb +34 -34
  28. data/lib/innodb/page/index.rb +964 -943
  29. data/lib/innodb/page/index_compressed.rb +34 -34
  30. data/lib/innodb/page/inode.rb +103 -112
  31. data/lib/innodb/page/sys.rb +13 -15
  32. data/lib/innodb/page/sys_data_dictionary_header.rb +81 -59
  33. data/lib/innodb/page/sys_ibuf_header.rb +45 -42
  34. data/lib/innodb/page/sys_rseg_header.rb +88 -82
  35. data/lib/innodb/page/trx_sys.rb +204 -182
  36. data/lib/innodb/page/undo_log.rb +106 -92
  37. data/lib/innodb/record.rb +121 -160
  38. data/lib/innodb/record_describer.rb +66 -68
  39. data/lib/innodb/space.rb +380 -418
  40. data/lib/innodb/stats.rb +33 -35
  41. data/lib/innodb/system.rb +149 -171
  42. data/lib/innodb/undo_log.rb +129 -107
  43. data/lib/innodb/undo_record.rb +255 -247
  44. data/lib/innodb/util/buffer_cursor.rb +81 -79
  45. data/lib/innodb/util/read_bits_at_offset.rb +2 -1
  46. data/lib/innodb/version.rb +2 -2
  47. data/lib/innodb/xdes.rb +144 -142
  48. metadata +80 -11
@@ -1,45 +1,48 @@
1
- # -*- encoding : utf-8 -*-
2
-
3
- class Innodb::Page::SysIbufHeader < Innodb::Page
4
- def pos_ibuf_header
5
- pos_page_body
6
- end
7
-
8
- def size_ibuf_header
9
- Innodb::FsegEntry::SIZE
10
- end
11
-
12
- def ibuf_header
13
- cursor(pos_ibuf_header).name("ibuf_header") do |c|
14
- {
15
- :fseg => c.name("fseg") {
16
- Innodb::FsegEntry.get_inode(space, c)
17
- }
18
- }
19
- end
20
- end
21
-
22
- def each_region
23
- unless block_given?
24
- return enum_for(:each_region)
25
- end
26
-
27
- super do |region|
28
- yield region
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
- # -*- encoding : utf-8 -*-
2
-
3
- class Innodb::Page::SysRsegHeader < Innodb::Page
4
- # The number of undo log slots in the page.
5
- UNDO_SEGMENT_SLOTS = 1024
6
-
7
- # The position of the rollback segment header within the page.
8
- def pos_rseg_header
9
- pos_page_body
10
- end
11
-
12
- # The size of the rollback segment header.
13
- def size_rseg_header
14
- 4 + 4 + Innodb::List::BASE_NODE_SIZE + Innodb::FsegEntry::SIZE
15
- end
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
- def pos_undo_segment_array
18
- pos_rseg_header + size_rseg_header
19
- end
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
- def size_undo_segment_slot
22
- 4
23
- end
27
+ def pos_undo_segment_array
28
+ pos_rseg_header + size_rseg_header
29
+ end
24
30
 
25
- # Parse the rollback segment header from the page.
26
- def rseg_header
27
- cursor(pos_rseg_header).name("rseg_header") do |c|
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
- def history_list
40
- Innodb::HistoryList.new(rseg_header[:history_list])
41
- end
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
- def each_undo_segment
44
- unless block_given?
45
- return enum_for(:each_undo_segment)
46
- end
49
+ def history_list
50
+ Innodb::HistoryList.new(rseg_header.history_list)
51
+ end
47
52
 
48
- cursor(pos_undo_segment_array).name("undo_segment_array") do |c|
49
- (0...UNDO_SEGMENT_SLOTS).each do |slot|
50
- page_number = c.name("slot[#{slot}]") {
51
- Innodb::Page.maybe_undefined(c.get_uint32)
52
- }
53
- yield slot, page_number
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
- def each_region
59
- unless block_given?
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
- super do |region|
64
- yield region
65
- end
69
+ super(&block)
66
70
 
67
- yield({
68
- :offset => pos_rseg_header,
69
- :length => size_rseg_header,
70
- :name => :rseg_header,
71
- :info => "Rollback Segment Header",
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
- nil
84
- end
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
- def dump
87
- super
87
+ nil
88
+ end
89
+
90
+ def dump
91
+ super
88
92
 
89
- puts
90
- puts "rollback segment header:"
91
- pp rseg_header
93
+ puts
94
+ puts "rollback segment header:"
95
+ pp rseg_header
92
96
 
93
- puts
94
- puts "undo segment array:"
95
- each_undo_segment do |slot, page_number|
96
- puts " #{slot}: #{page_number}"
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
@@ -1,4 +1,6 @@
1
- # -*- encoding : utf-8 -*-
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
- class Innodb::Page::TrxSys < Innodb::Page
13
- # The TRX_SYS header immediately follows the FIL header.
14
- def pos_trx_sys_header
15
- pos_page_body
16
- end
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
- def size_trx_sys_header
19
- 8 + Innodb::FsegEntry::SIZE
20
- end
63
+ def size_trx_sys_header
64
+ 8 + Innodb::FsegEntry::SIZE
65
+ end
21
66
 
22
- def pos_rsegs_array
23
- pos_trx_sys_header + size_trx_sys_header
24
- end
67
+ def pos_rsegs_array
68
+ pos_trx_sys_header + size_trx_sys_header
69
+ end
25
70
 
26
- def size_mysql_log_info
27
- 4 + 8 + 100
28
- end
71
+ def size_mysql_log_info
72
+ 4 + 8 + 100
73
+ end
29
74
 
30
- # The master's binary log information is located 2000 bytes from the end of
31
- # the page.
32
- def pos_mysql_master_log_info
33
- size - 2000
34
- end
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
- # The local binary log information is located 1000 bytes from the end of
37
- # the page.
38
- def pos_mysql_binary_log_info
39
- size - 1000
40
- end
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
- # The doublewrite buffer information is located 200 bytes from the end of
43
- # the page.
44
- def pos_doublewrite_info
45
- size - 200
46
- end
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
- def size_doublewrite_info
49
- Innodb::FsegEntry::SIZE + (2 * (4 + 4 + 4)) + 4
50
- end
93
+ def size_doublewrite_info
94
+ Innodb::FsegEntry::SIZE + (2 * (4 + 4 + 4)) + 4
95
+ end
51
96
 
52
- # A magic number present in each MySQL binary log information structure,
53
- # which helps identify whether the structure is populated or not.
54
- MYSQL_LOG_MAGIC_N = 873422344
55
-
56
- N_RSEGS = 128
57
-
58
- def rsegs_array(cursor)
59
- @rsegs_array ||= (0...N_RSEGS).to_a.inject([]) do |a, n|
60
- cursor.name("slot[#{n}]") do |c|
61
- slot = {
62
- :offset => c.position,
63
- :space_id => c.name("space_id") {
64
- Innodb::Page.maybe_undefined(c.get_uint32)
65
- },
66
- :page_number => c.name("page_number") {
67
- Innodb::Page.maybe_undefined(c.get_uint32)
68
- },
69
- }
70
- if slot[:space_id] && slot[:page_number]
71
- a << slot
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
- # Read a MySQL binary log information structure from a given position.
79
- def mysql_log_info(cursor, offset)
80
- cursor.peek(offset) do |c|
81
- if c.name("magic_n") { c.get_uint32 } == MYSQL_LOG_MAGIC_N
82
- {
83
- :offset => c.name("offset") { c.get_uint64 },
84
- :name => c.name("name") { c.get_bytes(100) },
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
- # A magic number present in each doublewrite buffer information structure,
91
- # which helps identify whether the structure is populated or not.
92
- DOUBLEWRITE_MAGIC_N = 536853855
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
- # 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 = 1783657386
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
- # Read the TRX_SYS headers and other information.
128
- def trx_sys
129
- @trx_sys ||= cursor(pos_trx_sys_header).name("trx_sys") do |c|
130
- {
131
- :trx_id => c.name("trx_id") { c.get_uint64 },
132
- :fseg => c.name("fseg") {
133
- Innodb::FsegEntry.get_inode(@space, c)
134
- },
135
- :rsegs => c.name("rsegs") {
136
- rsegs_array(c)
137
- },
138
- :binary_log => c.name("binary_log") {
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
- super do |region|
162
- yield region
163
- end
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
- yield({
166
- :offset => pos_trx_sys_header,
167
- :length => size_trx_sys_header,
168
- :name => :trx_sys_header,
169
- :info => "Transaction System Header",
170
- })
171
-
172
- rsegs.each do |rseg|
173
- yield({
174
- :offset => rseg[:offset],
175
- :length => 4 + 4,
176
- :name => :rseg,
177
- :info => "Rollback Segment",
178
- })
179
- end
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
- yield({
182
- :offset => pos_mysql_binary_log_info,
183
- :length => size_mysql_log_info,
184
- :name => :mysql_binary_log_info,
185
- :info => "Binary Log Info",
186
- })
187
-
188
- yield({
189
- :offset => pos_mysql_master_log_info,
190
- :length => size_mysql_log_info,
191
- :name => :mysql_master_log_info,
192
- :info => "Master Log Info",
193
- })
194
-
195
- yield({
196
- :offset => pos_doublewrite_info,
197
- :length => size_doublewrite_info,
198
- :name => :doublewrite_info,
199
- :info => "Double Write Buffer Info",
200
- })
201
-
202
- nil
203
- end
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
- # Dump the contents of a page for debugging purposes.
206
- def dump
207
- super
227
+ # Dump the contents of a page for debugging purposes.
228
+ def dump
229
+ super
208
230
 
209
- puts "trx_sys:"
210
- pp trx_sys
211
- puts
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