Topics in this section:
Notices are a way to send axillary data from the server to the client that can be:
local to the current message sequence
Notices don't affect the state of the current message sequence, that means: the client is may ignore notices and still be able to properly understand the message sequence.
Global Notices are sent by the server in case of events happen that are unrelated to the currently active message sequence:
server is shutting down
node disconnected from group
schema or table dropped
The server indicates that it shuts down in a clean way.
The slave stopped to replicate changes from the master/group and may contain stale information.
SHOW SLAVE STATUS and
leads to a race condition for the following query. One would
have to check after query of the slave is still running to see
if it didn't stop in between.
If a client maintains a cache of recent queries + resultsets it would improve the caching behavior if the client would be notified if a underlying table or schema was dropped, changed, and so on.
Local Notices are related to the currently active Message Sequence like:
It allows intermediates to track state changes on the clients session that may be otherwise unnoticeable like:
CREATE PROCEDURE init() BEGIN SET @@sql_mode=ANSI; END
Session variable changes are usually done from the client via
SET @@... or
SELECT @@... :=
1, but can also be done via:
Part of this functionality is provided in the MySQL C/S
SESSION_SYSVAR_TRACKER and the initial
Account Expired while Authentication
current schema changes:
sever-side generated primary keys (like
rows-found, rows-matched, rows-affected
Sent after statement that changes the current schema like
Sent after an ID was created by an INSERT-operation.Note
GENERATED_INSERT_IDnotices may be sent per message sequence. Stored Procedures, Multi-Row INSERTs, and so on.
Rows that would be found if
LIMITwasn't applied (see
Rows affected by a modifying statement
Rows matched by the criteria of a modifying statement (
ROWS_MATCHEDwhere sent in the MySQL C/S Protocol as plain text
OKpacket after an
Rows matched: 0 Changed: 0 Warnings: 0
Sent after a successful authentication before
Sent after a transaction was committed. .value may contain a transaction identifier.Note
Used to track implicit, explicit and auto commits.
Sent after a transaction was rolled back.Note
Used to track implicit and explicit rollback operations.
Sent after a session ID is assigned by the server.
The MySQL C/S provided some of this information via functions: