1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge remote-tracking branch 'origin/10.1' into 10.2

This commit is contained in:
Alexander Barkov
2015-12-29 19:37:11 +04:00
3663 changed files with 643591 additions and 222259 deletions

52
.gitignore vendored
View File

@@ -166,32 +166,32 @@ storage/myisam/myisamlog
storage/myisam/myisampack storage/myisam/myisampack
storage/myisam/rt_test storage/myisam/rt_test
storage/myisam/sp_test storage/myisam/sp_test
storage/tokudb/ft-index/buildheader/db.h storage/tokudb/PerconaFT/buildheader/db.h
storage/tokudb/ft-index/buildheader/make_tdb storage/tokudb/PerconaFT/buildheader/make_tdb
storage/tokudb/ft-index/buildheader/runcat.sh storage/tokudb/PerconaFT/buildheader/runcat.sh
storage/tokudb/ft-index/ft/log_code.cc storage/tokudb/PerconaFT/ft/log_code.cc
storage/tokudb/ft-index/ft/log_header.h storage/tokudb/PerconaFT/ft/log_header.h
storage/tokudb/ft-index/ft/log_print.cc storage/tokudb/PerconaFT/ft/log_print.cc
storage/tokudb/ft-index/ft/logformat storage/tokudb/PerconaFT/ft/logformat
storage/tokudb/ft-index/ft/ftverify storage/tokudb/PerconaFT/ft/ftverify
storage/tokudb/ft-index/ft/tdb-recover storage/tokudb/PerconaFT/ft/tdb-recover
storage/tokudb/ft-index/ft/tokuftdump storage/tokudb/PerconaFT/ft/tokuftdump
storage/tokudb/ft-index/portability/merge_archives_tokuportability_static.cmake storage/tokudb/PerconaFT/portability/merge_archives_tokuportability_static.cmake
storage/tokudb/ft-index/portability/toku_config.h storage/tokudb/PerconaFT/portability/toku_config.h
storage/tokudb/ft-index/portability/tokuportability_static_depends.cc storage/tokudb/PerconaFT/portability/tokuportability_static_depends.cc
storage/tokudb/ft-index/src/merge_archives_tokufractaltree_static.cmake storage/tokudb/PerconaFT/snappy/
storage/tokudb/ft-index/src/tokufractaltree_static_depends.cc storage/tokudb/PerconaFT/src/merge_archives_tokufractaltree_static.cmake
storage/tokudb/ft-index/toku_include/toku_config.h storage/tokudb/PerconaFT/src/tokufractaltree_static_depends.cc
storage/tokudb/ft-index/tools/ba_replay storage/tokudb/PerconaFT/toku_include/toku_config.h
storage/tokudb/ft-index/tools/ftverify storage/tokudb/PerconaFT/tools/ba_replay
storage/tokudb/ft-index/tools/tdb-recover storage/tokudb/PerconaFT/tools/ftverify
storage/tokudb/ft-index/tools/tdb_logprint storage/tokudb/PerconaFT/tools/tdb-recover
storage/tokudb/ft-index/tools/tokudb_dump storage/tokudb/PerconaFT/tools/tokudb_dump
storage/tokudb/ft-index/tools/tokudb_gen storage/tokudb/PerconaFT/tools/tokudb_gen
storage/tokudb/ft-index/tools/tokudb_load storage/tokudb/PerconaFT/tools/tokudb_load
storage/tokudb/ft-index/tools/tokuftdump storage/tokudb/PerconaFT/tools/tokuftdump
storage/tokudb/ft-index/tools/tokuft_logprint storage/tokudb/PerconaFT/tools/tokuft_logprint
storage/tokudb/ft-index/xz/ storage/tokudb/PerconaFT/xz/
support-files/MySQL-shared-compat.spec support-files/MySQL-shared-compat.spec
support-files/binary-configure support-files/binary-configure
support-files/config.huge.ini support-files/config.huge.ini

View File

@@ -256,6 +256,10 @@ fi
# (http://samba.org/ccache) is installed, use it. # (http://samba.org/ccache) is installed, use it.
# We use 'grep' and hope 'grep' will work as expected # We use 'grep' and hope 'grep' will work as expected
# (returns 0 if finds lines) # (returns 0 if finds lines)
# As cmake doesn't like CC and CXX with a space, use symlinks from
# /usr/lib64/ccache if they exits.
if test "$USING_GCOV" != "1" if test "$USING_GCOV" != "1"
then then
# Not using gcov; Safe to use ccache # Not using gcov; Safe to use ccache
@@ -264,8 +268,14 @@ fi
if ccache -V > /dev/null 2>&1 && test "$CCACHE_GCOV_VERSION_ENABLED" = "1" if ccache -V > /dev/null 2>&1 && test "$CCACHE_GCOV_VERSION_ENABLED" = "1"
then then
echo "$CC" | grep "ccache" > /dev/null || CC="ccache $CC" if test -x /usr/lib64/ccache/gcc
echo "$CXX" | grep "ccache" > /dev/null || CXX="ccache $CXX" then
CC=/usr/lib64/ccache/gcc
fi
if test -x /usr/lib64/ccache/g++
then
CXX=/usr/lib64/ccache/g++
fi
fi fi
# gcov # gcov

View File

@@ -265,7 +265,7 @@ IF(WIN32)
SET(SHAREDIR share) SET(SHAREDIR share)
ELSE() ELSE()
SET(DEFAULT_MYSQL_HOME ${CMAKE_INSTALL_PREFIX}) SET(DEFAULT_MYSQL_HOME ${CMAKE_INSTALL_PREFIX})
SET(SHAREDIR ${DEFAULT_MYSQL_HOME}/${INSTALL_MYSQLSHAREDIR}) SET(SHAREDIR ${INSTALL_MYSQLSHAREDIRABS})
ENDIF() ENDIF()
SET(DEFAULT_BASEDIR "${DEFAULT_MYSQL_HOME}") SET(DEFAULT_BASEDIR "${DEFAULT_MYSQL_HOME}")

View File

