OK_Packet
You are viewing an old version of this article. View
the current version here.
Contents
OK_Packet
OK_Packet is sent by the server to the client and indicates a successful completion of a command sent by the client before.
Direction
Server to client.
Fields
- int<1> 0x00 : OK_Packet header or (0xFE if CLIENT_DEPRECATE_EOF is set)
- int<lenenc> affected rows
- int<lenenc> last insert id
- int<2> server status
- int<2> warning count
- if session_tracking_supported (see CLIENT_SESSION_TRACK)
- string<lenenc> info
- if (status flags & SERVER_SESSION_STATE_CHANGED)
- string<lenenc> session state info
- string<lenenc> value of variable
- else
- string<EOF> info
- string<EOF> info
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_QUERY_NO_GOOD_INDEX_USED | 16 | |
SERVER_QUERY_NO_INDEX_USED | 32 | |
SERVER_STATUS_CURSOR_EXISTS | 64 | when using COM_STMT_FETCH, indicate that current cursor still has result (deprecated) |
SERVER_STATUS_LAST_ROW_SENT | 128 | when using COM_STMT_FETCH, indicate that current cursor has finished to send results (deprecated) |
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_QUERY_WAS_SLOW | 1<<11 | |
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
- until packet has remaining data
- int<1> session change type
- string<lenenc> session data's change
Session change type
0 | SESSION_TRACK_SYSTEM_VARIABLES |
1 | SESSION_TRACK_SCHEMA |
2 | SESSION_TRACK_STATE_CHANGE |
3 | SESSION_TRACK_GTIDS |
4 | SESSION_TRACK_TRANSACTION_CHARACTERISTICS |
5 | SESSION_TRACK_TRANSACTION_STATE |
session data's change
Each type of data has his own kind of format :
SESSION_TRACK_SCHEMA
- string<lenenc> new current schema
SESSION_TRACK_SYSTEM_VARIABLES
while there is remaining data :
- string<lenenc> variable data
for each variable data :
- string<lenenc> variable name
- string<lenenc> variable value
SESSION_TRACK_STATE_CHANGE
indicates if session state changes occured. The value is represented as "1".
- string<lenenc> "1" if session state tracking was enabled
Notes
- Session tracking is supported from MariaDB 10.2. To determine if session tracking is enabled, check if the CLIENT_SESSION_TRACK flag is set in server_capabilities.
Comments
Comments loading...
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.