class Mysql::Protocol::FieldPacket

Field packet

Attributes

charsetnr[R]
db[R]
decimals[R]
default[R]
flags[R]
length[R]
name[R]
org_name[R]
org_table[R]
table[R]
type[R]

Public Class Methods

new(*args) click to toggle source
# File lib/mysql/protocol.rb, line 652
def initialize(*args)
  @db, @table, @org_table, @name, @org_name, @charsetnr, @length, @type, @flags, @decimals, @default = args
end
parse(pkt) click to toggle source
# File lib/mysql/protocol.rb, line 630
def self.parse(pkt)
  _first = pkt.lcs
  db = pkt.lcs
  table = pkt.lcs
  org_table = pkt.lcs
  name = pkt.lcs
  org_name = pkt.lcs
  _f0 = pkt.utiny
  charsetnr = pkt.ushort
  length = pkt.ulong
  type = pkt.utiny
  flags = pkt.ushort
  decimals = pkt.utiny
  f1 = pkt.ushort

  raise ProtocolError, "invalid packet: f1=#{f1}" unless f1 == 0
  default = pkt.lcs
  return self.new(db, table, org_table, name, org_name, charsetnr, length, type, flags, decimals, default)
end