The OK_Packet is sent by the server to indicate the successful completion of a command, conveying affected row counts and server status flags.
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.
0x00 : OK_Packet header or (0xFE if CLIENT_DEPRECATE_EOF is set).
affected rows.
last insert id.
The length-encoded info string is not always included in the packet. Check the length of the packet to detect if there is data after the warning count. For the first OK_Packet in the connection it contains (if present) the . For the following OK_Packets it contains (if present) various human-readable information.
Values of server status flags:
While packet has remaining data:
.
If (session-change-type != SESSION_TRACK_STATE_CHANGE):
Each type of data has its own kind of format:
new current schema.
While there is remaining data:
variable data.
For each variable data:
variable name.
variable value.
Indicates if session state changes occurred. The value is represented as 1.
1 if session state tracking was enabled.
This tracker is not implemented by MariaDB.
Transaction characteristics.
Transaction characteristics is the set of SQL statements that reproduce the type and state of the current transaction. It can consist of the following SQL statements:
Transaction state string.
The transaction state string is always 8 characters long. The characters, in order, are:
No transaction: _ Explicit transaction: T Implicit transaction: I
Transaction read safe: _ Transaction read unsafe: r
Unknown transaction type: _
To determine if session tracking is enabled, check if the flag is set in server_capabilities.
This page is licensed: CC BY-SA / Gnu FDL
int<2> warning count.
If packet has more data:
string info.
If (status flags & SERVER_SESSION_STATE_CHANGED) and session_tracking_supported (see CLIENT_SESSION_TRACK):
.
SERVER_QUERY_NO_INDEX_USED
32
The query did not use an index.
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 re-prepare has been executed).
SERVER_QUERY_WAS_SLOW
1<<11
The query was slower than .
SERVER_PS_OUT_PARAMS
1<<12
This result set contains 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 for more information.
string session data change.
RTransaction write safe: _ Transaction write unsafe: w
Unknown transaction type: _ Read-write transaction: W
Transaction statement safe: _ Transaction statement unsafe: s
Transaction does not have resultsets: _ Transaction with result sets: S
No locked tables: _ Tables have been locked: L
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 packets will follow).
SERVER_QUERY_NO_GOOD_INDEX_USED
16
Set if EXPLAIN would've shown Range checked for each record.
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
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
START TRANSACTION;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
START TRANSACTION WITH CONSISTENT SNAPSHOT, READ ONLY;
START TRANSACTION WITH CONSISTENT SNAPSHOT, READ WRITE;
SET TRANSACTION READ ONLY;
SET TRANSACTION READ WRITE;
XA START <XA specification>;