summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <cvicentiu@gmail.com>2022-08-24 16:57:02 +0300
committerVicențiu Ciorbaru <cvicentiu@gmail.com>2022-08-24 16:57:02 +0300
commitc2b9d717da374a7c6b07533d73c062fec7fe3a98 (patch)
treed5b7a567c3c8c9be675de639ad923b2da2742687
parent839fa95011b4a293361147d052357bc0987fe9a6 (diff)
downloadmariadb-git-vicentiu-filter-2.tar.gz
Cleanup mysqlbinlogvicentiu-filter-2
-rw-r--r--client/mysqlbinlog.cc44
1 files changed, 1 insertions, 43 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index c7b719d949d..d5cebf61e17 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -2394,49 +2394,7 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
case OPT_REWRITE_DB: // db_from->db_to
{
/* See also handling of OPT_REPLICATE_REWRITE_DB in sql/mysqld.cc */
- const char* ptr;
- const char* key= argument; // db-from
- const char* val; // db-to
-
- // Skipp pre-space in key
- while (*key && my_isspace(&my_charset_latin1, *key))
- key++;
-
- // Where val begins
- if (!(ptr= strstr(key, "->")))
- {
- sql_print_error("Bad syntax in rewrite-db: missing '->'\n");
- return 1;
- }
- val= ptr + 2;
-
- // Skip blanks at the end of key
- while (ptr > key && my_isspace(&my_charset_latin1, ptr[-1]))
- ptr--;
-
- if (ptr == key)
- {
- sql_print_error("Bad syntax in rewrite-db: empty FROM db\n");
- return 1;
- }
- key= strmake_root(&glob_root, key, (size_t) (ptr-key));
-
- /* Skipp pre space in value */
- while (*val && my_isspace(&my_charset_latin1, *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 rewrite-db: empty TO db\n");
- return 1;
- }
- val= strmake_root(&glob_root, val, (size_t) (ptr-val));
-
- //TODO(cvicentiu)
- binlog_filter->add_rewrite_db(key);
+ binlog_filter->add_rewrite_db(argument);
break;
}
case OPT_PRINT_ROW_COUNT: