mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge MySQL 5.1.41 into MariaDB trunk, including a number of after-merge fixes.
Also merge charset patch.
This commit is contained in:
@ -54,6 +54,8 @@ static char **defaults_argv;
|
||||
|
||||
static my_bool not_used; /* Can't use GET_BOOL without a value pointer */
|
||||
|
||||
static my_bool opt_write_binlog;
|
||||
|
||||
#include <help_start.h>
|
||||
|
||||
static struct my_option my_long_options[]=
|
||||
@ -124,6 +126,11 @@ static struct my_option my_long_options[]=
|
||||
{"verbose", 'v', "Display more output about the process",
|
||||
(uchar**) &opt_verbose, (uchar**) &opt_verbose, 0,
|
||||
GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
{"write-binlog", OPT_WRITE_BINLOG,
|
||||
"All commands including mysqlcheck are binlogged. Enabled by default;"
|
||||
"use --skip-write-binlog when commands should not be sent to replication slaves.",
|
||||
(uchar**) &opt_write_binlog, (uchar**) &opt_write_binlog, 0, GET_BOOL, NO_ARG,
|
||||
1, 0, 0, 0, 0, 0},
|
||||
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
@ -448,6 +455,8 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
|
||||
int ret;
|
||||
File fd;
|
||||
char query_file_path[FN_REFLEN];
|
||||
const uchar sql_log_bin[]= "SET SQL_LOG_BIN=0;";
|
||||
|
||||
DBUG_ENTER("run_query");
|
||||
DBUG_PRINT("enter", ("query: %s", query));
|
||||
if ((fd= create_temp_file(query_file_path, opt_tmpdir,
|
||||
@ -455,6 +464,22 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
|
||||
MYF(MY_WME))) < 0)
|
||||
die("Failed to create temporary file for defaults");
|
||||
|
||||
/*
|
||||
Master and slave should be upgraded separately. All statements executed
|
||||
by mysql_upgrade will not be binlogged.
|
||||
'SET SQL_LOG_BIN=0' is executed before any other statements.
|
||||
*/
|
||||
if (!opt_write_binlog)
|
||||
{
|
||||
if (my_write(fd, sql_log_bin, sizeof(sql_log_bin)-1,
|
||||
MYF(MY_FNABP | MY_WME)))
|
||||
{
|
||||
my_close(fd, MYF(0));
|
||||
my_delete(query_file_path, MYF(0));
|
||||
die("Failed to write to '%s'", query_file_path);
|
||||
}
|
||||
}
|
||||
|
||||
if (my_write(fd, (uchar*) query, strlen(query),
|
||||
MYF(MY_FNABP | MY_WME)))
|
||||
{
|
||||
@ -646,6 +671,7 @@ static int run_mysqlcheck_upgrade(void)
|
||||
"--check-upgrade",
|
||||
"--all-databases",
|
||||
"--auto-repair",
|
||||
opt_write_binlog ? "--write-binlog" : "--skip-write-binlog",
|
||||
NULL);
|
||||
}
|
||||
|
||||
@ -660,6 +686,7 @@ static int run_mysqlcheck_fixnames(void)
|
||||
"--all-databases",
|
||||
"--fix-db-names",
|
||||
"--fix-table-names",
|
||||
opt_write_binlog ? "--write-binlog" : "--skip-write-binlog",
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user