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

#calculate_checksum, #checksum, #corrupt?, #cursor, #fil_header, handle, #initialize, #inspect, #lsn, maybe_undefined, #next, #offset, parse, #pos_fil_header, #pos_fil_trailer, #pos_page_body, #prev, #size, #size_fil_header, #size_fil_trailer, #type

Constructor Details

This class inherits a constructor from Innodb::Page

Instance Method Details

#data_dictionary_header ⇒ Object

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

#dump ⇒ Object



44
45
46
47
48
49
50
# File 'lib/innodb/page/sys_data_dictionary_header.rb', line 44

def dump
  super

  puts
  puts "data_dictionary header:"
  pp data_dictionary_header
end

#pos_data_dictionary_header ⇒ Object

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_fil_header + size_fil_header
end

#size_data_dictionary_header ⇒ Object

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