Class: Mysql::Protocol::ExecutePacket
- Defined in:
- lib/mysql/protocol.rb
Overview
Execute packet
Instance Attribute Summary collapse
-
#cursor_type ⇒ Object
Returns the value of attribute cursor_type.
-
#statement_id ⇒ Object
Returns the value of attribute statement_id.
-
#values ⇒ Object
Returns the value of attribute values.
Instance Method Summary collapse
-
#initialize(*args) ⇒ ExecutePacket
constructor
A new instance of ExecutePacket.
- #serialize ⇒ Object
Constructor Details
#initialize(*args) ⇒ ExecutePacket
Returns a new instance of ExecutePacket.
483 484 485 |
# File 'lib/mysql/protocol.rb', line 483 def initialize(*args) @statement_id, @cursor_type, @values = args end |
Instance Attribute Details
#cursor_type ⇒ Object
Returns the value of attribute cursor_type.
481 482 483 |
# File 'lib/mysql/protocol.rb', line 481 def cursor_type @cursor_type end |
#statement_id ⇒ Object
Returns the value of attribute statement_id.
481 482 483 |
# File 'lib/mysql/protocol.rb', line 481 def statement_id @statement_id end |
#values ⇒ Object
Returns the value of attribute values.
481 482 483 |
# File 'lib/mysql/protocol.rb', line 481 def values @values end |
Instance Method Details
#serialize ⇒ Object
487 488 489 490 491 492 493 494 495 496 |
# File 'lib/mysql/protocol.rb', line 487 def serialize nbm = null_bitmap values netvalues = "" types = values.map do |v| t, n = Protocol.value2net v netvalues.concat n if v t end [Mysql::COM_STMT_EXECUTE, statement_id, cursor_type, 1, nbm, 1, types.pack("v*"), netvalues].pack("CVCVa*Ca*a*") end |