[MDEV-25853] Enhance replicate-rewrite-db to work with object-level DDL Created: 2021-06-03 Updated: 2023-11-30 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Replication |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Minor |
| Reporter: | Juan | Assignee: | Ralf Gebhardt |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Currently replicate-rewrite-db is explicitly documented as having some limitations such as only working with binlog_format=ROW. In addition, this is what the docs say: "This option only affects statements that involve tables. This option does not affect statements involving the database itself, such as CREATE DATABASE, ALTER DATABASE, and DROP DATABASE." While technically correct, there is no mention of the fact that because DDL statements are always statement based, table-level DDL also does not work. While from a technical limitation perspective this is to be expected, from a syntactical point of view it seems like a trap: how would a user be expected to infer from this that CREATE TABLE does not work either? The feature request is to change replicate-rewrite-db to understand table-level DDL and apply the same rules to it as to DML. Currently this is the behavior as described by a customer: 1. Create a master with a schema1 schema. This works:
This fails because it forces t2 to be created in schema1 instead of schema2 on the replica:
The replica gets this error and you can see that the empty t2 table exists in the schema1 schema
|