-
Notifications
You must be signed in to change notification settings - Fork 679
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parse status variables in query event (#360)
* Parse status variables in query event packet Status variables contain useful information: 1. List of databases affected by the query 2. Runtime value of system variables (SQL_MODE, AUTOCOMMIT, CHARSET_SERVER, etc.) 3. timezone of the master For further information please refer to; [Syntax of system variables field in query event](https://dev.mysql.com/doc/internals/en/query-event.html#q-microseconds) [Definition of enumeration for system variable keys](https://github.com/mysql/mysql-server/blob/beb865a960b9a8a16cf999c323e46c5b0c67f21f/libbinlogevents/include/statement_events.h#L463-L532) [Semantics of system variable values](https://github.com/mysql/mysql-server/blob/beb865a960b9a8a16cf999c323e46c5b0c67f21f/libbinlogevents/include/statement_events.h#L156-L448)
- Loading branch information
1 parent
84f2cda
commit f70f05b
Showing
5 changed files
with
177 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#from enum import IntEnum | ||
|
||
#class StatusVarsKey(IntEnum): | ||
"""List of Query_event_status_vars | ||
A status variable in query events is a sequence of status KEY-VALUE pairs. | ||
The class variables enumerated below are KEYs. | ||
Each KEY determines the length of corresponding VALUE. | ||
For further details refer to: | ||
mysql-server: https://github.com/mysql/mysql-server/blob/beb865a960b9a8a16cf999c323e46c5b0c67f21f/libbinlogevents/include/statement_events.h#L463-L532 | ||
MySQL Documentation: https://dev.mysql.com/doc/internals/en/query-event.html | ||
Status variable key names From mysql-server source code, edited by dongwook-chan | ||
""" | ||
|
||
# KEY | ||
Q_FLAGS2_CODE = 0x00 | ||
Q_SQL_MODE_CODE = 0X01 | ||
Q_CATALOG_CODE = 0x02 | ||
Q_AUTO_INCREMENT = 0x03 | ||
Q_CHARSET_CODE = 0x04 | ||
Q_TIME_ZONE_CODE = 0x05 | ||
Q_CATALOG_NZ_CODE = 0x06 | ||
Q_LC_TIME_NAMES_CODE = 0x07 | ||
Q_CHARSET_DATABASE_CODE = 0x08 | ||
Q_TABLE_MAP_FOR_UPDATE_CODE = 0x09 | ||
Q_MASTER_DATA_WRITTEN_CODE = 0x0A | ||
Q_INVOKER = 0x0B | ||
Q_UPDATED_DB_NAMES = 0x0C | ||
Q_MICROSECONDS = 0x0D | ||
Q_COMMIT_TS = 0x0E | ||
Q_COMMIT_TS2 = 0X0F | ||
Q_EXPLICIT_DEFAULTS_FOR_TIMESTAMP = 0X10 | ||
Q_DDL_LOGGED_WITH_XID = 0X11 | ||
Q_DEFAULT_COLLATION_FOR_UTF8MB4 = 0X12 | ||
Q_SQL_REQUIRE_PRIMARY_KEY = 0X13 | ||
Q_DEFAULT_TABLE_ENCRYPTION = 0X14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
|
||
from .BINLOG import * | ||
from .FIELD_TYPE import * | ||
from .STATUS_VAR_KEY import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters