Class: Innodb::Page::SysDataDictionaryHeader

Inherits:
Innodb::Page show all
Defined in:
lib/innodb/page/sys_data_dictionary_header.rb

Constant Summary

Constants inherited from Innodb::Page

PAGE_TYPE, PAGE_TYPE_BY_VALUE, SPECIALIZED_CLASSES

Instance Attribute Summary

Attributes inherited from Innodb::Page

#space

Instance Method Summary collapse

Methods inherited from Innodb::Page

#checksum, #checksum_crc32, #checksum_crc32?, #checksum_innodb, #checksum_innodb?, #checksum_invalid?, #checksum_trailer, #checksum_type, #checksum_valid?, #corrupt?, #cursor, #each_page_body_byte_as_uint8, #each_page_header_byte_as_uint8, #fil_header, #fil_trailer, handle, #in_doublewrite_buffer?, #initialize, #inspect, #lsn, #lsn_low32_header, #lsn_low32_trailer, maybe_undefined, #misplaced?, #misplaced_offset?, #misplaced_space?, #name, #next, #offset, parse, #pos_fil_header, #pos_fil_trailer, #pos_page_body, #pos_partial_page_header, #prev, #size, #size_fil_header, #size_fil_trailer, #size_page_body, #size_partial_page_header, #space_id, #torn?, #type

Constructor Details

This class inherits a constructor from Innodb::Page

Instance Method Details

#data_dictionary_headerObject

Parse the data dictionary header from the page.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/innodb/page/sys_data_dictionary_header.rb', line 15

def data_dictionary_header
  cursor(pos_data_dictionary_header).name("data_dictionary_header") do |c|
    {
      :max_row_id => c.name("max_row_id") { c.get_uint64 },
      :max_table_id => c.name("max_table_id") { c.get_uint64 },
      :max_index_id => c.name("max_index_id") { c.get_uint64 },
      :max_space_id => c.name("max_space_id") { c.get_uint32 },
      :unused_mix_id_low => c.name("unused_mix_id_low") { c.get_uint32 },
      :indexes => c.name("indexes") {{
        :SYS_TABLES => c.name("SYS_TABLES") {{
          :PRIMARY => c.name("PRIMARY") { c.get_uint32 },
          :ID      => c.name("ID")      { c.get_uint32 },
        }},
        :SYS_COLUMNS => c.name("SYS_COLUMNS") {{
          :PRIMARY => c.name("PRIMARY") { c.get_uint32 },
        }},
        :SYS_INDEXES => c.name("SYS_INDEXES") {{
          :PRIMARY => c.name("PRIMARY") { c.get_uint32 },
        }},
        :SYS_FIELDS => c.name("SYS_FIELDS") {{
          :PRIMARY => c.name("PRIMARY") { c.get_uint32 },
        }}
      }},
      :unused_space => c.name("unused_space") { c.get_bytes(4) },
      :fseg => c.name("fseg") { Innodb::FsegEntry.get_inode(@space, c) },
    }
  end
end

#dumpObject



63
64
65
66
67
68
69
# File 'lib/innodb/page/sys_data_dictionary_header.rb', line 63

def dump
  super

  puts
  puts "data_dictionary header:"
  pp data_dictionary_header
end

#each_region {|{ :offset => pos_data_dictionary_header, :length => size_data_dictionary_header, :name => :data_dictionary_header, :info => "Data Dictionary Header", }| ... } ⇒ Object

Yields:



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/innodb/page/sys_data_dictionary_header.rb', line 44

def each_region
  unless block_given?
    return enum_for(:each_region)
  end

  super do |region|
    yield region
  end

  yield({
    :offset => pos_data_dictionary_header,
    :length => size_data_dictionary_header,
    :name => :data_dictionary_header,
    :info => "Data Dictionary Header",
  })

  nil
end

#pos_data_dictionary_headerObject

The position of the data dictionary header within the page.



5
6
7
# File 'lib/innodb/page/sys_data_dictionary_header.rb', line 5

def pos_data_dictionary_header
  pos_page_body
end

#size_data_dictionary_headerObject

The size of the data dictionary header.



10
11
12
# File 'lib/innodb/page/sys_data_dictionary_header.rb', line 10

def size_data_dictionary_header
  ((8 * 3) + (4 * 7) + 4 + Innodb::FsegEntry::SIZE)
end