MySQL 8.0.40
Source Code Documentation
|
Topics in this section:
Notices are a way to send axillary data from the server to the client that can be:
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:
The server indicates that it shuts down in a clean way.
The replica stopped to replicate changes from the replication source/group and may contain stale information.
SHOW SLAVE STATUS
and io_thread
and sql_thread
leads to a race condition for the following query. One would have to check after query of the replica is still running to see if it didn't stop in between. Following changes inside the group, trigger this notice: quorum loss, view changed, role of the node changed, state changed. This information is transfered inside GROUP_REPLICATION_STATE_CHANGED
notice, using following message Mysqlx::Notice::GroupReplicationStateChanged.
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:
Via Mysqlx::Notice::SessionVariableChanged
It allows intermediates to track state changes on the clients session that may be otherwise unnoticeable like:
Session variable changes are usually done from the client via SET @@...
or SELECT @@... := 1
, but can also be done via:
@@character_set_server
WL#4797
SESSION_SYSVAR_TRACKER
and the initial handshake packet.Via Mysqlx::Notice::SessionStateChanged.
USE ...
AUTO_INCREMENT
)USE ...
GENERATED_INSERT_ID
notices may be sent per message sequence. Stored Procedures, Multi-Row INSERTs, and so on.LIMIT
wasn't applied (see SQL_CALC_FOUND_ROWS
) UPDATE
, INSERT
, DELETE
, ...) ROWS_AFFECTED
and ROWS_MATCHED
where sent in the MySQL C/S Protocol as plain text info
for a OK
packet after an UPDATE
: Parameter | Information Functions |
---|---|
CURRENT_SCHEMA | DATABASE() |
GENERATED_INSERT_ID | LAST_INSERT_ID() |
ROWS_FOUND | FOUND_ROWS() |
ROWS_AFFECTED | ROW_COUNT() |
SESSION_ID | CONNECTION_ID() |