From c2b9d717da374a7c6b07533d73c062fec7fe3a98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Wed, 24 Aug 2022 16:57:02 +0300 Subject: Cleanup mysqlbinlog --- client/mysqlbinlog.cc | 44 +------------------------------------------- 1 file changed, 1 insertion(+), 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: -- cgit v1.2.1