OK_Packet
You are viewing an old version of this article. View
the current version here.
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
- 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
Status flag
SERVER_STATUS_IN_TRANS | 1 |
SERVER_STATUS_AUTOCOMMIT | 2 |
SERVER_MORE_RESULTS_EXISTS | 8 |
SERVER_QUERY_NO_GOOD_INDEX_USED | 16 |
SERVER_QUERY_NO_INDEX_USED | 32 |
SERVER_STATUS_CURSOR_EXISTS | 64 |
SERVER_STATUS_LAST_ROW_SENT | 128 |
SERVER_STATUS_DB_DROPPED | 1 << 8 |
SERVER_STATUS_NO_BACKSLASH_ESCAPES | 1 << 9 |
SERVER_STATUS_METADATA_CHANGED | 1 << 10 |
SERVER_QUERY_WAS_SLOW | 1 << 11 |
SERVER_PS_OUT_PARAMs | 1 << 12 |
SERVER_STATUS_IN_TRANS_READONLY | 1 << 13 |
SERVER_SESSION_STATE_CHANGED | 1 << 14 |
Session state info
- until packet has remaining data
- int<1> session change type
- string<lenenc> change data
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 |
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.