class Mysql::StmtRawRecord
Public Class Methods
Public Instance Methods
parse_record_packet()
click to toggle source
Parse statement result packet
Return¶ ↑
- Array of
Object
-
one record
# File lib/vendor/mysql/protocol.rb, line 746 def parse_record_packet @packet.utiny # skip first byte null_bit_map = @packet.read((@fields.length+7+2)/8).unpack("b*").first rec = @fields.each_with_index.map do |f, i| if null_bit_map[i+2] == ?1 nil else unsigned = f.flags & Field::UNSIGNED_FLAG != 0 v = Protocol.net2value(@packet, f.type, unsigned) if v.is_a? Numeric or v.is_a? Mysql::Time v elsif f.type == Field::TYPE_BIT or f.charsetnr == Charset::BINARY_CHARSET_NUMBER Charset.to_binary(v) else Charset.convert_encoding(v, @encoding) end end end rec end
Also aliased as: to_a