[MDEV-18918] SQL mode EMPTY_STRING_IS_NULL breaks RBR upon CREATE TABLE .. SELECT Created: 2019-03-13 Updated: 2022-04-20 Resolved: 2022-01-25 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Create Table, Replication, Variables |
| Affects Version/s: | 10.3, 10.4 |
| Fix Version/s: | 10.3.33, 10.4.23, 10.5.14, 10.6.6, 10.7.2, 10.8.1 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Elena Stepanova | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
Technically the error isn't wrong, so I have no idea what should be done about it; but I guess it shouldn't just be allowed to fail. |
| Comments |
| Comment by Sujatha Sivakumar (Inactive) [ 2019-07-19 ] | ||||||||||||||||||||
|
Background: For example: Query: create table t1 (a int) select b from t;
2) binlog-format= ROW
Reported Bug: The "TABLE_NAME" field in "INFORMATION_SCHEMA.TABLES" is defined as shown below. On master the above query gets executed successfully and it gets rewritten in the CREATE TABLE `t1` (`TABLE_NAME` varchar(64) CHARACTER SET utf8 NOT NULL DEFAULT '') On Slave: The rewritten query arrives for execution. The Replication behaves as expected. | ||||||||||||||||||||
| Comment by Andrei Elkin [ 2020-06-22 ] | ||||||||||||||||||||
|
Looks relating to | ||||||||||||||||||||
| Comment by Alexander Barkov [ 2021-11-22 ] | ||||||||||||||||||||
|
The problem is not really related to replication. It's repeatable on a single box:
Now I copy the table definition to the clipboard and paste it:
The CREATE..SELECT statement should probably create the column without any defaults when | ||||||||||||||||||||
| Comment by Alexander Barkov [ 2021-12-28 ] | ||||||||||||||||||||
|
serg, please review a patch: It's in this branch: https://github.com/MariaDB/server/tree/bb-10.3-bar-MDEV-18918 The 10.5 version of the patch: Thanks. | ||||||||||||||||||||
| Comment by Sergei Golubchik [ 2022-01-21 ] | ||||||||||||||||||||
|
ok to push |