You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/mysql57_support.rst
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,12 +5,12 @@ MySQL 5.7, MySQL 8.0+ and `use_column_name_cache`
5
5
6
6
In MySQL 5.7 and earlier, the binary log events for row-based replication do not include column name metadata. This means that `python-mysql-replication` cannot map column values to their names directly from the binlog event.
7
7
8
-
Starting with MySQL 8.0.1, the `binlog_row_metadata` system variable was introduced to control the amount of metadata written to the binary log. The default value for this variable is `MINIMAL`, which provides the same behavior as MySQL 5.7.
8
+
Starting with MySQL 8.0.1, the `binlog_row_metadata` system variable was introduced to control the amount of metadata written to the binary log. This is a **GLOBAL** and **DYNAMIC** variable. The default value for this variable is `MINIMAL`, which provides the same behavior as MySQL 5.7.
9
9
10
10
The Problem
11
11
-----------
12
12
13
-
When column metadata is not present in the binlog (as in MySQL 5.7 and earlier, or when `binlog_row_metadata` is set to `MINIMAL` in MySQL 8.0+), the `values` dictionary in a `WriteRowsEvent`, `UpdateRowsEvent`, or `DeleteRowsEvent` will contain integer keys corresponding to the column index, not the column names.
13
+
When column metadata is not present in the binlog (as in MySQL 5.7 and earlier, or when `binlog_row_metadata` is set to `MINIMAL` globally in MySQL 8.0+), the `values` dictionary in a `WriteRowsEvent`, `UpdateRowsEvent`, or `DeleteRowsEvent` will contain integer keys corresponding to the column index, not the column names.
14
14
15
15
For example, for a table `users` with columns `id` and `name`, an insert event might look like this:
16
16
@@ -32,7 +32,7 @@ This allows you to receive row data with column names as keys.
32
32
MySQL 8.0+ with `binlog_row_metadata=FULL`
33
33
------------------------------------------
34
34
35
-
In MySQL 8.0.1 and later, you can set `binlog_row_metadata` to `FULL`. When this setting is enabled, the column names are included directly in the binlog events, and `use_column_name_cache` is not necessary.
35
+
In MySQL 8.0.1 and later, you can set `binlog_row_metadata` to `FULL` using `SET GLOBAL binlog_row_metadata = 'FULL'`. When this setting is enabled, the column names are included directly in the binlog events, and `use_column_name_cache` is not necessary.
0 commit comments