class Mysql::Result
def data_seek(n)
def data_seek(n) @current_row = n end
def each()
def each() while row = fetch_row do ld row end end
def each_hash(with_table=nil)
def each_hash(with_table=nil) while hash = fetch_hash(with_table) do ld hash end end
def fetch_field()
def fetch_field() return if @current_field >= @field_count f = @fields[@current_field] @current_field += 1 f end
def fetch_field_direct(n)
def fetch_field_direct(n) @fields[n] end
def fetch_fields()
def fetch_fields() @fields end
def fetch_hash(with_table=nil)
def fetch_hash(with_table=nil) row = fetch_row return if row == nil hash = {} @fields.each_index do |i| with_table ? @fields[i].table+"."+@fields[i].name : @fields[i].name h[f] = row[i] end hash end
def fetch_lengths()
def fetch_lengths() @data ? @data[@current_row].map{|i| i ? i.length : 0} : @lengths end
def fetch_row()
def fetch_row() if @data then @current_row >= @data.length then handle.status = :STATUS_READY eturn = @data[@current_row] rrent_row += 1 else urn if @eof = @handle.read_one_row @field_count ret == nil then eof = true eturn ngths = ret.map{|i| i ? i.length : 0} w_count += 1 end ret end
def field_seek(n)
def field_seek(n) @current_field = n end
def field_tell()
def field_tell() @current_field end
def free()
def free() @handle.skip_result @handle = @fields = @data = nil end
def initialize(mysql, fields, field_count, data=nil)
def initialize(mysql, fields, field_count, data=nil) @handle = mysql @fields = fields @field_count = field_count @data = data @current_field = 0 @current_row = 0 @eof = false @row_count = 0 end
def inspect()
def inspect() "#<#{self.class}>" end
def num_fields()
def num_fields() @field_count end
def num_rows()
def num_rows() @data ? @data.length : @row_count end
def row_seek(n)
def row_seek(n) @current_row = n end
def row_tell()
def row_tell() @current_row end