Class: MysqlPR::Protocol::ResultPacket
- Inherits:
-
Object
- Object
- MysqlPR::Protocol::ResultPacket
- Defined in:
- lib/mysql-pr/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.
637 638 639 |
# File 'lib/mysql-pr/protocol.rb', line 637 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.
635 636 637 |
# File 'lib/mysql-pr/protocol.rb', line 635 def affected_rows @affected_rows end |
#field_count ⇒ Object (readonly)
Returns the value of attribute field_count.
635 636 637 |
# File 'lib/mysql-pr/protocol.rb', line 635 def field_count @field_count end |
#insert_id ⇒ Object (readonly)
Returns the value of attribute insert_id.
635 636 637 |
# File 'lib/mysql-pr/protocol.rb', line 635 def insert_id @insert_id end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
635 636 637 |
# File 'lib/mysql-pr/protocol.rb', line 635 def @message end |
#server_status ⇒ Object (readonly)
Returns the value of attribute server_status.
635 636 637 |
# File 'lib/mysql-pr/protocol.rb', line 635 def server_status @server_status end |
#warning_count ⇒ Object (readonly)
Returns the value of attribute warning_count.
635 636 637 |
# File 'lib/mysql-pr/protocol.rb', line 635 def warning_count @warning_count end |
Class Method Details
.parse(pkt) ⇒ Object
619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 |
# File 'lib/mysql-pr/protocol.rb', line 619 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 |