@@ -1,5 +1,5 @@
/* /*
Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@@ -404,7 +404,7 @@ exit:
static void usage(void) static void usage(void)
{ {
PRINT_VERSION; PRINT_VERSION;
puts("Copyright (c) 2011, Oracle and/or its affiliates. " puts("Copyright (c) 2011, 2015, Oracle and/or its affiliates. "
"All rights reserved.\n"); "All rights reserved.\n");
puts("Enable or disable plugins."); puts("Enable or disable plugins.");
printf("\nUsage: %s [options] <plugin> ENABLE|DISABLE\n\nOptions:\n", printf("\nUsage: %s [options] <plugin> ENABLE|DISABLE\n\nOptions:\n",
@@ -755,6 +755,11 @@ static int check_options(int argc, char **argv, char *operation)
/* read the plugin config file and check for match against argument */ /* read the plugin config file and check for match against argument */
else else
{ {
if (strlen(argv[i]) + 4 + 1 > FN_REFLEN)
{
fprintf(stderr, "ERROR: argument is too long.\n");
return 1;
}
strcpy(plugin_name, argv[i]); strcpy(plugin_name, argv[i]);
strcpy(config_file, argv[i]); strcpy(config_file, argv[i]);
strcat(config_file, ".ini"); strcat(config_file, ".ini");
@@ -846,6 +851,7 @@ static int process_options(int argc, char *argv[], char *operation)
if (opt_basedir[i-1] != FN_LIBCHAR || opt_basedir[i-1] != FN_LIBCHAR2) if (opt_basedir[i-1] != FN_LIBCHAR || opt_basedir[i-1] != FN_LIBCHAR2)
{ {
char buff[FN_REFLEN]; char buff[FN_REFLEN];
memset(buff, 0, sizeof(buff));
strncpy(buff, opt_basedir, sizeof(buff) - 1); strncpy(buff, opt_basedir, sizeof(buff) - 1);
#ifdef __WIN__ #ifdef __WIN__

View File

@@ -55,6 +55,8 @@ static DYNAMIC_STRING conn_args;
static char *opt_password= 0; static char *opt_password= 0;
static char *opt_plugin_dir= 0, *opt_default_auth= 0; static char *opt_plugin_dir= 0, *opt_default_auth= 0;
static char *cnf_file_path= 0, defaults_file[FN_REFLEN + 32];
static my_bool tty_password= 0; static my_bool tty_password= 0;
static char opt_tmpdir[FN_REFLEN] = ""; static char opt_tmpdir[FN_REFLEN] = "";
@@ -111,6 +113,7 @@ static struct my_option my_long_options[]=
&opt_force, &opt_force, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &opt_force, &opt_force, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"host", 'h', "Connect to host.", 0, {"host", 'h', "Connect to host.", 0,
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#define PASSWORD_OPT 12
{"password", 'p', {"password", 'p',
"Password to use when connecting to server. If password is not given," "Password to use when connecting to server. If password is not given,"
" it's solicited on the tty.", &opt_password,&opt_password, " it's solicited on the tty.", &opt_password,&opt_password,
@@ -147,6 +150,7 @@ static struct my_option my_long_options[]=
{"upgrade-system-tables", 's', "Only upgrade the system tables in the mysql database. Tables in other databases are not checked or touched.", {"upgrade-system-tables", 's', "Only upgrade the system tables in the mysql database. Tables in other databases are not checked or touched.",
&opt_systables_only, &opt_systables_only, 0, &opt_systables_only, &opt_systables_only, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#define USER_OPT (array_elements(my_long_options) - 6)
{"user", 'u', "User for login if not current user.", &opt_user, {"user", 'u', "User for login if not current user.", &opt_user,
&opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"verbose", 'v', "Display more output about the process; Using it twice will print connection argument; Using it 3 times will print out all CHECK, RENAME and ALTER TABLE during the check phase.", {"verbose", 'v', "Display more output about the process; Using it twice will print connection argument; Using it 3 times will print out all CHECK, RENAME and ALTER TABLE during the check phase.",
@@ -184,6 +188,8 @@ static void free_used_memory(void)
dynstr_free(&ds_args); dynstr_free(&ds_args);
dynstr_free(&conn_args); dynstr_free(&conn_args);
if (cnf_file_path)
my_delete(cnf_file_path, MYF(MY_WME));
} }
@@ -235,31 +241,32 @@ static void verbose(const char *fmt, ...)
this way we pass the same arguments on to mysql and mysql_check this way we pass the same arguments on to mysql and mysql_check
*/ */
static void add_one_option(DYNAMIC_STRING* ds, static void add_one_option_cmd_line(DYNAMIC_STRING *ds,
const struct my_option *opt, const struct my_option *opt,
const char* argument) const char* arg)
{ {
const char* eq= NullS; dynstr_append(ds, "--");
const char* arg= NullS; dynstr_append(ds, opt->name);
if (opt->arg_type != NO_ARG) if (arg)
{ {
eq= "="; dynstr_append(ds, "=");
switch (opt->var_type & GET_TYPE_MASK) { dynstr_append_os_quoted(ds, arg, NullS);
case GET_STR:
arg= argument;
break;
case GET_BOOL:
arg= (*(my_bool *)opt->value) ? "1" : "0";
break;
default:
die("internal error at %s: %d",__FILE__, __LINE__);
}
} }
dynstr_append_os_quoted(ds, "--", opt->name, eq, arg, NullS);
dynstr_append(ds, " "); dynstr_append(ds, " ");
} }
static void add_one_option_cnf_file(DYNAMIC_STRING *ds,
const struct my_option *opt,
const char* arg)
{
dynstr_append(ds, opt->name);
if (arg)
{
dynstr_append(ds, "=");
dynstr_append_os_quoted(ds, arg, NullS);
}
dynstr_append(ds, "\n");
}
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt, get_one_option(int optid, const struct my_option *opt,
@@ -290,16 +297,17 @@ get_one_option(int optid, const struct my_option *opt,
case 'p': case 'p':
if (argument == disabled_my_option) if (argument == disabled_my_option)
argument= (char*) ""; /* Don't require password */ argument= (char*) ""; /* Don't require password */
tty_password= 1;
add_option= FALSE; add_option= FALSE;
if (argument) if (argument)
{ {
/* Add password to ds_args before overwriting the arg with x's */ /* Add password to ds_args before overwriting the arg with x's */
add_one_option(&ds_args, opt, argument); add_one_option_cnf_file(&ds_args, opt, argument);
while (*argument) while (*argument)
*argument++= 'x'; /* Destroy argument */ *argument++= 'x'; /* Destroy argument */
tty_password= 0; tty_password= 0;
} }
else
tty_password= 1;
break; break;
case 't': case 't':
@@ -346,18 +354,18 @@ get_one_option(int optid, const struct my_option *opt,
case OPT_SHARED_MEMORY_BASE_NAME: /* --shared-memory-base-name */ case OPT_SHARED_MEMORY_BASE_NAME: /* --shared-memory-base-name */
case OPT_PLUGIN_DIR: /* --plugin-dir */ case OPT_PLUGIN_DIR: /* --plugin-dir */
case OPT_DEFAULT_AUTH: /* --default-auth */ case OPT_DEFAULT_AUTH: /* --default-auth */
add_one_option(&conn_args, opt, argument); add_one_option_cmd_line(&conn_args, opt, argument);
break; break;
} }
if (add_option) if (add_option)
{ {
/* /*
This is an option that is accpted by mysql_upgrade just so This is an option that is accepted by mysql_upgrade just so
it can be passed on to "mysql" and "mysqlcheck" it can be passed on to "mysql" and "mysqlcheck"
Save it in the ds_args string Save it in the ds_args string
*/ */
add_one_option(&ds_args, opt, argument); add_one_option_cnf_file(&ds_args, opt, argument);
} }
return 0; return 0;
} }
@@ -420,11 +428,8 @@ static int run_tool(char *tool_path, DYNAMIC_STRING *ds_res, ...)
while ((arg= va_arg(args, char *))) while ((arg= va_arg(args, char *)))
{ {
/* Options should be os quoted */ /* Options should already be os quoted */
if (strncmp(arg, "--", 2) == 0) dynstr_append(&ds_cmdline, arg);
dynstr_append_os_quoted(&ds_cmdline, arg, NullS);
else
dynstr_append(&ds_cmdline, arg);
dynstr_append(&ds_cmdline, " "); dynstr_append(&ds_cmdline, " ");
} }
@@ -580,8 +585,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
ret= run_tool(mysql_path, ret= run_tool(mysql_path,
ds_res, ds_res,
"--no-defaults", defaults_file,
ds_args.str,
"--database=mysql", "--database=mysql",
"--batch", /* Turns off pager etc. */ "--batch", /* Turns off pager etc. */
force ? "--force": "--skip-force", force ? "--force": "--skip-force",
@@ -773,8 +777,7 @@ static int run_mysqlcheck_upgrade(my_bool mysql_db_only)
print_conn_args("mysqlcheck"); print_conn_args("mysqlcheck");
retch= run_tool(mysqlcheck_path, retch= run_tool(mysqlcheck_path,
NULL, /* Send output from mysqlcheck directly to screen */ NULL, /* Send output from mysqlcheck directly to screen */
"--no-defaults", defaults_file,
ds_args.str,
"--check-upgrade", "--check-upgrade",
"--auto-repair", "--auto-repair",
!opt_silent || opt_verbose >= 1 ? "--verbose" : "", !opt_silent || opt_verbose >= 1 ? "--verbose" : "",
@@ -834,8 +837,7 @@ static int run_mysqlcheck_views(void)
print_conn_args("mysqlcheck"); print_conn_args("mysqlcheck");
return run_tool(mysqlcheck_path, return run_tool(mysqlcheck_path,
NULL, /* Send output from mysqlcheck directly to screen */ NULL, /* Send output from mysqlcheck directly to screen */
"--no-defaults", defaults_file,
ds_args.str,
"--all-databases", "--repair", "--all-databases", "--repair",
upgrade_views, upgrade_views,
"--skip-process-tables", "--skip-process-tables",
@@ -859,8 +861,7 @@ static int run_mysqlcheck_fixnames(void)
print_conn_args("mysqlcheck"); print_conn_args("mysqlcheck");
return run_tool(mysqlcheck_path, return run_tool(mysqlcheck_path,
NULL, /* Send output from mysqlcheck directly to screen */ NULL, /* Send output from mysqlcheck directly to screen */
"--no-defaults", defaults_file,
ds_args.str,
"--all-databases", "--all-databases",
"--fix-db-names", "--fix-db-names",
"--fix-table-names", "--fix-table-names",
@@ -1084,12 +1085,21 @@ int main(int argc, char **argv)
{ {
opt_password= get_tty_password(NullS); opt_password= get_tty_password(NullS);
/* add password to defaults file */ /* add password to defaults file */
dynstr_append_os_quoted(&ds_args, "--password=", opt_password, NullS); add_one_option_cnf_file(&ds_args, &my_long_options[PASSWORD_OPT], opt_password);
dynstr_append(&ds_args, " "); DBUG_ASSERT(strcmp(my_long_options[PASSWORD_OPT].name, "password") == 0);
} }
/* add user to defaults file */ /* add user to defaults file */
dynstr_append_os_quoted(&ds_args, "--user=", opt_user, NullS); add_one_option_cnf_file(&ds_args, &my_long_options[USER_OPT], opt_user);
dynstr_append(&ds_args, " "); DBUG_ASSERT(strcmp(my_long_options[USER_OPT].name, "user") == 0);
cnf_file_path= strmov(defaults_file, "--defaults-file=");
{
int fd= create_temp_file(cnf_file_path, opt_tmpdir[0] ? opt_tmpdir : NULL,
"mysql_upgrade-", O_CREAT | O_WRONLY, MYF(MY_FAE));
my_write(fd, USTRING_WITH_LEN( "[client]\n"), MYF(MY_FAE));
my_write(fd, (uchar*)ds_args.str, ds_args.length, MYF(MY_FAE));
my_close(fd, MYF(0));
}
/* Find mysql */ /* Find mysql */
find_tool(mysql_path, IF_WIN("mysql.exe", "mysql"), self_name); find_tool(mysql_path, IF_WIN("mysql.exe", "mysql"), self_name);

View File

@@ -1536,6 +1536,8 @@ static void cleanup()
my_free(host); my_free(host);
my_free(user); my_free(user);
my_free(const_cast<char*>(dirname_for_local_load)); my_free(const_cast<char*>(dirname_for_local_load));
my_free(start_datetime_str);
my_free(stop_datetime_str);
delete binlog_filter; delete binlog_filter;
delete glob_description_event; delete glob_description_event;
@@ -1722,7 +1724,7 @@ static int parse_args(int *argc, char*** argv)
exit(ho_error); exit(ho_error);
if (debug_info_flag) if (debug_info_flag)
my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO; my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
if (debug_check_flag) else if (debug_check_flag)
my_end_arg= MY_CHECK_ERROR; my_end_arg= MY_CHECK_ERROR;
if (start_position > UINT_MAX32 && remote_opt) if (start_position > UINT_MAX32 && remote_opt)
{ {
@@ -2056,6 +2058,7 @@ static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
if ((rev->ident_len != logname_len) || if ((rev->ident_len != logname_len) ||
memcmp(rev->new_log_ident, logname, logname_len)) memcmp(rev->new_log_ident, logname, logname_len))
{ {
delete ev;
DBUG_RETURN(OK_CONTINUE); DBUG_RETURN(OK_CONTINUE);
} }
/* /*
@@ -2064,6 +2067,7 @@ static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
log. If we are running with to_last_remote_log, we print it, log. If we are running with to_last_remote_log, we print it,
because it serves as a useful marker between binlogs then. because it serves as a useful marker between binlogs then.
*/ */
delete ev;
continue; continue;
} }
len= 1; // fake Rotate, so don't increment old_off len= 1; // fake Rotate, so don't increment old_off
@@ -2094,7 +2098,9 @@ static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
Exit_status retval; Exit_status retval;
if ((file= load_processor.prepare_new_file_for_old_format(le,fname)) < 0) if ((file= load_processor.prepare_new_file_for_old_format(le,fname)) < 0)
{
DBUG_RETURN(ERROR_STOP); DBUG_RETURN(ERROR_STOP);
}
retval= process_event(print_event_info, ev, old_off, logname); retval= process_event(print_event_info, ev, old_off, logname);
if (retval != OK_CONTINUE) if (retval != OK_CONTINUE)
@@ -2458,23 +2464,23 @@ int main(int argc, char** argv)
if (load_defaults("my", load_groups, &argc, &argv)) if (load_defaults("my", load_groups, &argc, &argv))
exit(1); exit(1);
defaults_argv= argv;
if (!(binlog_filter= new Rpl_filter)) if (!(binlog_filter= new Rpl_filter))
{ {
error("Failed to create Rpl_filter"); error("Failed to create Rpl_filter");
exit(1); goto err;
} }
defaults_argv= argv;
parse_args(&argc, (char***)&argv); parse_args(&argc, (char***)&argv);
if (!argc || opt_version) if (!argc || opt_version)
{ {
if (!argc) if (!argc)
usage(); usage();
cleanup(); if (!opt_version)
free_defaults(defaults_argv); retval= ERROR_STOP;
my_end(my_end_arg); goto err;
exit(!opt_version);
} }
if (opt_base64_output_mode == BASE64_OUTPUT_UNSPEC) if (opt_base64_output_mode == BASE64_OUTPUT_UNSPEC)
@@ -2494,12 +2500,18 @@ int main(int argc, char** argv)
if (!dirname_for_local_load) if (!dirname_for_local_load)
{ {
if (init_tmpdir(&tmpdir, 0)) if (init_tmpdir(&tmpdir, 0))
exit(1); {
retval= ERROR_STOP;
goto err;
}
dirname_for_local_load= my_strdup(my_tmpdir(&tmpdir), MY_WME); dirname_for_local_load= my_strdup(my_tmpdir(&tmpdir), MY_WME);
} }
if (load_processor.init()) if (load_processor.init())
exit(1); {
retval= ERROR_STOP;
goto err;
}
if (dirname_for_local_load) if (dirname_for_local_load)
load_processor.init_by_dir_name(dirname_for_local_load); load_processor.init_by_dir_name(dirname_for_local_load);
else else
@@ -2568,12 +2580,20 @@ int main(int argc, char** argv)
free_defaults(defaults_argv); free_defaults(defaults_argv);
my_free_open_file_info(); my_free_open_file_info();
load_processor.destroy(); load_processor.destroy();
mysql_server_end();
/* We cannot free DBUG, it is used in global destructors after exit(). */ /* We cannot free DBUG, it is used in global destructors after exit(). */
my_end(my_end_arg | MY_DONT_FREE_DBUG); my_end(my_end_arg | MY_DONT_FREE_DBUG);
exit(retval == ERROR_STOP ? 1 : 0); exit(retval == ERROR_STOP ? 1 : 0);
/* Keep compilers happy. */ /* Keep compilers happy. */
DBUG_RETURN(retval == ERROR_STOP ? 1 : 0); DBUG_RETURN(retval == ERROR_STOP ? 1 : 0);
err:
cleanup();
free_defaults(defaults_argv);
my_end(my_end_arg);
exit(retval == ERROR_STOP ? 1 : 0);
DBUG_RETURN(retval == ERROR_STOP ? 1 : 0);
} }

View File

@@ -43,7 +43,7 @@ static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0,
opt_silent = 0, opt_auto_repair = 0, ignore_errors = 0, opt_silent = 0, opt_auto_repair = 0, ignore_errors = 0,
tty_password= 0, opt_frm= 0, debug_info_flag= 0, debug_check_flag= 0, tty_password= 0, opt_frm= 0, debug_info_flag= 0, debug_check_flag= 0,
opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0, opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0,
opt_do_tables= 1; opt_persistent_all= 0, opt_do_tables= 1;
static my_bool opt_write_binlog= 1, opt_flush_tables= 0; static my_bool opt_write_binlog= 1, opt_flush_tables= 0;
static uint verbose = 0, opt_mysql_port=0; static uint verbose = 0, opt_mysql_port=0;
static int my_end_arg; static int my_end_arg;
@@ -160,6 +160,10 @@ static struct my_option my_long_options[] =
{"password", 'p', {"password", 'p',
"Password to use when connecting to server. If password is not given, it's solicited on the tty.", "Password to use when connecting to server. If password is not given, it's solicited on the tty.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"persistent", 'Z',
"When using ANALYZE TABLE use the PERSISTENT FOR ALL option.",
&opt_persistent_all, &opt_persistent_all, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
#ifdef __WIN__ #ifdef __WIN__
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG, {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -910,6 +914,7 @@ static int handle_request_for_tables(char *tables, size_t length, my_bool view)
case DO_ANALYZE: case DO_ANALYZE:
DBUG_ASSERT(!view); DBUG_ASSERT(!view);
op= (opt_write_binlog) ? "ANALYZE" : "ANALYZE NO_WRITE_TO_BINLOG"; op= (opt_write_binlog) ? "ANALYZE" : "ANALYZE NO_WRITE_TO_BINLOG";
if (opt_persistent_all) end = strmov(end, " PERSISTENT FOR ALL");
break; break;
case DO_OPTIMIZE: case DO_OPTIMIZE:
DBUG_ASSERT(!view); DBUG_ASSERT(!view);

View File

@@ -1,6 +1,6 @@
/* /*
Copyright (c) 2000, 2013, Oracle and/or its affiliates. Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2013, Monty Program Ab. Copyright (c) 2010, 2015, Monty Program Ab.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@@ -148,6 +148,12 @@ static int first_error=0;
*/ */
static uint multi_source= 0; static uint multi_source= 0;
static DYNAMIC_STRING extended_row; static DYNAMIC_STRING extended_row;
static DYNAMIC_STRING dynamic_where;
static MYSQL_RES *get_table_name_result= NULL;
static MEM_ROOT glob_root;
static MYSQL_RES *routine_res, *routine_list_res;
#include <sslopt-vars.h> #include <sslopt-vars.h>
FILE *md_result_file= 0; FILE *md_result_file= 0;
FILE *stderror_file=0; FILE *stderror_file=0;
@@ -1144,16 +1150,14 @@ static int fetch_db_collation(const char *db_name,
int db_cl_size) int db_cl_size)
{ {
my_bool err_status= FALSE; my_bool err_status= FALSE;
char query[QUERY_LENGTH];
MYSQL_RES *db_cl_res; MYSQL_RES *db_cl_res;
MYSQL_ROW db_cl_row; MYSQL_ROW db_cl_row;
char quoted_database_buf[NAME_LEN*2+3];
char *qdatabase= quote_name(db_name, quoted_database_buf, 1);
my_snprintf(query, sizeof (query), "use %s", qdatabase); if (mysql_select_db(mysql, db_name))
{
if (mysql_query_with_error_report(mysql, NULL, query)) DB_error(mysql, "when selecting the database");
return 1; return 1; /* If --force */
}
if (mysql_query_with_error_report(mysql, &db_cl_res, if (mysql_query_with_error_report(mysql, &db_cl_res,
"select @@collation_database")) "select @@collation_database"))
@@ -1591,14 +1595,26 @@ static void free_resources()
{ {
if (md_result_file && md_result_file != stdout) if (md_result_file && md_result_file != stdout)
my_fclose(md_result_file, MYF(0)); my_fclose(md_result_file, MYF(0));
if (get_table_name_result)
mysql_free_result(get_table_name_result);
if (routine_res)
mysql_free_result(routine_res);
if (routine_list_res)
mysql_free_result(routine_list_res);
if (mysql)
{
mysql_close(mysql);
mysql= 0;
}
my_free(order_by);
my_free(opt_password); my_free(opt_password);
my_free(current_host); my_free(current_host);
free_root(&glob_root, MYF(0));
if (my_hash_inited(&ignore_table)) if (my_hash_inited(&ignore_table))
my_hash_free(&ignore_table); my_hash_free(&ignore_table);
if (extended_insert) dynstr_free(&extended_row);
dynstr_free(&extended_row); dynstr_free(&dynamic_where);
if (insert_pat_inited) dynstr_free(&insert_pat);
dynstr_free(&insert_pat);
if (defaults_argv) if (defaults_argv)
free_defaults(defaults_argv); free_defaults(defaults_argv);
mysql_library_end(); mysql_library_end();
@@ -1615,8 +1631,6 @@ static void maybe_exit(int error)
ignore_errors= 1; /* don't want to recurse, if something fails below */ ignore_errors= 1; /* don't want to recurse, if something fails below */
if (opt_slave_data) if (opt_slave_data)
do_start_slave_sql(mysql); do_start_slave_sql(mysql);
if (mysql)
mysql_close(mysql);
free_resources(); free_resources();
exit(error); exit(error);
} }
@@ -1709,6 +1723,7 @@ static void dbDisconnect(char *host)
{ {
verbose_msg("-- Disconnecting from %s...\n", host ? host : "localhost"); verbose_msg("-- Disconnecting from %s...\n", host ? host : "localhost");
mysql_close(mysql); mysql_close(mysql);
mysql= 0;
} /* dbDisconnect */ } /* dbDisconnect */
@@ -2350,6 +2365,8 @@ static uint dump_events_for_db(char *db)
(const char *) (query_str != NULL ? query_str : row[3]), (const char *) (query_str != NULL ? query_str : row[3]),
(const char *) delimiter); (const char *) delimiter);
my_free(query_str);
restore_time_zone(sql_file, delimiter); restore_time_zone(sql_file, delimiter);
restore_sql_mode(sql_file, delimiter); restore_sql_mode(sql_file, delimiter);
@@ -2434,7 +2451,6 @@ static uint dump_routines_for_db(char *db)
char *routine_name; char *routine_name;
int i; int i;
FILE *sql_file= md_result_file; FILE *sql_file= md_result_file;
MYSQL_RES *routine_res, *routine_list_res;
MYSQL_ROW row, routine_list_row; MYSQL_ROW row, routine_list_row;
char db_cl_name[MY_CS_NAME_SIZE]; char db_cl_name[MY_CS_NAME_SIZE];
@@ -2458,7 +2474,7 @@ static uint dump_routines_for_db(char *db)
/* Get database collation. */ /* Get database collation. */
if (fetch_db_collation(db_name_buff, db_cl_name, sizeof (db_cl_name))) if (fetch_db_collation(db, db_cl_name, sizeof (db_cl_name)))
DBUG_RETURN(1); DBUG_RETURN(1);
if (switch_character_set_results(mysql, "binary")) if (switch_character_set_results(mysql, "binary"))
@@ -2489,7 +2505,11 @@ static uint dump_routines_for_db(char *db)
routine_type[i], routine_name); routine_type[i], routine_name);
if (mysql_query_with_error_report(mysql, &routine_res, query_buff)) if (mysql_query_with_error_report(mysql, &routine_res, query_buff))
{
mysql_free_result(routine_list_res);
routine_list_res= 0;
DBUG_RETURN(1); DBUG_RETURN(1);
}
while ((row= mysql_fetch_row(routine_res))) while ((row= mysql_fetch_row(routine_res)))
{ {
@@ -2507,7 +2527,8 @@ static uint dump_routines_for_db(char *db)
print_comment(sql_file, 1, print_comment(sql_file, 1,
"-- does %s have permissions on mysql.proc?\n\n", "-- does %s have permissions on mysql.proc?\n\n",
current_user); current_user);
maybe_die(EX_MYSQLERR,"%s has insufficent privileges to %s!", current_user, query_buff); maybe_die(EX_MYSQLERR,"%s has insufficent privileges to %s!",
current_user, query_buff);
} }
else if (strlen(row[2])) else if (strlen(row[2]))
{ {
@@ -2527,9 +2548,12 @@ static uint dump_routines_for_db(char *db)
if (mysql_num_fields(routine_res) >= 6) if (mysql_num_fields(routine_res) >= 6)
{ {
if (switch_db_collation(sql_file, db_name_buff, ";", if (switch_db_collation(sql_file, db, ";",
db_cl_name, row[5], &db_cl_altered)) db_cl_name, row[5], &db_cl_altered))
{ {
mysql_free_result(routine_res);
mysql_free_result(routine_list_res);
routine_res= routine_list_res= 0;
DBUG_RETURN(1); DBUG_RETURN(1);
} }
@@ -2574,18 +2598,25 @@ static uint dump_routines_for_db(char *db)
if (db_cl_altered) if (db_cl_altered)
{ {
if (restore_db_collation(sql_file, db_name_buff, ";", db_cl_name)) if (restore_db_collation(sql_file, db, ";", db_cl_name))
{
mysql_free_result(routine_res);
mysql_free_result(routine_list_res);
routine_res= routine_list_res= 0;
DBUG_RETURN(1); DBUG_RETURN(1);
}
} }
} }
} }
} /* end of routine printing */ } /* end of routine printing */
mysql_free_result(routine_res); mysql_free_result(routine_res);
routine_res= 0;
} /* end of list of routines */ } /* end of list of routines */
} }
mysql_free_result(routine_list_res); mysql_free_result(routine_list_res);
routine_list_res= 0;
} /* end of for i (0 .. 1) */ } /* end of for i (0 .. 1) */
if (opt_xml) if (opt_xml)
@@ -2708,13 +2739,20 @@ static uint get_table_structure(char *table, char *db, char *table_type,
if (switch_character_set_results(mysql, "binary") || if (switch_character_set_results(mysql, "binary") ||
mysql_query_with_error_report(mysql, &result, buff) || mysql_query_with_error_report(mysql, &result, buff) ||
switch_character_set_results(mysql, default_charset)) switch_character_set_results(mysql, default_charset))
{
my_free(order_by);
order_by= 0;
DBUG_RETURN(0); DBUG_RETURN(0);
}
if (path) if (path)
{ {
if (!(sql_file= open_sql_file_for_table(table, O_WRONLY))) if (!(sql_file= open_sql_file_for_table(table, O_WRONLY)))
{
my_free(order_by);
order_by= 0;
DBUG_RETURN(0); DBUG_RETURN(0);
}
write_header(sql_file, db); write_header(sql_file, db);
} }
@@ -3286,10 +3324,6 @@ static int dump_trigger(FILE *sql_file, MYSQL_RES *show_create_trigger_rs,
continue; continue;
} }
query_str= cover_definer_clause(row[2], strlen(row[2]),
C_STRING_WITH_LEN("50017"),
C_STRING_WITH_LEN("50003"),
C_STRING_WITH_LEN(" TRIGGER"));
if (switch_db_collation(sql_file, db_name, ";", if (switch_db_collation(sql_file, db_name, ";",
db_cl_name, row[5], &db_cl_altered)) db_cl_name, row[5], &db_cl_altered))
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
@@ -3301,12 +3335,18 @@ static int dump_trigger(FILE *sql_file, MYSQL_RES *show_create_trigger_rs,
switch_sql_mode(sql_file, ";", row[1]); switch_sql_mode(sql_file, ";", row[1]);
query_str= cover_definer_clause(row[2], strlen(row[2]),
C_STRING_WITH_LEN("50017"),
C_STRING_WITH_LEN("50003"),
C_STRING_WITH_LEN(" TRIGGER"));
fprintf(sql_file, fprintf(sql_file,
"DELIMITER ;;\n" "DELIMITER ;;\n"
"/*!50003 %s */;;\n" "/*!50003 %s */;;\n"
"DELIMITER ;\n", "DELIMITER ;\n",
(const char *) (query_str != NULL ? query_str : row[2])); (const char *) (query_str != NULL ? query_str : row[2]));
my_free(query_str);
restore_sql_mode(sql_file, ";"); restore_sql_mode(sql_file, ";");
restore_cs_variables(sql_file, ";"); restore_cs_variables(sql_file, ";");
@@ -3315,8 +3355,6 @@ static int dump_trigger(FILE *sql_file, MYSQL_RES *show_create_trigger_rs,
if (restore_db_collation(sql_file, db_name, ";", db_cl_name)) if (restore_db_collation(sql_file, db_name, ";", db_cl_name))
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
} }
my_free(query_str);
} }
DBUG_RETURN(FALSE); DBUG_RETURN(FALSE);
@@ -3409,13 +3447,14 @@ static int dump_triggers_for_table(char *table_name, char *db_name)
{ {
MYSQL_RES *show_create_trigger_rs= mysql_store_result(mysql); MYSQL_RES *show_create_trigger_rs= mysql_store_result(mysql);
if (!show_create_trigger_rs || int error= (!show_create_trigger_rs ||
dump_trigger(sql_file, show_create_trigger_rs, db_name, db_cl_name)) dump_trigger(sql_file, show_create_trigger_rs, db_name,
goto done; db_cl_name));
mysql_free_result(show_create_trigger_rs); mysql_free_result(show_create_trigger_rs);
if (error)
goto done;
} }
} }
if (opt_xml) if (opt_xml)
@@ -3662,12 +3701,14 @@ static void dump_table(char *table, char *db)
{ {
dynstr_append_checked(&query_string, " ORDER BY "); dynstr_append_checked(&query_string, " ORDER BY ");
dynstr_append_checked(&query_string, order_by); dynstr_append_checked(&query_string, order_by);
my_free(order_by);
order_by= 0;
} }
if (mysql_real_query(mysql, query_string.str, query_string.length)) if (mysql_real_query(mysql, query_string.str, query_string.length))
{ {
DB_error(mysql, "when executing 'SELECT INTO OUTFILE'");
dynstr_free(&query_string); dynstr_free(&query_string);
DB_error(mysql, "when executing 'SELECT INTO OUTFILE'");
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
} }
@@ -3693,6 +3734,8 @@ static void dump_table(char *table, char *db)
dynstr_append_checked(&query_string, " ORDER BY "); dynstr_append_checked(&query_string, " ORDER BY ");
dynstr_append_checked(&query_string, order_by); dynstr_append_checked(&query_string, order_by);
my_free(order_by);
order_by= 0;
} }
if (!opt_xml && !opt_compact) if (!opt_xml && !opt_compact)
@@ -3702,6 +3745,7 @@ static void dump_table(char *table, char *db)
} }
if (mysql_query_with_error_report(mysql, 0, query_string.str)) if (mysql_query_with_error_report(mysql, 0, query_string.str))
{ {
dynstr_free(&query_string);
DB_error(mysql, "when retrieving data from server"); DB_error(mysql, "when retrieving data from server");
goto err; goto err;
} }
@@ -3711,6 +3755,7 @@ static void dump_table(char *table, char *db)
res=mysql_store_result(mysql); res=mysql_store_result(mysql);
if (!res) if (!res)
{ {
dynstr_free(&query_string);
DB_error(mysql, "when retrieving data from server"); DB_error(mysql, "when retrieving data from server");
goto err; goto err;
} }
@@ -4026,23 +4071,22 @@ err:
static char *getTableName(int reset) static char *getTableName(int reset)
{ {
static MYSQL_RES *res= NULL; MYSQL_ROW row;
MYSQL_ROW row;
if (!res) if (!get_table_name_result)
{ {
if (!(res= mysql_list_tables(mysql,NullS))) if (!(get_table_name_result= mysql_list_tables(mysql,NullS)))
return(NULL); return(NULL);
} }
if ((row= mysql_fetch_row(res))) if ((row= mysql_fetch_row(get_table_name_result)))
return((char*) row[0]); return((char*) row[0]);
if (reset) if (reset)
mysql_data_seek(res,0); /* We want to read again */ mysql_data_seek(get_table_name_result,0); /* We want to read again */
else else
{ {
mysql_free_result(res); mysql_free_result(get_table_name_result);
res= NULL; get_table_name_result= NULL;
} }
return(NULL); return(NULL);
} /* getTableName */ } /* getTableName */
@@ -4059,46 +4103,44 @@ static int dump_all_tablespaces()
static int dump_tablespaces_for_tables(char *db, char **table_names, int tables) static int dump_tablespaces_for_tables(char *db, char **table_names, int tables)
{ {
DYNAMIC_STRING where;
int r; int r;
int i; int i;
char name_buff[NAME_LEN*2+3]; char name_buff[NAME_LEN*2+3];
mysql_real_escape_string(mysql, name_buff, db, strlen(db)); mysql_real_escape_string(mysql, name_buff, db, strlen(db));
init_dynamic_string_checked(&where, " AND TABLESPACE_NAME IN (" init_dynamic_string_checked(&dynamic_where, " AND TABLESPACE_NAME IN ("
"SELECT DISTINCT TABLESPACE_NAME FROM" "SELECT DISTINCT TABLESPACE_NAME FROM"
" INFORMATION_SCHEMA.PARTITIONS" " INFORMATION_SCHEMA.PARTITIONS"
" WHERE" " WHERE"
" TABLE_SCHEMA='", 256, 1024); " TABLE_SCHEMA='", 256, 1024);
dynstr_append_checked(&where, name_buff); dynstr_append_checked(&dynamic_where, name_buff);
dynstr_append_checked(&where, "' AND TABLE_NAME IN ("); dynstr_append_checked(&dynamic_where, "' AND TABLE_NAME IN (");
for (i=0 ; i<tables ; i++) for (i=0 ; i<tables ; i++)
{ {
mysql_real_escape_string(mysql, name_buff, mysql_real_escape_string(mysql, name_buff,
table_names[i], strlen(table_names[i])); table_names[i], strlen(table_names[i]));
dynstr_append_checked(&where, "'"); dynstr_append_checked(&dynamic_where, "'");
dynstr_append_checked(&where, name_buff); dynstr_append_checked(&dynamic_where, name_buff);
dynstr_append_checked(&where, "',"); dynstr_append_checked(&dynamic_where, "',");
} }
dynstr_trunc(&where, 1); dynstr_trunc(&dynamic_where, 1);
dynstr_append_checked(&where,"))"); dynstr_append_checked(&dynamic_where,"))");
DBUG_PRINT("info",("Dump TS for Tables where: %s",where.str)); DBUG_PRINT("info",("Dump TS for Tables where: %s",dynamic_where.str));
r= dump_tablespaces(where.str); r= dump_tablespaces(dynamic_where.str);
dynstr_free(&where); dynstr_free(&dynamic_where);
return r; return r;
} }
static int dump_tablespaces_for_databases(char** databases) static int dump_tablespaces_for_databases(char** databases)
{ {
DYNAMIC_STRING where;
int r; int r;
int i; int i;
init_dynamic_string_checked(&where, " AND TABLESPACE_NAME IN (" init_dynamic_string_checked(&dynamic_where, " AND TABLESPACE_NAME IN ("
"SELECT DISTINCT TABLESPACE_NAME FROM" "SELECT DISTINCT TABLESPACE_NAME FROM"
" INFORMATION_SCHEMA.PARTITIONS" " INFORMATION_SCHEMA.PARTITIONS"
" WHERE" " WHERE"
@@ -4109,16 +4151,16 @@ static int dump_tablespaces_for_databases(char** databases)
char db_name_buff[NAME_LEN*2+3]; char db_name_buff[NAME_LEN*2+3];
mysql_real_escape_string(mysql, db_name_buff, mysql_real_escape_string(mysql, db_name_buff,
databases[i], strlen(databases[i])); databases[i], strlen(databases[i]));
dynstr_append_checked(&where, "'"); dynstr_append_checked(&dynamic_where, "'");
dynstr_append_checked(&where, db_name_buff); dynstr_append_checked(&dynamic_where, db_name_buff);
dynstr_append_checked(&where, "',"); dynstr_append_checked(&dynamic_where, "',");
} }
dynstr_trunc(&where, 1); dynstr_trunc(&dynamic_where, 1);
dynstr_append_checked(&where,"))"); dynstr_append_checked(&dynamic_where,"))");
DBUG_PRINT("info",("Dump TS for DBs where: %s",where.str)); DBUG_PRINT("info",("Dump TS for DBs where: %s",dynamic_where.str));
r= dump_tablespaces(where.str); r= dump_tablespaces(dynamic_where.str);
dynstr_free(&where); dynstr_free(&dynamic_where);
return r; return r;
} }
@@ -4526,9 +4568,12 @@ static int dump_all_tables_in_db(char *database)
} }
} }
if (numrows && mysql_real_query(mysql, query.str, query.length-1)) if (numrows && mysql_real_query(mysql, query.str, query.length-1))
{
dynstr_free(&query);
DB_error(mysql, "when using LOCK TABLES"); DB_error(mysql, "when using LOCK TABLES");
/* We shall continue here, if --force was given */ /* We shall continue here, if --force was given */
dynstr_free(&query); }
dynstr_free(&query); /* Safe to call twice */
} }
if (flush_logs) if (flush_logs)
{ {
@@ -4542,7 +4587,9 @@ static int dump_all_tables_in_db(char *database)
{ {
verbose_msg("-- Setting savepoint...\n"); verbose_msg("-- Setting savepoint...\n");
if (mysql_query_with_error_report(mysql, 0, "SAVEPOINT sp")) if (mysql_query_with_error_report(mysql, 0, "SAVEPOINT sp"))
{
DBUG_RETURN(1); DBUG_RETURN(1);
}
} }
while ((table= getTableName(0))) while ((table= getTableName(0)))
{ {
@@ -4839,7 +4886,6 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
{ {
char table_buff[NAME_LEN*2+3]; char table_buff[NAME_LEN*2+3];
DYNAMIC_STRING lock_tables_query; DYNAMIC_STRING lock_tables_query;
MEM_ROOT root;
char **dump_tables, **pos, **end; char **dump_tables, **pos, **end;
int lower_case_table_names; int lower_case_table_names;
DBUG_ENTER("dump_selected_tables"); DBUG_ENTER("dump_selected_tables");
@@ -4847,8 +4893,9 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
if (init_dumping(db, init_dumping_tables)) if (init_dumping(db, init_dumping_tables))
DBUG_RETURN(1); DBUG_RETURN(1);
init_alloc_root(&root, 8192, 0, MYF(0)); init_alloc_root(&glob_root, 8192, 0, MYF(0));
if (!(dump_tables= pos= (char**) alloc_root(&root, tables * sizeof(char *)))) if (!(dump_tables= pos= (char**) alloc_root(&glob_root,
tables * sizeof(char *))))
die(EX_EOM, "alloc_root failure."); die(EX_EOM, "alloc_root failure.");
/* Figure out how to compare table names. */ /* Figure out how to compare table names. */
@@ -4859,7 +4906,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
{ {
/* the table name passed on commandline may be wrong case */ /* the table name passed on commandline may be wrong case */
if ((*pos= get_actual_table_name(*table_names, lower_case_table_names, if ((*pos= get_actual_table_name(*table_names, lower_case_table_names,
&root))) &glob_root)))
{ {
/* Add found table name to lock_tables_query */ /* Add found table name to lock_tables_query */
if (lock_tables) if (lock_tables)
@@ -4874,7 +4921,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
if (!ignore_errors) if (!ignore_errors)
{ {
dynstr_free(&lock_tables_query); dynstr_free(&lock_tables_query);
free_root(&root, MYF(0)); free_root(&glob_root, MYF(0));
} }
maybe_die(EX_ILLEGAL_TABLE, "Couldn't find table: \"%s\"", *table_names); maybe_die(EX_ILLEGAL_TABLE, "Couldn't find table: \"%s\"", *table_names);
/* We shall countinue here, if --force was given */ /* We shall countinue here, if --force was given */
@@ -4895,7 +4942,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
if (!ignore_errors) if (!ignore_errors)
{ {
dynstr_free(&lock_tables_query); dynstr_free(&lock_tables_query);
free_root(&root, MYF(0)); free_root(&glob_root, MYF(0));
} }
DB_error(mysql, "when doing LOCK TABLES"); DB_error(mysql, "when doing LOCK TABLES");
/* We shall countinue here, if --force was given */ /* We shall countinue here, if --force was given */
@@ -4907,7 +4954,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
if (mysql_refresh(mysql, REFRESH_LOG)) if (mysql_refresh(mysql, REFRESH_LOG))
{ {
if (!ignore_errors) if (!ignore_errors)
free_root(&root, MYF(0)); free_root(&glob_root, MYF(0));
DB_error(mysql, "when doing refresh"); DB_error(mysql, "when doing refresh");
} }
/* We shall countinue here, if --force was given */ /* We shall countinue here, if --force was given */
@@ -4921,7 +4968,10 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
{ {
verbose_msg("-- Setting savepoint...\n"); verbose_msg("-- Setting savepoint...\n");
if (mysql_query_with_error_report(mysql, 0, "SAVEPOINT sp")) if (mysql_query_with_error_report(mysql, 0, "SAVEPOINT sp"))
{
free_root(&glob_root, MYF(0));
DBUG_RETURN(1); DBUG_RETURN(1);
}
} }
/* Dump each selected table */ /* Dump each selected table */
@@ -4936,6 +4986,8 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
{ {
if (path) if (path)
my_fclose(md_result_file, MYF(MY_WME)); my_fclose(md_result_file, MYF(MY_WME));
if (!ignore_errors)
free_root(&glob_root, MYF(0));
maybe_exit(EX_MYSQLERR); maybe_exit(EX_MYSQLERR);
} }
} }
@@ -4954,7 +5006,11 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
{ {
verbose_msg("-- Rolling back to savepoint sp...\n"); verbose_msg("-- Rolling back to savepoint sp...\n");
if (mysql_query_with_error_report(mysql, 0, "ROLLBACK TO SAVEPOINT sp")) if (mysql_query_with_error_report(mysql, 0, "ROLLBACK TO SAVEPOINT sp"))
{
if (!ignore_errors)
free_root(&glob_root, MYF(0));
maybe_exit(EX_MYSQLERR); maybe_exit(EX_MYSQLERR);
}
} }
} }
@@ -4962,8 +5018,10 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
{ {
verbose_msg("-- Releasing savepoint...\n"); verbose_msg("-- Releasing savepoint...\n");
if (mysql_query_with_error_report(mysql, 0, "RELEASE SAVEPOINT sp")) if (mysql_query_with_error_report(mysql, 0, "RELEASE SAVEPOINT sp"))
{
free_root(&glob_root, MYF(0));
DBUG_RETURN(1); DBUG_RETURN(1);
}
} }
/* Dump each selected view */ /* Dump each selected view */
@@ -4983,9 +5041,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
DBUG_PRINT("info", ("Dumping routines for database %s", db)); DBUG_PRINT("info", ("Dumping routines for database %s", db));
dump_routines_for_db(db); dump_routines_for_db(db);
} }
free_root(&root, MYF(0)); free_root(&glob_root, MYF(0));
my_free(order_by);
order_by= 0;
if (opt_xml) if (opt_xml)
{ {
fputs("</database>\n", md_result_file); fputs("</database>\n", md_result_file);

View File

@@ -1,6 +1,6 @@
/* /*
Copyright (c) 2000, 2012, Oracle and/or its affiliates. Copyright (c) 2000, 2015, Oracle and/or its affiliates.
Copyright (c) 2010, 2012, Monty Program Ab Copyright (c) 2010, 2015, MariaDB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@@ -68,10 +68,12 @@ int main(int argc, char **argv)
my_bool first_argument_uses_wildcards=0; my_bool first_argument_uses_wildcards=0;
char *wild; char *wild;
MYSQL mysql; MYSQL mysql;
static char **defaults_argv;
MY_INIT(argv[0]); MY_INIT(argv[0]);
sf_leaking_memory=1; /* don't report memory leaks on early exits */ sf_leaking_memory=1; /* don't report memory leaks on early exits */
if (load_defaults("my",load_default_groups,&argc,&argv)) if (load_defaults("my",load_default_groups,&argc,&argv))
exit(1); exit(1);
defaults_argv=argv;
get_options(&argc,&argv); get_options(&argc,&argv);
@@ -150,7 +152,8 @@ int main(int argc, char **argv)
0))) 0)))
{ {
fprintf(stderr,"%s: %s\n",my_progname,mysql_error(&mysql)); fprintf(stderr,"%s: %s\n",my_progname,mysql_error(&mysql));
exit(1); error= 1;
goto error;
} }
mysql.reconnect= 1; mysql.reconnect= 1;
@@ -169,11 +172,14 @@ int main(int argc, char **argv)
error=list_fields(&mysql,argv[0],argv[1],wild); error=list_fields(&mysql,argv[0],argv[1],wild);
break; break;
} }
error:
mysql_close(&mysql); /* Close & free connection */ mysql_close(&mysql); /* Close & free connection */
my_free(opt_password); my_free(opt_password);
mysql_server_end();
#ifdef HAVE_SMEM #ifdef HAVE_SMEM
my_free(shared_memory_base_name); my_free(shared_memory_base_name);
#endif #endif
free_defaults(defaults_argv);
my_end(my_end_arg); my_end(my_end_arg);
exit(error ? 1 : 0); exit(error ? 1 : 0);
return 0; /* No compiler warnings */ return 0; /* No compiler warnings */
@@ -376,7 +382,7 @@ list_dbs(MYSQL *mysql,const char *wild)
uint length, counter = 0; uint length, counter = 0;
ulong rowcount = 0L; ulong rowcount = 0L;
char tables[NAME_LEN+1], rows[NAME_LEN+1]; char tables[NAME_LEN+1], rows[NAME_LEN+1];
char query[255]; char query[NAME_LEN + 100];
MYSQL_FIELD *field; MYSQL_FIELD *field;
MYSQL_RES *result; MYSQL_RES *result;
MYSQL_ROW row= NULL, rrow; MYSQL_ROW row= NULL, rrow;
@@ -443,7 +449,8 @@ list_dbs(MYSQL *mysql,const char *wild)
MYSQL_ROW trow; MYSQL_ROW trow;
while ((trow = mysql_fetch_row(tresult))) while ((trow = mysql_fetch_row(tresult)))
{ {
sprintf(query,"SELECT COUNT(*) FROM `%s`",trow[0]); my_snprintf(query, sizeof(query),
"SELECT COUNT(*) FROM `%s`", trow[0]);
if (!(mysql_query(mysql,query))) if (!(mysql_query(mysql,query)))
{ {
MYSQL_RES *rresult; MYSQL_RES *rresult;
@@ -499,7 +506,7 @@ list_tables(MYSQL *mysql,const char *db,const char *table)
{ {
const char *header; const char *header;
uint head_length, counter = 0; uint head_length, counter = 0;
char query[255], rows[NAME_LEN], fields[16]; char query[NAME_LEN + 100], rows[NAME_LEN], fields[16];
MYSQL_FIELD *field; MYSQL_FIELD *field;
MYSQL_RES *result; MYSQL_RES *result;
MYSQL_ROW row, rrow; MYSQL_ROW row, rrow;
@@ -584,7 +591,8 @@ list_tables(MYSQL *mysql,const char *db,const char *table)
if (opt_verbose > 1) if (opt_verbose > 1)
{ {
/* Print the count of rows for each table */ /* Print the count of rows for each table */
sprintf(query,"SELECT COUNT(*) FROM `%s`",row[0]); my_snprintf(query, sizeof(query), "SELECT COUNT(*) FROM `%s`",
row[0]);
if (!(mysql_query(mysql,query))) if (!(mysql_query(mysql,query)))
{ {
if ((rresult = mysql_store_result(mysql))) if ((rresult = mysql_store_result(mysql)))
@@ -644,13 +652,15 @@ list_tables(MYSQL *mysql,const char *db,const char *table)
static int static int
list_table_status(MYSQL *mysql,const char *db,const char *wild) list_table_status(MYSQL *mysql,const char *db,const char *wild)
{ {
char query[1024],*end; char query[NAME_LEN + 100];
int len;
MYSQL_RES *result; MYSQL_RES *result;
MYSQL_ROW row; MYSQL_ROW row;
end=strxmov(query,"show table status from `",db,"`",NullS); len= sizeof(query);
if (wild && wild[0]) len-= my_snprintf(query, len, "show table status from `%s`", db);
strxmov(end," like '",wild,"'",NullS); if (wild && wild[0] && len)
strxnmov(query + strlen(query), len, " like '", wild, "'", NullS);
if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql))) if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql)))
{ {
fprintf(stderr,"%s: Cannot get status for db: %s, table: %s: %s\n", fprintf(stderr,"%s: Cannot get status for db: %s, table: %s: %s\n",
@@ -682,7 +692,8 @@ static int
list_fields(MYSQL *mysql,const char *db,const char *table, list_fields(MYSQL *mysql,const char *db,const char *table,
const char *wild) const char *wild)
{ {
char query[1024],*end; char query[NAME_LEN + 100];
int len;
MYSQL_RES *result; MYSQL_RES *result;
MYSQL_ROW row; MYSQL_ROW row;
ulong UNINIT_VAR(rows); ulong UNINIT_VAR(rows);
@@ -696,7 +707,7 @@ list_fields(MYSQL *mysql,const char *db,const char *table,
if (opt_count) if (opt_count)
{ {
sprintf(query,"select count(*) from `%s`", table); my_snprintf(query, sizeof(query), "select count(*) from `%s`", table);
if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql))) if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql)))
{ {
fprintf(stderr,"%s: Cannot get record count for db: %s, table: %s: %s\n", fprintf(stderr,"%s: Cannot get record count for db: %s, table: %s: %s\n",
@@ -708,9 +719,11 @@ list_fields(MYSQL *mysql,const char *db,const char *table,
mysql_free_result(result); mysql_free_result(result);
} }
end=strmov(strmov(strmov(query,"show /*!32332 FULL */ columns from `"),table),"`"); len= sizeof(query);
if (wild && wild[0]) len-= my_snprintf(query, len, "show /*!32332 FULL */ columns from `%s`",
strxmov(end," like '",wild,"'",NullS); table);
if (wild && wild[0] && len)
strxnmov(query + strlen(query), len, " like '", wild, "'", NullS);
if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql))) if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql)))
{ {
fprintf(stderr,"%s: Cannot list columns in db: %s, table: %s: %s\n", fprintf(stderr,"%s: Cannot list columns in db: %s, table: %s: %s\n",
@@ -731,7 +744,7 @@ list_fields(MYSQL *mysql,const char *db,const char *table,
print_res_top(result); print_res_top(result);
if (opt_show_keys) if (opt_show_keys)
{ {
end=strmov(strmov(strmov(query,"show keys from `"),table),"`"); my_snprintf(query, sizeof(query), "show keys from `%s`", table);
if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql))) if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql)))
{ {
fprintf(stderr,"%s: Cannot list keys in db: %s, table: %s: %s\n", fprintf(stderr,"%s: Cannot list keys in db: %s, table: %s: %s\n",

View File

@@ -168,6 +168,7 @@ static ulonglong auto_generate_sql_number;
const char *concurrency_str= NULL; const char *concurrency_str= NULL;
static char *create_string; static char *create_string;
uint *concurrency; uint *concurrency;
static char mysql_charsets_dir[FN_REFLEN+1];
const char *default_dbug_option="d:t:o,/tmp/mysqlslap.trace"; const char *default_dbug_option="d:t:o,/tmp/mysqlslap.trace";
const char *opt_csv_str; const char *opt_csv_str;
@@ -372,6 +373,7 @@ int main(int argc, char **argv)
{ {
fprintf(stderr,"%s: Error when connecting to server: %s\n", fprintf(stderr,"%s: Error when connecting to server: %s\n",
my_progname,mysql_error(&mysql)); my_progname,mysql_error(&mysql));
mysql_close(&mysql);
free_defaults(defaults_argv); free_defaults(defaults_argv);
my_end(0); my_end(0);
exit(1); exit(1);
@@ -417,8 +419,7 @@ int main(int argc, char **argv)
pthread_mutex_destroy(&sleeper_mutex); pthread_mutex_destroy(&sleeper_mutex);
pthread_cond_destroy(&sleep_threshhold); pthread_cond_destroy(&sleep_threshhold);
if (!opt_only_print) mysql_close(&mysql); /* Close & free connection */
mysql_close(&mysql); /* Close & free connection */
/* now free all the strings we created */ /* now free all the strings we created */
my_free(opt_password); my_free(opt_password);
@@ -585,6 +586,9 @@ static struct my_option my_long_options[] =
"Number of row inserts to perform for each thread (default is 100).", "Number of row inserts to perform for each thread (default is 100).",
&auto_generate_sql_number, &auto_generate_sql_number, &auto_generate_sql_number, &auto_generate_sql_number,
0, GET_ULL, REQUIRED_ARG, 100, 0, 0, 0, 0, 0}, 0, GET_ULL, REQUIRED_ARG, 100, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
"Directory for character set files.", &charsets_dir,
&charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"commit", OPT_SLAP_COMMIT, "Commit records every X number of statements.", {"commit", OPT_SLAP_COMMIT, "Commit records every X number of statements.",
&commit_rate, &commit_rate, 0, GET_UINT, REQUIRED_ARG, &commit_rate, &commit_rate, 0, GET_UINT, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
@@ -782,6 +786,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
DBUG_PUSH(argument ? argument : default_dbug_option); DBUG_PUSH(argument ? argument : default_dbug_option);
debug_check_flag= 1; debug_check_flag= 1;
break; break;
case OPT_CHARSETS_DIR:
strmake_buf(mysql_charsets_dir, argument);
charsets_dir = mysql_charsets_dir;
break;
case OPT_SLAP_CSV: case OPT_SLAP_CSV:
if (!argument) if (!argument)
argument= (char *)"-"; /* use stdout */ argument= (char *)"-"; /* use stdout */
@@ -1863,21 +1871,21 @@ pthread_handler_t run_task(void *p)
} }
pthread_mutex_unlock(&sleeper_mutex); pthread_mutex_unlock(&sleeper_mutex);
if (!(mysql= mysql_init(NULL)))
{
fprintf(stderr,"%s: mysql_init() failed ERROR : %s\n",
my_progname, mysql_error(mysql));
exit(0);
}
set_mysql_connect_options(mysql);
if (mysql_thread_init()) if (mysql_thread_init())
{ {
fprintf(stderr,"%s: mysql_thread_init() failed ERROR : %s\n", fprintf(stderr,"%s: mysql_thread_init() failed\n", my_progname);
my_progname, mysql_error(mysql));
exit(0); exit(0);
} }
if (!(mysql= mysql_init(NULL)))
{
fprintf(stderr,"%s: mysql_init() failed\n", my_progname);
mysql_thread_end();
exit(0);
}
set_mysql_connect_options(mysql);
DBUG_PRINT("info", ("trying to connect to host %s as user %s", host, user)); DBUG_PRINT("info", ("trying to connect to host %s as user %s", host, user));
if (!opt_only_print) if (!opt_only_print)
@@ -1995,8 +2003,7 @@ end:
if (commit_rate) if (commit_rate)
run_query(mysql, "COMMIT", strlen("COMMIT")); run_query(mysql, "COMMIT", strlen("COMMIT"));
if (!opt_only_print) mysql_close(mysql);
mysql_close(mysql);
mysql_thread_end(); mysql_thread_end();

View File

@@ -154,6 +154,25 @@ IF(UNIX)
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_CXX_FLAGS}") SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_CXX_FLAGS}")
ENDIF() ENDIF()
# IBM Z flags
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "s390x")
IF(RPM MATCHES "(rhel|centos)6" OR RPM MATCHES "(suse|sles)11")
SET(z_flags "-funroll-loops -march=z9-109 -mtune=z10 ")
ELSEIF(RPM MATCHES "(rhel|centos)7" OR RPM MATCHES "(suse|sles)12")
SET(z_flags "-funroll-loops -march=z196 -mtune=zEC12 ")
ELSE()
SET(z_flags "")
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${z_flags}${CMAKE_C_FLAGS_RELWITHDEBINFO}")
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${z_flags}${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
ENDIF()
UNSET(z_flags)
ENDIF()
# HPUX flags # HPUX flags
IF(CMAKE_SYSTEM_NAME MATCHES "HP-UX") IF(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
IF(CMAKE_C_COMPILER_ID MATCHES "HP") IF(CMAKE_C_COMPILER_ID MATCHES "HP")

View File

@@ -32,7 +32,7 @@ SET(CPACK_RPM_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${VERSION}-${RPM}-${CMAKE_SYSTEM_PROCESSOR}") SET(CPACK_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${VERSION}-${RPM}-${CMAKE_SYSTEM_PROCESSOR}")
SET(CPACK_RPM_PACKAGE_RELEASE "1%{?dist}") SET(CPACK_RPM_PACKAGE_RELEASE "1%{?dist}")
SET(CPACK_RPM_PACKAGE_LICENSE "GPL") SET(CPACK_RPM_PACKAGE_LICENSE "GPLv2")
SET(CPACK_RPM_PACKAGE_RELOCATABLE FALSE) SET(CPACK_RPM_PACKAGE_RELOCATABLE FALSE)
SET(CPACK_PACKAGE_RELOCATABLE FALSE) SET(CPACK_PACKAGE_RELOCATABLE FALSE)
SET(CPACK_RPM_PACKAGE_GROUP "Applications/Databases") SET(CPACK_RPM_PACKAGE_GROUP "Applications/Databases")
@@ -55,8 +55,8 @@ SET(CPACK_RPM_SPEC_MORE_DEFINE "
%define mysqldatadir ${INSTALL_MYSQLDATADIR} %define mysqldatadir ${INSTALL_MYSQLDATADIR}
%define mysqld_user mysql %define mysqld_user mysql
%define mysqld_group mysql %define mysqld_group mysql
%define _bindir ${CMAKE_INSTALL_PREFIX}/${INSTALL_BINDIR} %define _bindir ${INSTALL_BINDIRABS}
%define _sbindir ${CMAKE_INSTALL_PREFIX}/${INSTALL_SBINDIR} %define _sbindir ${INSTALL_SBINDIRABS}
%define _sysconfdir ${INSTALL_SYSCONFDIR} %define _sysconfdir ${INSTALL_SYSCONFDIR}
") ")

View File

@@ -236,6 +236,12 @@ FOREACH(var BIN SBIN LIB MYSQLSHARE SHARE PLUGIN INCLUDE SCRIPT DOC MAN SYSCONF
SET(INSTALL_${var}DIR ${INSTALL_${var}DIR_${INSTALL_LAYOUT}} SET(INSTALL_${var}DIR ${INSTALL_${var}DIR_${INSTALL_LAYOUT}}
CACHE STRING "${var} installation directory" ${FORCE}) CACHE STRING "${var} installation directory" ${FORCE})
MARK_AS_ADVANCED(INSTALL_${var}DIR) MARK_AS_ADVANCED(INSTALL_${var}DIR)
IF(IS_ABSOLUTE ${INSTALL_${var}DIR})
SET(INSTALL_${var}DIRABS ${INSTALL_${var}DIR})
ELSE()
SET(INSTALL_${var}DIRABS "${CMAKE_INSTALL_PREFIX}/${INSTALL_${var}DIR}")
ENDIF()
ENDFOREACH() ENDFOREACH()
IF(NOT MYSQL_UNIX_ADDR) IF(NOT MYSQL_UNIX_ADDR)

View File

@@ -55,6 +55,7 @@ MACRO (MYSQL_USE_BUNDLED_SSL)
SET(SSL_INCLUDE_DIRS ${INC_DIRS}) SET(SSL_INCLUDE_DIRS ${INC_DIRS})
SET(SSL_INTERNAL_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL) SET(SSL_INTERNAL_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL)
SET(SSL_DEFINES "-DHAVE_YASSL -DYASSL_PREFIX -DHAVE_OPENSSL -DMULTI_THREADED") SET(SSL_DEFINES "-DHAVE_YASSL -DYASSL_PREFIX -DHAVE_OPENSSL -DMULTI_THREADED")
SET(HAVE_ERR_remove_thread_state OFF CACHE INTERNAL "yassl doesn't have ERR_remove_thread_state")
SET(HAVE_EncryptAes128Ctr OFF CACHE INTERNAL "yassl doesn't support AES-CTR") SET(HAVE_EncryptAes128Ctr OFF CACHE INTERNAL "yassl doesn't support AES-CTR")
SET(HAVE_EncryptAes128Gcm OFF CACHE INTERNAL "yassl doesn't support AES-GCM") SET(HAVE_EncryptAes128Gcm OFF CACHE INTERNAL "yassl doesn't support AES-GCM")
CHANGE_SSL_SETTINGS("bundled") CHANGE_SSL_SETTINGS("bundled")
@@ -197,6 +198,8 @@ MACRO (MYSQL_CHECK_SSL)
SET(SSL_DEFINES "-DHAVE_OPENSSL") SET(SSL_DEFINES "-DHAVE_OPENSSL")
SET(CMAKE_REQUIRED_LIBRARIES ${SSL_LIBRARIES}) SET(CMAKE_REQUIRED_LIBRARIES ${SSL_LIBRARIES})
CHECK_SYMBOL_EXISTS(ERR_remove_thread_state "openssl/err.h"
HAVE_ERR_remove_thread_state)
CHECK_SYMBOL_EXISTS(EVP_aes_128_ctr "openssl/evp.h" CHECK_SYMBOL_EXISTS(EVP_aes_128_ctr "openssl/evp.h"
HAVE_EncryptAes128Ctr) HAVE_EncryptAes128Ctr)
CHECK_SYMBOL_EXISTS(EVP_aes_128_gcm "openssl/evp.h" CHECK_SYMBOL_EXISTS(EVP_aes_128_gcm "openssl/evp.h"

View File

@@ -331,6 +331,7 @@
#cmakedefine RETSIGTYPE @RETSIGTYPE@ #cmakedefine RETSIGTYPE @RETSIGTYPE@
#cmakedefine VOID_SIGHANDLER 1 #cmakedefine VOID_SIGHANDLER 1
#cmakedefine HAVE_SIGHANDLER_T 1
#define STRUCT_RLIMIT struct rlimit #define STRUCT_RLIMIT struct rlimit
#ifdef __APPLE__ #ifdef __APPLE__
@@ -378,6 +379,9 @@
#cmakedefine HAVE_POSIX_SIGNALS 1 #cmakedefine HAVE_POSIX_SIGNALS 1
#cmakedefine HAVE_BSD_SIGNALS 1 #cmakedefine HAVE_BSD_SIGNALS 1
#cmakedefine HAVE_SVR3_SIGNALS 1
#cmakedefine HAVE_V7_SIGNALS 1
#cmakedefine HAVE_ERR_remove_thread_state 1
#cmakedefine HAVE_SOLARIS_STYLE_GETHOST 1 #cmakedefine HAVE_SOLARIS_STYLE_GETHOST 1

View File

@@ -506,6 +506,7 @@ MY_CHECK_TYPE_SIZE(mode_t MODE_T)
IF(NOT SIZEOF_MODE_T) IF(NOT SIZEOF_MODE_T)
SET(mode_t int) SET(mode_t int)
ENDIF() ENDIF()
MY_CHECK_TYPE_SIZE(sighandler_t SIGHANDLER_T)
IF(HAVE_NETINET_IN_H) IF(HAVE_NETINET_IN_H)
SET(CMAKE_EXTRA_INCLUDE_FILES netinet/in.h) SET(CMAKE_EXTRA_INCLUDE_FILES netinet/in.h)

View File

@@ -62,7 +62,7 @@ max_heap_table_size = 32M
# #
# This replaces the startup script and checks MyISAM tables if needed # This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched. On error, make copy and try a repair. # the first time they are touched. On error, make copy and try a repair.
myisam_recover = BACKUP myisam_recover_options = BACKUP
key_buffer_size = 128M key_buffer_size = 128M
#open-files-limit = 2000 #open-files-limit = 2000
table_open_cache = 400 table_open_cache = 400

View File

@@ -47,7 +47,6 @@ else
sed -i -e "s/\\\${MAYBE_LIBCRACK}/${MAYBE_LIBCRACK}/g" debian/control sed -i -e "s/\\\${MAYBE_LIBCRACK}/${MAYBE_LIBCRACK}/g" debian/control
fi fi
# Adjust changelog, add new version. # Adjust changelog, add new version.
# #
echo "Incrementing changelog and starting build scripts" echo "Incrementing changelog and starting build scripts"

View File

@@ -2,7 +2,7 @@
# flush-logs'd only once. # flush-logs'd only once.
# Else the binary logs would automatically increase by n times every day. # Else the binary logs would automatically increase by n times every day.
# - The error log is obsolete, messages go to syslog now. # - The error log is obsolete, messages go to syslog now.
/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log { /var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mariadb-slow.log {
daily daily
rotate 7 rotate 7
missingok missingok

View File

@@ -17,9 +17,6 @@ set -e
set -u set -u
${DEBIAN_SCRIPT_DEBUG:+ set -v -x} ${DEBIAN_SCRIPT_DEBUG:+ set -v -x}
# Prevent Debian's init scripts from calling systemctl
_SYSTEMCTL_SKIP_REDIRECT=true
test -x /usr/sbin/mysqld || exit 0 test -x /usr/sbin/mysqld || exit 0
. /lib/lsb/init-functions . /lib/lsb/init-functions

View File

@@ -157,7 +157,9 @@ EOF
else else
pass=`perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..16)'`; pass=`perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..16)'`;
if [ ! -d "$mysql_cfgdir" ]; then install -o 0 -g 0 -m 0755 -d $mysql_cfgdir; fi if [ ! -d "$mysql_cfgdir" ]; then install -o 0 -g 0 -m 0755 -d $mysql_cfgdir; fi
umask 066
cat /dev/null > $dc cat /dev/null > $dc
umask 022
echo "# Automatically generated for Debian scripts. DO NOT TOUCH!" >>$dc echo "# Automatically generated for Debian scripts. DO NOT TOUCH!" >>$dc
echo "[client]" >>$dc echo "[client]" >>$dc
echo "host = localhost" >>$dc echo "host = localhost" >>$dc

View File

@@ -72,6 +72,7 @@ IF(WITH_INNOBASE_STORAGE_ENGINE OR WITH_XTRADB_STORAGE_ENGINE)
# We use the InnoDB code directly in case the code changes. # We use the InnoDB code directly in case the code changes.
ADD_DEFINITIONS("-DUNIV_INNOCHECKSUM") ADD_DEFINITIONS("-DUNIV_INNOCHECKSUM")
SET(INNOBASE_SOURCES SET(INNOBASE_SOURCES
../storage/innobase/buf/buf0checksum.cc ../storage/innobase/buf/buf0checksum.cc
../storage/innobase/ut/ut0crc32.cc ../storage/innobase/ut/ut0crc32.cc
@@ -79,6 +80,14 @@ IF(WITH_INNOBASE_STORAGE_ENGINE OR WITH_XTRADB_STORAGE_ENGINE)
../storage/innobase/page/page0zip.cc ../storage/innobase/page/page0zip.cc
) )
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le")
enable_language(ASM)
LIST(APPEND INNOBASE_SOURCES
../storage/innobase/ut/crc32_power8/crc32.S
../storage/innobase/ut/crc32_power8/crc32_wrapper.c
)
ENDIF()
MYSQL_ADD_EXECUTABLE(innochecksum innochecksum.cc ${INNOBASE_SOURCES}) MYSQL_ADD_EXECUTABLE(innochecksum innochecksum.cc ${INNOBASE_SOURCES})
TARGET_LINK_LIBRARIES(innochecksum mysys mysys_ssl) TARGET_LINK_LIBRARIES(innochecksum mysys mysys_ssl)
ADD_DEPENDENCIES(innochecksum GenError) ADD_DEPENDENCIES(innochecksum GenError)

View File

@@ -1,5 +1,5 @@
/* /*
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2005, 2012, Oracle and/or its affiliates.
Copyright (c) 2014, 2015, MariaDB Corporation. Copyright (c) 2014, 2015, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
@@ -663,8 +663,8 @@ int main(int argc, char **argv)
{ {
FILE* f; /* our input file */ FILE* f; /* our input file */
char* filename; /* our input filename. */ char* filename; /* our input filename. */
unsigned char *big_buf, *buf; unsigned char *big_buf= 0, *buf;
unsigned char *big_xdes, *xdes; unsigned char *big_xdes= 0, *xdes;
ulong bytes; /* bytes read count */ ulong bytes; /* bytes read count */
ulint ct; /* current page number (0 based) */ ulint ct; /* current page number (0 based) */
time_t now; /* current time */ time_t now; /* current time */
@@ -694,14 +694,14 @@ int main(int argc, char **argv)
if (*filename == '\0') if (*filename == '\0')
{ {
fprintf(stderr, "Error; File name missing\n"); fprintf(stderr, "Error; File name missing\n");
return 1; goto error;
} }
/* stat the file to get size and page count */ /* stat the file to get size and page count */
if (stat(filename, &st)) if (stat(filename, &st))
{ {
fprintf(stderr, "Error; %s cannot be found\n", filename); fprintf(stderr, "Error; %s cannot be found\n", filename);
return 1; goto error;
} }
size= st.st_size; size= st.st_size;
@@ -711,7 +711,7 @@ int main(int argc, char **argv)
{ {
fprintf(stderr, "Error; %s cannot be opened", filename); fprintf(stderr, "Error; %s cannot be opened", filename);
perror(" "); perror(" ");
return 1; goto error;
} }
big_buf = (unsigned char *)malloc(2 * UNIV_PAGE_SIZE_MAX); big_buf = (unsigned char *)malloc(2 * UNIV_PAGE_SIZE_MAX);
@@ -719,7 +719,7 @@ int main(int argc, char **argv)
{ {
fprintf(stderr, "Error; failed to allocate memory\n"); fprintf(stderr, "Error; failed to allocate memory\n");
perror(""); perror("");
return 1; goto error;
} }
/* Make sure the page is aligned */ /* Make sure the page is aligned */
@@ -740,10 +740,7 @@ int main(int argc, char **argv)
if (!get_page_size(f, buf, &logical_page_size, &physical_page_size)) if (!get_page_size(f, buf, &logical_page_size, &physical_page_size))
{ goto error;
free(big_buf);
return 1;
}
if (compressed) if (compressed)
{ {
@@ -763,8 +760,7 @@ int main(int argc, char **argv)
if (verbose) if (verbose)
printf("Number of pages: "); printf("Number of pages: ");
printf("%lu\n", pages); printf("%lu\n", pages);
free(big_buf); goto ok;
return 0;
} }
else if (verbose) else if (verbose)
{ {
@@ -790,9 +786,7 @@ int main(int argc, char **argv)
if (!fd) if (!fd)
{ {
perror("Error; Unable to obtain file descriptor number"); perror("Error; Unable to obtain file descriptor number");
free(big_buf); goto error;
free(big_xdes);
return 1;
} }
offset= (off_t)start_page * (off_t)physical_page_size; offset= (off_t)start_page * (off_t)physical_page_size;
@@ -800,9 +794,7 @@ int main(int argc, char **argv)
if (lseek(fd, offset, SEEK_SET) != offset) if (lseek(fd, offset, SEEK_SET) != offset)
{ {
perror("Error; Unable to seek to necessary offset"); perror("Error; Unable to seek to necessary offset");
free(big_buf); goto error;
free(big_xdes);
return 1;
} }
} }
@@ -816,20 +808,13 @@ int main(int argc, char **argv)
bytes= fread(buf, 1, physical_page_size, f); bytes= fread(buf, 1, physical_page_size, f);
if (!bytes && feof(f)) if (!bytes && feof(f))
{ goto ok;
print_stats();
free(big_buf);
free(big_xdes);
return 0;
}
if (ferror(f)) if (ferror(f))
{ {
fprintf(stderr, "Error reading %lu bytes", physical_page_size); fprintf(stderr, "Error reading %lu bytes", physical_page_size);
perror(" "); perror(" ");
free(big_buf); goto error;
free(big_xdes);
return 1;
} }
ulint page_type = mach_read_from_2(buf+FIL_PAGE_TYPE); ulint page_type = mach_read_from_2(buf+FIL_PAGE_TYPE);
@@ -883,11 +868,7 @@ int main(int argc, char **argv)
if (!page_zip_verify_checksum(buf, physical_page_size)) { if (!page_zip_verify_checksum(buf, physical_page_size)) {
fprintf(stderr, "Fail; page %lu invalid (fails compressed page checksum).\n", ct); fprintf(stderr, "Fail; page %lu invalid (fails compressed page checksum).\n", ct);
if (!skip_corrupt) if (!skip_corrupt)
{ goto error;
free(big_buf);
free(big_xdes);
return 1;
}
page_ok = 0; page_ok = 0;
} }
} }
@@ -918,11 +899,7 @@ int main(int argc, char **argv)
{ {
fprintf(stderr, "Fail; page %lu invalid (fails log sequence number check)\n", ct); fprintf(stderr, "Fail; page %lu invalid (fails log sequence number check)\n", ct);
if (!skip_corrupt) if (!skip_corrupt)
{ goto error;
free(big_buf);
free(big_xdes);
return 1;
}
page_ok = 0; page_ok = 0;
} }
@@ -935,11 +912,7 @@ int main(int argc, char **argv)
{ {
fprintf(stderr, "Fail; page %lu invalid (fails old style checksum)\n", ct); fprintf(stderr, "Fail; page %lu invalid (fails old style checksum)\n", ct);
if (!skip_corrupt) if (!skip_corrupt)
{ goto error;
free(big_buf);
free(big_xdes);
return 1;
}
page_ok = 0; page_ok = 0;
} }
} }
@@ -959,22 +932,13 @@ int main(int argc, char **argv)
{ {
fprintf(stderr, "Fail; page %lu invalid (fails innodb and crc32 checksum)\n", ct); fprintf(stderr, "Fail; page %lu invalid (fails innodb and crc32 checksum)\n", ct);
if (!skip_corrupt) if (!skip_corrupt)
{ goto error;
free(big_buf);
free(big_xdes);
return 1;
}
page_ok = 0; page_ok = 0;
} }
} }
/* end if this was the last page we were supposed to check */ /* end if this was the last page we were supposed to check */
if (use_end_page && (ct >= end_page)) if (use_end_page && (ct >= end_page))
{ goto ok;
print_stats();
free(big_buf);
free(big_xdes);
return 0;
}
if (per_page_details) if (per_page_details)
{ {
@@ -1013,8 +977,18 @@ int main(int argc, char **argv)
} }
} }
} }
print_stats();
free(big_buf); ok:
if (!just_count)
print_stats();
free(big_xdes); free(big_xdes);
return 0; free(big_buf);
my_end(0);
exit(0);
error:
free(big_xdes);
free(big_buf);
my_end(0);
exit(1);
} }

View File

@@ -545,7 +545,11 @@ typedef int my_socket; /* File descriptor for sockets */
/* Type for fuctions that handles signals */ /* Type for fuctions that handles signals */
#define sig_handler RETSIGTYPE #define sig_handler RETSIGTYPE
C_MODE_START C_MODE_START
typedef void (*sig_return)(); /* Returns type from signal */ #ifdef HAVE_SIGHANDLER_T
#define sig_return sighandler_t
#else
typedef void (*sig_return)(void); /* Returns type from signal */
#endif
C_MODE_END C_MODE_END
#if defined(__GNUC__) && !defined(_lint) #if defined(__GNUC__) && !defined(_lint)
typedef char pchar; /* Mixed prototypes can take char */ typedef char pchar; /* Mixed prototypes can take char */

View File

@@ -125,6 +125,7 @@ C_MODE_END
#define MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME 25 #define MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME 25
#define MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME 26 #define MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME 26
#define MY_TIMER_ROUTINE_ASM_SUNPRO_X86_64 27 #define MY_TIMER_ROUTINE_ASM_SUNPRO_X86_64 27
#define MY_TIMER_ROUTINE_ASM_S390 28
#endif #endif

View File

@@ -267,8 +267,7 @@ extern myf my_global_flags; /* Set to MY_WME for more error messages
/* Point to current my_message() */ /* Point to current my_message() */
extern void (*my_sigtstp_cleanup)(void), extern void (*my_sigtstp_cleanup)(void),
/* Executed before jump to shell */ /* Executed before jump to shell */
(*my_sigtstp_restart)(void), (*my_sigtstp_restart)(void);
(*my_abort_hook)(int);
/* Executed when comming from shell */ /* Executed when comming from shell */
extern MYSQL_PLUGIN_IMPORT int my_umask; /* Default creation mask */ extern MYSQL_PLUGIN_IMPORT int my_umask; /* Default creation mask */
extern int my_umask_dir, extern int my_umask_dir,

View File

@@ -149,7 +149,7 @@ MYSQL_SOCKET socket __attribute__ ((unused))
/** /**
MYSQL_SOCKET helper. Get socket descriptor. MYSQL_SOCKET helper. Get socket descriptor.
@param mysql_socket Instrumented socket @param mysql_socket Instrumented socket
@sa mysql_socket_setfd @sa mysql_socket_getfd
*/ */
static inline my_socket static inline my_socket
mysql_socket_getfd(MYSQL_SOCKET mysql_socket) mysql_socket_getfd(MYSQL_SOCKET mysql_socket)
@@ -161,7 +161,7 @@ mysql_socket_getfd(MYSQL_SOCKET mysql_socket)
MYSQL_SOCKET helper. Set socket descriptor. MYSQL_SOCKET helper. Set socket descriptor.
@param mysql_socket Instrumented socket @param mysql_socket Instrumented socket
@param fd Socket descriptor @param fd Socket descriptor
@sa mysql_socket_getfd @sa mysql_socket_setfd
*/ */
static inline void static inline void
mysql_socket_setfd(MYSQL_SOCKET *mysql_socket, my_socket fd) mysql_socket_setfd(MYSQL_SOCKET *mysql_socket, my_socket fd)
@@ -1013,7 +1013,9 @@ inline_mysql_socket_accept
#endif #endif
MYSQL_SOCKET socket_listen, struct sockaddr *addr, socklen_t *addr_len) MYSQL_SOCKET socket_listen, struct sockaddr *addr, socklen_t *addr_len)
{ {
#ifdef FD_CLOEXEC
int flags __attribute__ ((unused)); int flags __attribute__ ((unused));
#endif
MYSQL_SOCKET socket_accept= MYSQL_INVALID_SOCKET; MYSQL_SOCKET socket_accept= MYSQL_INVALID_SOCKET;
socklen_t addr_length= (addr_len != NULL) ? *addr_len : 0; socklen_t addr_length= (addr_len != NULL) ? *addr_len : 0;

View File

@@ -1009,6 +1009,8 @@ struct PSI_statement_locker_state_v1
char m_schema_name[PSI_SCHEMA_NAME_LEN]; char m_schema_name[PSI_SCHEMA_NAME_LEN];
/** Length in bytes of @c m_schema_name. */ /** Length in bytes of @c m_schema_name. */
uint m_schema_name_length; uint m_schema_name_length;
/** Statement character set number. */
uint m_cs_number;
}; };
/** /**

View File

@@ -268,6 +268,7 @@ struct PSI_statement_locker_state_v1
const struct sql_digest_storage *m_digest; const struct sql_digest_storage *m_digest;
char m_schema_name[(64 * 3)]; char m_schema_name[(64 * 3)];
uint m_schema_name_length; uint m_schema_name_length;
uint m_cs_number;
}; };
struct PSI_socket_locker_state_v1 struct PSI_socket_locker_state_v1
{ {

View File

@@ -55,7 +55,7 @@
Supported formats are 's' (null pointer is accepted, printed as Supported formats are 's' (null pointer is accepted, printed as
"(null)"), 'b' (extension, see below), 'c', 'd', 'i', 'u', 'x', 'o', "(null)"), 'b' (extension, see below), 'c', 'd', 'i', 'u', 'x', 'o',
'X', 'p' (works as 0x%x), 'f', 'g'. 'X', 'p' (works as 0x%x), 'f', 'g', 'M' (extension, see below).
Standard syntax for positional arguments $n is supported. Standard syntax for positional arguments $n is supported.
@@ -65,6 +65,10 @@
Format 'b': binary buffer, prints exactly <precision> bytes from the Format 'b': binary buffer, prints exactly <precision> bytes from the
argument, without stopping at '\0'. argument, without stopping at '\0'.
Format 'M': takes one integer, prints this integer, space, double quote
error message, double quote. In other words
printf("%M", n) === printf("%d \"%s\"", n, strerror(n))
*/ */
#ifdef __cplusplus #ifdef __cplusplus

View File

@@ -104,6 +104,7 @@ extern struct wsrep_service_st {
const char * (*wsrep_thd_query_state_str_func)(THD *thd); const char * (*wsrep_thd_query_state_str_func)(THD *thd);
int (*wsrep_thd_retry_counter_func)(THD *thd); int (*wsrep_thd_retry_counter_func)(THD *thd);
void (*wsrep_thd_set_conflict_state_func)(THD *thd, enum wsrep_conflict_state state); void (*wsrep_thd_set_conflict_state_func)(THD *thd, enum wsrep_conflict_state state);
bool (*wsrep_thd_skip_append_keys_func)(THD *thd);
long long (*wsrep_thd_trx_seqno_func)(THD *thd); long long (*wsrep_thd_trx_seqno_func)(THD *thd);
struct wsrep_ws_handle * (*wsrep_thd_ws_handle_func)(THD *thd); struct wsrep_ws_handle * (*wsrep_thd_ws_handle_func)(THD *thd);
int (*wsrep_trx_is_aborting_func)(MYSQL_THD thd); int (*wsrep_trx_is_aborting_func)(MYSQL_THD thd);
@@ -144,6 +145,7 @@ extern struct wsrep_service_st {
#define wsrep_thd_query_state_str(T) wsrep_service->wsrep_thd_query_state_str_func(T) #define wsrep_thd_query_state_str(T) wsrep_service->wsrep_thd_query_state_str_func(T)
#define wsrep_thd_retry_counter(T) wsrep_service->wsrep_thd_retry_counter_func(T) #define wsrep_thd_retry_counter(T) wsrep_service->wsrep_thd_retry_counter_func(T)
#define wsrep_thd_set_conflict_state(T,S) wsrep_service->wsrep_thd_set_conflict_state_func(T,S) #define wsrep_thd_set_conflict_state(T,S) wsrep_service->wsrep_thd_set_conflict_state_func(T,S)
#define wsrep_thd_skip_append_keys(T) wsrep_service->wsrep_thd_skip_append_keys_func(T)
#define wsrep_thd_trx_seqno(T) wsrep_service->wsrep_thd_trx_seqno_func(T) #define wsrep_thd_trx_seqno(T) wsrep_service->wsrep_thd_trx_seqno_func(T)
#define wsrep_thd_ws_handle(T) wsrep_service->wsrep_thd_ws_handle_func(T) #define wsrep_thd_ws_handle(T) wsrep_service->wsrep_thd_ws_handle_func(T)
#define wsrep_trx_is_aborting(T) wsrep_service->wsrep_trx_is_aborting_func(T) #define wsrep_trx_is_aborting(T) wsrep_service->wsrep_trx_is_aborting_func(T)
@@ -204,6 +206,7 @@ void wsrep_thd_LOCK(THD *thd);
void wsrep_thd_UNLOCK(THD *thd); void wsrep_thd_UNLOCK(THD *thd);
void wsrep_thd_awake(THD *thd, my_bool signal); void wsrep_thd_awake(THD *thd, my_bool signal);
void wsrep_thd_set_conflict_state(THD *thd, enum wsrep_conflict_state state); void wsrep_thd_set_conflict_state(THD *thd, enum wsrep_conflict_state state);
bool wsrep_thd_skip_append_keys(THD *thd);
void wsrep_unlock_rollback(); void wsrep_unlock_rollback();
#endif #endif

View File

@@ -30,7 +30,7 @@
#define VERSION_thd_timezone 0x0100 #define VERSION_thd_timezone 0x0100
#define VERSION_my_sha1 0x0101 #define VERSION_my_sha1 0x0101
#define VERSION_my_md5 0x0100 #define VERSION_my_md5 0x0100
#define VERSION_wsrep 0x0200 #define VERSION_wsrep 0x0201
#define VERSION_logger 0x0100 #define VERSION_logger 0x0100
#define VERSION_thd_autoinc 0x0100 #define VERSION_thd_autoinc 0x0100
#define VERSION_thd_error_context 0x0100 #define VERSION_thd_error_context 0x0100

View File

@@ -146,6 +146,10 @@ typedef my_socket YASSL_SOCKET_T;
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include <openssl/err.h> #include <openssl/err.h>
#ifdef HAVE_ERR_remove_thread_state
#define ERR_remove_state(X) ERR_remove_thread_state(NULL)
#endif
enum enum_ssl_init_error enum enum_ssl_init_error
{ {
SSL_INITERR_NOERROR= 0, SSL_INITERR_CERT, SSL_INITERR_KEY, SSL_INITERR_NOERROR= 0, SSL_INITERR_CERT, SSL_INITERR_KEY,

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. /* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@@ -118,7 +118,7 @@ print_arrays_for(char *set)
{ {
FILE *f; FILE *f;
sprintf(buf, "%s.conf", set); snprintf(buf, sizeof(buf), "%s.conf", set);
if ((f = fopen(buf, "r")) == NULL) { if ((f = fopen(buf, "r")) == NULL) {
fprintf(stderr, "%s: can't read conf file for charset %s\n", prog, set); fprintf(stderr, "%s: can't read conf file for charset %s\n", prog, set);

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBCOMP_ERR\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBCOMP_ERR\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBINNOCHECKSUM\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBINNOCHECKSUM\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
@@ -62,6 +62,19 @@ supports the following options\&. For options that refer to page numbers, the nu
.sp -1 .sp -1
.IP \(bu 2.3 .IP \(bu 2.3
.\} .\}
\fB\-?, --help\fR
.sp
Displays help and exits\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-c, --count\fR \fB\-c, --count\fR
.sp .sp
Print a count of the number of pages in the file\&. Print a count of the number of pages in the file\&.
@@ -101,6 +114,58 @@ End at this page number\&.
.sp -1 .sp -1
.IP \(bu 2.3 .IP \(bu 2.3
.\} .\}
\fB\-i, --per-page-details\fR
.sp
Print out per-page detail information\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-I, --info\fR
.sp
Synonym for \fB--help\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-l, --leaf\fR
.sp
Examine leaf index pages\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-m \fR\fB\fInum\fB, --merge=#\fR\fR
.sp
Leaf page count if merge given number of consecutive pages\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-p \fR\fB\fInum\fB, --page-num=#\fR\fR \fB\-p \fR\fB\fInum\fB, --page-num=#\fR\fR
.sp .sp
Check only this page number\&. Check only this page number\&.
@@ -144,6 +209,19 @@ Skip corrupt pages\&.
.sp .sp
Verbose mode; print a progress indicator every five seconds\&. Verbose mode; print a progress indicator every five seconds\&.
.RE .RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-V, --version\fR
.sp
Displays version information and exits\&.
.RE
.SH "COPYRIGHT" .SH "COPYRIGHT"
.br .br
.PP .PP

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMAKE_WIN_BIN_DIST" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMAKE_WIN_BIN_DIST" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMSQL2MYSQL\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMSQL2MYSQL\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMY_PRINT_DEFAULTS" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMY_PRINT_DEFAULTS" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYISAM_FTDUMP\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYISAM_FTDUMP\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYISAMCHK\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYISAMCHK\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYISAMLOG\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYISAMLOG\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYISAMPACK\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYISAMPACK\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQL\-STRESS\-TE" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQL\-STRESS\-TE" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQL\-TEST\-RUN\" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQL\-TEST\-RUN\" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQL\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQL\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQL\&.SERVER\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQL\&.SERVER\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQL_CLIENT_TEST" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQL_CLIENT_TEST" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQL_CONFIG\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQL_CONFIG\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQL_CONVERT_TAB" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQL_CONVERT_TAB" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQL_FIND_ROWS\F" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQL_FIND_ROWS\F" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQL_FIX_EXTENSI" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQL_FIX_EXTENSI" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQL_INSTALL_DB\" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQL_INSTALL_DB\" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQL_PLUGIN\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQL_PLUGIN\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * Define some portability stuff .\" * Define some portability stuff
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQL_SECURE_INST" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQL_SECURE_INST" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQL_SETPERMISSI" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQL_SETPERMISSI" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQL_TZINFO_TO_S" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQL_TZINFO_TO_S" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQL_UPGRADE\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQL_UPGRADE\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQL_WAITPID\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQL_WAITPID\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQLACCESS\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQLACCESS\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQLADMIN\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQLADMIN\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQLBINLOG\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQLBINLOG\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQLCHECK\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQLCHECK\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
@@ -677,6 +677,22 @@ Specifying a password on the command line should be considered insecure\&. You c
.sp -1 .sp -1
.IP \(bu 2.3 .IP \(bu 2.3
.\} .\}
.\" mysqlcheck: persisent option
.\" persistent option: mysql
\fB\-\-persistent\fR,
\fB\-Z\fR
.sp
Used with ANALYZE TABLE to append the option PERSISENT FOR ALL.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysqlcheck: pipe option .\" mysqlcheck: pipe option
.\" pipe option: mysql .\" pipe option: mysql
\fB\-\-pipe\fR, \fB\-\-pipe\fR,

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQLD\FR" "8" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQLD\FR" "8" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQLD_MULTI\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQLD_MULTI\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQLD_SAFE\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQLD_SAFE\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQLDUMP\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQLDUMP\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
@@ -1103,6 +1103,22 @@ Log warnings and errors by appending them to the named file\&. The default is to
.sp -1 .sp -1
.IP \(bu 2.3 .IP \(bu 2.3
.\} .\}
.\" mysqldump: log-queries option
.\" log-queries option: mysqldump
\fB\-\-log\-queries\fR\fR
.sp
When restoring the dump, the server will, if logging is turned on, log the queries to the general and slow query log\&.
Defaults to on; use \fB--skip-log-queries\fR to disable\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysqldump: master-data option .\" mysqldump: master-data option
.\" master-data option: mysqldump .\" master-data option: mysqldump
\fB\-\-master\-data[=\fR\fB\fIvalue\fR\fR\fB]\fR \fB\-\-master\-data[=\fR\fB\fIvalue\fR\fR\fB]\fR
@@ -1275,7 +1291,7 @@ to point the slave to the correct master server host\&. Add any such parameters
.\" max-allowed-packet option: mysqldump .\" max-allowed-packet option: mysqldump
\fB\-\-max\-allowed\-packet=\fR\fB\fIlength\fR\fR \fB\-\-max\-allowed\-packet=\fR\fB\fIlength\fR\fR
.sp .sp
Sets the maximum packet length to send to or recieve from server\&. Sets the maximum packet length to send to or receive from server\&.
.RE .RE
.sp .sp
.RS 4 .RS 4

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQLDUMPSLOW\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQLDUMPSLOW\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQLHOTCOPY\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQLHOTCOPY\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQLIMPORT\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQLIMPORT\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQLSHOW\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQLSHOW\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQLSLAP\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQLSLAP\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBMYSQLTEST\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBMYSQLTEST\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBPERROR\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBPERROR\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBREPLACE\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBREPLACE\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBRESOLVE_STACK_DUM" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBRESOLVE_STACK_DUM" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t '\" t
.\" .\"
.TH "\FBRESOLVEIP\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .TH "\FBRESOLVEIP\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------

View File

@@ -62,24 +62,3 @@ UPDATE t1 SET c1= 0;
DROP TABLE t1; DROP TABLE t1;
-- sync_slave_with_master -- sync_slave_with_master
#
# BUG#11766865: 60091: RBR + NO PK + UPDATE NULL VALUE --> SLAVE BREAK WITH ERROR HA_ERR_END_OF_
#
--connection master
--source include/rpl_reset.inc
--connection master
--eval CREATE TABLE t1 (c1 int(11) NOT NULL, c2 int(11) NOT NULL, c3 int(11) DEFAULT '-1') ENGINE=$engine DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (1,2,NULL);
UPDATE t1 SET c1=1, c2=2, c3=-1 WHERE c1=1 AND c2=2 AND ISNULL(c3);
--sync_slave_with_master
--let $diff_tables=master:test.t1, slave:test.t1
--source include/diff_tables.inc
--connection master
DROP TABLE t1;
--sync_slave_with_master

View File

@@ -440,7 +440,7 @@ INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
connection slave; connection slave;
# 1677 = ER_SLAVE_CONVERSION_FAILED # 1677 = ER_SLAVE_CONVERSION_FAILED
--let $slave_sql_errno= 1677 --let $slave_sql_errno= 1677
--let $show_slave_sql_error= 1 --let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc --source include/wait_for_slave_sql_error.inc
@@ -453,7 +453,7 @@ INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
connection slave; connection slave;
# 1677 = ER_SLAVE_CONVERSION_FAILED # 1677 = ER_SLAVE_CONVERSION_FAILED
--let $slave_sql_errno= 1677 --let $slave_sql_errno= 1677
--let $show_slave_sql_error= 1 --let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc --source include/wait_for_slave_sql_error.inc

View File

@@ -13,7 +13,8 @@ eval CREATE TABLE t1 (name varchar(64), age smallint(3))ENGINE=$engine_type;
INSERT INTO t1 SET name='Andy', age=31; INSERT INTO t1 SET name='Andy', age=31;
INSERT INTO t1 SET name='Jacob', age=2; INSERT INTO t1 SET name='Jacob', age=2;
INSERT INTO t1 SET name='Caleb', age=1; INSERT INTO t1 SET name='Caleb', age=1;
ALTER TABLE t1 ADD id int(8) ZEROFILL AUTO_INCREMENT PRIMARY KEY; ALTER TABLE t1 ADD id int(8) ZEROFILL AUTO_INCREMENT PRIMARY KEY,
ALGORITHM=COPY;
SELECT * FROM t1 ORDER BY id; SELECT * FROM t1 ORDER BY id;
sync_slave_with_master; sync_slave_with_master;
SELECT * FROM t1 ORDER BY id; SELECT * FROM t1 ORDER BY id;

View File

@@ -28,7 +28,7 @@
if ($_param_value != $slave_param_value) { if ($_param_value != $slave_param_value) {
--source include/show_rpl_debug_info.inc --source include/show_rpl_debug_info.inc
--echo Wrong value for $slave_param. Expected '$slave_param_value', got '$_param_value' --echo Wrong value for $slave_param. Expected '$slave_param_value', got '$_param_value'
--die Wrong value for slave parameter --die Wrong value for slave parameter $slave_param
} }

View File

@@ -274,6 +274,7 @@ if (IS_WINDOWS)
# #
my @client_rules= my @client_rules=
( (
{ 'character-sets-dir' => \&fix_charset_dir },
); );
@@ -296,7 +297,6 @@ my @mysqltest_rules=
# #
my @mysqlbinlog_rules= my @mysqlbinlog_rules=
( (
{ 'character-sets-dir' => \&fix_charset_dir },
); );

View File

@@ -354,7 +354,7 @@ my $opt_max_save_datadir= env_or_val(MTR_MAX_SAVE_DATADIR => 20);
my $opt_max_test_fail= env_or_val(MTR_MAX_TEST_FAIL => 10); my $opt_max_test_fail= env_or_val(MTR_MAX_TEST_FAIL => 10);
my $opt_parallel= $ENV{MTR_PARALLEL} || 1; my $opt_parallel= $ENV{MTR_PARALLEL} || 1;
my $opt_port_group_size = $ENV{MTR_PORT_GROUP_SIZE} || 10; my $opt_port_group_size = $ENV{MTR_PORT_GROUP_SIZE} || 20;
# lock file to stop tests # lock file to stop tests
my $opt_stop_file= $ENV{MTR_STOP_FILE}; my $opt_stop_file= $ENV{MTR_STOP_FILE};
@@ -5993,10 +5993,10 @@ Options to control what engine/variation to run:
non-blocking-api Use the non-blocking client API non-blocking-api Use the non-blocking client API
compress Use the compressed protocol between client and server compress Use the compressed protocol between client and server
ssl Use ssl protocol between client and server ssl Use ssl protocol between client and server
skip-ssl Dont start server with support for ssl connections skip-ssl Don't start server with support for ssl connections
vs-config Visual Studio configuration used to create executables vs-config Visual Studio configuration used to create executables
(default: MTR_VS_CONFIG environment variable) (default: MTR_VS_CONFIG environment variable)
parallel=# How many parallell test should be run parallel=# How many parallel test should be run
defaults-file=<config template> Use fixed config template for all defaults-file=<config template> Use fixed config template for all
tests tests
defaults-extra-file=<config template> Extra config template to add to defaults-extra-file=<config template> Extra config template to add to
@@ -6126,7 +6126,7 @@ Options for debugging the product
up disks for heavily crashing server). Defaults to up disks for heavily crashing server). Defaults to
$opt_max_save_datadir, set to 0 for no limit. Set $opt_max_save_datadir, set to 0 for no limit. Set
it's default with MTR_MAX_SAVE_DATADIR it's default with MTR_MAX_SAVE_DATADIR
max-test-fail Limit the number of test failurs before aborting max-test-fail Limit the number of test failures before aborting
the current test run. Defaults to the current test run. Defaults to
$opt_max_test_fail, set to 0 for no limit. Set $opt_max_test_fail, set to 0 for no limit. Set
it's default with MTR_MAX_TEST_FAIL it's default with MTR_MAX_TEST_FAIL
@@ -6173,7 +6173,7 @@ Misc options
--mysqld (if any) --mysqld (if any)
wait-all If --start or --start-dirty option is used, wait for all wait-all If --start or --start-dirty option is used, wait for all
servers to exit before finishing the process servers to exit before finishing the process
fast Run as fast as possible, dont't wait for servers fast Run as fast as possible, don't wait for servers
to shutdown etc. to shutdown etc.
parallel=N Run tests in N parallel threads (default 1) parallel=N Run tests in N parallel threads (default 1)
Use parallel=auto for auto-setting of N Use parallel=auto for auto-setting of N
@@ -6207,7 +6207,7 @@ Misc options
actions. Disable facility with NUM=0. actions. Disable facility with NUM=0.
gcov Collect coverage information after the test. gcov Collect coverage information after the test.
The result is a gcov file per source and header file. The result is a gcov file per source and header file.
gcov-src-dir=subdir Colllect coverage only within the given subdirectory. gcov-src-dir=subdir Collect coverage only within the given subdirectory.
For example, if you're only developing the SQL layer, For example, if you're only developing the SQL layer,
it makes sense to use --gcov-src-dir=sql it makes sense to use --gcov-src-dir=sql
gprof Collect profiling information using gprof. gprof Collect profiling information using gprof.

View File

@@ -1883,5 +1883,11 @@ t1 CREATE TABLE `t1` (
`c` char(32) AS (convert(cast(n as char), char)) PERSISTENT `c` char(32) AS (convert(cast(n as char), char)) PERSISTENT
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1; drop table t1;
set @@session.collation_server=filename;
create table t1(a enum('',''));
Warnings:
Note 1291 Column 'a' has duplicated value '' in ENUM
drop table t1;
set @@session.collation_server=default;
create table t1; create table t1;
ERROR 42000: A table must have at least 1 column ERROR 42000: A table must have at least 1 column

View File

@@ -11,6 +11,9 @@ create table com1 (a int);
drop table com1; drop table com1;
create table `clock$` (a int); create table `clock$` (a int);
drop table `clock$`; drop table `clock$`;
select convert(convert(',' using filename) using binary);
convert(convert(',' using filename) using binary)
@002c
# #
# MDEV-7677 my_charset_handler_filename has a wrong "ismbchar" member # MDEV-7677 my_charset_handler_filename has a wrong "ismbchar" member
# #

View File

@@ -5640,5 +5640,14 @@ Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d` from `test`.`t1` where ((coalesce(`test`.`t1`.`c`,0) = '3 ') and (coalesce(`test`.`t1`.`d`,0) = '3 ')) Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d` from `test`.`t1` where ((coalesce(`test`.`t1`.`c`,0) = '3 ') and (coalesce(`test`.`t1`.`d`,0) = '3 '))
DROP TABLE t1; DROP TABLE t1;
# #
# MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED)
#
SET NAMES utf8;
SELECT CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED);
CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED)
1
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '1IJ3'
#
# End of 10.1 tests # End of 10.1 tests
# #

View File

@@ -2190,5 +2190,14 @@ COUNT(DISTINCT a)
7 7
DROP TABLE t1; DROP TABLE t1;
# #
# MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING utf16) AS SIGNED)
#
SET NAMES utf8;
SELECT CAST(CONVERT('1IJ3' USING utf16) AS SIGNED);
CAST(CONVERT('1IJ3' USING utf16) AS SIGNED)
1
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '1IJ3'
#
# End of 10.1 tests # End of 10.1 tests
# #

View File

@@ -2382,5 +2382,14 @@ COUNT(DISTINCT a)
7 7
DROP TABLE t1; DROP TABLE t1;
# #
# MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED)
#
SET NAMES utf8;
SELECT CAST(CONVERT('1IJ3' USING utf16le) AS SIGNED);
CAST(CONVERT('1IJ3' USING utf16le) AS SIGNED)
1
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '1IJ3'
#
# End of 10.1 tests # End of 10.1 tests
# #

View File

@@ -2226,5 +2226,14 @@ SELECT _utf32 0x10001=_utf32 0x10002;
_utf32 0x10001=_utf32 0x10002 _utf32 0x10001=_utf32 0x10002
1 1
# #
# MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED)
#
SET NAMES utf8;
SELECT CAST(CONVERT('1IJ3' USING utf32) AS SIGNED);
CAST(CONVERT('1IJ3' USING utf32) AS SIGNED)
1
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '1IJ3'
#
# End of 10.1 tests # End of 10.1 tests
# #

View File

@@ -6155,6 +6155,49 @@ SELECT (SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2);
ERROR 21000: Subquery returns more than 1 row ERROR 21000: Subquery returns more than 1 row
DROP TABLE t1, t2; DROP TABLE t1, t2;
# #
# MDEV-8630 Datetime value dropped in "INSERT ... SELECT ... ON DUPLICATE KEY"
#
SET NAMES utf8;
CREATE TABLE t1 (id2 int, ts timestamp);
INSERT INTO t1 VALUES (1,'2012-06-11 15:17:34'),(2,'2012-06-11 15:18:24');
CREATE TABLE t2 AS SELECT
COALESCE(ts, 0) AS c0,
GREATEST(COALESCE(ts, 0), COALESCE(ts, 0)) AS c1,
GREATEST(CASE WHEN 1 THEN ts ELSE 0 END, CASE WHEN 1 THEN ts ELSE 0 END) AS c2,
GREATEST(IFNULL(ts,0), IFNULL(ts,0)) AS c3,
GREATEST(IF(1,ts,0), IF(1,ts,0)) AS c4
FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`c0` varchar(19) CHARACTER SET utf8 NOT NULL,
`c1` varchar(19) CHARACTER SET utf8 NOT NULL,
`c2` varchar(19) CHARACTER SET utf8 NOT NULL,
`c3` varchar(19) CHARACTER SET utf8 NOT NULL,
`c4` varchar(19) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t2;
c0 c1 c2 c3 c4
2012-06-11 15:17:34 2012-06-11 15:17:34 2012-06-11 15:17:34 2012-06-11 15:17:34 2012-06-11 15:17:34
2012-06-11 15:18:24 2012-06-11 15:18:24 2012-06-11 15:18:24 2012-06-11 15:18:24 2012-06-11 15:18:24
DROP TABLE t2, t1;
#
# MDEV-9319 ALTER from a bigger to a smaller blob type truncates too much data
#
SET NAMES utf8;
CREATE TABLE t1 (a TEXT CHARACTER SET utf8);
INSERT INTO t1 VALUES (REPEAT('',100));
SELECT OCTET_LENGTH(a) FROM t1;
OCTET_LENGTH(a)
300
ALTER TABLE t1 MODIFY a TINYTEXT CHARACTER SET utf8;
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
SELECT OCTET_LENGTH(a),a FROM t1;
OCTET_LENGTH(a) a
255
DROP TABLE t1;
#
# End of 5.5 tests # End of 5.5 tests
# #
# #

View File

@@ -2809,6 +2809,22 @@ Warning 1292 Truncated incorrect INTEGER value: 'a'
DROP TABLE t1; DROP TABLE t1;
# End of test for Bug#13581962,Bug#14096619 # End of test for Bug#13581962,Bug#14096619
# #
# MDEV-9319 ALTER from a bigger to a smaller blob type truncates too much data
#
SET NAMES utf8mb4;
CREATE TABLE t1 (a TEXT CHARACTER SET utf8mb4);
INSERT INTO t1 VALUES (REPEAT('😎',100));
SELECT OCTET_LENGTH(a) FROM t1;
OCTET_LENGTH(a)
400
ALTER TABLE t1 MODIFY a TINYTEXT CHARACTER SET utf8mb4;
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
SELECT OCTET_LENGTH(a),a FROM t1;
OCTET_LENGTH(a) a
252 😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎
DROP TABLE t1;
#
# End of 5.5 tests # End of 5.5 tests
# #
# #

View File

@@ -6,16 +6,16 @@ hex(COLUMN_CREATE(1, NULL AS char character set utf8))
000000 000000
select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8)); select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8));
hex(COLUMN_CREATE(1, "afaf" AS char character set utf8)) hex(COLUMN_CREATE(1, "afaf" AS char character set utf8))
0001000100030861666166 0001000100032161666166
select hex(COLUMN_CREATE(1, 1212 AS char character set utf8)); select hex(COLUMN_CREATE(1, 1212 AS char character set utf8));
hex(COLUMN_CREATE(1, 1212 AS char character set utf8)) hex(COLUMN_CREATE(1, 1212 AS char character set utf8))
0001000100030831323132 0001000100032131323132
select hex(COLUMN_CREATE(1, 12.12 AS char character set utf8)); select hex(COLUMN_CREATE(1, 12.12 AS char character set utf8));
hex(COLUMN_CREATE(1, 12.12 AS char character set utf8)) hex(COLUMN_CREATE(1, 12.12 AS char character set utf8))
0001000100030831322E3132 0001000100032131322E3132
select hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS char character set utf8)); select hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS char character set utf8));
hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS char character set utf8)) hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS char character set utf8))
000100010003083939393939393939393939393939393939393939393939393939393939 000100010003213939393939393939393939393939393939393939393939393939393939
select hex(COLUMN_CREATE(1, NULL AS unsigned int)); select hex(COLUMN_CREATE(1, NULL AS unsigned int));
hex(COLUMN_CREATE(1, NULL AS unsigned int)) hex(COLUMN_CREATE(1, NULL AS unsigned int))
000000 000000
@@ -144,7 +144,7 @@ hex(COLUMN_CREATE(1, "afaf" AS char character set utf8,
6, "2011-04-05" AS date, 6, "2011-04-05" AS date,
7, "- 0:45:49.000001" AS time, 7, "- 0:45:49.000001" AS time,
8, "2011-04-05 0:45:49.000001" AS datetime)) 8, "2011-04-05 0:45:49.000001" AS datetime))
01080001000300020029000300380004004A0005008C000600AE000700C7000800F5000861666166BC0478093D0AD7A3703D284002028C0C85B60F010010B7000485B60F010010B70000 01080001000300020029000300380004004A0005008C000600AE000700C7000800F5002161666166BC0478093D0AD7A3703D284002028C0C85B60F010010B7000485B60F010010B70000
explain extended explain extended
select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8, select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8,
2, 1212 AS unsigned int, 2, 1212 AS unsigned int,
@@ -1693,10 +1693,10 @@ ERROR 22007: Illegal value used as argument of dynamic column function
# #
select column_json(column_create("int", -1212 as int, "uint", 12334 as unsigned int, "decimal", "23.344" as decimal, "double", 1.23444e50 as double, "string", 'gdgd\\dhdjh"dhdhd' as char, "time", "0:45:49.000001" AS time, "datetime", "2011-04-05 0:45:49.000001" AS datetime, "date", "2011-04-05" AS date)); select column_json(column_create("int", -1212 as int, "uint", 12334 as unsigned int, "decimal", "23.344" as decimal, "double", 1.23444e50 as double, "string", 'gdgd\\dhdjh"dhdhd' as char, "time", "0:45:49.000001" AS time, "datetime", "2011-04-05 0:45:49.000001" AS datetime, "date", "2011-04-05" AS date));
column_json(column_create("int", -1212 as int, "uint", 12334 as unsigned int, "decimal", "23.344" as decimal, "double", 1.23444e50 as double, "string", 'gdgd\\dhdjh"dhdhd' as char, "time", "0:45:49.000001" AS time, "datetime", "2011-04-05 0:45:49.000001" column_json(column_create("int", -1212 as int, "uint", 12334 as unsigned int, "decimal", "23.344" as decimal, "double", 1.23444e50 as double, "string", 'gdgd\\dhdjh"dhdhd' as char, "time", "0:45:49.000001" AS time, "datetime", "2011-04-05 0:45:49.000001"
{"int":-1212,"date":"2011-04-05","time":"00:45:49.000001","uint":12334,"double":"1.2e50","string":"gdgd\\dhdjh\"dhdhd","decimal":23.344,"datetime":"2011-04-05 00:45:49.000001"} {"int":-1212,"date":"2011-04-05","time":"00:45:49.000001","uint":12334,"double":1.23444e50,"string":"gdgd\\dhdjh\"dhdhd","decimal":23.344,"datetime":"2011-04-05 00:45:49.000001"}
select column_json(column_create(1, -1212 as int, 2, 12334 as unsigned int, 3, "23.344" as decimal, 4, 1.23444e50 as double, 5, 'gdgd\\dhdjh"dhdhd' as char, 6, "0:45:49.000001" AS time, 7, "2011-04-05 0:45:49.000001" AS datetime, 8, "2011-04-05" AS date)); select column_json(column_create(1, -1212 as int, 2, 12334 as unsigned int, 3, "23.344" as decimal, 4, 1.23444e50 as double, 5, 'gdgd\\dhdjh"dhdhd' as char, 6, "0:45:49.000001" AS time, 7, "2011-04-05 0:45:49.000001" AS datetime, 8, "2011-04-05" AS date));
column_json(column_create(1, -1212 as int, 2, 12334 as unsigned int, 3, "23.344" as decimal, 4, 1.23444e50 as double, 5, 'gdgd\\dhdjh"dhdhd' as char, 6, "0:45:49.000001" AS time, 7, "2011-04-05 0:45:49.000001" AS datetime, 8, "2011-04-05" AS date)) column_json(column_create(1, -1212 as int, 2, 12334 as unsigned int, 3, "23.344" as decimal, 4, 1.23444e50 as double, 5, 'gdgd\\dhdjh"dhdhd' as char, 6, "0:45:49.000001" AS time, 7, "2011-04-05 0:45:49.000001" AS datetime, 8, "2011-04-05" AS date))
{"1":-1212,"2":12334,"3":23.344,"4":"1.2e50","5":"gdgd\\dhdjh\"dhdhd","6":"00:45:49.000001","7":"2011-04-05 00:45:49.000001","8":"2011-04-05"} {"1":-1212,"2":12334,"3":23.344,"4":1.23444e50,"5":"gdgd\\dhdjh\"dhdhd","6":"00:45:49.000001","7":"2011-04-05 00:45:49.000001","8":"2011-04-05"}
# #
# CHECK test # CHECK test
# #
@@ -1820,5 +1820,58 @@ SELECT COLUMN_JSON(COLUMN_CREATE('a',1,'b','1'));
COLUMN_JSON(COLUMN_CREATE('a',1,'b','1')) COLUMN_JSON(COLUMN_CREATE('a',1,'b','1'))
{"a":1,"b":"1"} {"a":1,"b":"1"}
# #
# MDEV-8401: COLUMN_CREATE(name, value as DOUBLE) results in string
#
SELECT COLUMN_JSON(
COLUMN_CREATE(
'one', 123.456,
'two', 123.456 as DOUBLE
)
);
COLUMN_JSON(
COLUMN_CREATE(
'one', 123.456,
'two', 123.456 as DOUBLE
)
)
{"one":123.456,"two":123.456}
#
# MDEV-8521: Drastic loss of precision in COLUMN_JSON() on DOUBLEs
#
select column_get(column_create('float', 1.23456789012345E+100 as double), 'float' as double);
column_get(column_create('float', 1.23456789012345E+100 as double), 'float' as double)
1.23456789012345e100
select column_json(column_create('float', 1.23456789012345E+100 as double));
column_json(column_create('float', 1.23456789012345E+100 as double))
{"float":1.23456789012345e100}
select column_json(column_create('float', 1.23456789012345E+10 as double));
column_json(column_create('float', 1.23456789012345E+10 as double))
{"float":12345678901.2345}
#
# MDEV-9147: Character set is ignored in Dynamic Column for saved string
#
SET NAMES utf8;
SELECT COLUMN_GET(COLUMN_CREATE(1, 0xC2A2 AS CHAR CHARACTER SET latin1), 1 AS CHAR CHARACTER SET utf8) AS a;
a
¢
SELECT COLUMN_GET(COLUMN_CREATE(1, 0xC2A2 AS CHAR CHARACTER SET utf8), 1 AS CHAR CHARACTER SET utf8) AS a;
a
¢
#
# MDEV-9167: COLUMN_CHECK fails on valid decimal data
#
SELECT COLUMN_CHECK(COLUMN_CREATE('a',0 AS DECIMAL,'b',1 AS DECIMAL));
COLUMN_CHECK(COLUMN_CREATE('a',0 AS DECIMAL,'b',1 AS DECIMAL))
1
SELECT COLUMN_CHECK(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL));
COLUMN_CHECK(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL))
1
SELECT COLUMN_JSON(COLUMN_CREATE('a',0 AS DECIMAL,'b',1 AS DECIMAL));
COLUMN_JSON(COLUMN_CREATE('a',0 AS DECIMAL,'b',1 AS DECIMAL))
{"a":0,"b":1}
SELECT COLUMN_JSON(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL));
COLUMN_JSON(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL))
{"a":1,"b":1}
#
# end of 10.0 tests # end of 10.0 tests
# #

View File

@@ -115,8 +115,7 @@ create table t_event3 (a int, b float);
drop event if exists event3; drop event if exists event3;
Warnings: Warnings:
Note 1305 Event event3 does not exist Note 1305 Event event3 does not exist
create event event3 on schedule every 50 + 10 minute starts date_add("20100101", interval 5 minute) ends date_add("20251010", interval 5 day) create event event3 on schedule every 50 + 10 minute starts date_add(curdate(), interval 5 minute) ends date_add(curdate(), interval 5 day) comment "portokala_comment" DO insert into t_event3 values (unix_timestamp(), rand());
comment "portokala_comment" DO insert into t_event3 values (unix_timestamp(), rand());
select count(*) from t_event3; select count(*) from t_event3;
count(*) count(*)
0 0

View File

@@ -393,3 +393,17 @@ Warnings:
Note 1003 select NULL AS `a` from (select NULL AS `a` from `test`.`t1` where 0) `t` Note 1003 select NULL AS `a` from (select NULL AS `a` from `test`.`t1` where 0) `t`
set optimizer_switch=@tmp_optimizer_switch; set optimizer_switch=@tmp_optimizer_switch;
DROP TABLE t1,t2; DROP TABLE t1,t2;
#
# MDEV-7215: EXPLAIN REPLACE produces an error:
# Column count doesn't match value count
#
create table t1 (a int);
insert into t1 values (1);
create table t2 (b int, c int);
replace into t2 select 100, (select a from t1);
explain replace into t2 select 100, (select a from t1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 SUBQUERY t1 system NULL NULL NULL NULL 1
drop table t1, t2;
# End of 10.1 tests

View File

@@ -551,7 +551,7 @@ MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE)
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1(a TEXT); CREATE TABLE t1(a TEXT);
SELECT GROUP_CONCAT(a) AS st FROM t1 HAVING MATCH(st) AGAINST('test' IN BOOLEAN MODE); SELECT GROUP_CONCAT(a) AS st FROM t1 HAVING MATCH(st) AGAINST('test' IN BOOLEAN MODE);
ERROR HY000: Incorrect arguments to AGAINST ERROR HY000: Incorrect arguments to MATCH
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1(a VARCHAR(64), FULLTEXT(a)); CREATE TABLE t1(a VARCHAR(64), FULLTEXT(a));
INSERT INTO t1 VALUES('awrd bwrd cwrd'),('awrd bwrd cwrd'),('awrd bwrd cwrd'); INSERT INTO t1 VALUES('awrd bwrd cwrd'),('awrd bwrd cwrd'),('awrd bwrd cwrd');

View File

@@ -1727,7 +1727,7 @@ Table Create Table
SPATIAL_REF_SYS CREATE TEMPORARY TABLE `SPATIAL_REF_SYS` ( SPATIAL_REF_SYS CREATE TEMPORARY TABLE `SPATIAL_REF_SYS` (
`SRID` smallint(5) NOT NULL DEFAULT '0', `SRID` smallint(5) NOT NULL DEFAULT '0',
`AUTH_NAME` varchar(512) NOT NULL DEFAULT '', `AUTH_NAME` varchar(512) NOT NULL DEFAULT '',
`AUTH_SRID` smallint(5) NOT NULL DEFAULT '0', `AUTH_SRID` int(5) NOT NULL DEFAULT '0',
`SRTEXT` varchar(2048) NOT NULL DEFAULT '' `SRTEXT` varchar(2048) NOT NULL DEFAULT ''
) ENGINE=MEMORY DEFAULT CHARSET=utf8 ) ENGINE=MEMORY DEFAULT CHARSET=utf8
create table t1(g GEOMETRY, pt POINT); create table t1(g GEOMETRY, pt POINT);

View File

@@ -29,9 +29,11 @@ select length(data) from t1;
length(data) length(data)
18874368 18874368
alter table t1 modify data blob; alter table t1 modify data blob;
Warnings:
Warning 1265 Data truncated for column 'data' at row 1
select length(data) from t1; select length(data) from t1;
length(data) length(data)
0 65535
drop table t1; drop table t1;
CREATE TABLE t1 (data BLOB) ENGINE=myisam; CREATE TABLE t1 (data BLOB) ENGINE=myisam;
INSERT INTO t1 (data) VALUES (NULL); INSERT INTO t1 (data) VALUES (NULL);

View File

@@ -102,7 +102,7 @@ ERROR: Missing --plugin_dir option.
# Show the help. # Show the help.
# #
mysql_plugin Ver V.V.VV Distrib XX.XX.XX mysql_plugin Ver V.V.VV Distrib XX.XX.XX
Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
Enable or disable plugins. Enable or disable plugins.

View File

@@ -46,7 +46,7 @@ Phase 6/6: Running 'FLUSH PRIVILEGES'
OK OK
Run it again - should say already completed Run it again - should say already completed
This installation of MySQL is already upgraded to VERSION, use --force if you still need to run mysql_upgrade This installation of MySQL is already upgraded to VERSION, use --force if you still need to run mysql_upgrade
Force should run it regardless of wether it's been run before Force should run it regardless of whether it has been run before
Phase 1/6: Checking and upgrading mysql database Phase 1/6: Checking and upgrading mysql database
Processing databases Processing databases
mysql mysql
@@ -394,6 +394,13 @@ test
Phase 6/6: Running 'FLUSH PRIVILEGES' Phase 6/6: Running 'FLUSH PRIVILEGES'
OK OK
# #
# Bug #21489398: MYSQL_UPGRADE: FATAL ERROR: UPGRADE FAILED - IMPROVE ERROR
#
Run mysql_upgrade with unauthorized access
Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
FATAL ERROR: Upgrade failed
#
# MDEV-4332 Increase username length from 16 characters # MDEV-4332 Increase username length from 16 characters
# MDEV-6068, MDEV-6178 mysql_upgrade breaks databases with long user names # MDEV-6068, MDEV-6178 mysql_upgrade breaks databases with long user names
# #

View File

@@ -347,6 +347,9 @@ CREATE TABLE test.`t.1` (id int);
mysqlcheck test t.1 mysqlcheck test t.1
test.t.1 OK test.t.1 OK
drop table test.`t.1`; drop table test.`t.1`;
#
# MDEV-8123 mysqlcheck: new --process-views option conflicts with --quick, --extended and such
#
create view v1 as select 1; create view v1 as select 1;
mysqlcheck --process-views test mysqlcheck --process-views test
test.v1 OK test.v1 OK
@@ -361,6 +364,9 @@ test.v1 OK
mysqlcheck --process-views --check-upgrade test mysqlcheck --process-views --check-upgrade test
test.v1 OK test.v1 OK
drop view v1; drop view v1;
#
# MDEV-8124 mysqlcheck: --auto-repair runs REPAIR TABLE instead of REPAIR VIEW on views
#
create table t1(a int); create table t1(a int);
mysqlcheck --process-views --check-upgrade --auto-repair test mysqlcheck --process-views --check-upgrade --auto-repair test
test.t1 OK test.t1 OK
@@ -370,3 +376,16 @@ Repairing views
test.v1 OK test.v1 OK
drop view v1; drop view v1;
drop table t1; drop table t1;
#
#MDEV-7384 [PATCH] add PERSISENT FOR ALL option to mysqlanalyze/mysqlcheck
#
create table t1(a int);
insert into t1 (a) values (1), (2), (3);
select * from mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
test.t1 Engine-independent statistics collected
status : OK
select * from mysql.column_stats where db_name = 'test' and table_name = 't1';
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
test t1 a 1 3 0.0000 4.0000 1.0000 0 NULL NULL
drop table t1;

Some files were not shown because too many files have changed in this diff Show More