# File lib/innodb/page/index.rb, line 373
  def record_header_compact_variable_lengths_and_externs(cursor, nulls)
    fields = (record_format[:key] + record_format[:row])

    lengths = {}
    externs = []

    # For each non-NULL variable-length field, the record header contains
    # the length in one or two bytes.
    fields.each do |f|
      next if !f.variable? || nulls.include?(f.name)

      len = cursor.get_uint8
      ext = false

      # Two bytes are used only if the length exceeds 127 bytes and the
      # maximum length exceeds 255 bytes (or the field is a BLOB type).
      if len > 127 && (f.blob? || f.data_type.width > 255)
        ext = (0x40 & len) != 0
        len = ((len & 0x3f) << 8) + cursor.get_uint8
      end

      lengths[f.name] = len
      externs << f.name if ext
    end

    return lengths, externs
  end