diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-03-13 12:30:29 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-03-13 12:31:55 +0200 |
commit | 5fe87ac413cdc27ef09ea130a0bc4feea410cba0 (patch) | |
tree | 3d375ccb503dfe23c934928fcf549c8a042a70d7 /client | |
parent | 51e9381dcc01ebd72d4f0adc057a64213f850d70 (diff) | |
parent | ed21202a14e981a997061db12b2a377910fb02d5 (diff) | |
download | mariadb-git-5fe87ac413cdc27ef09ea130a0bc4feea410cba0.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'client')
-rw-r--r-- | client/mysql_upgrade.c | 61 | ||||
-rw-r--r-- | client/mysqlbinlog.cc | 14 |
2 files changed, 67 insertions, 8 deletions
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index bba2530f266..ea2108875e9 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -1006,6 +1006,64 @@ static int install_used_engines(void) return 0; } +static int check_slave_repositories(void) +{ + DYNAMIC_STRING ds_result; + int row_count= 0; + int error= 0; + const char *query = "SELECT COUNT(*) AS c1 FROM mysql.slave_master_info"; + + if (init_dynamic_string(&ds_result, "", 512, 512)) + die("Out of memory"); + + run_query(query, &ds_result, TRUE); + + if (ds_result.length) + { + row_count= atoi((char *)ds_result.str); + if (row_count) + { + fprintf(stderr,"Slave info repository compatibility check:" + " Found data in `mysql`.`slave_master_info` table.\n"); + fprintf(stderr,"Warning: Content of `mysql`.`slave_master_info` table" + " will be ignored as MariaDB supports file based info " + "repository.\n"); + error= 1; + } + } + dynstr_free(&ds_result); + + query = "SELECT COUNT(*) AS c1 FROM mysql.slave_relay_log_info"; + + if (init_dynamic_string(&ds_result, "", 512, 512)) + die("Out of memory"); + + run_query(query, &ds_result, TRUE); + + if (ds_result.length) + { + row_count= atoi((char *)ds_result.str); + if (row_count) + { + fprintf(stderr, "Slave info repository compatibility check:" + " Found data in `mysql`.`slave_relay_log_info` table.\n"); + fprintf(stderr, "Warning: Content of `mysql`.`slave_relay_log_info` " + "table will be ignored as MariaDB supports file based " + "repository.\n"); + error= 1; + } + } + dynstr_free(&ds_result); + if (error) + { + fprintf(stderr,"Slave server may not possess the correct replication " + "metadata.\n"); + fprintf(stderr, "Execution of CHANGE MASTER as per " + "`mysql`.`slave_master_info` and `mysql`.`slave_relay_log_info` " + "table content is recommended.\n"); + } + return 0; +} /* Update all system tables in MySQL Server to current @@ -1217,7 +1275,8 @@ int main(int argc, char **argv) run_mysqlcheck_views() || run_sql_fix_privilege_tables() || run_mysqlcheck_fixnames() || - run_mysqlcheck_upgrade(FALSE)) + run_mysqlcheck_upgrade(FALSE) || + check_slave_repositories()) die("Upgrade failed" ); verbose("Phase %d/%d: Running 'FLUSH PRIVILEGES'", ++phase, phases_total); diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 0e296a358e1..c65ea4f6cdf 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -1,6 +1,6 @@ /* Copyright (c) 2000, 2014, Oracle and/or its affiliates. - Copyright (c) 2009, 2019, MariaDB + Copyright (c) 2009, 2020, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -182,7 +182,7 @@ enum Exit_status { */ static Annotate_rows_log_event *annotate_event= NULL; -void free_annotate_event() +static void free_annotate_event() { if (annotate_event) { @@ -928,7 +928,7 @@ static bool print_row_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, } } - /* + /* end of statement check: i) destroy/free ignored maps ii) if skip event @@ -939,21 +939,21 @@ static bool print_row_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, */ if (is_stmt_end) { - /* + /* Now is safe to clear ignored map (clear_tables will also delete original table map events stored in the map). */ if (print_event_info->m_table_map_ignored.count() > 0) print_event_info->m_table_map_ignored.clear_tables(); - /* + /* If there is a kept Annotate event and all corresponding rbr-events were filtered away, the Annotate event was not freed and it is just the time to do it. */ - free_annotate_event(); + free_annotate_event(); - /* + /* One needs to take into account an event that gets filtered but was last event in the statement. If this is the case, previous rows events that were written into |