OK_Packet is sent by the server to the client and indicates a successful completion of a command sent by the client before.
Server to client.
The length-encoded string that contains the human-readable information is not always included in the packet. Check the length of the packet to detect if there is data after the warning count.
Server status flag
Values of server status flag
|SERVER_STATUS_IN_TRANS||1||A transaction is currently active|
|SERVER_STATUS_AUTOCOMMIT||2||Autocommit mode is set|
|SERVER_MORE_RESULTS_EXISTS||8||more results exists (more packet follow)|
|SERVER_STATUS_CURSOR_EXISTS||64||when using COM_STMT_FETCH, indicate that current cursor still has result|
|SERVER_STATUS_LAST_ROW_SENT||128||when using COM_STMT_FETCH, indicate that current cursor has finished to send results|
|SERVER_STATUS_DB_DROPPED||1<<8||database has been dropped|
|SERVER_STATUS_NO_BACKSLASH_ESCAPES||1<<9||current escape mode is "no backslash escape"|
|SERVER_STATUS_METADATA_CHANGED||1<<10||A DDL change did have an impact on an existing PREPARE (an automatic reprepare has been executed)|
|SERVER_PS_OUT_PARAMS||1<<12||this resultset contain stored procedure output parameter|
|SERVER_STATUS_IN_TRANS_READONLY||1<<13||current transaction is a read-only transaction|
|SERVER_SESSION_STATE_CHANGED||1<<14||session state change. see Session change type for more information|
Session state info
Session change type
session data's change
Each type of data has his own kind of format :
- string<lenenc> new current schema
while there is remaining data :
- string<lenenc> variable data
for each variable data :
indicates if session state changes occured. The value is represented as "1".
- string<lenenc> "1" if session state tracking was enabled