Class: Mysql::Protocol::ResultPacket
- Inherits:
-
Object
- Object
- Mysql::Protocol::ResultPacket
- Defined in:
- lib/mysql/protocol.rb
Overview
Result packet
Instance Attribute Summary collapse
-
#affected_rows ⇒ Object
readonly
Returns the value of attribute affected_rows.
-
#field_count ⇒ Object
readonly
Returns the value of attribute field_count.
-
#insert_id ⇒ Object
readonly
Returns the value of attribute insert_id.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#server_status ⇒ Object
readonly
Returns the value of attribute server_status.
-
#warning_count ⇒ Object
readonly
Returns the value of attribute warning_count.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ ResultPacket
constructor
A new instance of ResultPacket.
Constructor Details
#initialize(*args) ⇒ ResultPacket
Returns a new instance of ResultPacket.
622 623 624 |
# File 'lib/mysql/protocol.rb', line 622 def initialize(*args) @field_count, @affected_rows, @insert_id, @server_status, @warning_count, @message = args end |
Instance Attribute Details
#affected_rows ⇒ Object (readonly)
Returns the value of attribute affected_rows.
620 621 622 |
# File 'lib/mysql/protocol.rb', line 620 def affected_rows @affected_rows end |
#field_count ⇒ Object (readonly)
Returns the value of attribute field_count.
620 621 622 |
# File 'lib/mysql/protocol.rb', line 620 def field_count @field_count end |
#insert_id ⇒ Object (readonly)
Returns the value of attribute insert_id.
620 621 622 |
# File 'lib/mysql/protocol.rb', line 620 def insert_id @insert_id end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
620 621 622 |
# File 'lib/mysql/protocol.rb', line 620 def @message end |
#server_status ⇒ Object (readonly)
Returns the value of attribute server_status.
620 621 622 |
# File 'lib/mysql/protocol.rb', line 620 def server_status @server_status end |
#warning_count ⇒ Object (readonly)
Returns the value of attribute warning_count.
620 621 622 |
# File 'lib/mysql/protocol.rb', line 620 def warning_count @warning_count end |
Class Method Details
.parse(pkt) ⇒ Object
604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 |
# File 'lib/mysql/protocol.rb', line 604 def self.parse(pkt) field_count = pkt.lcb if field_count == 0 affected_rows = pkt.lcb insert_id = pkt.lcb server_status = pkt.ushort warning_count = pkt.ushort = pkt.lcs return self.new(field_count, affected_rows, insert_id, server_status, warning_count, ) elsif field_count.nil? # LOAD DATA LOCAL INFILE return self.new(nil, nil, nil, nil, nil, pkt.to_s) else return self.new(field_count) end end |