mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-15530: Variable replicate_rewrite_db cannot be found in "show global variables"
- Add `replicate_rewrite_db` status variable, that may accept comma
separated key-value pairs.
- Note that option `OPT_REPLICATE_REWRITE_DB` already existed in `mysqld.h`
from this commit 23d8586dbf
Reviewer:Brandon Nesterenko <brandon.nesterenko@mariadb.com>
This commit is contained in:
committed by
Brandon Nesterenko
parent
ccf0e27f28
commit
1a057a923b
@@ -8091,45 +8091,11 @@ mysqld_get_one_option(const struct my_option *opt, const char *argument,
|
||||
case (int)OPT_REPLICATE_REWRITE_DB:
|
||||
{
|
||||
/* See also OPT_REWRITE_DB handling in client/mysqlbinlog.cc */
|
||||
const char* key= argument, *ptr, *val;
|
||||
|
||||
// Skipp pre-space in key
|
||||
while (*key && my_isspace(mysqld_charset, *key))
|
||||
key++;
|
||||
|
||||
// Where val begins
|
||||
if (!(ptr= strstr(key, "->")))
|
||||
if (cur_rpl_filter->add_rewrite_db(argument))
|
||||
{
|
||||
sql_print_error("Bad syntax in replicate-rewrite-db: missing '->'");
|
||||
sql_print_error("Bad syntax in replicate-rewrite-db.Expected syntax is FROM->TO.");
|
||||
return 1;
|
||||
}
|
||||
val= ptr+2;
|
||||
|
||||
// Skip blanks at the end of key
|
||||
while (ptr > key && my_isspace(mysqld_charset, ptr[-1]))
|
||||
ptr--;
|
||||
if (ptr == key)
|
||||
{
|
||||
sql_print_error("Bad syntax in replicate-rewrite-db - empty FROM db");
|
||||
return 1;
|
||||
}
|
||||
key= strmake_root(&startup_root, key, (size_t) (ptr-key));
|
||||
|
||||
/* Skipp pre space in value */
|
||||
while (*val && my_isspace(mysqld_charset, *val))
|
||||
val++;
|
||||
|
||||
// Value ends with \0 or space
|
||||
for (ptr= val; *ptr && !my_isspace(&my_charset_latin1, *ptr) ; ptr++)
|
||||
{}
|
||||
if (ptr == val)
|
||||
{
|
||||
sql_print_error("Bad syntax in replicate-rewrite-db - empty TO db");
|
||||
return 1;
|
||||
}
|
||||
val= strmake_root(&startup_root, val, (size_t) (ptr-val));
|
||||
|
||||
cur_rpl_filter->add_db_rewrite(key, val);
|
||||
break;
|
||||
}
|
||||
case (int)OPT_SLAVE_PARALLEL_MODE:
|
||||
|
Reference in New Issue
Block a user