[MDEV-17119] replicate_rewrite_db does not work for single char database name Created: 2018-09-02  Updated: 2019-03-22  Resolved: 2019-03-22

Status: Closed
Project: MariaDB Server
Component/s: Replication
Affects Version/s: 5.5, 10.0, 10.1, 10.2, 10.3
Fix Version/s: 5.5.64

Type: Bug Priority: Major
Reporter: Sachin Setiya (Inactive) Assignee: Sachin Setiya (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Environment:

All



 Description   

mdev.test

# TBF - difference in row level logging
-- source include/have_binlog_format_mixed_or_statement.inc
-- source include/master-slave.inc
 
connection master;
SET sql_log_bin= 0;
create database x;
SET sql_log_bin= 1;
use x;
 
connection slave;
SET sql_log_bin= 0;
create database y;
SET sql_log_bin= 1;
use y;
 
--connection master
create table t1(a int);
insert into t1 values(1);
 
--sync_slave_with_master
select * from y.t1;
 
 
--source include/rpl_end.inc

mdev-slave.opt

"--replicate-rewrite-db=x->y"

While running this test case I get this error

CURRENT_TEST: rpl.rpl_one_char_db_rewrt_db
180902 19:14:02 [ERROR] Bad syntax in replicate-rewrite-db - empty FROM db!
 
180902 19:14:02 [ERROR] Aborting
 



 Comments   
Comment by Sachin Setiya (Inactive) [ 2018-10-13 ]

bb-5.5-17119

Comment by Andrei Elkin [ 2019-03-19 ]

MDEV-17119 patch 5b3018e0476 looks good. I suggest we extend the test to cover various x -> y combinations similarly to mysql patch 0fc330319399. That is to include checks

mysqld --replicate-rewrite-db=a-value

where a-value is formatted as a zero- or one- non "blackspace" char
padded from the left and right with zero or more whitespaces:

[:space:]*zero_or_one_char_name[:space:]*->... 

The zero db "name" case, like in

--replicate-rewrite-db=->y

should error out.

Generated at Thu Feb 08 08:34:03 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.