mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
mysql-5.5 merge
This commit is contained in:
@ -564,6 +564,8 @@ static void verbose_msg(const char *fmt, ...)
|
||||
vfprintf(stderr, fmt, args);
|
||||
va_end(args);
|
||||
|
||||
fflush(stderr);
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
@ -4131,6 +4133,8 @@ static int dump_all_tables_in_db(char *database)
|
||||
if (mysql_refresh(mysql, REFRESH_LOG))
|
||||
DB_error(mysql, "when doing refresh");
|
||||
/* We shall continue here, if --force was given */
|
||||
else
|
||||
verbose_msg("-- dump_all_tables_in_db : logs flushed successfully!\n");
|
||||
}
|
||||
while ((table= getTableName(0)))
|
||||
{
|
||||
@ -4231,6 +4235,8 @@ static my_bool dump_all_views_in_db(char *database)
|
||||
if (mysql_refresh(mysql, REFRESH_LOG))
|
||||
DB_error(mysql, "when doing refresh");
|
||||
/* We shall continue here, if --force was given */
|
||||
else
|
||||
verbose_msg("-- dump_all_views_in_db : logs flushed successfully!\n");
|
||||
}
|
||||
while ((table= getTableName(0)))
|
||||
{
|
||||
@ -4369,6 +4375,8 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
|
||||
DB_error(mysql, "when doing refresh");
|
||||
}
|
||||
/* We shall countinue here, if --force was given */
|
||||
else
|
||||
verbose_msg("-- dump_selected_tables : logs flushed successfully!\n");
|
||||
}
|
||||
if (opt_xml)
|
||||
print_xml_tag(md_result_file, "", "\n", "database", "name=", db, NullS);
|
||||
@ -4675,6 +4683,7 @@ static int purge_bin_logs_to(MYSQL *mysql_con, char* log_name)
|
||||
|
||||
static int start_transaction(MYSQL *mysql_con)
|
||||
{
|
||||
verbose_msg("-- Starting transaction...\n");
|
||||
/*
|
||||
We use BEGIN for old servers. --single-transaction --master-data will fail
|
||||
on old servers, but that's ok as it was already silently broken (it didn't
|
||||
@ -5284,25 +5293,39 @@ int main(int argc, char **argv)
|
||||
consistent_binlog_pos= check_consistent_binlog_pos(NULL, NULL);
|
||||
}
|
||||
|
||||
if ((opt_lock_all_tables || (opt_master_data && !consistent_binlog_pos)) &&
|
||||
if ((opt_lock_all_tables || (opt_master_data && !consistent_binlog_pos) ||
|
||||
(opt_single_transaction && flush_logs)) &&
|
||||
do_flush_tables_read_lock(mysql))
|
||||
goto err;
|
||||
if (opt_single_transaction && start_transaction(mysql))
|
||||
goto err;
|
||||
if (opt_delete_master_logs)
|
||||
|
||||
/*
|
||||
Flush logs before starting transaction since
|
||||
this causes implicit commit starting mysql-5.5.
|
||||
*/
|
||||
if (opt_lock_all_tables || opt_master_data ||
|
||||
(opt_single_transaction && flush_logs) ||
|
||||
opt_delete_master_logs)
|
||||
{
|
||||
if (mysql_refresh(mysql, REFRESH_LOG) ||
|
||||
get_bin_log_name(mysql, bin_log_name, sizeof(bin_log_name)))
|
||||
goto err;
|
||||
if (flush_logs || opt_delete_master_logs)
|
||||
{
|
||||
if (mysql_refresh(mysql, REFRESH_LOG))
|
||||
goto err;
|
||||
verbose_msg("-- main : logs flushed successfully!\n");
|
||||
}
|
||||
|
||||
/* Not anymore! That would not be sensible. */
|
||||
flush_logs= 0;
|
||||
}
|
||||
if (opt_lock_all_tables || opt_master_data)
|
||||
|
||||
if (opt_delete_master_logs)
|
||||
{
|
||||
if (flush_logs && mysql_refresh(mysql, REFRESH_LOG))
|
||||
if (get_bin_log_name(mysql, bin_log_name, sizeof(bin_log_name)))
|
||||
goto err;
|
||||
flush_logs= 0; /* not anymore; that would not be sensible */
|
||||
}
|
||||
|
||||
if (opt_single_transaction && start_transaction(mysql))
|
||||
goto err;
|
||||
|
||||
/* Add 'STOP SLAVE to beginning of dump */
|
||||
if (opt_slave_apply && add_stop_slave())
|
||||
goto err;
|
||||
|
Reference in New Issue
Block a user