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.
851 852 853 |
# File 'lib/mysql-pr/protocol.rb', line 851 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.
849 850 851 |
# File 'lib/mysql-pr/protocol.rb', line 849 def affected_rows @affected_rows end |
#field_count ⇒ Object (readonly)
Returns the value of attribute field_count.
849 850 851 |
# File 'lib/mysql-pr/protocol.rb', line 849 def field_count @field_count end |
#insert_id ⇒ Object (readonly)
Returns the value of attribute insert_id.
849 850 851 |
# File 'lib/mysql-pr/protocol.rb', line 849 def insert_id @insert_id end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
849 850 851 |
# File 'lib/mysql-pr/protocol.rb', line 849 def @message end |
#server_status ⇒ Object (readonly)
Returns the value of attribute server_status.
849 850 851 |
# File 'lib/mysql-pr/protocol.rb', line 849 def server_status @server_status end |
#warning_count ⇒ Object (readonly)
Returns the value of attribute warning_count.
849 850 851 |
# File 'lib/mysql-pr/protocol.rb', line 849 def warning_count @warning_count end |
Class Method Details
.parse(pkt) ⇒ Object
833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 |
# File 'lib/mysql-pr/protocol.rb', line 833 def self.parse(pkt) field_count = pkt.lcb if field_count.zero? affected_rows = pkt.lcb insert_id = pkt.lcb server_status = pkt.ushort warning_count = pkt.ushort = pkt.lcs new(field_count, affected_rows, insert_id, server_status, warning_count, ) elsif field_count.nil? # LOAD DATA LOCAL INFILE new(nil, nil, nil, nil, nil, pkt.to_s) else new(field_count) end end |