[MDEV-30824] Binlog contains unsupported statement when using non-default character set Created: 2023-03-09 Updated: 2023-04-21 Resolved: 2023-03-21 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server |
| Affects Version/s: | 10.9.2, 10.10.1, 10.11.1, 11.0.1 |
| Fix Version/s: | 10.11.3, 10.5.20, 10.6.13, 10.7.8, 10.8.8, 10.9.6, 10.10.4 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Tingyao Nian | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Description |
|
A commit https://github.com/MariaDB/server/commit/a923d6f49c1ad6fd3f4d6ec02e444c26e4d1dfa8 merged in 10.9.2+ disabled numeric setting of character_set_* variables with non-default values. However the corresponding binlog functionality also needs to be fixed. During binlog generation, server writes charactor_set_client information to binlog based on what character set the client is using, which looks like:
The problem is that it's totally possible for client to use a non-default value, which is written into binlog as it is:
which is now an invalid statement due to commit https://github.com/MariaDB/server/commit/a923d6f49c1ad6fd3f4d6ec02e444c26e4d1dfa8 and will cause error if this binlog is ever fed back to the server:
In addition, MariaDB Connector/J has a tendency to use 224 as the default character set, which is non-default, therefore this issue is expected to impact many user who connect to database via Connector/J
|
| Comments |
| Comment by Daniel Lenski [ 2023-03-10 ] | |||
|
Having discussed this with tingynia, it appears that this bug means that replication using any non-default character set will be broken on 10.9.2+. | |||
| Comment by Tingyao Nian [ 2023-03-15 ] | |||
|
I'm working on a PR to fix the binlog to always use 'string' type. | |||
| Comment by Otto Kekäläinen [ 2023-03-18 ] | |||
|
PR was submitted at https://github.com/MariaDB/server/pull/2557 - no reviews so far. | |||
| Comment by Alexander Barkov [ 2023-03-21 ] | |||
|
Pushed to 10.5 (instead of 10.9 originally proposed in the PR), so 10.9 can read mysqlbinlog dumps created by any version starting from 10.5. Thanks for your contribution! | |||
| Comment by Otto Kekäläinen [ 2023-03-21 ] | |||
|
Hi! Why did you push your by yourself to 10.5 instead of asking contributor to | |||
| Comment by Alexander Barkov [ 2023-03-21 ] | |||
|
Hi otto, I needed to check something, to decide which version is the best to backport to. Btw, I preserved the authorship in the patch:
|