1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

merge from trunk

This commit is contained in:
Bjorn Munch
2010-06-17 12:27:50 +02:00
865 changed files with 34864 additions and 36089 deletions

View File

@ -3085,3 +3085,13 @@ client/dtoa.c
libmysqld/sql_audit.cc libmysqld/sql_audit.cc
configure.am configure.am
libmysqld/des_key_file.cc libmysqld/des_key_file.cc
CPackConfig.cmake
CPackSourceConfig.cmake
make_dist.cmake
client/echo
libmysql/libmysql_exports_file.cc
libmysql/merge_archives_mysqlclient.cmake
libmysqld/merge_archives_mysqlserver.cmake
libmysqld/mysqlserver_depends.c
libmysqld/examples/mysql_embedded
sql/.empty

View File

@ -25,8 +25,6 @@ EXTRA_DIST = FINISH.sh \
check-cpu \ check-cpu \
cleanup \ cleanup \
compile-alpha \ compile-alpha \
compile-alpha-ccc \
compile-alpha-cxx \
compile-alpha-debug \ compile-alpha-debug \
compile-amd64-debug-max \ compile-amd64-debug-max \
compile-amd64-debug-max-no-ndb \ compile-amd64-debug-max-no-ndb \

View File

@ -119,8 +119,12 @@ fi
# Set flags for various build configurations. # Set flags for various build configurations.
# Used in -valgrind builds # Used in -valgrind builds
valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify " # Override -DFORCE_INIT_OF_VARS from debug_cflags. It enables the macro
# LINT_INIT(), which is only useful for silencing spurious warnings
# of static analysis tools. We want LINT_INIT() to be a no-op in Valgrind.
valgrind_flags="-UFORCE_INIT_OF_VARS -DHAVE_purify "
valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max" valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max"
valgrind_configs="--with-valgrind"
# #
# Used in -debug builds # Used in -debug builds
debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS " debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS "

View File

@ -1010,9 +1010,10 @@ set_ccache_usage()
set_valgrind_flags() set_valgrind_flags()
{ {
if test "x$valgrind_flag" = "xyes" ; then if test "x$valgrind_flag" = "xyes" ; then
loc_valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify " loc_valgrind_flags="-UFORCE_INIT_OF_VARS -DHAVE_purify "
loc_valgrind_flags="$loc_valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max" loc_valgrind_flags="$loc_valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max"
compiler_flags="$compiler_flags $loc_valgrind_flags" compiler_flags="$compiler_flags $loc_valgrind_flags"
with_flags="$with_flags --with-valgrind"
fi fi
} }

View File

@ -1,41 +0,0 @@
#! /bin/sh
/bin/rm -f */.deps/*.P */*.o
make -k maintainer-clean
/bin/rm -f */.deps/*.P */*.o
/bin/rm -f config.cache mysql-*.tar.gz
path=`dirname $0`
. "$path/autorun.sh"
CC=ccc CFLAGS="-fast -O3 -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti -mcpu=ev6 -Wa,-mev6" CXXLDFLAGS='/usr/lib/compaq/libots-2.2.7/libots.so /usr/lib/compaq/cpml-5.0.0/libcpml_ev6.a' ./configure --prefix=/usr/local/mysql --disable-shared --with-extra-charsets=complex --enable-thread-safe-client
make
rm */.deps/*
make
if [ $? = 0 ]
then
rm */.deps/*
bin/mysqladmin shutdown
sur make install
if [ $? = 0 ]
then
scripts/make_binary_distribution
fi
fi
exit
# This should give better performance by compiling many files at once, but
# according to our benchmarks there isn't any real difference.
pwd=`pwd`
for i in */make-ccc
do
cd `dirname $i`
make-ccc
cd $pwd
done
cd sql
rm mysqld .deps/*.P
make mysqld
cd $pwd

View File

@ -1,43 +0,0 @@
#! /bin/sh
/bin/rm -f */.deps/*.P */*.o
make -k maintainer-clean
/bin/rm -f */.deps/*.P */*.o
/bin/rm -f */.deps/*.P config.cache storage/innobase/config.cache mysql-*.tar.gz
path=`dirname $0`
. "$path/autorun.sh"
CC=ccc CFLAGS="-fast" CXX=cxx CXXFLAGS="-fast -noexceptions -nortti" ./configure --prefix=/usr/local/mysql --disable-shared --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-non_shared --with-client-ldflags=-non_shared --without-extra-tools --disable-dependency-tracking
make -j2
find . -name ".deps" | xargs rm -r
make
if [ $? = 0 ]
then
find . -name ".deps" | xargs rm -r
bin/mysqladmin shutdown
sur make install
if [ $? = 0 ]
then
scripts/make_binary_distribution
fi
make test
fi
exit
# This should give better performance by compiling many files at once, but
# according to our benchmarks there isn't any real difference.
pwd=`pwd`
for i in */make-ccc
do
cd `dirname $i`
make-ccc
cd $pwd
done
cd sql
rm mysqld .deps/*.P
make mysqld
cd $pwd

View File

@ -4,7 +4,7 @@ path=`dirname $0`
. "$path/SETUP.sh" . "$path/SETUP.sh"
extra_flags="$amd64_cflags $debug_cflags $valgrind_flags" extra_flags="$amd64_cflags $debug_cflags $valgrind_flags"
extra_configs="$amd64_configs $debug_configs $max_configs" extra_configs="$amd64_configs $debug_configs $valgrind_configs $max_configs"
. "$path/FINISH.sh" . "$path/FINISH.sh"

View File

@ -29,6 +29,6 @@ extra_flags="$pentium_cflags $debug_cflags $valgrind_flags"
c_warnings="-Wall -Wcheck -wd161,444,279,810,981,1292,1469,1572" c_warnings="-Wall -Wcheck -wd161,444,279,810,981,1292,1469,1572"
cxx_warnings="$c_warnings -wd869,874" cxx_warnings="$c_warnings -wd869,874"
base_cxxflags="-fno-exceptions -fno-rtti" base_cxxflags="-fno-exceptions -fno-rtti"
extra_configs="$pentium_configs $debug_configs" extra_configs="$pentium_configs $debug_configs $valgrind_configs"
. "$path/FINISH.sh" . "$path/FINISH.sh"

View File

@ -4,7 +4,7 @@ path=`dirname $0`
. "$path/SETUP.sh" . "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags $valgrind_flags" extra_flags="$pentium_cflags $debug_cflags $valgrind_flags"
extra_configs="$pentium_configs $debug_configs $max_configs" extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs"
. "$path/FINISH.sh" . "$path/FINISH.sh"

View File

@ -4,7 +4,7 @@ path=`dirname $0`
. "$path/SETUP.sh" . "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags $valgrind_flags" extra_flags="$pentium_cflags $debug_cflags $valgrind_flags"
extra_configs="$pentium_configs $debug_configs $max_no_ndb_configs" extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_no_ndb_configs"
. "$path/FINISH.sh" . "$path/FINISH.sh"

View File

@ -4,7 +4,7 @@ path=`dirname $0`
. "$path/SETUP.sh" . "$path/SETUP.sh"
extra_flags="$pentium64_cflags $debug_cflags $valgrind_flags" extra_flags="$pentium64_cflags $debug_cflags $valgrind_flags"
extra_configs="$pentium_configs $debug_configs $max_configs" extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs"
. "$path/FINISH.sh" . "$path/FINISH.sh"

View File

@ -262,6 +262,7 @@ IF(NOT WITHOUT_SERVER)
ENDIF() ENDIF()
INCLUDE(cmake/abi_check.cmake) INCLUDE(cmake/abi_check.cmake)
INCLUDE(cmake/tags.cmake)
CONFIGURE_FILE(config.h.cmake ${CMAKE_BINARY_DIR}/include/my_config.h) CONFIGURE_FILE(config.h.cmake ${CMAKE_BINARY_DIR}/include/my_config.h)
CONFIGURE_FILE(config.h.cmake ${CMAKE_BINARY_DIR}/include/config.h) CONFIGURE_FILE(config.h.cmake ${CMAKE_BINARY_DIR}/include/config.h)

View File

@ -59,8 +59,6 @@ static char *server_version= NULL;
/* Array of options to pass to libemysqld */ /* Array of options to pass to libemysqld */
#define MAX_SERVER_ARGS 64 #define MAX_SERVER_ARGS 64
void* sql_alloc(unsigned size); // Don't use mysqld alloc for these
void sql_element_free(void *ptr);
#include "sql_string.h" #include "sql_string.h"
extern "C" { extern "C" {
@ -1372,102 +1370,117 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"auto-rehash", OPT_AUTO_REHASH, {"auto-rehash", OPT_AUTO_REHASH,
"Enable automatic rehashing. One doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time. Disable with --disable-auto-rehash.", "Enable automatic rehashing. One doesn't need to use 'rehash' to get table "
(uchar**) &opt_rehash, (uchar**) &opt_rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, "and field completion, but startup and reconnecting may take a longer time. "
"Disable with --disable-auto-rehash.",
&opt_rehash, &opt_rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
0, 0}, 0, 0},
{"no-auto-rehash", 'A', {"no-auto-rehash", 'A',
"No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect.", "No automatic rehashing. One has to use 'rehash' to get table and field "
"completion. This gives a quicker start of mysql and disables rehashing "
"on reconnect.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"auto-vertical-output", OPT_AUTO_VERTICAL_OUTPUT, {"auto-vertical-output", OPT_AUTO_VERTICAL_OUTPUT,
"Automatically switch to vertical output mode if the result is wider than the terminal width.", "Automatically switch to vertical output mode if the result is wider "
(uchar**) &auto_vertical_output, (uchar**) &auto_vertical_output, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, "than the terminal width.",
&auto_vertical_output, &auto_vertical_output, 0, GET_BOOL, NO_ARG, 0,
0, 0, 0, 0, 0},
{"batch", 'B', {"batch", 'B',
"Don't use history file. Disable interactive behavior. (Enables --silent.)", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, "Don't use history file. Disable interactive behavior. (Enables --silent.)",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR, {"character-sets-dir", OPT_CHARSETS_DIR,
"Directory for character set files.", (uchar**) &charsets_dir, "Directory for character set files.", &charsets_dir,
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"column-type-info", OPT_COLUMN_TYPES, "Display column type information.", {"column-type-info", OPT_COLUMN_TYPES, "Display column type information.",
(uchar**) &column_types_flag, (uchar**) &column_types_flag, &column_types_flag, &column_types_flag,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"comments", 'c', "Preserve comments. Send comments to the server." {"comments", 'c', "Preserve comments. Send comments to the server."
" The default is --skip-comments (discard comments), enable with --comments.", " The default is --skip-comments (discard comments), enable with --comments.",
(uchar**) &preserve_comments, (uchar**) &preserve_comments, &preserve_comments, &preserve_comments,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"compress", 'C', "Use compression in server/client protocol.", {"compress", 'C', "Use compression in server/client protocol.",
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
#ifdef DBUG_OFF #ifdef DBUG_OFF
{"debug", '#', "This is a non-debug version. Catch this and exit.", {"debug", '#', "This is a non-debug version. Catch this and exit.",
0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, 0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else #else
{"debug", '#', "Output debug log.", (uchar**) &default_dbug_option, {"debug", '#', "Output debug log.", &default_dbug_option,
(uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.", {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0, &debug_check_flag, &debug_check_flag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", 'T', "Print some debug info at exit.", (uchar**) &debug_info_flag, {"debug-info", 'T', "Print some debug info at exit.", &debug_info_flag,
(uchar**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"database", 'D', "Database to use.", (uchar**) &current_db, {"database", 'D', "Database to use.", &current_db,
(uchar**) &current_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &current_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET, {"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", (uchar**) &default_charset, "Set the default character set.", &default_charset,
(uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"delimiter", OPT_DELIMITER, "Delimiter to be used.", (uchar**) &delimiter_str, {"delimiter", OPT_DELIMITER, "Delimiter to be used.", &delimiter_str,
(uchar**) &delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"execute", 'e', "Execute command and quit. (Disables --force and history file.)", 0, {"execute", 'e', "Execute command and quit. (Disables --force and history file.)", 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},
{"vertical", 'E', "Print the output of a query (rows) vertically.", {"vertical", 'E', "Print the output of a query (rows) vertically.",
(uchar**) &vertical, (uchar**) &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, &vertical, &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0}, 0},
{"force", 'f', "Continue even if we get an SQL error.", {"force", 'f', "Continue even if we get an SQL error.",
(uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0, &ignore_errors, &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0}, 0, 0, 0, 0},
{"named-commands", 'G', {"named-commands", 'G',
"Enable named commands. Named commands mean this program's internal commands; see mysql> help . When enabled, the named commands can be used from any line of the query, otherwise only from the first line, before an enter. Disable with --disable-named-commands. This option is disabled by default.", "Enable named commands. Named commands mean this program's internal "
(uchar**) &named_cmds, (uchar**) &named_cmds, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, "commands; see mysql> help . When enabled, the named commands can be "
"used from any line of the query, otherwise only from the first line, "
"before an enter. Disable with --disable-named-commands. This option "
"is disabled by default.",
&named_cmds, &named_cmds, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
{"ignore-spaces", 'i', "Ignore space after function names.", {"ignore-spaces", 'i', "Ignore space after function names.",
(uchar**) &ignore_spaces, (uchar**) &ignore_spaces, 0, GET_BOOL, NO_ARG, 0, 0, &ignore_spaces, &ignore_spaces, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0}, 0, 0, 0, 0},
{"init-command", OPT_INIT_COMMAND, {"init-command", OPT_INIT_COMMAND,
"SQL Command to execute when connecting to MySQL server. Will automatically be re-executed when reconnecting.", "SQL Command to execute when connecting to MySQL server. Will "
(uchar**) &opt_init_command, (uchar**) &opt_init_command, 0, "automatically be re-executed when reconnecting.",
&opt_init_command, &opt_init_command, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"local-infile", OPT_LOCAL_INFILE, "Enable/disable LOAD DATA LOCAL INFILE.", {"local-infile", OPT_LOCAL_INFILE, "Enable/disable LOAD DATA LOCAL INFILE.",
(uchar**) &opt_local_infile, &opt_local_infile, &opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
(uchar**) &opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"no-beep", 'b', "Turn off beep on error.", &opt_nobeep,
{"no-beep", 'b', "Turn off beep on error.", (uchar**) &opt_nobeep, &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
(uchar**) &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"host", 'h', "Connect to host.", &current_host,
{"host", 'h', "Connect to host.", (uchar**) &current_host, &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
(uchar**) &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"html", 'H', "Produce HTML output.", &opt_html, &opt_html,
{"html", 'H', "Produce HTML output.", (uchar**) &opt_html, (uchar**) &opt_html,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"xml", 'X', "Produce XML output.", (uchar**) &opt_xml, (uchar**) &opt_xml, 0, {"xml", 'X', "Produce XML output.", &opt_xml, &opt_xml, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"line-numbers", OPT_LINE_NUMBERS, "Write line numbers for errors.", {"line-numbers", OPT_LINE_NUMBERS, "Write line numbers for errors.",
(uchar**) &line_numbers, (uchar**) &line_numbers, 0, GET_BOOL, &line_numbers, &line_numbers, 0, GET_BOOL,
NO_ARG, 1, 0, 0, 0, 0, 0}, NO_ARG, 1, 0, 0, 0, 0, 0},
{"skip-line-numbers", 'L', "Don't write line number for errors.", 0, 0, 0, GET_NO_ARG, {"skip-line-numbers", 'L', "Don't write line number for errors.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
{"unbuffered", 'n', "Flush buffer after each query.", (uchar**) &unbuffered, {"unbuffered", 'n', "Flush buffer after each query.", &unbuffered,
(uchar**) &unbuffered, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &unbuffered, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"column-names", OPT_COLUMN_NAMES, "Write column names in results.", {"column-names", OPT_COLUMN_NAMES, "Write column names in results.",
(uchar**) &column_names, (uchar**) &column_names, 0, GET_BOOL, &column_names, &column_names, 0, GET_BOOL,
NO_ARG, 1, 0, 0, 0, 0, 0}, NO_ARG, 1, 0, 0, 0, 0, 0},
{"skip-column-names", 'N', {"skip-column-names", 'N',
"Don't write column names in results.", "Don't write column names in results.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"sigint-ignore", OPT_SIGINT_IGNORE, "Ignore SIGINT (CTRL-C).", {"sigint-ignore", OPT_SIGINT_IGNORE, "Ignore SIGINT (CTRL-C).",
(uchar**) &opt_sigint_ignore, (uchar**) &opt_sigint_ignore, 0, GET_BOOL, &opt_sigint_ignore, &opt_sigint_ignore, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
{"one-database", 'o', {"one-database", 'o',
"Only update the default database. This is useful for skipping updates to other database in the update log.", "Only update the default database. This is useful for skipping updates "
"to other database in the update log.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef USE_POPEN #ifdef USE_POPEN
{"pager", OPT_PAGER, {"pager", OPT_PAGER,
"Pager to use to display results. If you don't supply an option, the default pager is taken from your ENV variable PAGER. Valid pagers are less, more, cat [> filename], etc. See interactive help (\\h) also. This option does not work in batch mode. Disable with --disable-pager. This option is disabled by default.", "Pager to use to display results. If you don't supply an option, the "
"default pager is taken from your ENV variable PAGER. Valid pagers are "
"less, more, cat [> filename], etc. See interactive help (\\h) also. "
"This option does not work in batch mode. Disable with --disable-pager. "
"This option is disabled by default.",
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},
#endif #endif
{"password", 'p', {"password", 'p',
@ -1483,46 +1496,50 @@ static struct my_option my_long_options[] =
"/etc/services, " "/etc/services, "
#endif #endif
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
(uchar**) &opt_mysql_port, &opt_mysql_port,
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"prompt", OPT_PROMPT, "Set the mysql prompt to this value.", {"prompt", OPT_PROMPT, "Set the mysql prompt to this value.",
(uchar**) &current_prompt, (uchar**) &current_prompt, 0, GET_STR_ALLOC, &current_prompt, &current_prompt, 0, GET_STR_ALLOC,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).", {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"quick", 'q', {"quick", 'q',
"Don't cache result, print it row by row. This may slow down the server if the output is suspended. Doesn't use history file.", "Don't cache result, print it row by row. This may slow down the server "
(uchar**) &quick, (uchar**) &quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, "if the output is suspended. Doesn't use history file.",
&quick, &quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"raw", 'r', "Write fields without conversion. Used with --batch.", {"raw", 'r', "Write fields without conversion. Used with --batch.",
(uchar**) &opt_raw_data, (uchar**) &opt_raw_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, &opt_raw_data, &opt_raw_data, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
{"reconnect", OPT_RECONNECT, "Reconnect if the connection is lost. Disable with --disable-reconnect. This option is enabled by default.", {"reconnect", OPT_RECONNECT, "Reconnect if the connection is lost. Disable "
(uchar**) &opt_reconnect, (uchar**) &opt_reconnect, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, "with --disable-reconnect. This option is enabled by default.",
{"silent", 's', "Be more silent. Print results with a tab as separator, each row on new line.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, &opt_reconnect, &opt_reconnect, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
0, 0}, {"silent", 's', "Be more silent. Print results with a tab as separator, "
"each row on new line.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM #ifdef HAVE_SMEM
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name, "Base name of shared memory.", &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"socket", 'S', "The socket file to use for connection.", {"socket", 'S', "The socket file to use for connection.",
(uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR_ALLOC, &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR_ALLOC,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include "sslopt-longopts.h" #include "sslopt-longopts.h"
{"table", 't', "Output in table format.", (uchar**) &output_tables, {"table", 't', "Output in table format.", &output_tables,
(uchar**) &output_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &output_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"tee", OPT_TEE, {"tee", OPT_TEE,
"Append everything into outfile. See interactive help (\\h) also. Does not work in batch mode. Disable with --disable-tee. This option is disabled by default.", "Append everything into outfile. See interactive help (\\h) also. "
"Does not work in batch mode. Disable with --disable-tee. "
"This option is disabled by default.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifndef DONT_ALLOW_USER_CHANGE #ifndef DONT_ALLOW_USER_CHANGE
{"user", 'u', "User for login if not current user.", (uchar**) &current_user, {"user", 'u', "User for login if not current user.", &current_user,
(uchar**) &current_user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &current_user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"safe-updates", 'U', "Only allow UPDATE and DELETE that uses keys.", {"safe-updates", 'U', "Only allow UPDATE and DELETE that uses keys.",
(uchar**) &safe_updates, (uchar**) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0, &safe_updates, &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0}, 0, 0, 0, 0},
{"i-am-a-dummy", 'U', "Synonym for option --safe-updates, -U.", {"i-am-a-dummy", 'U', "Synonym for option --safe-updates, -U.",
(uchar**) &safe_updates, (uchar**) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0, &safe_updates, &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0}, 0, 0, 0, 0},
{"verbose", 'v', "Write more. (-v -v -v gives the table output format).", 0, {"verbose", 'v', "Write more. (-v -v -v gives the table output format).", 0,
0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@ -1532,35 +1549,32 @@ static struct my_option my_long_options[] =
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
{"connect_timeout", OPT_CONNECT_TIMEOUT, {"connect_timeout", OPT_CONNECT_TIMEOUT,
"Number of seconds before connection timeout.", "Number of seconds before connection timeout.",
(uchar**) &opt_connect_timeout, &opt_connect_timeout, &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG,
(uchar**) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 3600*12, 0, 0, 0, 3600*12, 0, 0, 0},
0, 0},
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET,
"The maximum packet length to send to or receive from server.", "The maximum packet length to send to or receive from server.",
(uchar**) &opt_max_allowed_packet, (uchar**) &opt_max_allowed_packet, 0, &opt_max_allowed_packet, &opt_max_allowed_packet, 0,
GET_ULONG, REQUIRED_ARG, 16 *1024L*1024L, 4096, GET_ULONG, REQUIRED_ARG, 16 *1024L*1024L, 4096,
(longlong) 2*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0}, (longlong) 2*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
{"net_buffer_length", OPT_NET_BUFFER_LENGTH, {"net_buffer_length", OPT_NET_BUFFER_LENGTH,
"The buffer size for TCP/IP and socket communication.", "The buffer size for TCP/IP and socket communication.",
(uchar**) &opt_net_buffer_length, (uchar**) &opt_net_buffer_length, 0, GET_ULONG, &opt_net_buffer_length, &opt_net_buffer_length, 0, GET_ULONG,
REQUIRED_ARG, 16384, 1024, 512*1024*1024L, MALLOC_OVERHEAD, 1024, 0}, REQUIRED_ARG, 16384, 1024, 512*1024*1024L, MALLOC_OVERHEAD, 1024, 0},
{"select_limit", OPT_SELECT_LIMIT, {"select_limit", OPT_SELECT_LIMIT,
"Automatic limit for SELECT when using --safe-updates.", "Automatic limit for SELECT when using --safe-updates.",
(uchar**) &select_limit, &select_limit, &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L,
(uchar**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ULONG_MAX, 1, ULONG_MAX, 0, 1, 0},
0, 1, 0},
{"max_join_size", OPT_MAX_JOIN_SIZE, {"max_join_size", OPT_MAX_JOIN_SIZE,
"Automatic limit for rows in a join when using --safe-updates.", "Automatic limit for rows in a join when using --safe-updates.",
(uchar**) &max_join_size, &max_join_size, &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L,
(uchar**) &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L, 1, ULONG_MAX, 1, ULONG_MAX, 0, 1, 0},
0, 1, 0},
{"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it" {"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it"
" uses old (pre-4.1.1) protocol.", (uchar**) &opt_secure_auth, " uses old (pre-4.1.1) protocol.", &opt_secure_auth,
(uchar**) &opt_secure_auth, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &opt_secure_auth, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"server-arg", OPT_SERVER_ARG, "Send embedded server this as a parameter.", {"server-arg", OPT_SERVER_ARG, "Send embedded server this as a parameter.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"show-warnings", OPT_SHOW_WARNINGS, "Show warnings after every statement.", {"show-warnings", OPT_SHOW_WARNINGS, "Show warnings after every statement.",
(uchar**) &show_warnings, (uchar**) &show_warnings, 0, GET_BOOL, NO_ARG, &show_warnings, &show_warnings, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
}; };
@ -2318,8 +2332,10 @@ static bool add_line(String &buffer,char *line,char *in_string,
#ifdef HAVE_READLINE #ifdef HAVE_READLINE
C_MODE_START
static char *new_command_generator(const char *text, int); static char *new_command_generator(const char *text, int);
extern "C" char **new_mysql_completion (const char *text, int start, int end); static char **new_mysql_completion(const char *text, int start, int end);
C_MODE_END
/* /*
Tell the GNU Readline library how to complete. We want to try to complete Tell the GNU Readline library how to complete. We want to try to complete
@ -2451,9 +2467,9 @@ static void initialize_readline (char *name)
array of matches, or NULL if there aren't any. array of matches, or NULL if there aren't any.
*/ */
char **new_mysql_completion (const char *text, static char **new_mysql_completion(const char *text,
int start __attribute__((unused)), int start __attribute__((unused)),
int end __attribute__((unused))) int end __attribute__((unused)))
{ {
if (!status.batch && !quick) if (!status.batch && !quick)
#if defined(USE_NEW_READLINE_INTERFACE) #if defined(USE_NEW_READLINE_INTERFACE)
@ -4963,17 +4979,3 @@ static int com_prompt(String *buffer, char *line)
tee_fprintf(stdout, "PROMPT set to '%s'\n", current_prompt); tee_fprintf(stdout, "PROMPT set to '%s'\n", current_prompt);
return 0; return 0;
} }
#ifndef EMBEDDED_LIBRARY
/* Keep sql_string library happy */
void *sql_alloc(size_t Size)
{
return my_malloc(Size,MYF(MY_WME));
}
void sql_element_free(void *ptr)
{
my_free(ptr,MYF(0));
}
#endif /* EMBEDDED_LIBRARY */

View File

@ -69,7 +69,7 @@ static struct my_option my_long_options[]=
"Directory for character set files.", 0, "Directory for character set files.", 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},
{"compress", OPT_COMPRESS, "Use compression in server/client protocol.", {"compress", OPT_COMPRESS, "Use compression in server/client protocol.",
(uchar**)&not_used, (uchar**)&not_used, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &not_used, &not_used, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"datadir", 'd', {"datadir", 'd',
"Not used by mysql_upgrade. Only for backward compatibility.", "Not used by mysql_upgrade. Only for backward compatibility.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@ -77,26 +77,26 @@ static struct my_option my_long_options[]=
{"debug", '#', "This is a non-debug version. Catch this and exit.", {"debug", '#', "This is a non-debug version. Catch this and exit.",
0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else #else
{"debug", '#', "Output debug log.", (uchar* *) & default_dbug_option, {"debug", '#', "Output debug log.", &default_dbug_option,
(uchar* *) & default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.", {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0, &debug_check_flag, &debug_check_flag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", 'T', "Print some debug info at exit.", (uchar**) &debug_info_flag, {"debug-info", 'T', "Print some debug info at exit.", &debug_info_flag,
(uchar**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET, {"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", 0, "Set the default character set.", 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},
{"force", 'f', "Force execution of mysqlcheck even if mysql_upgrade " {"force", 'f', "Force execution of mysqlcheck even if mysql_upgrade "
"has already been executed for the current version of MySQL.", "has already been executed for the current version of MySQL.",
(uchar**)&opt_force, (uchar**)&opt_force, 0, &opt_force, &opt_force, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 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},
{"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.", (uchar**) &opt_password,(uchar**) &opt_password, " it's solicited on the tty.", &opt_password,&opt_password,
0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#ifdef __WIN__ #ifdef __WIN__
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0,
@ -124,17 +124,17 @@ static struct my_option my_long_options[]=
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"upgrade-system-tables", 's', "Only upgrade the system tables " {"upgrade-system-tables", 's', "Only upgrade the system tables "
"do not try to upgrade the data.", "do not try to upgrade the data.",
(uchar**)&opt_systables_only, (uchar**)&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},
{"user", 'u', "User for login if not current user.", (uchar**) &opt_user, {"user", 'u', "User for login if not current user.", &opt_user,
(uchar**) &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.", {"verbose", 'v', "Display more output about the process.",
(uchar**) &opt_verbose, (uchar**) &opt_verbose, 0, &opt_verbose, &opt_verbose, 0,
GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"write-binlog", OPT_WRITE_BINLOG, {"write-binlog", OPT_WRITE_BINLOG,
"All commands including mysqlcheck are binlogged. Enabled by default;" "All commands including mysqlcheck are binlogged. Enabled by default;"
"use --skip-write-binlog when commands should not be sent to replication slaves.", "use --skip-write-binlog when commands should not be sent to replication slaves.",
(uchar**) &opt_write_binlog, (uchar**) &opt_write_binlog, 0, GET_BOOL, NO_ARG, &opt_write_binlog, &opt_write_binlog, 0, GET_BOOL, NO_ARG,
1, 0, 0, 0, 0, 0}, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
}; };

View File

@ -122,37 +122,38 @@ static struct my_option my_long_options[] =
#endif #endif
{"count", 'c', {"count", 'c',
"Number of iterations to make. This works with -i (--sleep) only.", "Number of iterations to make. This works with -i (--sleep) only.",
(uchar**) &nr_iterations, (uchar**) &nr_iterations, 0, GET_UINT, &nr_iterations, &nr_iterations, 0, GET_UINT,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifndef DBUG_OFF #ifndef DBUG_OFF
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
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},
#endif #endif
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.", {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0, &debug_check_flag, &debug_check_flag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
(uchar**) &debug_info_flag, (uchar**) &debug_info_flag, &debug_info_flag, &debug_info_flag,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"force", 'f', {"force", 'f',
"Don't ask for confirmation on drop database; with multiple commands, continue even if an error occurs.", "Don't ask for confirmation on drop database; with multiple commands, "
(uchar**) &option_force, (uchar**) &option_force, 0, GET_BOOL, NO_ARG, 0, 0, "continue even if an error occurs.",
&option_force, &option_force, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0}, 0, 0, 0, 0},
{"compress", 'C', "Use compression in server/client protocol.", {"compress", 'C', "Use compression in server/client protocol.",
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR, {"character-sets-dir", OPT_CHARSETS_DIR,
"Directory for character set files.", (uchar**) &charsets_dir, "Directory for character set files.", &charsets_dir,
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET, {"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", (uchar**) &default_charset, "Set the default character set.", &default_charset,
(uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
{"host", 'h', "Connect to host.", (uchar**) &host, (uchar**) &host, 0, GET_STR, {"host", 'h', "Connect to host.", &host, &host, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"no-beep", 'b', "Turn off beep on error.", (uchar**) &opt_nobeep, {"no-beep", 'b', "Turn off beep on error.", &opt_nobeep,
(uchar**) &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p', {"password", 'p',
"Password to use when connecting to server. If password is not given it's asked from the tty.", "Password to use when connecting to server. If password is not given it's asked from 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},
@ -166,47 +167,47 @@ static struct my_option my_long_options[] =
"/etc/services, " "/etc/services, "
#endif #endif
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
(uchar**) &tcp_port, &tcp_port, &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
(uchar**) &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).", {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"relative", 'r', {"relative", 'r',
"Show difference between current and previous values when used with -i. Currently only works with extended-status.", "Show difference between current and previous values when used with -i. "
(uchar**) &opt_relative, (uchar**) &opt_relative, 0, GET_BOOL, NO_ARG, 0, 0, 0, "Currently only works with extended-status.",
&opt_relative, &opt_relative, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
#ifdef HAVE_SMEM #ifdef HAVE_SMEM
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name, "Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"silent", 's', "Silently exit if one can't connect to server.", {"silent", 's', "Silently exit if one can't connect to server.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"socket", 'S', "The socket file to use for connection.", {"socket", 'S', "The socket file to use for connection.",
(uchar**) &unix_port, (uchar**) &unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, &unix_port, &unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
{"sleep", 'i', "Execute commands repeatedly with a sleep between.", {"sleep", 'i', "Execute commands repeatedly with a sleep between.",
(uchar**) &interval, (uchar**) &interval, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, &interval, &interval, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
#include <sslopt-longopts.h> #include <sslopt-longopts.h>
#ifndef DONT_ALLOW_USER_CHANGE #ifndef DONT_ALLOW_USER_CHANGE
{"user", 'u', "User for login if not current user.", (uchar**) &user, {"user", 'u', "User for login if not current user.", &user,
(uchar**) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"verbose", 'v', "Write more information.", (uchar**) &opt_verbose, {"verbose", 'v', "Write more information.", &opt_verbose,
(uchar**) &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG, {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
{"vertical", 'E', {"vertical", 'E',
"Print output vertically. Is similar to --relative, but prints output vertically.", "Print output vertically. Is similar to --relative, but prints output vertically.",
(uchar**) &opt_vertical, (uchar**) &opt_vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, &opt_vertical, &opt_vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
{"wait", 'w', "Wait and retry if connection is down.", 0, 0, 0, GET_UINT, {"wait", 'w', "Wait and retry if connection is down.", 0, 0, 0, GET_UINT,
OPT_ARG, 0, 0, 0, 0, 0, 0}, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"connect_timeout", OPT_CONNECT_TIMEOUT, "", (uchar**) &opt_connect_timeout, {"connect_timeout", OPT_CONNECT_TIMEOUT, "", &opt_connect_timeout,
(uchar**) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 3600*12, 0, &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 3600*12, 0,
3600*12, 0, 1, 0}, 3600*12, 0, 1, 0},
{"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", (uchar**) &opt_shutdown_timeout, {"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", &opt_shutdown_timeout,
(uchar**) &opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG, &opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG,
SHUTDOWN_DEF_TIMEOUT, 0, 3600*12, 0, 1, 0}, SHUTDOWN_DEF_TIMEOUT, 0, 3600*12, 0, 1, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
}; };

View File

@ -1016,9 +1016,8 @@ static struct my_option my_long_options[] =
"events); 'always' prints base64 whenever possible. 'always' is for " "events); 'always' prints base64 whenever possible. 'always' is for "
"debugging only and should not be used in a production system. If this " "debugging only and should not be used in a production system. If this "
"argument is not given, the default is 'auto'; if it is given with no " "argument is not given, the default is 'auto'; if it is given with no "
"argument, 'always' is used." "argument, 'always' is used.",
,(uchar**) &opt_base64_output_mode_str, &opt_base64_output_mode_str, &opt_base64_output_mode_str,
(uchar**) &opt_base64_output_mode_str,
0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
/* /*
mysqlbinlog needs charsets knowledge, to be able to convert a charset mysqlbinlog needs charsets knowledge, to be able to convert a charset
@ -1027,43 +1026,43 @@ static struct my_option my_long_options[] =
SET @`a`:=_cp850 0x4DFC6C6C6572 COLLATE `cp850_general_ci`; SET @`a`:=_cp850 0x4DFC6C6C6572 COLLATE `cp850_general_ci`;
*/ */
{"character-sets-dir", OPT_CHARSETS_DIR, {"character-sets-dir", OPT_CHARSETS_DIR,
"Directory for character set files.", (uchar**) &charsets_dir, "Directory for character set files.", &charsets_dir,
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"database", 'd', "List entries for just this database (local log only).", {"database", 'd', "List entries for just this database (local log only).",
(uchar**) &database, (uchar**) &database, 0, GET_STR_ALLOC, REQUIRED_ARG, &database, &database, 0, GET_STR_ALLOC, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
#ifndef DBUG_OFF #ifndef DBUG_OFF
{"debug", '#', "Output debug log.", (uchar**) &default_dbug_option, {"debug", '#', "Output debug log.", &default_dbug_option,
(uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .", {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0, &debug_check_flag, &debug_check_flag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
(uchar**) &debug_info_flag, (uchar**) &debug_info_flag, &debug_info_flag, &debug_info_flag,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"disable-log-bin", 'D', "Disable binary log. This is useful, if you " {"disable-log-bin", 'D', "Disable binary log. This is useful, if you "
"enabled --to-last-log and are sending the output to the same MySQL server. " "enabled --to-last-log and are sending the output to the same MySQL server. "
"This way you could avoid an endless loop. You would also like to use it " "This way you could avoid an endless loop. You would also like to use it "
"when restoring after a crash to avoid duplication of the statements you " "when restoring after a crash to avoid duplication of the statements you "
"already have. NOTE: you will need a SUPER privilege to use this option.", "already have. NOTE: you will need a SUPER privilege to use this option.",
(uchar**) &disable_log_bin, (uchar**) &disable_log_bin, 0, GET_BOOL, &disable_log_bin, &disable_log_bin, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
{"force-if-open", 'F', "Force if binlog was not closed properly.", {"force-if-open", 'F', "Force if binlog was not closed properly.",
(uchar**) &force_if_open_opt, (uchar**) &force_if_open_opt, 0, GET_BOOL, NO_ARG, &force_if_open_opt, &force_if_open_opt, 0, GET_BOOL, NO_ARG,
1, 0, 0, 0, 0, 0}, 1, 0, 0, 0, 0, 0},
{"force-read", 'f', "Force reading unknown binlog events.", {"force-read", 'f', "Force reading unknown binlog events.",
(uchar**) &force_opt, (uchar**) &force_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, &force_opt, &force_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
{"hexdump", 'H', "Augment output with hexadecimal and ASCII event dump.", {"hexdump", 'H', "Augment output with hexadecimal and ASCII event dump.",
(uchar**) &opt_hexdump, (uchar**) &opt_hexdump, 0, GET_BOOL, NO_ARG, &opt_hexdump, &opt_hexdump, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"host", 'h', "Get the binlog from server.", (uchar**) &host, (uchar**) &host, {"host", 'h', "Get the binlog from server.", &host, &host,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"local-load", 'l', "Prepare local temporary files for LOAD DATA INFILE in the specified directory.", {"local-load", 'l', "Prepare local temporary files for LOAD DATA INFILE in the specified directory.",
(uchar**) &dirname_for_local_load, (uchar**) &dirname_for_local_load, 0, &dirname_for_local_load, &dirname_for_local_load, 0,
GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"offset", 'o', "Skip the first N entries.", (uchar**) &offset, (uchar**) &offset, {"offset", 'o', "Skip the first N entries.", &offset, &offset,
0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p', "Password to connect to remote server.", {"password", 'p', "Password to connect to remote server.",
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},
@ -1073,37 +1072,37 @@ static struct my_option my_long_options[] =
"/etc/services, " "/etc/services, "
#endif #endif
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
(uchar**) &port, (uchar**) &port, 0, GET_INT, REQUIRED_ARG, &port, &port, 0, GET_INT, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"protocol", OPT_MYSQL_PROTOCOL, {"protocol", OPT_MYSQL_PROTOCOL,
"The protocol to use for connection (tcp, socket, pipe, memory).", "The protocol to use for connection (tcp, socket, pipe, memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"read-from-remote-server", 'R', "Read binary logs from a MySQL server.", {"read-from-remote-server", 'R', "Read binary logs from a MySQL server.",
(uchar**) &remote_opt, (uchar**) &remote_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, &remote_opt, &remote_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
{"result-file", 'r', "Direct output to a given file.", 0, 0, 0, GET_STR, {"result-file", 'r', "Direct output to a given file.", 0, 0, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"server-id", OPT_SERVER_ID, {"server-id", OPT_SERVER_ID,
"Extract only binlog entries created by the server having the given id.", "Extract only binlog entries created by the server having the given id.",
(uchar**) &server_id, (uchar**) &server_id, 0, GET_ULONG, &server_id, &server_id, 0, GET_ULONG,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"set-charset", OPT_SET_CHARSET, {"set-charset", OPT_SET_CHARSET,
"Add 'SET NAMES character_set' to the output.", (uchar**) &charset, "Add 'SET NAMES character_set' to the output.", &charset,
(uchar**) &charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM #ifdef HAVE_SMEM
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory.", (uchar**) &shared_memory_base_name, "Base name of shared memory.", &shared_memory_base_name,
(uchar**) &shared_memory_base_name, &shared_memory_base_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"short-form", 's', "Just show regular queries: no extra info and no " {"short-form", 's', "Just show regular queries: no extra info and no "
"row-based events. This is for testing only, and should not be used in " "row-based events. This is for testing only, and should not be used in "
"production systems. If you want to suppress base64-output, consider " "production systems. If you want to suppress base64-output, consider "
"using --base64-output=never instead.", "using --base64-output=never instead.",
(uchar**) &short_form, (uchar**) &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, &short_form, &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
{"socket", 'S', "The socket file to use for connection.", {"socket", 'S', "The socket file to use for connection.",
(uchar**) &sock, (uchar**) &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, &sock, &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
{"start-datetime", OPT_START_DATETIME, {"start-datetime", OPT_START_DATETIME,
"Start reading the binlog at first event having a datetime equal or " "Start reading the binlog at first event having a datetime equal or "
@ -1111,12 +1110,12 @@ static struct my_option my_long_options[] =
"in the local time zone, in any format accepted by the MySQL server " "in the local time zone, in any format accepted by the MySQL server "
"for DATETIME and TIMESTAMP types, for example: 2004-12-25 11:25:56 " "for DATETIME and TIMESTAMP types, for example: 2004-12-25 11:25:56 "
"(you should probably use quotes for your shell to set it properly).", "(you should probably use quotes for your shell to set it properly).",
(uchar**) &start_datetime_str, (uchar**) &start_datetime_str, &start_datetime_str, &start_datetime_str,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"start-position", 'j', {"start-position", 'j',
"Start reading the binlog at position N. Applies to the first binlog " "Start reading the binlog at position N. Applies to the first binlog "
"passed on the command line.", "passed on the command line.",
(uchar**) &start_position, (uchar**) &start_position, 0, GET_ULL, &start_position, &start_position, 0, GET_ULL,
REQUIRED_ARG, BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE, REQUIRED_ARG, BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE,
/* COM_BINLOG_DUMP accepts only 4 bytes for the position */ /* COM_BINLOG_DUMP accepts only 4 bytes for the position */
(ulonglong)(~(uint32)0), 0, 0, 0}, (ulonglong)(~(uint32)0), 0, 0, 0},
@ -1126,22 +1125,22 @@ static struct my_option my_long_options[] =
"in the local time zone, in any format accepted by the MySQL server " "in the local time zone, in any format accepted by the MySQL server "
"for DATETIME and TIMESTAMP types, for example: 2004-12-25 11:25:56 " "for DATETIME and TIMESTAMP types, for example: 2004-12-25 11:25:56 "
"(you should probably use quotes for your shell to set it properly).", "(you should probably use quotes for your shell to set it properly).",
(uchar**) &stop_datetime_str, (uchar**) &stop_datetime_str, &stop_datetime_str, &stop_datetime_str,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"stop-position", OPT_STOP_POSITION, {"stop-position", OPT_STOP_POSITION,
"Stop reading the binlog at position N. Applies to the last binlog " "Stop reading the binlog at position N. Applies to the last binlog "
"passed on the command line.", "passed on the command line.",
(uchar**) &stop_position, (uchar**) &stop_position, 0, GET_ULL, &stop_position, &stop_position, 0, GET_ULL,
REQUIRED_ARG, (ulonglong)(~(my_off_t)0), BIN_LOG_HEADER_SIZE, REQUIRED_ARG, (ulonglong)(~(my_off_t)0), BIN_LOG_HEADER_SIZE,
(ulonglong)(~(my_off_t)0), 0, 0, 0}, (ulonglong)(~(my_off_t)0), 0, 0, 0},
{"to-last-log", 't', "Requires -R. Will not stop at the end of the \ {"to-last-log", 't', "Requires -R. Will not stop at the end of the \
requested binlog but rather continue printing until the end of the last \ requested binlog but rather continue printing until the end of the last \
binlog of the MySQL server. If you send the output to the same MySQL server, \ binlog of the MySQL server. If you send the output to the same MySQL server, \
that may lead to an endless loop.", that may lead to an endless loop.",
(uchar**) &to_last_remote_log, (uchar**) &to_last_remote_log, 0, GET_BOOL, &to_last_remote_log, &to_last_remote_log, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
{"user", 'u', "Connect to the remote server as username.", {"user", 'u', "Connect to the remote server as username.",
(uchar**) &user, (uchar**) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, &user, &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
{"verbose", 'v', "Reconstruct SQL statements out of row events. " {"verbose", 'v', "Reconstruct SQL statements out of row events. "
"-v -v adds comments on column data types.", "-v -v adds comments on column data types.",
@ -1150,7 +1149,7 @@ that may lead to an endless loop.",
0, 0, 0, 0, 0}, 0, 0, 0, 0, 0},
{"open_files_limit", OPT_OPEN_FILES_LIMIT, {"open_files_limit", OPT_OPEN_FILES_LIMIT,
"Used to reserve file descriptors for use by this program.", "Used to reserve file descriptors for use by this program.",
(uchar**) &open_files_limit, (uchar**) &open_files_limit, 0, GET_ULONG, &open_files_limit, &open_files_limit, 0, GET_ULONG,
REQUIRED_ARG, MY_NFILE, 8, OS_FILE_LIMIT, 0, 1, 0}, REQUIRED_ARG, MY_NFILE, 8, OS_FILE_LIMIT, 0, 1, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
}; };

View File

@ -54,13 +54,13 @@ static struct my_option my_long_options[] =
{ {
{"all-databases", 'A', {"all-databases", 'A',
"Check all the databases. This is the same as --databases with all databases selected.", "Check all the databases. This is the same as --databases with all databases selected.",
(uchar**) &opt_alldbs, (uchar**) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, &opt_alldbs, &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
{"analyze", 'a', "Analyze given tables.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, {"analyze", 'a', "Analyze given tables.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
0, 0, 0, 0}, 0, 0, 0, 0},
{"all-in-1", '1', {"all-in-1", '1',
"Instead of issuing one query for each table, use one query per database, naming all tables in the database in a comma-separated list.", "Instead of issuing one query for each table, use one query per database, naming all tables in the database in a comma-separated list.",
(uchar**) &opt_all_in_1, (uchar**) &opt_all_in_1, 0, GET_BOOL, NO_ARG, 0, 0, 0, &opt_all_in_1, &opt_all_in_1, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
#ifdef __NETWARE__ #ifdef __NETWARE__
{"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.", {"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
@ -68,11 +68,11 @@ static struct my_option my_long_options[] =
#endif #endif
{"auto-repair", OPT_AUTO_REPAIR, {"auto-repair", OPT_AUTO_REPAIR,
"If a checked table is corrupted, automatically fix it. Repairing will be done after all tables have been checked, if corrupted ones were found.", "If a checked table is corrupted, automatically fix it. Repairing will be done after all tables have been checked, if corrupted ones were found.",
(uchar**) &opt_auto_repair, (uchar**) &opt_auto_repair, 0, GET_BOOL, NO_ARG, 0, &opt_auto_repair, &opt_auto_repair, 0, GET_BOOL, NO_ARG, 0,
0, 0, 0, 0, 0}, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR, {"character-sets-dir", OPT_CHARSETS_DIR,
"Directory for character set files.", (uchar**) &charsets_dir, "Directory for character set files.", &charsets_dir,
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"check", 'c', "Check table for errors.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, {"check", 'c', "Check table for errors.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
0, 0, 0, 0}, 0, 0, 0, 0},
{"check-only-changed", 'C', {"check-only-changed", 'C',
@ -82,11 +82,11 @@ static struct my_option my_long_options[] =
"Check tables for version-dependent changes. May be used with --auto-repair to correct tables requiring version-dependent updates.", "Check tables for version-dependent changes. May be used with --auto-repair to correct tables requiring version-dependent updates.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"compress", OPT_COMPRESS, "Use compression in server/client protocol.", {"compress", OPT_COMPRESS, "Use compression in server/client protocol.",
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
{"databases", 'B', {"databases", 'B',
"Check several databases. Note the difference in usage; in this case no tables are given. All name arguments are regarded as database names.", "Check several databases. Note the difference in usage; in this case no tables are given. All name arguments are regarded as database names.",
(uchar**) &opt_databases, (uchar**) &opt_databases, 0, GET_BOOL, NO_ARG, &opt_databases, &opt_databases, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
#ifdef DBUG_OFF #ifdef DBUG_OFF
{"debug", '#', "This is a non-debug version. Catch this and exit.", {"debug", '#', "This is a non-debug version. Catch this and exit.",
@ -96,40 +96,41 @@ static struct my_option my_long_options[] =
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},
#endif #endif
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.", {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0, &debug_check_flag, &debug_check_flag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
(uchar**) &debug_info_flag, (uchar**) &debug_info_flag, &debug_info_flag, &debug_info_flag,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET, {"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", (uchar**) &default_charset, "Set the default character set.", &default_charset,
(uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"fast",'F', "Check only tables that haven't been closed properly.", {"fast",'F', "Check only tables that haven't been closed properly.",
(uchar**) &opt_fast, (uchar**) &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, &opt_fast, &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0}, 0},
{"fix-db-names", OPT_FIX_DB_NAMES, "Fix database names.", {"fix-db-names", OPT_FIX_DB_NAMES, "Fix database names.",
(uchar**) &opt_fix_db_names, (uchar**) &opt_fix_db_names, &opt_fix_db_names, &opt_fix_db_names,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"fix-table-names", OPT_FIX_TABLE_NAMES, "Fix table names.", {"fix-table-names", OPT_FIX_TABLE_NAMES, "Fix table names.",
(uchar**) &opt_fix_table_names, (uchar**) &opt_fix_table_names, &opt_fix_table_names, &opt_fix_table_names,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"force", 'f', "Continue even if we get an SQL error.", {"force", 'f', "Continue even if we get an SQL error.",
(uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0, &ignore_errors, &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0}, 0, 0, 0, 0},
{"extended", 'e', {"extended", 'e',
"If you are using this option with CHECK TABLE, it will ensure that the table is 100 percent consistent, but will take a long time. If you are using this option with REPAIR TABLE, it will force using old slow repair with keycache method, instead of much faster repair by sorting.", "If you are using this option with CHECK TABLE, it will ensure that the table is 100 percent consistent, but will take a long time. If you are using this option with REPAIR TABLE, it will force using old slow repair with keycache method, instead of much faster repair by sorting.",
(uchar**) &opt_extended, (uchar**) &opt_extended, 0, GET_BOOL, NO_ARG, 0, 0, 0, &opt_extended, &opt_extended, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
{"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG, {"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
{"host",'h', "Connect to host.", (uchar**) &current_host, {"host",'h', "Connect to host.", &current_host,
(uchar**) &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"medium-check", 'm', {"medium-check", 'm',
"Faster than extended-check, but only finds 99.99 percent of all errors. Should be good enough for most cases.", "Faster than extended-check, but only finds 99.99 percent of all errors. Should be good enough for most cases.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"write-binlog", OPT_WRITE_BINLOG, {"write-binlog", OPT_WRITE_BINLOG,
"Log ANALYZE, OPTIMIZE and REPAIR TABLE commands. Use --skip-write-binlog when commands should not be sent to replication slaves.", "Log ANALYZE, OPTIMIZE and REPAIR TABLE commands. Use --skip-write-binlog "
(uchar**) &opt_write_binlog, (uchar**) &opt_write_binlog, 0, GET_BOOL, NO_ARG, "when commands should not be sent to replication slaves.",
&opt_write_binlog, &opt_write_binlog, 0, GET_BOOL, NO_ARG,
1, 0, 0, 0, 0, 0}, 1, 0, 0, 0, 0, 0},
{"optimize", 'o', "Optimize table.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, {"optimize", 'o', "Optimize table.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
@ -146,38 +147,37 @@ static struct my_option my_long_options[] =
"/etc/services, " "/etc/services, "
#endif #endif
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
(uchar**) &opt_mysql_port, &opt_mysql_port, &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
0}, 0},
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).", {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"quick", 'q', {"quick", 'q',
"If you are using this option with CHECK TABLE, it prevents the check from scanning the rows to check for wrong links. This is the fastest check. If you are using this option with REPAIR TABLE, it will try to repair only the index tree. This is the fastest repair method for a table.", "If you are using this option with CHECK TABLE, it prevents the check from scanning the rows to check for wrong links. This is the fastest check. If you are using this option with REPAIR TABLE, it will try to repair only the index tree. This is the fastest repair method for a table.",
(uchar**) &opt_quick, (uchar**) &opt_quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, &opt_quick, &opt_quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0}, 0},
{"repair", 'r', {"repair", 'r',
"Can fix almost anything except unique keys that aren't unique.", "Can fix almost anything except unique keys that aren't unique.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM #ifdef HAVE_SMEM
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name, "Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"silent", 's', "Print only error messages.", (uchar**) &opt_silent, {"silent", 's', "Print only error messages.", &opt_silent,
(uchar**) &opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"socket", 'S', "The socket file to use for connection.", {"socket", 'S', "The socket file to use for connection.",
(uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR, &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include <sslopt-longopts.h> #include <sslopt-longopts.h>
{"tables", OPT_TABLES, "Overrides option --databases (-B).", 0, 0, 0, {"tables", OPT_TABLES, "Overrides option --databases (-B).", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"use-frm", OPT_FRM, {"use-frm", OPT_FRM,
"When used with REPAIR, get table structure from .frm file, so the table can be repaired even if .MYI header is corrupted.", "When used with REPAIR, get table structure from .frm file, so the table can be repaired even if .MYI header is corrupted.",
(uchar**) &opt_frm, (uchar**) &opt_frm, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, &opt_frm, &opt_frm, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0}, 0},
#ifndef DONT_ALLOW_USER_CHANGE #ifndef DONT_ALLOW_USER_CHANGE
{"user", 'u', "User for login if not current user.", (uchar**) &current_user, {"user", 'u', "User for login if not current user.", &current_user,
(uchar**) &current_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &current_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"verbose", 'v', "Print info about the various stages.", 0, 0, 0, GET_NO_ARG, {"verbose", 'v', "Print info about the various stages.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},

View File

@ -186,90 +186,98 @@ static struct my_option my_long_options[] =
{ {
{"all-databases", 'A', {"all-databases", 'A',
"Dump all the databases. This will be same as --databases with all databases selected.", "Dump all the databases. This will be same as --databases with all databases selected.",
(uchar**) &opt_alldbs, (uchar**) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, &opt_alldbs, &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
{"all-tablespaces", 'Y', {"all-tablespaces", 'Y',
"Dump all the tablespaces.", "Dump all the tablespaces.",
(uchar**) &opt_alltspcs, (uchar**) &opt_alltspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, &opt_alltspcs, &opt_alltspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
{"no-tablespaces", 'y', {"no-tablespaces", 'y',
"Do not dump any tablespace information.", "Do not dump any tablespace information.",
(uchar**) &opt_notspcs, (uchar**) &opt_notspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, &opt_notspcs, &opt_notspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
{"add-drop-database", OPT_DROP_DATABASE, "Add a DROP DATABASE before each create.", {"add-drop-database", OPT_DROP_DATABASE, "Add a DROP DATABASE before each create.",
(uchar**) &opt_drop_database, (uchar**) &opt_drop_database, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, &opt_drop_database, &opt_drop_database, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0}, 0},
{"add-drop-table", OPT_DROP, "Add a DROP TABLE before each create.", {"add-drop-table", OPT_DROP, "Add a DROP TABLE before each create.",
(uchar**) &opt_drop, (uchar**) &opt_drop, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, &opt_drop, &opt_drop, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
0}, 0},
{"add-locks", OPT_LOCKS, "Add locks around INSERT statements.", {"add-locks", OPT_LOCKS, "Add locks around INSERT statements.",
(uchar**) &opt_lock, (uchar**) &opt_lock, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, &opt_lock, &opt_lock, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
0}, 0},
{"allow-keywords", OPT_KEYWORDS, {"allow-keywords", OPT_KEYWORDS,
"Allow creation of column names that are keywords.", (uchar**) &opt_keywords, "Allow creation of column names that are keywords.", &opt_keywords,
(uchar**) &opt_keywords, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &opt_keywords, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"apply-slave-statements", OPT_MYSQLDUMP_SLAVE_APPLY, {"apply-slave-statements", OPT_MYSQLDUMP_SLAVE_APPLY,
"Adds 'STOP SLAVE' prior to 'CHANGE MASTER' and 'START SLAVE' to bottom of dump.", "Adds 'STOP SLAVE' prior to 'CHANGE MASTER' and 'START SLAVE' to bottom of dump.",
(uchar**) &opt_slave_apply, (uchar**) &opt_slave_apply, 0, GET_BOOL, NO_ARG, &opt_slave_apply, &opt_slave_apply, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
#ifdef __NETWARE__ #ifdef __NETWARE__
{"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.", {"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"character-sets-dir", OPT_CHARSETS_DIR, {"character-sets-dir", OPT_CHARSETS_DIR,
"Directory for character set files.", (uchar**) &charsets_dir, "Directory for character set files.", &charsets_dir,
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"comments", 'i', "Write additional information.", {"comments", 'i', "Write additional information.",
(uchar**) &opt_comments, (uchar**) &opt_comments, 0, GET_BOOL, NO_ARG, &opt_comments, &opt_comments, 0, GET_BOOL, NO_ARG,
1, 0, 0, 0, 0, 0}, 1, 0, 0, 0, 0, 0},
{"compatible", OPT_COMPATIBLE, {"compatible", OPT_COMPATIBLE,
"Change the dump to be compatible with a given mode. By default tables are dumped in a format optimized for MySQL. Legal modes are: ansi, mysql323, mysql40, postgresql, oracle, mssql, db2, maxdb, no_key_options, no_table_options, no_field_options. One can use several modes separated by commas. Note: Requires MySQL server version 4.1.0 or higher. This option is ignored with earlier server versions.", "Change the dump to be compatible with a given mode. By default tables "
(uchar**) &opt_compatible_mode_str, (uchar**) &opt_compatible_mode_str, 0, "are dumped in a format optimized for MySQL. Legal modes are: ansi, "
"mysql323, mysql40, postgresql, oracle, mssql, db2, maxdb, no_key_options, "
"no_table_options, no_field_options. One can use several modes separated "
"by commas. Note: Requires MySQL server version 4.1.0 or higher. "
"This option is ignored with earlier server versions.",
&opt_compatible_mode_str, &opt_compatible_mode_str, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"compact", OPT_COMPACT, {"compact", OPT_COMPACT,
"Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --skip-add-locks --skip-comments --skip-disable-keys --skip-set-charset.", "Give less verbose output (useful for debugging). Disables structure "
(uchar**) &opt_compact, (uchar**) &opt_compact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, "comments and header/footer constructs. Enables options --skip-add-"
0, 0}, "drop-table --skip-add-locks --skip-comments --skip-disable-keys "
"--skip-set-charset.",
&opt_compact, &opt_compact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"complete-insert", 'c', "Use complete insert statements.", {"complete-insert", 'c', "Use complete insert statements.",
(uchar**) &opt_complete_insert, (uchar**) &opt_complete_insert, 0, GET_BOOL, &opt_complete_insert, &opt_complete_insert, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
{"compress", 'C', "Use compression in server/client protocol.", {"compress", 'C', "Use compression in server/client protocol.",
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
{"create-options", 'a', {"create-options", 'a',
"Include all MySQL specific create options.", "Include all MySQL specific create options.",
(uchar**) &create_options, (uchar**) &create_options, 0, GET_BOOL, NO_ARG, 1, &create_options, &create_options, 0, GET_BOOL, NO_ARG, 1,
0, 0, 0, 0, 0}, 0, 0, 0, 0, 0},
{"databases", 'B', {"databases", 'B',
"Dump several databases. Note the difference in usage; in this case no tables are given. All name arguments are regarded as database names. 'USE db_name;' will be included in the output.", "Dump several databases. Note the difference in usage; in this case no tables are given. All name arguments are regarded as database names. 'USE db_name;' will be included in the output.",
(uchar**) &opt_databases, (uchar**) &opt_databases, 0, GET_BOOL, NO_ARG, 0, 0, &opt_databases, &opt_databases, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0}, 0, 0, 0, 0},
#ifdef DBUG_OFF #ifdef DBUG_OFF
{"debug", '#', "This is a non-debug version. Catch this and exit.", {"debug", '#', "This is a non-debug version. Catch this and exit.",
0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, 0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else #else
{"debug", '#', "Output debug log.", (uchar**) &default_dbug_option, {"debug", '#', "Output debug log.", &default_dbug_option,
(uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.", {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0, &debug_check_flag, &debug_check_flag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
(uchar**) &debug_info_flag, (uchar**) &debug_info_flag, &debug_info_flag, &debug_info_flag,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET, {"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", (uchar**) &default_charset, "Set the default character set.", &default_charset,
(uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"delayed-insert", OPT_DELAYED, "Insert rows with INSERT DELAYED.", {"delayed-insert", OPT_DELAYED, "Insert rows with INSERT DELAYED.",
(uchar**) &opt_delayed, (uchar**) &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, &opt_delayed, &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
{"delete-master-logs", OPT_DELETE_MASTER_LOGS, {"delete-master-logs", OPT_DELETE_MASTER_LOGS,
"Delete logs on master after backup. This automatically enables --master-data.", "Delete logs on master after backup. This automatically enables --master-data.",
(uchar**) &opt_delete_master_logs, (uchar**) &opt_delete_master_logs, 0, &opt_delete_master_logs, &opt_delete_master_logs, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"disable-keys", 'K', {"disable-keys", 'K',
"'/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and '/*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put in the output.", (uchar**) &opt_disable_keys, "'/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and '/*!40000 ALTER "
(uchar**) &opt_disable_keys, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, "TABLE tb_name ENABLE KEYS */; will be put in the output.", &opt_disable_keys,
&opt_disable_keys, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"dump-slave", OPT_MYSQLDUMP_SLAVE_DATA, {"dump-slave", OPT_MYSQLDUMP_SLAVE_DATA,
"This causes the binary log position and filename of the master to be " "This causes the binary log position and filename of the master to be "
"appended to the dumped data output. Setting the value to 1, will print" "appended to the dumped data output. Setting the value to 1, will print"
@ -281,31 +289,28 @@ static struct my_option my_long_options[] =
"- don't forget to read about --single-transaction below). In all cases " "- don't forget to read about --single-transaction below). In all cases "
"any action on logs will happen at the exact moment of the dump." "any action on logs will happen at the exact moment of the dump."
"Option automatically turns --lock-tables off.", "Option automatically turns --lock-tables off.",
(uchar**) &opt_slave_data, (uchar**) &opt_slave_data, 0, &opt_slave_data, &opt_slave_data, 0,
GET_UINT, OPT_ARG, 0, 0, MYSQL_OPT_SLAVE_DATA_COMMENTED_SQL, 0, 0, 0}, GET_UINT, OPT_ARG, 0, 0, MYSQL_OPT_SLAVE_DATA_COMMENTED_SQL, 0, 0, 0},
{"events", 'E', "Dump events.", {"events", 'E', "Dump events.",
(uchar**) &opt_events, (uchar**) &opt_events, 0, GET_BOOL, &opt_events, &opt_events, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
{"extended-insert", 'e', {"extended-insert", 'e',
"Use multiple-row INSERT syntax that include several VALUES lists.", "Use multiple-row INSERT syntax that include several VALUES lists.",
(uchar**) &extended_insert, (uchar**) &extended_insert, 0, GET_BOOL, NO_ARG, &extended_insert, &extended_insert, 0, GET_BOOL, NO_ARG,
1, 0, 0, 0, 0, 0}, 1, 0, 0, 0, 0, 0},
{"fields-terminated-by", OPT_FTB, {"fields-terminated-by", OPT_FTB,
"Fields in the output file are terminated by the given string.", "Fields in the output file are terminated by the given string.",
(uchar**) &fields_terminated, (uchar**) &fields_terminated, 0, &fields_terminated, &fields_terminated, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"fields-enclosed-by", OPT_ENC, {"fields-enclosed-by", OPT_ENC,
"Fields in the output file are enclosed by the given character.", "Fields in the output file are enclosed by the given character.",
(uchar**) &enclosed, (uchar**) &enclosed, 0, &enclosed, &enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
{"fields-optionally-enclosed-by", OPT_O_ENC, {"fields-optionally-enclosed-by", OPT_O_ENC,
"Fields in the output file are optionally enclosed by the given character.", "Fields in the output file are optionally enclosed by the given character.",
(uchar**) &opt_enclosed, (uchar**) &opt_enclosed, 0, &opt_enclosed, &opt_enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
{"fields-escaped-by", OPT_ESC, {"fields-escaped-by", OPT_ESC,
"Fields in the output file are escaped by the given character.", "Fields in the output file are escaped by the given character.",
(uchar**) &escaped, (uchar**) &escaped, 0, &escaped, &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"flush-logs", 'F', "Flush logs file in server before starting dump. " {"flush-logs", 'F', "Flush logs file in server before starting dump. "
"Note that if you dump many databases at once (using the option " "Note that if you dump many databases at once (using the option "
"--databases= or --all-databases), the logs will be flushed for " "--databases= or --all-databases), the logs will be flushed for "
@ -315,24 +320,24 @@ static struct my_option my_long_options[] =
"to the moment all tables are locked. So if you want your dump and " "to the moment all tables are locked. So if you want your dump and "
"the log flush to happen at the same exact moment you should use " "the log flush to happen at the same exact moment you should use "
"--lock-all-tables or --master-data with --flush-logs.", "--lock-all-tables or --master-data with --flush-logs.",
(uchar**) &flush_logs, (uchar**) &flush_logs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, &flush_logs, &flush_logs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
{"flush-privileges", OPT_ESC, "Emit a FLUSH PRIVILEGES statement " {"flush-privileges", OPT_ESC, "Emit a FLUSH PRIVILEGES statement "
"after dumping the mysql database. This option should be used any " "after dumping the mysql database. This option should be used any "
"time the dump contains the mysql database and any other database " "time the dump contains the mysql database and any other database "
"that depends on the data in the mysql database for proper restore. ", "that depends on the data in the mysql database for proper restore. ",
(uchar**) &flush_privileges, (uchar**) &flush_privileges, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, &flush_privileges, &flush_privileges, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
{"force", 'f', "Continue even if we get an SQL error.", {"force", 'f', "Continue even if we get an SQL error.",
(uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, &ignore_errors, &ignore_errors, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG, {"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
{"hex-blob", OPT_HEXBLOB, "Dump binary strings (BINARY, " {"hex-blob", OPT_HEXBLOB, "Dump binary strings (BINARY, "
"VARBINARY, BLOB) in hexadecimal format.", "VARBINARY, BLOB) in hexadecimal format.",
(uchar**) &opt_hex_blob, (uchar**) &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &opt_hex_blob, &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"host", 'h', "Connect to host.", (uchar**) &current_host, {"host", 'h', "Connect to host.", &current_host,
(uchar**) &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"ignore-table", OPT_IGNORE_TABLE, {"ignore-table", OPT_IGNORE_TABLE,
"Do not dump the specified table. To specify more than one table to ignore, " "Do not dump the specified table. To specify more than one table to ignore, "
"use the directive multiple times, once for each table. Each table must " "use the directive multiple times, once for each table. Each table must "
@ -340,27 +345,26 @@ static struct my_option my_long_options[] =
"--ignore-table=database.table.", "--ignore-table=database.table.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"include-master-host-port", OPT_MYSQLDUMP_INCLUDE_MASTER_HOST_PORT, {"include-master-host-port", OPT_MYSQLDUMP_INCLUDE_MASTER_HOST_PORT,
"Adds 'MASTER_HOST=<host>, MASTER_PORT=<port>' to 'CHANGE MASTER TO..' in dump produced with --dump-slave.", "Adds 'MASTER_HOST=<host>, MASTER_PORT=<port>' to 'CHANGE MASTER TO..' "
(uchar**) &opt_include_master_host_port, "in dump produced with --dump-slave.", &opt_include_master_host_port,
(uchar**) &opt_include_master_host_port, &opt_include_master_host_port, 0, GET_BOOL, NO_ARG,
0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"insert-ignore", OPT_INSERT_IGNORE, "Insert rows with INSERT IGNORE.", {"insert-ignore", OPT_INSERT_IGNORE, "Insert rows with INSERT IGNORE.",
(uchar**) &opt_ignore, (uchar**) &opt_ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, &opt_ignore, &opt_ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
{"lines-terminated-by", OPT_LTB, {"lines-terminated-by", OPT_LTB,
"Lines in the output file are terminated by the given string.", "Lines in the output file are terminated by the given string.",
(uchar**) &lines_terminated, (uchar**) &lines_terminated, 0, GET_STR, &lines_terminated, &lines_terminated, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"lock-all-tables", 'x', "Locks all tables across all databases. This " {"lock-all-tables", 'x', "Locks all tables across all databases. This "
"is achieved by taking a global read lock for the duration of the whole " "is achieved by taking a global read lock for the duration of the whole "
"dump. Automatically turns --single-transaction and --lock-tables off.", "dump. Automatically turns --single-transaction and --lock-tables off.",
(uchar**) &opt_lock_all_tables, (uchar**) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG, &opt_lock_all_tables, &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"lock-tables", 'l', "Lock all tables for read.", (uchar**) &lock_tables, {"lock-tables", 'l', "Lock all tables for read.", &lock_tables,
(uchar**) &lock_tables, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, &lock_tables, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"log-error", OPT_ERROR_LOG_FILE, "Append warnings and errors to given file.", {"log-error", OPT_ERROR_LOG_FILE, "Append warnings and errors to given file.",
(uchar**) &log_error_file, (uchar**) &log_error_file, 0, GET_STR, &log_error_file, &log_error_file, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"master-data", OPT_MASTER_DATA, {"master-data", OPT_MASTER_DATA,
"This causes the binary log position and filename to be appended to the " "This causes the binary log position and filename to be appended to the "
@ -372,41 +376,41 @@ static struct my_option my_long_options[] =
"don't forget to read about --single-transaction below). In all cases, " "don't forget to read about --single-transaction below). In all cases, "
"any action on logs will happen at the exact moment of the dump. " "any action on logs will happen at the exact moment of the dump. "
"Option automatically turns --lock-tables off.", "Option automatically turns --lock-tables off.",
(uchar**) &opt_master_data, (uchar**) &opt_master_data, 0, &opt_master_data, &opt_master_data, 0,
GET_UINT, OPT_ARG, 0, 0, MYSQL_OPT_MASTER_DATA_COMMENTED_SQL, 0, 0, 0}, GET_UINT, OPT_ARG, 0, 0, MYSQL_OPT_MASTER_DATA_COMMENTED_SQL, 0, 0, 0},
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET,
"The maximum packet length to send to or receive from server.", "The maximum packet length to send to or receive from server.",
(uchar**) &opt_max_allowed_packet, (uchar**) &opt_max_allowed_packet, 0, &opt_max_allowed_packet, &opt_max_allowed_packet, 0,
GET_ULONG, REQUIRED_ARG, 24*1024*1024, 4096, GET_ULONG, REQUIRED_ARG, 24*1024*1024, 4096,
(longlong) 2L*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0}, (longlong) 2L*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
{"net_buffer_length", OPT_NET_BUFFER_LENGTH, {"net_buffer_length", OPT_NET_BUFFER_LENGTH,
"The buffer size for TCP/IP and socket communication.", "The buffer size for TCP/IP and socket communication.",
(uchar**) &opt_net_buffer_length, (uchar**) &opt_net_buffer_length, 0, &opt_net_buffer_length, &opt_net_buffer_length, 0,
GET_ULONG, REQUIRED_ARG, 1024*1024L-1025, 4096, 16*1024L*1024L, GET_ULONG, REQUIRED_ARG, 1024*1024L-1025, 4096, 16*1024L*1024L,
MALLOC_OVERHEAD-1024, 1024, 0}, MALLOC_OVERHEAD-1024, 1024, 0},
{"no-autocommit", OPT_AUTOCOMMIT, {"no-autocommit", OPT_AUTOCOMMIT,
"Wrap tables with autocommit/commit statements.", "Wrap tables with autocommit/commit statements.",
(uchar**) &opt_autocommit, (uchar**) &opt_autocommit, 0, GET_BOOL, NO_ARG, &opt_autocommit, &opt_autocommit, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"no-create-db", 'n', {"no-create-db", 'n',
"Suppress the CREATE DATABASE ... IF EXISTS statement that normally is " "Suppress the CREATE DATABASE ... IF EXISTS statement that normally is "
"output for each dumped database if --all-databases or --databases is " "output for each dumped database if --all-databases or --databases is "
"given.", "given.",
(uchar**) &opt_create_db, (uchar**) &opt_create_db, 0, &opt_create_db, &opt_create_db, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-create-info", 't', "Don't write table creation info.", {"no-create-info", 't', "Don't write table creation info.",
(uchar**) &opt_no_create_info, (uchar**) &opt_no_create_info, 0, GET_BOOL, &opt_no_create_info, &opt_no_create_info, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-data", 'd', "No row information.", (uchar**) &opt_no_data, {"no-data", 'd', "No row information.", &opt_no_data,
(uchar**) &opt_no_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &opt_no_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-set-names", 'N', "Same as--skip-set-charset.", {"no-set-names", 'N', "Same as --skip-set-charset.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"opt", OPT_OPTIMIZE, {"opt", OPT_OPTIMIZE,
"Same as --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys. Enabled by default, disable with --skip-opt.", "Same as --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys. Enabled by default, disable with --skip-opt.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"order-by-primary", OPT_ORDER_BY_PRIMARY, {"order-by-primary", OPT_ORDER_BY_PRIMARY,
"Sorts each table's rows by primary key, or first unique key, if such a key exists. Useful when dumping a MyISAM table to be loaded into an InnoDB table, but will make the dump itself take considerably longer.", "Sorts each table's rows by primary key, or first unique key, if such a key exists. Useful when dumping a MyISAM table to be loaded into an InnoDB table, but will make the dump itself take considerably longer.",
(uchar**) &opt_order_by_primary, (uchar**) &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &opt_order_by_primary, &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"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},
@ -414,33 +418,35 @@ static struct my_option my_long_options[] =
{"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},
#endif #endif
{"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port, {"port", 'P', "Port number to use for connection.", &opt_mysql_port,
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
0}, 0},
{"protocol", OPT_MYSQL_PROTOCOL, {"protocol", OPT_MYSQL_PROTOCOL,
"The protocol to use for connection (tcp, socket, pipe, memory).", "The protocol to use for connection (tcp, socket, pipe, memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"quick", 'q', "Don't buffer query, dump directly to stdout.", {"quick", 'q', "Don't buffer query, dump directly to stdout.",
(uchar**) &quick, (uchar**) &quick, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, &quick, &quick, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"quote-names",'Q', "Quote table and column names with backticks (`).", {"quote-names",'Q', "Quote table and column names with backticks (`).",
(uchar**) &opt_quoted, (uchar**) &opt_quoted, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, &opt_quoted, &opt_quoted, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
0, 0}, 0, 0},
{"replace", OPT_MYSQL_REPLACE_INTO, "Use REPLACE INTO instead of INSERT INTO.", {"replace", OPT_MYSQL_REPLACE_INTO, "Use REPLACE INTO instead of INSERT INTO.",
(uchar**) &opt_replace_into, (uchar**) &opt_replace_into, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, &opt_replace_into, &opt_replace_into, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
{"result-file", 'r', {"result-file", 'r',
"Direct output to a given file. This option should be used in MSDOS, because it prevents new line '\\n' from being converted to '\\r\\n' (carriage return + line feed).", "Direct output to a given file. This option should be used in MSDOS, "
"because it prevents new line '\\n' from being converted to '\\r\\n' "
"(carriage return + line feed).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"routines", 'R', "Dump stored routines (functions and procedures).", {"routines", 'R', "Dump stored routines (functions and procedures).",
(uchar**) &opt_routines, (uchar**) &opt_routines, 0, GET_BOOL, &opt_routines, &opt_routines, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
{"set-charset", OPT_SET_CHARSET, {"set-charset", OPT_SET_CHARSET,
"Add 'SET NAMES default_character_set' to the output.", "Add 'SET NAMES default_character_set' to the output.",
(uchar**) &opt_set_charset, (uchar**) &opt_set_charset, 0, GET_BOOL, NO_ARG, 1, &opt_set_charset, &opt_set_charset, 0, GET_BOOL, NO_ARG, 1,
0, 0, 0, 0, 0}, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM #ifdef HAVE_SMEM
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name, "Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
/* /*
@ -458,42 +464,42 @@ static struct my_option my_long_options[] =
"connection should use the following statements: ALTER TABLE, DROP " "connection should use the following statements: ALTER TABLE, DROP "
"TABLE, RENAME TABLE, TRUNCATE TABLE, as consistent snapshot is not " "TABLE, RENAME TABLE, TRUNCATE TABLE, as consistent snapshot is not "
"isolated from them. Option automatically turns off --lock-tables.", "isolated from them. Option automatically turns off --lock-tables.",
(uchar**) &opt_single_transaction, (uchar**) &opt_single_transaction, 0, &opt_single_transaction, &opt_single_transaction, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"dump-date", OPT_DUMP_DATE, "Put a dump date to the end of the output.", {"dump-date", OPT_DUMP_DATE, "Put a dump date to the end of the output.",
(uchar**) &opt_dump_date, (uchar**) &opt_dump_date, 0, &opt_dump_date, &opt_dump_date, 0,
GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"skip-opt", OPT_SKIP_OPTIMIZATION, {"skip-opt", OPT_SKIP_OPTIMIZATION,
"Disable --opt. Disables --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys.", "Disable --opt. Disables --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"socket", 'S', "The socket file to use for connection.", {"socket", 'S', "The socket file to use for connection.",
(uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, &opt_mysql_unix_port, &opt_mysql_unix_port, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include <sslopt-longopts.h> #include <sslopt-longopts.h>
{"tab",'T', {"tab",'T',
"Create tab-separated textfile for each table to given path. (Create .sql " "Create tab-separated textfile for each table to given path. (Create .sql "
"and .txt files.) NOTE: This only works if mysqldump is run on the same " "and .txt files.) NOTE: This only works if mysqldump is run on the same "
"machine as the mysqld server.", "machine as the mysqld server.",
(uchar**) &path, (uchar**) &path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &path, &path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"tables", OPT_TABLES, "Overrides option --databases (-B).", {"tables", OPT_TABLES, "Overrides option --databases (-B).",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"triggers", OPT_TRIGGERS, "Dump triggers for each dumped table.", {"triggers", OPT_TRIGGERS, "Dump triggers for each dumped table.",
(uchar**) &opt_dump_triggers, (uchar**) &opt_dump_triggers, 0, GET_BOOL, &opt_dump_triggers, &opt_dump_triggers, 0, GET_BOOL,
NO_ARG, 1, 0, 0, 0, 0, 0}, NO_ARG, 1, 0, 0, 0, 0, 0},
{"tz-utc", OPT_TZ_UTC, {"tz-utc", OPT_TZ_UTC,
"SET TIME_ZONE='+00:00' at top of dump to allow dumping of TIMESTAMP data when a server has data in different time zones or data is being moved between servers with different time zones.", "SET TIME_ZONE='+00:00' at top of dump to allow dumping of TIMESTAMP data when a server has data in different time zones or data is being moved between servers with different time zones.",
(uchar**) &opt_tz_utc, (uchar**) &opt_tz_utc, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, &opt_tz_utc, &opt_tz_utc, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
#ifndef DONT_ALLOW_USER_CHANGE #ifndef DONT_ALLOW_USER_CHANGE
{"user", 'u', "User for login if not current user.", {"user", 'u', "User for login if not current user.",
(uchar**) &current_user, (uchar**) &current_user, 0, GET_STR, REQUIRED_ARG, &current_user, &current_user, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
#endif #endif
{"verbose", 'v', "Print info about the various stages.", {"verbose", 'v', "Print info about the various stages.",
(uchar**) &verbose, (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &verbose, &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version",'V', "Output version information and exit.", 0, 0, 0, {"version",'V', "Output version information and exit.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"where", 'w', "Dump only selected records. Quotes are mandatory.", {"where", 'w', "Dump only selected records. Quotes are mandatory.",
(uchar**) &where, (uchar**) &where, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &where, &where, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"xml", 'X', "Dump a database as well formed XML.", 0, 0, 0, GET_NO_ARG, {"xml", 'X', "Dump a database as well formed XML.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}

View File

@ -72,68 +72,68 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"character-sets-dir", OPT_CHARSETS_DIR, {"character-sets-dir", OPT_CHARSETS_DIR,
"Directory for character set files.", (uchar**) &charsets_dir, "Directory for character set files.", &charsets_dir,
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET, {"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", (uchar**) &default_charset, "Set the default character set.", &default_charset,
(uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"columns", 'c', {"columns", 'c',
"Use only these columns to import the data to. Give the column names in a comma separated list. This is same as giving columns to LOAD DATA INFILE.", "Use only these columns to import the data to. Give the column names in a comma separated list. This is same as giving columns to LOAD DATA INFILE.",
(uchar**) &opt_columns, (uchar**) &opt_columns, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, &opt_columns, &opt_columns, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
{"compress", 'C', "Use compression in server/client protocol.", {"compress", 'C', "Use compression in server/client protocol.",
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
{"debug",'#', "Output debug log. Often this is 'd:t:o,filename'.", 0, 0, 0, {"debug",'#', "Output debug log. Often this is 'd:t:o,filename'.", 0, 0, 0,
GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.", {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0, &debug_check_flag, &debug_check_flag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
(uchar**) &debug_info_flag, (uchar**) &debug_info_flag, &debug_info_flag, &debug_info_flag,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"delete", 'd', "First delete all rows from table.", (uchar**) &opt_delete, {"delete", 'd', "First delete all rows from table.", &opt_delete,
(uchar**) &opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"fields-terminated-by", OPT_FTB, {"fields-terminated-by", OPT_FTB,
"Fields in the input file are terminated by the given string.", "Fields in the input file are terminated by the given string.",
(uchar**) &fields_terminated, (uchar**) &fields_terminated, 0, &fields_terminated, &fields_terminated, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"fields-enclosed-by", OPT_ENC, {"fields-enclosed-by", OPT_ENC,
"Fields in the import file are enclosed by the given character.", "Fields in the import file are enclosed by the given character.",
(uchar**) &enclosed, (uchar**) &enclosed, 0, &enclosed, &enclosed, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"fields-optionally-enclosed-by", OPT_O_ENC, {"fields-optionally-enclosed-by", OPT_O_ENC,
"Fields in the input file are optionally enclosed by the given character.", "Fields in the input file are optionally enclosed by the given character.",
(uchar**) &opt_enclosed, (uchar**) &opt_enclosed, 0, &opt_enclosed, &opt_enclosed, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"fields-escaped-by", OPT_ESC, {"fields-escaped-by", OPT_ESC,
"Fields in the input file are escaped by the given character.", "Fields in the input file are escaped by the given character.",
(uchar**) &escaped, (uchar**) &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, &escaped, &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
{"force", 'f', "Continue even if we get an SQL error.", {"force", 'f', "Continue even if we get an SQL error.",
(uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0, &ignore_errors, &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0}, 0, 0, 0, 0},
{"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG, NO_ARG, {"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"host", 'h', "Connect to host.", (uchar**) &current_host, {"host", 'h', "Connect to host.", &current_host,
(uchar**) &current_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &current_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"ignore", 'i', "If duplicate unique key was found, keep old row.", {"ignore", 'i', "If duplicate unique key was found, keep old row.",
(uchar**) &ignore, (uchar**) &ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &ignore, &ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"ignore-lines", OPT_IGN_LINES, "Ignore first n lines of data infile.", {"ignore-lines", OPT_IGN_LINES, "Ignore first n lines of data infile.",
(uchar**) &opt_ignore_lines, (uchar**) &opt_ignore_lines, 0, GET_LL, &opt_ignore_lines, &opt_ignore_lines, 0, GET_LL,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"lines-terminated-by", OPT_LTB, {"lines-terminated-by", OPT_LTB,
"Lines in the input file are terminated by the given string.", "Lines in the input file are terminated by the given string.",
(uchar**) &lines_terminated, (uchar**) &lines_terminated, 0, GET_STR, &lines_terminated, &lines_terminated, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"local", 'L', "Read all files through the client.", (uchar**) &opt_local_file, {"local", 'L', "Read all files through the client.", &opt_local_file,
(uchar**) &opt_local_file, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &opt_local_file, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"lock-tables", 'l', "Lock all tables for write (this disables threads).", {"lock-tables", 'l', "Lock all tables for write (this disables threads).",
(uchar**) &lock_tables, (uchar**) &lock_tables, 0, GET_BOOL, NO_ARG, &lock_tables, &lock_tables, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"low-priority", OPT_LOW_PRIORITY, {"low-priority", OPT_LOW_PRIORITY,
"Use LOW_PRIORITY when updating the table.", (uchar**) &opt_low_priority, "Use LOW_PRIORITY when updating the table.", &opt_low_priority,
(uchar**) &opt_low_priority, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &opt_low_priority, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p', {"password", 'p',
"Password to use when connecting to server. If password is not given it's asked from the tty.", "Password to use when connecting to server. If password is not given it's asked from 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},
@ -147,35 +147,35 @@ static struct my_option my_long_options[] =
"/etc/services, " "/etc/services, "
#endif #endif
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
(uchar**) &opt_mysql_port, &opt_mysql_port,
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
0}, 0},
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).", {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"replace", 'r', "If duplicate unique key was found, replace old row.", {"replace", 'r', "If duplicate unique key was found, replace old row.",
(uchar**) &replace, (uchar**) &replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &replace, &replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM #ifdef HAVE_SMEM
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name, "Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"silent", 's', "Be more silent.", (uchar**) &silent, (uchar**) &silent, 0, {"silent", 's', "Be more silent.", &silent, &silent, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"socket", 'S', "The socket file to use for connection.", {"socket", 'S', "The socket file to use for connection.",
(uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR, &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include <sslopt-longopts.h> #include <sslopt-longopts.h>
{"use-threads", OPT_USE_THREADS, {"use-threads", OPT_USE_THREADS,
"Load files in parallel. The argument is the number " "Load files in parallel. The argument is the number "
"of threads to use for loading data.", "of threads to use for loading data.",
(uchar**) &opt_use_threads, (uchar**) &opt_use_threads, 0, &opt_use_threads, &opt_use_threads, 0,
GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifndef DONT_ALLOW_USER_CHANGE #ifndef DONT_ALLOW_USER_CHANGE
{"user", 'u', "User for login if not current user.", (uchar**) &current_user, {"user", 'u', "User for login if not current user.", &current_user,
(uchar**) &current_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &current_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"verbose", 'v', "Print info about the various stages.", (uchar**) &verbose, {"verbose", 'v', "Print info about the various stages.", &verbose,
(uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG, {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}

View File

@ -166,35 +166,35 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"character-sets-dir", 'c', "Directory for character set files.", {"character-sets-dir", 'c', "Directory for character set files.",
(uchar**) &charsets_dir, (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, &charsets_dir, &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0,
0, 0, 0, 0, 0}, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET, {"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", (uchar**) &default_charset, "Set the default character set.", &default_charset,
(uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"count", OPT_COUNT, {"count", OPT_COUNT,
"Show number of rows per table (may be slow for non-MyISAM tables).", "Show number of rows per table (may be slow for non-MyISAM tables).",
(uchar**) &opt_count, (uchar**) &opt_count, 0, GET_BOOL, NO_ARG, 0, 0, 0, &opt_count, &opt_count, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
{"compress", 'C', "Use compression in server/client protocol.", {"compress", 'C', "Use compression in server/client protocol.",
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
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},
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.", {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0, &debug_check_flag, &debug_check_flag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
(uchar**) &debug_info_flag, (uchar**) &debug_info_flag, &debug_info_flag, &debug_info_flag,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"host", 'h', "Connect to host.", (uchar**) &host, (uchar**) &host, 0, GET_STR, {"host", 'h', "Connect to host.", &host, &host, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"status", 'i', "Shows a lot of extra information about each table.", {"status", 'i', "Shows a lot of extra information about each table.",
(uchar**) &opt_status, (uchar**) &opt_status, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, &opt_status, &opt_status, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
{"keys", 'k', "Show keys for table.", (uchar**) &opt_show_keys, {"keys", 'k', "Show keys for table.", &opt_show_keys,
(uchar**) &opt_show_keys, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &opt_show_keys, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p', {"password", 'p',
"Password to use when connecting to server. If password is not given, it's " "Password to use when connecting to server. If password is not given, it's "
"solicited on the tty.", "solicited on the tty.",
@ -205,8 +205,8 @@ static struct my_option my_long_options[] =
"/etc/services, " "/etc/services, "
#endif #endif
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
(uchar**) &opt_mysql_port, &opt_mysql_port,
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 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,
@ -217,19 +217,20 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM #ifdef HAVE_SMEM
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name, "Base name of shared memory.", &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#endif #endif
{"show-table-type", 't', "Show table type column.", {"show-table-type", 't', "Show table type column.",
(uchar**) &opt_table_type, (uchar**) &opt_table_type, 0, GET_BOOL, &opt_table_type, &opt_table_type, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
{"socket", 'S', "The socket file to use for connection.", {"socket", 'S', "The socket file to use for connection.",
(uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR, &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include <sslopt-longopts.h> #include <sslopt-longopts.h>
#ifndef DONT_ALLOW_USER_CHANGE #ifndef DONT_ALLOW_USER_CHANGE
{"user", 'u', "User for login if not current user.", (uchar**) &user, {"user", 'u', "User for login if not current user.", &user,
(uchar**) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"verbose", 'v', {"verbose", 'v',
"More verbose output; you can use this multiple times to get even more " "More verbose output; you can use this multiple times to get even more "

View File

@ -515,62 +515,62 @@ static struct my_option my_long_options[] =
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"auto-generate-sql", 'a', {"auto-generate-sql", 'a',
"Generate SQL where not supplied by file or command line.", "Generate SQL where not supplied by file or command line.",
(uchar**) &auto_generate_sql, (uchar**) &auto_generate_sql, &auto_generate_sql, &auto_generate_sql,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"auto-generate-sql-add-autoincrement", OPT_SLAP_AUTO_GENERATE_ADD_AUTO, {"auto-generate-sql-add-autoincrement", OPT_SLAP_AUTO_GENERATE_ADD_AUTO,
"Add an AUTO_INCREMENT column to auto-generated tables.", "Add an AUTO_INCREMENT column to auto-generated tables.",
(uchar**) &auto_generate_sql_autoincrement, &auto_generate_sql_autoincrement,
(uchar**) &auto_generate_sql_autoincrement, &auto_generate_sql_autoincrement,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"auto-generate-sql-execute-number", OPT_SLAP_AUTO_GENERATE_EXECUTE_QUERIES, {"auto-generate-sql-execute-number", OPT_SLAP_AUTO_GENERATE_EXECUTE_QUERIES,
"Set this number to generate a set number of queries to run.", "Set this number to generate a set number of queries to run.",
(uchar**) &auto_actual_queries, (uchar**) &auto_actual_queries, &auto_actual_queries, &auto_actual_queries,
0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"auto-generate-sql-guid-primary", OPT_SLAP_AUTO_GENERATE_GUID_PRIMARY, {"auto-generate-sql-guid-primary", OPT_SLAP_AUTO_GENERATE_GUID_PRIMARY,
"Add GUID based primary keys to auto-generated tables.", "Add GUID based primary keys to auto-generated tables.",
(uchar**) &auto_generate_sql_guid_primary, &auto_generate_sql_guid_primary,
(uchar**) &auto_generate_sql_guid_primary, &auto_generate_sql_guid_primary,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"auto-generate-sql-load-type", OPT_SLAP_AUTO_GENERATE_SQL_LOAD_TYPE, {"auto-generate-sql-load-type", OPT_SLAP_AUTO_GENERATE_SQL_LOAD_TYPE,
"Specify test load type: mixed, update, write, key, or read; default is mixed.", "Specify test load type: mixed, update, write, key, or read; default is mixed.",
(uchar**) &auto_generate_sql_type, (uchar**) &auto_generate_sql_type, &auto_generate_sql_type, &auto_generate_sql_type,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"auto-generate-sql-secondary-indexes", {"auto-generate-sql-secondary-indexes",
OPT_SLAP_AUTO_GENERATE_SECONDARY_INDEXES, OPT_SLAP_AUTO_GENERATE_SECONDARY_INDEXES,
"Number of secondary indexes to add to auto-generated tables.", "Number of secondary indexes to add to auto-generated tables.",
(uchar**) &auto_generate_sql_secondary_indexes, &auto_generate_sql_secondary_indexes,
(uchar**) &auto_generate_sql_secondary_indexes, 0, &auto_generate_sql_secondary_indexes, 0,
GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"auto-generate-sql-unique-query-number", {"auto-generate-sql-unique-query-number",
OPT_SLAP_AUTO_GENERATE_UNIQUE_QUERY_NUM, OPT_SLAP_AUTO_GENERATE_UNIQUE_QUERY_NUM,
"Number of unique queries to generate for automatic tests.", "Number of unique queries to generate for automatic tests.",
(uchar**) &auto_generate_sql_unique_query_number, &auto_generate_sql_unique_query_number,
(uchar**) &auto_generate_sql_unique_query_number, &auto_generate_sql_unique_query_number,
0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0}, 0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0},
{"auto-generate-sql-unique-write-number", {"auto-generate-sql-unique-write-number",
OPT_SLAP_AUTO_GENERATE_UNIQUE_WRITE_NUM, OPT_SLAP_AUTO_GENERATE_UNIQUE_WRITE_NUM,
"Number of unique queries to generate for auto-generate-sql-write-number.", "Number of unique queries to generate for auto-generate-sql-write-number.",
(uchar**) &auto_generate_sql_unique_write_number, &auto_generate_sql_unique_write_number,
(uchar**) &auto_generate_sql_unique_write_number, &auto_generate_sql_unique_write_number,
0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0}, 0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0},
{"auto-generate-sql-write-number", OPT_SLAP_AUTO_GENERATE_WRITE_NUM, {"auto-generate-sql-write-number", OPT_SLAP_AUTO_GENERATE_WRITE_NUM,
"Number of row inserts to perform for each thread (default is 100).", "Number of row inserts to perform for each thread (default is 100).",
(uchar**) &auto_generate_sql_number, (uchar**) &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},
{"commit", OPT_SLAP_COMMIT, "Commit records every X number of statements.", {"commit", OPT_SLAP_COMMIT, "Commit records every X number of statements.",
(uchar**) &commit_rate, (uchar**) &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},
{"compress", 'C', "Use compression in server/client protocol.", {"compress", 'C', "Use compression in server/client protocol.",
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
{"concurrency", 'c', "Number of clients to simulate for query to run.", {"concurrency", 'c', "Number of clients to simulate for query to run.",
(uchar**) &concurrency_str, (uchar**) &concurrency_str, 0, GET_STR, &concurrency_str, &concurrency_str, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"create", OPT_SLAP_CREATE_STRING, "File or string to use create tables.", {"create", OPT_SLAP_CREATE_STRING, "File or string to use create tables.",
(uchar**) &create_string, (uchar**) &create_string, 0, GET_STR, REQUIRED_ARG, &create_string, &create_string, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"create-schema", OPT_CREATE_SLAP_SCHEMA, "Schema to run tests in.", {"create-schema", OPT_CREATE_SLAP_SCHEMA, "Schema to run tests in.",
(uchar**) &create_schema_string, (uchar**) &create_schema_string, 0, GET_STR, &create_schema_string, &create_schema_string, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"csv", OPT_SLAP_CSV, {"csv", OPT_SLAP_CSV,
"Generate CSV output to named file or to stdout if no file is named.", "Generate CSV output to named file or to stdout if no file is named.",
@ -580,45 +580,45 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else #else
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
(uchar**) &default_dbug_option, (uchar**) &default_dbug_option, 0, GET_STR, &default_dbug_option, &default_dbug_option, 0, GET_STR,
OPT_ARG, 0, 0, 0, 0, 0, 0}, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.", {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0, &debug_check_flag, &debug_check_flag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", 'T', "Print some debug info at exit.", (uchar**) &debug_info_flag, {"debug-info", 'T', "Print some debug info at exit.", &debug_info_flag,
(uchar**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"delimiter", 'F', {"delimiter", 'F',
"Delimiter to use in SQL statements supplied in file or command line.", "Delimiter to use in SQL statements supplied in file or command line.",
(uchar**) &delimiter, (uchar**) &delimiter, 0, GET_STR, REQUIRED_ARG, &delimiter, &delimiter, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"detach", OPT_SLAP_DETACH, {"detach", OPT_SLAP_DETACH,
"Detach (close and reopen) connections after X number of requests.", "Detach (close and reopen) connections after X number of requests.",
(uchar**) &detach_rate, (uchar**) &detach_rate, 0, GET_UINT, REQUIRED_ARG, &detach_rate, &detach_rate, 0, GET_UINT, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"engine", 'e', "Storage engine to use for creating the table.", {"engine", 'e', "Storage engine to use for creating the table.",
(uchar**) &default_engine, (uchar**) &default_engine, 0, &default_engine, &default_engine, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"host", 'h', "Connect to host.", (uchar**) &host, (uchar**) &host, 0, GET_STR, {"host", 'h', "Connect to host.", &host, &host, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"iterations", 'i', "Number of times to run the tests.", (uchar**) &iterations, {"iterations", 'i', "Number of times to run the tests.", &iterations,
(uchar**) &iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0}, &iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
{"number-char-cols", 'x', {"number-char-cols", 'x',
"Number of VARCHAR columns to create in table if specifying --auto-generate-sql.", "Number of VARCHAR columns to create in table if specifying --auto-generate-sql.",
(uchar**) &num_char_cols_opt, (uchar**) &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG, &num_char_cols_opt, &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"number-int-cols", 'y', {"number-int-cols", 'y',
"Number of INT columns to create in table if specifying --auto-generate-sql.", "Number of INT columns to create in table if specifying --auto-generate-sql.",
(uchar**) &num_int_cols_opt, (uchar**) &num_int_cols_opt, 0, GET_STR, REQUIRED_ARG, &num_int_cols_opt, &num_int_cols_opt, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"number-of-queries", OPT_MYSQL_NUMBER_OF_QUERY, {"number-of-queries", OPT_MYSQL_NUMBER_OF_QUERY,
"Limit each client to this number of queries (this is not exact).", "Limit each client to this number of queries (this is not exact).",
(uchar**) &num_of_query, (uchar**) &num_of_query, 0, &num_of_query, &num_of_query, 0,
GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"only-print", OPT_MYSQL_ONLY_PRINT, {"only-print", OPT_MYSQL_ONLY_PRINT,
"Do not connect to the databases, but instead print out what would have " "Do not connect to the databases, but instead print out what would have "
"been done.", "been done.",
(uchar**) &opt_only_print, (uchar**) &opt_only_print, 0, GET_BOOL, NO_ARG, &opt_only_print, &opt_only_print, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"password", 'p', {"password", 'p',
"Password to use when connecting to server. If password is not given it's " "Password to use when connecting to server. If password is not given it's "
@ -627,58 +627,54 @@ static struct my_option my_long_options[] =
{"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},
#endif #endif
{"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port, {"port", 'P', "Port number to use for connection.", &opt_mysql_port,
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0, &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
0}, 0},
{"post-query", OPT_SLAP_POST_QUERY, {"post-query", OPT_SLAP_POST_QUERY,
"Query to run or file containing query to execute after tests have completed.", "Query to run or file containing query to execute after tests have completed.",
(uchar**) &user_supplied_post_statements, &user_supplied_post_statements, &user_supplied_post_statements,
(uchar**) &user_supplied_post_statements,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"post-system", OPT_SLAP_POST_SYSTEM, {"post-system", OPT_SLAP_POST_SYSTEM,
"system() string to execute after tests have completed.", "system() string to execute after tests have completed.",
(uchar**) &post_system, &post_system, &post_system,
(uchar**) &post_system,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"pre-query", OPT_SLAP_PRE_QUERY, {"pre-query", OPT_SLAP_PRE_QUERY,
"Query to run or file containing query to execute before running tests.", "Query to run or file containing query to execute before running tests.",
(uchar**) &user_supplied_pre_statements, &user_supplied_pre_statements, &user_supplied_pre_statements,
(uchar**) &user_supplied_pre_statements,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"pre-system", OPT_SLAP_PRE_SYSTEM, {"pre-system", OPT_SLAP_PRE_SYSTEM,
"system() string to execute before running tests.", "system() string to execute before running tests.",
(uchar**) &pre_system, &pre_system, &pre_system,
(uchar**) &pre_system,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"protocol", OPT_MYSQL_PROTOCOL, {"protocol", OPT_MYSQL_PROTOCOL,
"The protocol to use for connection (tcp, socket, pipe, memory).", "The protocol to use for connection (tcp, socket, pipe, memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"query", 'q', "Query to run or file containing query to run.", {"query", 'q', "Query to run or file containing query to run.",
(uchar**) &user_supplied_query, (uchar**) &user_supplied_query, &user_supplied_query, &user_supplied_query,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM #ifdef HAVE_SMEM
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory.", (uchar**) &shared_memory_base_name, "Base name of shared memory.", &shared_memory_base_name,
(uchar**) &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG, &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
#endif #endif
{"silent", 's', "Run program in silent mode - no output.", {"silent", 's', "Run program in silent mode - no output.",
(uchar**) &opt_silent, (uchar**) &opt_silent, 0, GET_BOOL, NO_ARG, &opt_silent, &opt_silent, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"socket", 'S', "The socket file to use for connection.", {"socket", 'S', "The socket file to use for connection.",
(uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR, &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include <sslopt-longopts.h> #include <sslopt-longopts.h>
#ifndef DONT_ALLOW_USER_CHANGE #ifndef DONT_ALLOW_USER_CHANGE
{"user", 'u', "User for login if not current user.", (uchar**) &user, {"user", 'u', "User for login if not current user.", &user,
(uchar**) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"verbose", 'v', {"verbose", 'v',
"More verbose output; you can use this multiple times to get even more " "More verbose output; you can use this multiple times to get even more "
"verbose output.", (uchar**) &verbose, (uchar**) &verbose, 0, "verbose output.", &verbose, &verbose, 0, GET_NO_ARG, NO_ARG,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG, {"version", 'V', "Output version information and exit.", 0, 0, 0,
NO_ARG, 0, 0, 0, 0, 0, 0}, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
}; };

View File

@ -77,11 +77,17 @@
static int setenv(const char *name, const char *value, int overwrite); static int setenv(const char *name, const char *value, int overwrite);
#endif #endif
C_MODE_START
static sig_handler signal_handler(int sig);
static my_bool get_one_option(int optid, const struct my_option *,
char *argument);
C_MODE_END
enum { enum {
OPT_SKIP_SAFEMALLOC=OPT_MAX_CLIENT_OPTION, OPT_SKIP_SAFEMALLOC=OPT_MAX_CLIENT_OPTION,
OPT_PS_PROTOCOL, OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL, OPT_PS_PROTOCOL, OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL,
OPT_MAX_CONNECT_RETRIES, OPT_MAX_CONNECTIONS, OPT_MARK_PROGRESS, OPT_MAX_CONNECT_RETRIES, OPT_MAX_CONNECTIONS, OPT_MARK_PROGRESS,
OPT_LOG_DIR, OPT_TAIL_LINES, OPT_RESULT_FORMAT_VERSION, OPT_LOG_DIR, OPT_TAIL_LINES, OPT_RESULT_FORMAT_VERSION
}; };
static int record= 0, opt_sleep= -1; static int record= 0, opt_sleep= -1;
@ -464,7 +470,6 @@ void log_msg(const char *fmt, ...)
VAR* var_from_env(const char *, const char *); VAR* var_from_env(const char *, const char *);
VAR* var_init(VAR* v, const char *name, int name_len, const char *val, VAR* var_init(VAR* v, const char *name, int name_len, const char *val,
int val_len); int val_len);
void var_free(void* v);
VAR* var_get(const char *var_name, const char** var_name_end, VAR* var_get(const char *var_name, const char** var_name_end,
my_bool raw, my_bool ignore_not_existing); my_bool raw, my_bool ignore_not_existing);
void eval_expr(VAR* v, const char *p, const char** p_end); void eval_expr(VAR* v, const char *p, const char** p_end);
@ -1921,6 +1926,8 @@ static void strip_parentheses(struct st_command *command)
} }
C_MODE_START
static uchar *get_var_key(const uchar* var, size_t *len, static uchar *get_var_key(const uchar* var, size_t *len,
my_bool __attribute__((unused)) t) my_bool __attribute__((unused)) t)
{ {
@ -1931,6 +1938,16 @@ static uchar *get_var_key(const uchar* var, size_t *len,
} }
static void var_free(void *v)
{
my_free(((VAR*) v)->str_val, MYF(MY_WME));
if (((VAR*)v)->alloced)
my_free(v, MYF(MY_WME));
}
C_MODE_END
VAR *var_init(VAR *v, const char *name, int name_len, const char *val, VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
int val_len) int val_len)
{ {
@ -1973,14 +1990,6 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
} }
void var_free(void *v)
{
my_free(((VAR*) v)->str_val, MYF(MY_WME));
if (((VAR*)v)->alloced)
my_free(v, MYF(MY_WME));
}
VAR* var_from_env(const char *name, const char *def_val) VAR* var_from_env(const char *name, const char *def_val)
{ {
const char *tmp; const char *tmp;
@ -5933,18 +5942,18 @@ static struct my_option my_long_options[] =
{ {
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"basedir", 'b', "Basedir for tests.", (uchar**) &opt_basedir, {"basedir", 'b', "Basedir for tests.", &opt_basedir,
(uchar**) &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR, {"character-sets-dir", OPT_CHARSETS_DIR,
"Directory for character set files.", (uchar**) &opt_charsets_dir, "Directory for character set files.", &opt_charsets_dir,
(uchar**) &opt_charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &opt_charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"compress", 'C', "Use the compressed server/client protocol.", {"compress", 'C', "Use the compressed server/client protocol.",
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
{"cursor-protocol", OPT_CURSOR_PROTOCOL, "Use cursors for prepared statements.", {"cursor-protocol", OPT_CURSOR_PROTOCOL, "Use cursors for prepared statements.",
(uchar**) &cursor_protocol, (uchar**) &cursor_protocol, 0, &cursor_protocol, &cursor_protocol, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"database", 'D', "Database to use.", (uchar**) &opt_db, (uchar**) &opt_db, 0, {"database", 'D', "Database to use.", &opt_db, &opt_db, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef DBUG_OFF #ifdef DBUG_OFF
{"debug", '#', "This is a non-debug version. Catch this and exit", {"debug", '#', "This is a non-debug version. Catch this and exit",
@ -5954,28 +5963,28 @@ static struct my_option my_long_options[] =
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},
#endif #endif
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.", {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0, &debug_check_flag, &debug_check_flag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
(uchar**) &debug_info_flag, (uchar**) &debug_info_flag, &debug_info_flag, &debug_info_flag,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"host", 'h', "Connect to host.", (uchar**) &opt_host, (uchar**) &opt_host, 0, {"host", 'h', "Connect to host.", &opt_host, &opt_host, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"include", 'i', "Include SQL before each test case.", (uchar**) &opt_include, {"include", 'i', "Include SQL before each test case.", &opt_include,
(uchar**) &opt_include, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &opt_include, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"logdir", OPT_LOG_DIR, "Directory for log files", (uchar**) &opt_logdir, {"logdir", OPT_LOG_DIR, "Directory for log files", &opt_logdir,
(uchar**) &opt_logdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &opt_logdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"mark-progress", OPT_MARK_PROGRESS, {"mark-progress", OPT_MARK_PROGRESS,
"Write line number and elapsed time to <testname>.progress.", "Write line number and elapsed time to <testname>.progress.",
(uchar**) &opt_mark_progress, (uchar**) &opt_mark_progress, 0, &opt_mark_progress, &opt_mark_progress, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"max-connect-retries", OPT_MAX_CONNECT_RETRIES, {"max-connect-retries", OPT_MAX_CONNECT_RETRIES,
"Maximum number of attempts to connect to server.", "Maximum number of attempts to connect to server.",
(uchar**) &opt_max_connect_retries, (uchar**) &opt_max_connect_retries, 0, &opt_max_connect_retries, &opt_max_connect_retries, 0,
GET_INT, REQUIRED_ARG, 500, 1, 10000, 0, 0, 0}, GET_INT, REQUIRED_ARG, 500, 1, 10000, 0, 0, 0},
{"max-connections", OPT_MAX_CONNECTIONS, {"max-connections", OPT_MAX_CONNECTIONS,
"Max number of open connections to server", "Max number of open connections to server",
(uchar**) &opt_max_connections, (uchar**) &opt_max_connections, 0, &opt_max_connections, &opt_max_connections, 0,
GET_INT, REQUIRED_ARG, 128, 8, 5120, 0, 0, 0}, GET_INT, REQUIRED_ARG, 128, 8, 5120, 0, 0, 0},
{"password", 'p', "Password to use when connecting to server.", {"password", 'p', "Password to use when connecting to server.",
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},
@ -5987,18 +5996,17 @@ static struct my_option my_long_options[] =
"/etc/services, " "/etc/services, "
#endif #endif
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
(uchar**) &opt_port, &opt_port, &opt_port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
(uchar**) &opt_port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"ps-protocol", OPT_PS_PROTOCOL, {"ps-protocol", OPT_PS_PROTOCOL,
"Use prepared-statement protocol for communication.", "Use prepared-statement protocol for communication.",
(uchar**) &ps_protocol, (uchar**) &ps_protocol, 0, &ps_protocol, &ps_protocol, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"quiet", 's', "Suppress all normal output.", (uchar**) &silent, {"quiet", 's', "Suppress all normal output.", &silent,
(uchar**) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"record", 'r', "Record output of test_file into result file.", {"record", 'r', "Record output of test_file into result file.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"result-file", 'R', "Read/store result from/in this file.", {"result-file", 'R', "Read/store result from/in this file.",
(uchar**) &result_file_name, (uchar**) &result_file_name, 0, &result_file_name, &result_file_name, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"result-format-version", OPT_RESULT_FORMAT_VERSION, {"result-format-version", OPT_RESULT_FORMAT_VERSION,
"Version of the result file format to use", "Version of the result file format to use",
@ -6010,27 +6018,27 @@ static struct my_option my_long_options[] =
{"server-file", 'F', "Read embedded server arguments from file.", {"server-file", 'F', "Read embedded server arguments from file.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory.", (uchar**) &shared_memory_base_name, "Base name of shared memory.", &shared_memory_base_name,
(uchar**) &shared_memory_base_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, &shared_memory_base_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
{"silent", 's', "Suppress all normal output. Synonym for --quiet.", {"silent", 's', "Suppress all normal output. Synonym for --quiet.",
(uchar**) &silent, (uchar**) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &silent, &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"skip-safemalloc", OPT_SKIP_SAFEMALLOC, {"skip-safemalloc", OPT_SKIP_SAFEMALLOC,
"Don't use the memory allocation checking.", 0, 0, 0, GET_NO_ARG, NO_ARG, "Don't use the memory allocation checking.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"sleep", 'T', "Always sleep this many seconds on sleep commands.", {"sleep", 'T', "Always sleep this many seconds on sleep commands.",
(uchar**) &opt_sleep, (uchar**) &opt_sleep, 0, GET_INT, REQUIRED_ARG, -1, -1, 0, &opt_sleep, &opt_sleep, 0, GET_INT, REQUIRED_ARG, -1, -1, 0,
0, 0, 0}, 0, 0, 0},
{"socket", 'S', "The socket file to use for connection.", {"socket", 'S', "The socket file to use for connection.",
(uchar**) &unix_sock, (uchar**) &unix_sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, &unix_sock, &unix_sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
{"sp-protocol", OPT_SP_PROTOCOL, "Use stored procedures for select.", {"sp-protocol", OPT_SP_PROTOCOL, "Use stored procedures for select.",
(uchar**) &sp_protocol, (uchar**) &sp_protocol, 0, &sp_protocol, &sp_protocol, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#include "sslopt-longopts.h" #include "sslopt-longopts.h"
{"tail-lines", OPT_TAIL_LINES, {"tail-lines", OPT_TAIL_LINES,
"Number of lines of the result to include in a failure report.", "Number of lines of the result to include in a failure report.",
(uchar**) &opt_tail_lines, (uchar**) &opt_tail_lines, 0, &opt_tail_lines, &opt_tail_lines, 0,
GET_INT, REQUIRED_ARG, 0, 0, 10000, 0, 0, 0}, GET_INT, REQUIRED_ARG, 0, 0, 10000, 0, 0, 0},
{"test-file", 'x', "Read test from/in this file (default stdin).", {"test-file", 'x', "Read test from/in this file (default stdin).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@ -6038,14 +6046,14 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"tmpdir", 't', "Temporary directory where sockets are put.", {"tmpdir", 't', "Temporary directory where sockets are put.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"user", 'u', "User for login.", (uchar**) &opt_user, (uchar**) &opt_user, 0, {"user", 'u', "User for login.", &opt_user, &opt_user, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"verbose", 'v', "Write more.", (uchar**) &verbose, (uchar**) &verbose, 0, {"verbose", 'v', "Write more.", &verbose, &verbose, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit.", {"version", 'V', "Output version information and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"view-protocol", OPT_VIEW_PROTOCOL, "Use views for select.", {"view-protocol", OPT_VIEW_PROTOCOL, "Use views for select.",
(uchar**) &view_protocol, (uchar**) &view_protocol, 0, &view_protocol, &view_protocol, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"connect_timeout", OPT_CONNECT_TIMEOUT, {"connect_timeout", OPT_CONNECT_TIMEOUT,
"Number of seconds before connection timeout.", "Number of seconds before connection timeout.",
@ -6126,8 +6134,7 @@ void read_embedded_server_arguments(const char *name)
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, char *argument)
char *argument)
{ {
switch(optid) { switch(optid) {
case '#': case '#':

View File

@ -24,13 +24,6 @@
#include <m_string.h> #include <m_string.h>
#include <m_ctype.h> #include <m_ctype.h>
#include <mysql_com.h> #include <mysql_com.h>
/*
The following extern declarations are ok as these are interface functions
required by the string function
*/
extern void sql_alloc(size_t size);
extern void sql_element_free(void *ptr);
#include "sql_string.h" #include "sql_string.h"

View File

@ -24,6 +24,7 @@ EXTRA_DIST = \
dtrace_prelink.cmake \ dtrace_prelink.cmake \
versioninfo.rc.in \ versioninfo.rc.in \
mysql_add_executable.cmake \ mysql_add_executable.cmake \
tags.cmake \
install_layout.cmake \ install_layout.cmake \
build_configurations/mysql_release.cmake \ build_configurations/mysql_release.cmake \
os/Windows.cmake \ os/Windows.cmake \

View File

@ -1,5 +1,5 @@
# Copyright (C) 2010 Sun Microsystems, Inc # Copyright (c) 2010, 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
@ -15,6 +15,9 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# This file includes FreeBSD specific options and quirks, related to system checks # This file includes FreeBSD specific options and quirks, related to system checks
#Legacy option, maybe not needed anymore , taken as is from autotools build
ADD_DEFINITIONS(-DNET_RETRY_COUNT=1000000)
# Should not be needed any more, but kept for easy resurrection if needed
# #Legacy option, maybe not needed anymore , taken as is from autotools build
# ADD_DEFINITIONS(-DNET_RETRY_COUNT=1000000)
ADD_DEFINITIONS(-DHAVE_BROKEN_REALPATH)

View File

@ -25,7 +25,7 @@ MACRO (MYSQL_USE_BUNDLED_SSL)
SET(SSL_LIBRARIES yassl taocrypt) SET(SSL_LIBRARIES yassl taocrypt)
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_PURE_C -DYASSL_PREFIX -DHAVE_OPENSSL") SET(SSL_DEFINES"-DHAVE_YASSL -DYASSL_PURE_C -DYASSL_PREFIX -DHAVE_OPENSSL -DYASSL_THREAD_SAFE")
CHANGE_SSL_SETTINGS("bundled") CHANGE_SSL_SETTINGS("bundled")
#Remove -fno-implicit-templates #Remove -fno-implicit-templates
#(yassl sources cannot be compiled with it) #(yassl sources cannot be compiled with it)

26
cmake/tags.cmake Normal file
View File

@ -0,0 +1,26 @@
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
#
# 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
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Generate tag files
IF(UNIX)
ADD_CUSTOM_TARGET (tags
COMMAND support-files/build-tags
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
ADD_CUSTOM_TARGET (ctags
COMMAND ctags -R -f CTAGS
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
ENDIF()

View File

@ -95,10 +95,9 @@ static char break_chars[] = { ' ', '\t', '\n', '"', '\\', '\'', '`', '@', '$',
char * char *
fn_tilde_expand(const char *txt) fn_tilde_expand(const char *txt)
{ {
struct passwd pwres, *pass; struct passwd *pass;
char *temp; char *temp;
size_t len = 0; size_t len = 0;
char pwbuf[1024];
if (txt[0] != '~') if (txt[0] != '~')
return (strdup(txt)); return (strdup(txt));

View File

@ -318,7 +318,9 @@ _rl_input_available ()
return (_kbhit ()); return (_kbhit ());
#endif #endif
#if !defined (HAVE_SELECT)
return 0; return 0;
#endif
} }
int int

View File

@ -282,6 +282,8 @@
#cmakedefine HAVE_NETINET_IN6_H 1 #cmakedefine HAVE_NETINET_IN6_H 1
#cmakedefine HAVE_IPV6 1 #cmakedefine HAVE_IPV6 1
#cmakedefine ss_family @ss_family@ #cmakedefine ss_family @ss_family@
#cmakedefine HAVE_SOCKADDR_IN_SIN_LEN 1
#cmakedefine HAVE_SOCKADDR_IN6_SIN6_LEN 1
#cmakedefine HAVE_TIMESPEC_TS_SEC 1 #cmakedefine HAVE_TIMESPEC_TS_SEC 1
#cmakedefine STRUCT_DIRENT_HAS_D_INO 1 #cmakedefine STRUCT_DIRENT_HAS_D_INO 1
#cmakedefine STRUCT_DIRENT_HAS_D_NAMLEN 1 #cmakedefine STRUCT_DIRENT_HAS_D_NAMLEN 1

View File

@ -38,11 +38,20 @@ AC_DEFUN([MYSQL_USE_BUNDLED_YASSL], [
esac esac
AC_SUBST([yassl_taocrypt_extra_cxxflags]) AC_SUBST([yassl_taocrypt_extra_cxxflags])
# Thread safe check
yassl_thread_cxxflags=""
yassl_thread_safe=""
if test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no"; then
yassl_thread_cxxflags="-DYASSL_THREAD_SAFE"
yassl_thread_safe="(thread-safe)"
fi
AC_SUBST([yassl_thread_cxxflags])
# Link extra/yassl/include/openssl subdir to include/ # Link extra/yassl/include/openssl subdir to include/
yassl_h_ln_cmd="\$(LN) -s \$(top_srcdir)/extra/yassl/include/openssl openssl" yassl_h_ln_cmd="\$(LN) -s \$(top_srcdir)/extra/yassl/include/openssl openssl"
AC_SUBST(yassl_h_ln_cmd) AC_SUBST(yassl_h_ln_cmd)
AC_MSG_RESULT([using bundled yaSSL]) AC_MSG_RESULT([using bundled yaSSL $yassl_thread_safe])
]) ])

View File

@ -54,6 +54,15 @@ IF(NOT SYSTEM_TYPE)
ENDIF() ENDIF()
# Always enable -Wall for gnu C/C++
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused-parameter")
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCXX) IF(CMAKE_COMPILER_IS_GNUCXX)
# MySQL "canonical" GCC flags. At least -fno-rtti flag affects # MySQL "canonical" GCC flags. At least -fno-rtti flag affects
# ABI and cannot be simply removed. # ABI and cannot be simply removed.
@ -1000,6 +1009,21 @@ IF(NOT HAVE_SOCKADDR_STORAGE_SS_FAMILY)
SET(ss_family __ss_family) SET(ss_family __ss_family)
ENDIF() ENDIF()
ENDIF() ENDIF()
#
# Check if struct sockaddr_in::sin_len is available.
#
CHECK_STRUCT_HAS_MEMBER("struct sockaddr_in" sin_len
"${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_SOCKADDR_IN_SIN_LEN)
#
# Check if struct sockaddr_in6::sin6_len is available.
#
CHECK_STRUCT_HAS_MEMBER("struct sockaddr_in6" sin6_len
"${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_SOCKADDR_IN6_SIN6_LEN)
SET(CMAKE_EXTRA_INCLUDE_FILES) SET(CMAKE_EXTRA_INCLUDE_FILES)
CHECK_STRUCT_HAS_MEMBER("struct dirent" d_ino "dirent.h" STRUCT_DIRENT_HAS_D_INO) CHECK_STRUCT_HAS_MEMBER("struct dirent" d_ino "dirent.h" STRUCT_DIRENT_HAS_D_INO)

View File

@ -1,7 +1,7 @@
dnl -*- ksh -*- dnl -*- ksh -*-
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
# Copyright (C) 2008-2009 Sun Microsystems, Inc # Copyright (c) 2000, 2010, 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
@ -844,8 +844,8 @@ AC_TYPE_SIZE_T
AC_HEADER_DIRENT AC_HEADER_DIRENT
AC_HEADER_STDC AC_HEADER_STDC
AC_HEADER_SYS_WAIT AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h fenv.h float.h floatingpoint.h ieeefp.h limits.h \ AC_CHECK_HEADERS(fcntl.h fenv.h float.h floatingpoint.h fpu_control.h \
memory.h pwd.h select.h poll.h \ ieeefp.h limits.h memory.h pwd.h select.h poll.h \
stdlib.h stddef.h \ stdlib.h stddef.h \
strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \ strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \
sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \ sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \
@ -1013,6 +1013,66 @@ else
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
fi fi
#--------------------------------------------------------------------------
# Check if struct sockaddr_in::sin_len is available
#--------------------------------------------------------------------------
AC_CACHE_CHECK(
[if sockaddr_in::sin_len is available],
mysql_cv_have_sockaddr_in_sin_len,
AC_TRY_COMPILE(
[
#ifdef WIN32
#include <winsock2.h>
#else
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#endif
],
[unsigned int i = sizeof(((struct sockaddr_in *) 0)->sin_len)],
mysql_cv_have_sockaddr_in_sin_len=yes,
mysql_cv_have_sockaddr_in_sin_len=no))
if test "$mysql_cv_have_sockaddr_in_sin_len" = "yes"; then
AC_DEFINE(
[HAVE_SOCKADDR_IN_SIN_LEN],
[1],
[If sockaddr_in::sin_len is available])
fi
#--------------------------------------------------------------------------
# Check if struct sockaddr_in6::sin6_len is available
#--------------------------------------------------------------------------
AC_CACHE_CHECK(
[if sockaddr_in6::sin6_len is available],
mysql_cv_have_sockaddr_in6_sin6_len,
AC_TRY_COMPILE(
[
#ifdef WIN32
#include <winsock2.h>
#else
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN6_H
#include <netinet/in6.h>
#endif
],
[unsigned int i = sizeof(((struct sockaddr_in6 *) 0)->sin6_len)],
mysql_cv_have_sockaddr_in6_sin6_len=yes,
mysql_cv_have_sockaddr_in6_sin6_len=no))
if test "$mysql_cv_have_sockaddr_in_sin6_len" = "yes"; then
AC_DEFINE(
[HAVE_SOCKADDR_IN6_SIN6_LEN],
[1],
[If sockaddr_in6::sin6_len is available])
fi
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Check for TCP wrapper support # Check for TCP wrapper support
#-------------------------------------------------------------------- #--------------------------------------------------------------------
@ -1236,14 +1296,22 @@ case $SYSTEM_TYPE in
fi fi
;; ;;
*freebsd*|*dragonfly*) *freebsd*|*dragonfly*)
AC_MSG_WARN([Adding fix for interrupted reads]) dnl These dependencies have not really been checked for some time
OSVERSION=`sysctl -a | grep osreldate | awk '{ print $2 }'` OSVERSION=`sysctl -a | grep osreldate | awk '{ print $2 }'`
if test "$OSVERSION" -gt "480100" && \ if test "$OSVERSION" -gt "600000"
then
# Post user-level threads, MYSQLD_NET_RETRY_COUNT is not needed any more
AC_MSG_WARN([Adding fix for broken realpath])
CFLAGS="$CFLAGS -DHAVE_BROKEN_REALPATH"
CXXFLAGS="$CXXFLAGS -DHAVE_BROKEN_REALPATH"
elif test "$OSVERSION" -gt "480100" && \
test "$OSVERSION" -lt "500000" || \ test "$OSVERSION" -lt "500000" || \
test "$OSVERSION" -gt "500109" test "$OSVERSION" -gt "500109"
then then
AC_MSG_WARN([Adding fix for interrupted reads])
CXXFLAGS="$CXXFLAGS -DMYSQLD_NET_RETRY_COUNT=1000000" CXXFLAGS="$CXXFLAGS -DMYSQLD_NET_RETRY_COUNT=1000000"
else else
AC_MSG_WARN([Adding fix for interrupted reads and broken realpath])
CFLAGS="$CFLAGS -DHAVE_BROKEN_REALPATH" CFLAGS="$CFLAGS -DHAVE_BROKEN_REALPATH"
CXXFLAGS="$CXXFLAGS -DMYSQLD_NET_RETRY_COUNT=1000000 -DHAVE_BROKEN_REALPATH" CXXFLAGS="$CXXFLAGS -DMYSQLD_NET_RETRY_COUNT=1000000 -DHAVE_BROKEN_REALPATH"
fi fi
@ -1845,6 +1913,17 @@ else
CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS" CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS"
fi fi
AC_ARG_WITH([valgrind],
[AS_HELP_STRING([--with-valgrind],
[Valgrind instrumentation @<:@default=no@:>@])],
[], [with_valgrind=no])
if test "$with_valgrind" != "no"
then
AC_CHECK_HEADERS([valgrind/valgrind.h valgrind/memcheck.h],
[AC_DEFINE([HAVE_VALGRIND], [1], [Define for Valgrind support])])
fi
# Debug Sync Facility. NOTE: depends on 'with_debug'. Must be behind it. # Debug Sync Facility. NOTE: depends on 'with_debug'. Must be behind it.
AC_MSG_CHECKING(if Debug Sync Facility should be enabled.) AC_MSG_CHECKING(if Debug Sync Facility should be enabled.)
AC_ARG_ENABLE(debug_sync, AC_ARG_ENABLE(debug_sync,
@ -3122,6 +3201,7 @@ esac
AC_SUBST([RDTSC_SPARC_ASSEMBLY]) AC_SUBST([RDTSC_SPARC_ASSEMBLY])
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Output results # Output results
#-------------------------------------------------------------------- #--------------------------------------------------------------------

View File

@ -99,31 +99,29 @@ static struct my_option my_long_options[]=
{"debug", '#', "This is a non-debug version. Catch this and exit", {"debug", '#', "This is a non-debug version. Catch this and exit",
0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else #else
{"debug", '#', "Output debug log", (uchar**) & default_dbug_option, {"debug", '#', "Output debug log", &default_dbug_option,
(uchar**) & default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"debug-info", 'T', "Print some debug info at exit.", (uchar**) & info_flag, {"debug-info", 'T', "Print some debug info at exit.", &info_flag,
(uchar**) & info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG, {"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Prints version", 0, 0, 0, GET_NO_ARG, {"version", 'V', "Prints version", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
{"charset", 'C', "Charset dir", (uchar**) & charsets_dir, {"charset", 'C', "Charset dir", &charsets_dir, &charsets_dir,
(uchar**) & charsets_dir,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"in_file", 'F', "Input file", (uchar**) & TXTFILE, (uchar**) & TXTFILE, {"in_file", 'F', "Input file", &TXTFILE, &TXTFILE,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"out_dir", 'D', "Output base directory", (uchar**) & DATADIRECTORY, {"out_dir", 'D', "Output base directory", &DATADIRECTORY, &DATADIRECTORY,
(uchar**) & DATADIRECTORY,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"out_file", 'O', "Output filename (errmsg.sys)", (uchar**) & OUTFILE, {"out_file", 'O', "Output filename (errmsg.sys)", &OUTFILE,
(uchar**) & OUTFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &OUTFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"header_file", 'H', "mysqld_error.h file ", (uchar**) & HEADERFILE, {"header_file", 'H', "mysqld_error.h file ", &HEADERFILE,
(uchar**) & HEADERFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &HEADERFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"name_file", 'N', "mysqld_ername.h file ", (uchar**) & NAMEFILE, {"name_file", 'N', "mysqld_ername.h file ", &NAMEFILE,
(uchar**) & NAMEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &NAMEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"state_file", 'S', "sql_state.h file", (uchar**) & STATEFILE, {"state_file", 'S', "sql_state.h file", &STATEFILE,
(uchar**) & STATEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &STATEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
}; };
@ -686,7 +684,7 @@ static ha_checksum checksum_format_specifier(const char* msg)
case 'u': case 'u':
case 'x': case 'x':
case 's': case 's':
chksum= my_checksum(chksum, start, (uint) (p + 1 - start)); chksum= my_checksum(chksum, (uchar*) start, (uint) (p + 1 - start));
start= 0; /* Not in format specifier anymore */ start= 0; /* Not in format specifier anymore */
break; break;

View File

@ -46,31 +46,36 @@ static struct my_option my_long_options[] =
searched for a file of this name (and standard filename extensions are searched for a file of this name (and standard filename extensions are
added if the file has no extension) added if the file has no extension)
*/ */
{"config-file", 'c', "Deprecated, please use --defaults-file instead. Name of config file to read; if no extension is given, default extension (e.g., .ini or .cnf) will be added", {"config-file", 'c', "Deprecated, please use --defaults-file instead. "
(uchar**) &config_file, (uchar**) &config_file, 0, GET_STR, REQUIRED_ARG, "Name of config file to read; if no extension is given, default "
"extension (e.g., .ini or .cnf) will be added",
&config_file, &config_file, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
#ifdef DBUG_OFF #ifdef DBUG_OFF
{"debug", '#', "This is a non-debug version. Catch this and exit", {"debug", '#', "This is a non-debug version. Catch this and exit",
0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, 0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else #else
{"debug", '#', "Output debug log", (uchar**) &default_dbug_option, {"debug", '#', "Output debug log", &default_dbug_option,
(uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"defaults-file", 'c', "Like --config-file, except: if first option, then read this file only, do not read global or per-user config files; should be the first option", {"defaults-file", 'c', "Like --config-file, except: if first option, "
(uchar**) &config_file, (uchar**) &config_file, 0, GET_STR, REQUIRED_ARG, "then read this file only, do not read global or per-user config "
"files; should be the first option",
&config_file, &config_file, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"defaults-extra-file", 'e', {"defaults-extra-file", 'e',
"Read this file after the global config file and before the config file in the users home directory; should be the first option", "Read this file after the global config file and before the config "
(uchar**) &my_defaults_extra_file, (uchar**) &my_defaults_extra_file, 0, "file in the users home directory; should be the first option",
&my_defaults_extra_file, &my_defaults_extra_file, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"defaults-group-suffix", 'g', {"defaults-group-suffix", 'g',
"In addition to the given groups, read also groups with this suffix", "In addition to the given groups, read also groups with this suffix",
(uchar**) &my_defaults_group_suffix, (uchar**) &my_defaults_group_suffix, &my_defaults_group_suffix, &my_defaults_group_suffix,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"extra-file", 'e', {"extra-file", 'e',
"Deprecated. Synonym for --defaults-extra-file.", "Deprecated. Synonym for --defaults-extra-file.",
(uchar**) &my_defaults_extra_file, &my_defaults_extra_file,
(uchar**) &my_defaults_extra_file, 0, GET_STR, &my_defaults_extra_file, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"no-defaults", 'n', "Return an empty string (useful for scripts).", {"no-defaults", 'n', "Return an empty string (useful for scripts).",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},

View File

@ -38,7 +38,7 @@ static struct my_option my_long_options[] =
0, 0, 0, 0, 0}, 0, 0, 0, 0, 0},
{"verbose", 'v', {"verbose", 'v',
"Be more verbose. Give a warning, if kill can't handle signal 0.", "Be more verbose. Give a warning, if kill can't handle signal 0.",
(uchar**) &verbose, (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &verbose, &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Print version information and exit.", 0, 0, 0, {"version", 'V', "Print version information and exit.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}

View File

@ -60,18 +60,18 @@ static struct my_option my_long_options[] =
{"info", 'I', "Synonym for --help.", 0, 0, 0, GET_NO_ARG, {"info", 'I', "Synonym for --help.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
{"ndb", 257, "Ndbcluster storage engine specific error codes.", (uchar**) &ndb_code, {"ndb", 257, "Ndbcluster storage engine specific error codes.", &ndb_code,
(uchar**) &ndb_code, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, &ndb_code, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
#ifdef HAVE_SYS_ERRLIST #ifdef HAVE_SYS_ERRLIST
{"all", 'a', "Print all the error messages and the number.", {"all", 'a', "Print all the error messages and the number.",
(uchar**) &print_all_codes, (uchar**) &print_all_codes, 0, GET_BOOL, NO_ARG, &print_all_codes, &print_all_codes, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
#endif #endif
{"silent", 's', "Only print the error message.", 0, 0, 0, GET_NO_ARG, NO_ARG, {"silent", 's', "Only print the error message.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"verbose", 'v', "Print error code and message (default).", (uchar**) &verbose, {"verbose", 'v', "Print error code and message (default).", &verbose,
(uchar**) &verbose, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, &verbose, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"version", 'V', "Displays version information and exits.", {"version", 'V', "Displays version information and exits.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
@ -269,7 +269,7 @@ int main(int argc,char *argv[])
HA_ERRORS *ha_err_ptr; HA_ERRORS *ha_err_ptr;
for (code=1 ; code < sys_nerr ; code++) for (code=1 ; code < sys_nerr ; code++)
{ {
if (sys_errlist[code][0]) if (sys_errlist[code] && sys_errlist[code][0])
{ /* Skip if no error-text */ { /* Skip if no error-text */
printf("%3d = %s\n",code,sys_errlist[code]); printf("%3d = %s\n",code,sys_errlist[code]);
} }

View File

@ -53,10 +53,10 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit.", {"version", 'V', "Output version information and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"symbols-file", 's', "Use specified symbols file.", (uchar**) &sym_fname, {"symbols-file", 's', "Use specified symbols file.", &sym_fname,
(uchar**) &sym_fname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &sym_fname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"numeric-dump-file", 'n', "Read the dump from specified file.", {"numeric-dump-file", 'n', "Read the dump from specified file.",
(uchar**) &dump_fname, (uchar**) &dump_fname, 0, GET_STR, REQUIRED_ARG, &dump_fname, &dump_fname, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
}; };

View File

@ -45,7 +45,7 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"info", 'I', "Synonym for --help.", {"info", 'I', "Synonym for --help.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"silent", 's', "Be more silent.", (uchar**) &silent, (uchar**) &silent, {"silent", 's', "Be more silent.", &silent, &silent,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Displays version information and exits.", {"version", 'V', "Displays version information and exits.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},

View File

@ -5,49 +5,49 @@ Certificate:
Signature Algorithm: md5WithRSAEncryption Signature Algorithm: md5WithRSAEncryption
Issuer: C=US, ST=Oregon, L=Portland, O=sawtooth, CN=www.sawtooth-consulting.com/emailAddress=info@yassl.com Issuer: C=US, ST=Oregon, L=Portland, O=sawtooth, CN=www.sawtooth-consulting.com/emailAddress=info@yassl.com
Validity Validity
Not Before: Jan 18 20:12:32 2005 GMT Not Before: Mar 7 03:10:11 2005 GMT
Not After : Oct 15 20:12:32 2007 GMT Not After : Apr 1 03:10:11 2046 GMT
Subject: C=US, ST=Oregon, L=Portland, O=sawtooth, CN=www.sawtooth-consulting.com/emailAddress=info@yassl.com Subject: C=US, ST=Oregon, L=Portland, O=sawtooth, CN=www.sawtooth-consulting.com/emailAddress=info@yassl.com
Subject Public Key Info: Subject Public Key Info:
Public Key Algorithm: rsaEncryption Public Key Algorithm: rsaEncryption
RSA Public Key: (512 bit) RSA Public Key: (512 bit)
Modulus (512 bit): Modulus (512 bit):
00:cf:2b:14:00:b0:3c:df:6f:9e:91:40:ec:c8:f6: 00:ef:c1:e3:9a:3c:6e:6e:cb:26:6f:05:be:e0:cb:
90:b2:5b:b4:70:80:a5:a4:0a:73:c7:44:f3:2a:26: 57:a0:4b:68:e6:1b:f9:95:db:01:92:aa:6e:a6:b5:
c4:2f:f1:3a:f1:c3:c4:ac:fc:c3:d2:c3:bf:f5:d7: 2d:b1:2b:50:fd:db:13:f2:c5:d8:b8:4f:75:28:53:
6a:38:42:ad:22:ab:c8:c4:4b:4c:1d:16:af:05:34: 72:e8:e5:11:9d:bb:c3:4f:4f:09:fd:4c:e7:46:d5:
7d:79:97:5e:e1 1d:bb:35:02:af
Exponent: 65537 (0x10001) Exponent: 65537 (0x10001)
X509v3 extensions: X509v3 extensions:
X509v3 Subject Key Identifier: X509v3 Subject Key Identifier:
CB:0F:1F:E9:A2:76:71:C9:E6:E8:23:A6:C1:18:B7:CC:44:CF:B9:84 1D:EF:A1:B8:81:78:12:47:E8:57:06:08:74:18:F7:D3:AA:D8:F7:BD
X509v3 Authority Key Identifier: X509v3 Authority Key Identifier:
keyid:CB:0F:1F:E9:A2:76:71:C9:E6:E8:23:A6:C1:18:B7:CC:44:CF:B9:84 keyid:1D:EF:A1:B8:81:78:12:47:E8:57:06:08:74:18:F7:D3:AA:D8:F7:BD
DirName:/C=US/ST=Oregon/L=Portland/O=sawtooth/CN=www.sawtooth-consulting.com/emailAddress=info@yassl.com DirName:/C=US/ST=Oregon/L=Portland/O=sawtooth/CN=www.sawtooth-consulting.com/emailAddress=info@yassl.com
serial:00 serial:00
X509v3 Basic Constraints: X509v3 Basic Constraints:
CA:TRUE CA:TRUE
Signature Algorithm: md5WithRSAEncryption Signature Algorithm: md5WithRSAEncryption
27:f7:3d:fb:39:6f:73:a4:86:f3:a0:48:22:60:84:e9:5c:3d: d9:77:e3:07:d9:2e:ec:2f:9b:8e:9e:ca:b4:00:0b:ef:c7:74:
28:36:05:16:44:98:07:87:e1:5d:b5:f3:a7:bc:33:5f:f4:29: cb:f4:f6:44:2f:02:75:17:a5:74:3e:26:b2:26:fd:1f:ab:3a:
a9:5f:87:33:df:e6:8e:bd:e2:f3:0a:c8:00:69:ae:3d:41:47: df:d5:e3:05:14:08:d0:8c:1d:c9:3e:e1:59:6f:b3:38:5d:af:
03:ea:0b:4c:67:45:4b:ab:f3:39 78:60:e3:c5:6a:69:96:80:7d:00
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIIC7zCCApmgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBiTELMAkGA1UEBhMCVVMx MIIC7zCCApmgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBiTELMAkGA1UEBhMCVVMx
DzANBgNVBAgTBk9yZWdvbjERMA8GA1UEBxMIUG9ydGxhbmQxETAPBgNVBAoTCHNh DzANBgNVBAgTBk9yZWdvbjERMA8GA1UEBxMIUG9ydGxhbmQxETAPBgNVBAoTCHNh
d3Rvb3RoMSQwIgYDVQQDExt3d3cuc2F3dG9vdGgtY29uc3VsdGluZy5jb20xHTAb d3Rvb3RoMSQwIgYDVQQDExt3d3cuc2F3dG9vdGgtY29uc3VsdGluZy5jb20xHTAb
BgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tMB4XDTA1MDExODIwMTIzMloXDTA3 BgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tMB4XDTA1MDMwNzAzMTAxMVoXDTQ2
MTAxNTIwMTIzMlowgYkxCzAJBgNVBAYTAlVTMQ8wDQYDVQQIEwZPcmVnb24xETAP MDQwMTAzMTAxMVowgYkxCzAJBgNVBAYTAlVTMQ8wDQYDVQQIEwZPcmVnb24xETAP
BgNVBAcTCFBvcnRsYW5kMREwDwYDVQQKEwhzYXd0b290aDEkMCIGA1UEAxMbd3d3 BgNVBAcTCFBvcnRsYW5kMREwDwYDVQQKEwhzYXd0b290aDEkMCIGA1UEAxMbd3d3
LnNhd3Rvb3RoLWNvbnN1bHRpbmcuY29tMR0wGwYJKoZIhvcNAQkBFg5pbmZvQHlh LnNhd3Rvb3RoLWNvbnN1bHRpbmcuY29tMR0wGwYJKoZIhvcNAQkBFg5pbmZvQHlh
c3NsLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDPKxQAsDzfb56RQOzI9pCy c3NsLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDvweOaPG5uyyZvBb7gy1eg
W7RwgKWkCnPHRPMqJsQv8Trxw8Ss/MPSw7/112o4Qq0iq8jES0wdFq8FNH15l17h S2jmG/mV2wGSqm6mtS2xK1D92xPyxdi4T3UoU3Lo5RGdu8NPTwn9TOdG1R27NQKv
AgMBAAGjgekwgeYwHQYDVR0OBBYEFMsPH+midnHJ5ugjpsEYt8xEz7mEMIG2BgNV AgMBAAGjgekwgeYwHQYDVR0OBBYEFB3vobiBeBJH6FcGCHQY99Oq2Pe9MIG2BgNV
HSMEga4wgauAFMsPH+midnHJ5ugjpsEYt8xEz7mEoYGPpIGMMIGJMQswCQYDVQQG HSMEga4wgauAFB3vobiBeBJH6FcGCHQY99Oq2Pe9oYGPpIGMMIGJMQswCQYDVQQG
EwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFuZDERMA8GA1UE EwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFuZDERMA8GA1UE
ChMIc2F3dG9vdGgxJDAiBgNVBAMTG3d3dy5zYXd0b290aC1jb25zdWx0aW5nLmNv ChMIc2F3dG9vdGgxJDAiBgNVBAMTG3d3dy5zYXd0b290aC1jb25zdWx0aW5nLmNv
bTEdMBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb22CAQAwDAYDVR0TBAUwAwEB bTEdMBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb22CAQAwDAYDVR0TBAUwAwEB
/zANBgkqhkiG9w0BAQQFAANBACf3Pfs5b3OkhvOgSCJghOlcPSg2BRZEmAeH4V21 /zANBgkqhkiG9w0BAQQFAANBANl34wfZLuwvm46eyrQAC+/HdMv09kQvAnUXpXQ+
86e8M1/0KalfhzPf5o694vMKyABprj1BRwPqC0xnRUur8zk= JrIm/R+rOt/V4wUUCNCMHck+4Vlvszhdr3hg48VqaZaAfQA=
-----END CERTIFICATE----- -----END CERTIFICATE-----

Binary file not shown.

View File

@ -5,8 +5,8 @@ Certificate:
Signature Algorithm: md5WithRSAEncryption Signature Algorithm: md5WithRSAEncryption
Issuer: C=US, ST=Oregon, L=Portland, O=yaSSL, CN=www.yassl.com/emailAddress=info@yassl.com Issuer: C=US, ST=Oregon, L=Portland, O=yaSSL, CN=www.yassl.com/emailAddress=info@yassl.com
Validity Validity
Not Before: Jan 18 19:33:15 2005 GMT Not Before: Mar 7 03:00:31 2005 GMT
Not After : Oct 15 19:33:15 2007 GMT Not After : Apr 1 03:00:31 2046 GMT
Subject: C=US, ST=Oregon, L=Portland, O=yaSSL, CN=www.yassl.com/emailAddress=info@yassl.com Subject: C=US, ST=Oregon, L=Portland, O=yaSSL, CN=www.yassl.com/emailAddress=info@yassl.com
Subject Public Key Info: Subject Public Key Info:
Public Key Algorithm: rsaEncryption Public Key Algorithm: rsaEncryption
@ -29,15 +29,15 @@ Certificate:
X509v3 Basic Constraints: X509v3 Basic Constraints:
CA:TRUE CA:TRUE
Signature Algorithm: md5WithRSAEncryption Signature Algorithm: md5WithRSAEncryption
c5:82:26:0c:1f:61:01:14:b0:ce:18:99:64:91:0e:f1:f8:90: 59:19:ae:1b:4e:65:9e:ca:f1:b8:3d:ff:c7:5e:15:86:10:97:
3e:a3:0e:be:38:7c:97:ba:05:c9:2a:dc:dd:62:2d:12:61:79: 8c:3e:22:32:ab:4e:75:a7:70:83:f2:fb:2f:af:fe:26:28:e9:
7a:86:b1:97:5d:1e:e8:f7:e8:32:34:f7:8f:b1:08:3d:13:71: 4f:d4:c9:49:7c:6f:51:7e:2a:ff:a0:5b:25:45:2e:66:d9:0d:
a6:3c:15:91:85:12:35:6e:78:87 92:94:e5:b8:60:c6:67:1a:f3:03
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIICtzCCAmGgAwIBAgIBADANBgkqhkiG9w0BAQQFADB4MQswCQYDVQQGEwJVUzEP MIICtzCCAmGgAwIBAgIBADANBgkqhkiG9w0BAQQFADB4MQswCQYDVQQGEwJVUzEP
MA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFuZDEOMAwGA1UEChMFeWFT MA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFuZDEOMAwGA1UEChMFeWFT
U0wxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkqhkiG9w0BCQEWDmluZm9A U0wxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkqhkiG9w0BCQEWDmluZm9A
eWFzc2wuY29tMB4XDTA1MDExODE5MzMxNVoXDTA3MTAxNTE5MzMxNVoweDELMAkG eWFzc2wuY29tMB4XDTA1MDMwNzAzMDAzMVoXDTQ2MDQwMTAzMDAzMVoweDELMAkG
A1UEBhMCVVMxDzANBgNVBAgTBk9yZWdvbjERMA8GA1UEBxMIUG9ydGxhbmQxDjAM A1UEBhMCVVMxDzANBgNVBAgTBk9yZWdvbjERMA8GA1UEBxMIUG9ydGxhbmQxDjAM
BgNVBAoTBXlhU1NMMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0wGwYJKoZIhvcN BgNVBAoTBXlhU1NMMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0wGwYJKoZIhvcN
AQkBFg5pbmZvQHlhc3NsLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDNH3hH AQkBFg5pbmZvQHlhc3NsLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDNH3hH
@ -47,6 +47,6 @@ wP/OtbStMIGiBgNVHSMEgZowgZeAFK4lXvpNo1srh97xKvVCwP/OtbStoXykejB4
MQswCQYDVQQGEwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFu MQswCQYDVQQGEwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFu
ZDEOMAwGA1UEChMFeWFTU0wxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkq ZDEOMAwGA1UEChMFeWFTU0wxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkq
hkiG9w0BCQEWDmluZm9AeWFzc2wuY29tggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZI hkiG9w0BCQEWDmluZm9AeWFzc2wuY29tggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZI
hvcNAQEEBQADQQDFgiYMH2EBFLDOGJlkkQ7x+JA+ow6+OHyXugXJKtzdYi0SYXl6 hvcNAQEEBQADQQBZGa4bTmWeyvG4Pf/HXhWGEJeMPiIyq051p3CD8vsvr/4mKOlP
hrGXXR7o9+gyNPePsQg9E3GmPBWRhRI1bniH 1MlJfG9Rfir/oFslRS5m2Q2SlOW4YMZnGvMD
-----END CERTIFICATE----- -----END CERTIFICATE-----

View File

@ -5,8 +5,8 @@ Certificate:
Signature Algorithm: dsaWithSHA1 Signature Algorithm: dsaWithSHA1
Issuer: C=US, ST=Oregon, L=Portland, O=yaSSL DSA, CN=yaSSL DSA/emailAddress=info@yassl.com Issuer: C=US, ST=Oregon, L=Portland, O=yaSSL DSA, CN=yaSSL DSA/emailAddress=info@yassl.com
Validity Validity
Not Before: Jan 23 22:54:51 2005 GMT Not Before: Mar 7 03:22:00 2005 GMT
Not After : Oct 20 22:54:51 2007 GMT Not After : Apr 1 03:22:00 2046 GMT
Subject: C=US, ST=Oregon, L=Portland, O=yaSSL DSA, CN=yaSSL DSA/emailAddress=info@yassl.com Subject: C=US, ST=Oregon, L=Portland, O=yaSSL DSA, CN=yaSSL DSA/emailAddress=info@yassl.com
Subject Public Key Info: Subject Public Key Info:
Public Key Algorithm: dsaEncryption Public Key Algorithm: dsaEncryption
@ -43,14 +43,14 @@ Certificate:
X509v3 Basic Constraints: X509v3 Basic Constraints:
CA:TRUE CA:TRUE
Signature Algorithm: dsaWithSHA1 Signature Algorithm: dsaWithSHA1
30:2b:02:14:74:46:9f:91:7b:24:17:3b:ee:0f:10:e3:76:62: 30:2c:02:14:7e:5e:94:fc:7f:ca:81:ab:b3:32:f7:21:83:48:
f4:dc:81:e6:fd:fe:02:13:08:f4:87:0a:ab:ba:9c:de:3a:69: 48:5f:0a:f1:13:ca:02:14:73:54:32:14:51:22:bf:0b:ec:d7:
72:59:b8:ec:e9:57:f4:bf:37 6a:6a:fa:a7:1d:46:b4:c2:a3:b5
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIIDMTCCAvKgAwIBAgIBADAJBgcqhkjOOAQDMHgxCzAJBgNVBAYTAlVTMQ8wDQYD MIIDMjCCAvKgAwIBAgIBADAJBgcqhkjOOAQDMHgxCzAJBgNVBAYTAlVTMQ8wDQYD
VQQIEwZPcmVnb24xETAPBgNVBAcTCFBvcnRsYW5kMRIwEAYDVQQKEwl5YVNTTCBE VQQIEwZPcmVnb24xETAPBgNVBAcTCFBvcnRsYW5kMRIwEAYDVQQKEwl5YVNTTCBE
U0ExEjAQBgNVBAMTCXlhU1NMIERTQTEdMBsGCSqGSIb3DQEJARYOaW5mb0B5YXNz U0ExEjAQBgNVBAMTCXlhU1NMIERTQTEdMBsGCSqGSIb3DQEJARYOaW5mb0B5YXNz
bC5jb20wHhcNMDUwMTIzMjI1NDUxWhcNMDcxMDIwMjI1NDUxWjB4MQswCQYDVQQG bC5jb20wHhcNMDUwMzA3MDMyMjAwWhcNNDYwNDAxMDMyMjAwWjB4MQswCQYDVQQG
EwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFuZDESMBAGA1UE EwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFuZDESMBAGA1UE
ChMJeWFTU0wgRFNBMRIwEAYDVQQDEwl5YVNTTCBEU0ExHTAbBgkqhkiG9w0BCQEW ChMJeWFTU0wgRFNBMRIwEAYDVQQDEwl5YVNTTCBEU0ExHTAbBgkqhkiG9w0BCQEW
DmluZm9AeWFzc2wuY29tMIHwMIGoBgcqhkjOOAQBMIGcAkEAmSlpgMk8mGhFqYL+ DmluZm9AeWFzc2wuY29tMIHwMIGoBgcqhkjOOAQBMIGcAkEAmSlpgMk8mGhFqYL+
@ -63,6 +63,6 @@ IeRhRHPp4jCBogYDVR0jBIGaMIGXgBS++Yxd1hy07oHdNlYKIeRhRHPp4qF8pHow
eDELMAkGA1UEBhMCVVMxDzANBgNVBAgTBk9yZWdvbjERMA8GA1UEBxMIUG9ydGxh eDELMAkGA1UEBhMCVVMxDzANBgNVBAgTBk9yZWdvbjERMA8GA1UEBxMIUG9ydGxh
bmQxEjAQBgNVBAoTCXlhU1NMIERTQTESMBAGA1UEAxMJeWFTU0wgRFNBMR0wGwYJ bmQxEjAQBgNVBAoTCXlhU1NMIERTQTESMBAGA1UEAxMJeWFTU0wgRFNBMR0wGwYJ
KoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbYIBADAMBgNVHRMEBTADAQH/MAkGByqG KoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbYIBADAMBgNVHRMEBTADAQH/MAkGByqG
SM44BAMDLgAwKwIUdEafkXskFzvuDxDjdmL03IHm/f4CEwj0hwqrupzeOmlyWbjs SM44BAMDLwAwLAIUfl6U/H/KgauzMvchg0hIXwrxE8oCFHNUMhRRIr8L7Ndqavqn
6Vf0vzc= HUa0wqO1
-----END CERTIFICATE----- -----END CERTIFICATE-----

View File

@ -5,8 +5,8 @@ Certificate:
Signature Algorithm: md5WithRSAEncryption Signature Algorithm: md5WithRSAEncryption
Issuer: C=US, ST=Oregon, L=Portland, O=sawtooth, CN=www.sawtooth-consulting.com/emailAddress=info@yassl.com Issuer: C=US, ST=Oregon, L=Portland, O=sawtooth, CN=www.sawtooth-consulting.com/emailAddress=info@yassl.com
Validity Validity
Not Before: Jan 18 20:50:59 2005 GMT Not Before: Mar 8 03:00:47 2005 GMT
Not After : Oct 15 20:50:59 2007 GMT Not After : Apr 2 03:00:47 2046 GMT
Subject: C=US, ST=Oregon, L=Portland, O=taoSoftDev, CN=www.taosoftdev.com/emailAddress=info@yassl.com Subject: C=US, ST=Oregon, L=Portland, O=taoSoftDev, CN=www.taosoftdev.com/emailAddress=info@yassl.com
Subject Public Key Info: Subject Public Key Info:
Public Key Algorithm: rsaEncryption Public Key Algorithm: rsaEncryption
@ -19,20 +19,20 @@ Certificate:
f2:25:93:22:e7 f2:25:93:22:e7
Exponent: 65537 (0x10001) Exponent: 65537 (0x10001)
Signature Algorithm: md5WithRSAEncryption Signature Algorithm: md5WithRSAEncryption
08:36:07:8c:3a:7f:f9:91:0a:82:d1:6a:c1:34:be:bc:2d:b2: 36:72:12:3b:ac:e4:58:83:09:86:4f:71:2a:3a:0d:8a:05:27:
20:98:dc:45:50:53:9c:66:e6:26:71:bd:fa:d2:b4:91:d3:53: 75:f3:3e:62:4f:ab:b8:70:20:cd:ad:70:ab:91:11:68:f8:82:
c0:20:05:c0:b6:84:9a:5f:3f:61:75:f5:fd:c6:ec:e2:f6:9f: 33:e2:78:85:a8:16:f5:66:bd:68:2c:5a:26:15:12:1e:6e:83:
a2:13:17:a9:b7:83:60:cc:cb:eb c7:6d:62:b9:c3:ff:e1:86:e4:e6
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIIB9zCCAaECAQEwDQYJKoZIhvcNAQEEBQAwgYkxCzAJBgNVBAYTAlVTMQ8wDQYD MIIB9zCCAaECAQEwDQYJKoZIhvcNAQEEBQAwgYkxCzAJBgNVBAYTAlVTMQ8wDQYD
VQQIEwZPcmVnb24xETAPBgNVBAcTCFBvcnRsYW5kMREwDwYDVQQKEwhzYXd0b290 VQQIEwZPcmVnb24xETAPBgNVBAcTCFBvcnRsYW5kMREwDwYDVQQKEwhzYXd0b290
aDEkMCIGA1UEAxMbd3d3LnNhd3Rvb3RoLWNvbnN1bHRpbmcuY29tMR0wGwYJKoZI aDEkMCIGA1UEAxMbd3d3LnNhd3Rvb3RoLWNvbnN1bHRpbmcuY29tMR0wGwYJKoZI
hvcNAQkBFg5pbmZvQHlhc3NsLmNvbTAeFw0wNTAxMTgyMDUwNTlaFw0wNzEwMTUy hvcNAQkBFg5pbmZvQHlhc3NsLmNvbTAeFw0wNTAzMDgwMzAwNDdaFw00NjA0MDIw
MDUwNTlaMIGCMQswCQYDVQQGEwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQH MzAwNDdaMIGCMQswCQYDVQQGEwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQH
EwhQb3J0bGFuZDETMBEGA1UEChMKdGFvU29mdERldjEbMBkGA1UEAxMSd3d3LnRh EwhQb3J0bGFuZDETMBEGA1UEChMKdGFvU29mdERldjEbMBkGA1UEAxMSd3d3LnRh
b3NvZnRkZXYuY29tMR0wGwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTBcMA0G b3NvZnRkZXYuY29tMR0wGwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTBcMA0G
CSqGSIb3DQEBAQUAA0sAMEgCQQCkaLu8tydfPPV4xhqvuZX8fmEfqIEKykOImgPg CSqGSIb3DQEBAQUAA0sAMEgCQQCkaLu8tydfPPV4xhqvuZX8fmEfqIEKykOImgPg
0KZ5cBY0uXx1VMpwGWY4vm4ofqX/azyDLzlCwxXzvfIlkyLnAgMBAAEwDQYJKoZI 0KZ5cBY0uXx1VMpwGWY4vm4ofqX/azyDLzlCwxXzvfIlkyLnAgMBAAEwDQYJKoZI
hvcNAQEEBQADQQAINgeMOn/5kQqC0WrBNL68LbIgmNxFUFOcZuYmcb360rSR01PA hvcNAQEEBQADQQA2chI7rORYgwmGT3EqOg2KBSd18z5iT6u4cCDNrXCrkRFo+IIz
IAXAtoSaXz9hdfX9xuzi9p+iExept4NgzMvr 4niFqBb1Zr1oLFomFRIeboPHbWK5w//hhuTm
-----END CERTIFICATE----- -----END CERTIFICATE-----

View File

@ -23,13 +23,21 @@
#ifndef yaSSL_LOCK_HPP #ifndef yaSSL_LOCK_HPP
#define yaSSL_LOCK_HPP #define yaSSL_LOCK_HPP
/*
Visual Studio Source Annotations header (sourceannotations.h) fails
to compile if outside of the global namespace.
*/
#ifdef YASSL_THREAD_SAFE
#ifdef _WIN32
#include <windows.h>
#endif
#endif
namespace yaSSL { namespace yaSSL {
#ifdef MULTI_THREADED #ifdef YASSL_THREAD_SAFE
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h>
class Mutex { class Mutex {
CRITICAL_SECTION cs_; CRITICAL_SECTION cs_;
@ -69,7 +77,7 @@ namespace yaSSL {
}; };
#endif // _WIN32 #endif // _WIN32
#else // MULTI_THREADED (WE'RE SINGLE) #else // YASSL_THREAD_SAFE (WE'RE SINGLE)
class Mutex { class Mutex {
public: public:
@ -79,7 +87,7 @@ namespace yaSSL {
}; };
}; };
#endif // MULTI_THREADED #endif // YASSL_THREAD_SAFE

View File

@ -5,4 +5,4 @@ libyassl_la_SOURCES = buffer.cpp cert_wrapper.cpp crypto_wrapper.cpp \
handshake.cpp lock.cpp log.cpp socket_wrapper.cpp ssl.cpp \ handshake.cpp lock.cpp log.cpp socket_wrapper.cpp ssl.cpp \
template_instnt.cpp timer.cpp yassl_imp.cpp yassl_error.cpp yassl_int.cpp template_instnt.cpp timer.cpp yassl_imp.cpp yassl_error.cpp yassl_int.cpp
EXTRA_DIST = $(wildcard ../include/*.hpp) $(wildcard ../include/openssl/*.h) EXTRA_DIST = $(wildcard ../include/*.hpp) $(wildcard ../include/openssl/*.h)
AM_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX AM_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX @yassl_thread_cxxflags@

View File

@ -26,7 +26,7 @@
namespace yaSSL { namespace yaSSL {
#ifdef MULTI_THREADED #ifdef YASSL_THREAD_SAFE
#ifdef _WIN32 #ifdef _WIN32
Mutex::Mutex() Mutex::Mutex()
@ -79,7 +79,7 @@ namespace yaSSL {
#endif // _WIN32 #endif // _WIN32
#endif // MULTI_THREADED #endif // YASSL_THREAD_SAFE

View File

@ -2,5 +2,5 @@ INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../mySTL
noinst_PROGRAMS = benchmark noinst_PROGRAMS = benchmark
benchmark_SOURCES = benchmark.cpp benchmark_SOURCES = benchmark.cpp
benchmark_LDADD = $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la benchmark_LDADD = $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la
benchmark_CXXFLAGS = -DYASSL_PURE_C benchmark_CXXFLAGS = -DYASSL_PURE_C @yassl_thread_cxxflags@
EXTRA_DIST = benchmark.dsp rsa1024.der dh1024.der dsa1024.der make.bat EXTRA_DIST = benchmark.dsp rsa1024.der dh1024.der dsa1024.der make.bat

View File

@ -60,7 +60,7 @@ static int __cxa_pure_virtual() __attribute__((noinline, used));
static int __cxa_pure_virtual() static int __cxa_pure_virtual()
{ {
// oops, pure virtual called! // oops, pure virtual called!
assert("Pure virtual method called." == "Aborted"); assert(!"Pure virtual method called. Aborted");
return 0; return 0;
} }

View File

@ -8,6 +8,7 @@ libtaocrypt_la_SOURCES = aes.cpp aestables.cpp algebra.cpp arc4.cpp \
random.cpp ripemd.cpp rsa.cpp sha.cpp template_instnt.cpp \ random.cpp ripemd.cpp rsa.cpp sha.cpp template_instnt.cpp \
tftables.cpp twofish.cpp tftables.cpp twofish.cpp
libtaocrypt_la_CXXFLAGS = @yassl_taocrypt_extra_cxxflags@ -DYASSL_PURE_C libtaocrypt_la_CXXFLAGS = @yassl_taocrypt_extra_cxxflags@ -DYASSL_PURE_C \
@yassl_thread_cxxflags@
EXTRA_DIST = $(wildcard ../include/*.hpp) EXTRA_DIST = $(wildcard ../include/*.hpp)

View File

@ -2,5 +2,5 @@ INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../mySTL
noinst_PROGRAMS = test noinst_PROGRAMS = test
test_SOURCES = test.cpp test_SOURCES = test.cpp
test_LDADD = $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la test_LDADD = $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la
test_CXXFLAGS = -DYASSL_PURE_C test_CXXFLAGS = -DYASSL_PURE_C @yassl_thread_cxxflags@
EXTRA_DIST = make.bat EXTRA_DIST = make.bat

View File

@ -13,7 +13,7 @@
To use MemoryTracker merely add this file to your project To use MemoryTracker merely add this file to your project
No need to instantiate anything No need to instantiate anything
If your app is multi threaded define MULTI_THREADED If your app is multi threaded define YASSL_THREAD_SAFE
*********************************************************************/ *********************************************************************/

View File

@ -4,7 +4,7 @@ testsuite_SOURCES = testsuite.cpp ../taocrypt/test/test.cpp \
../examples/client/client.cpp ../examples/server/server.cpp \ ../examples/client/client.cpp ../examples/server/server.cpp \
../examples/echoclient/echoclient.cpp \ ../examples/echoclient/echoclient.cpp \
../examples/echoserver/echoserver.cpp ../examples/echoserver/echoserver.cpp
testsuite_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX -DNO_MAIN_DRIVER testsuite_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX -DNO_MAIN_DRIVER @yassl_thread_cxxflags@
testsuite_LDADD = $(top_builddir)/extra/yassl/src/libyassl.la \ testsuite_LDADD = $(top_builddir)/extra/yassl/src/libyassl.la \
$(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la
EXTRA_DIST = testsuite.dsp test.hpp input quit make.bat EXTRA_DIST = testsuite.dsp test.hpp input quit make.bat

View File

@ -127,9 +127,6 @@ extern size_t bcmp(const uchar *s1,const uchar *s2,size_t len);
extern size_t my_bcmp(const uchar *s1,const uchar *s2,size_t len); extern size_t my_bcmp(const uchar *s1,const uchar *s2,size_t len);
#undef bcmp #undef bcmp
#define bcmp(A,B,C) my_bcmp((A),(B),(C)) #define bcmp(A,B,C) my_bcmp((A),(B),(C))
#define bzero_if_purify(A,B) bzero(A,B)
#else
#define bzero_if_purify(A,B)
#endif /* HAVE_purify */ #endif /* HAVE_purify */
#ifndef bmove512 #ifndef bmove512

View File

@ -23,6 +23,10 @@
#define ALLOC_MAX_BLOCK_TO_DROP 4096 #define ALLOC_MAX_BLOCK_TO_DROP 4096
#define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP 10 #define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP 10
#ifdef __cplusplus
extern "C" {
#endif
typedef struct st_used_mem typedef struct st_used_mem
{ /* struct for once_alloc (block) */ { /* struct for once_alloc (block) */
struct st_used_mem *next; /* Next block in use */ struct st_used_mem *next; /* Next block in use */
@ -48,4 +52,9 @@ typedef struct st_mem_root
void (*error_handler)(void); void (*error_handler)(void);
} MEM_ROOT; } MEM_ROOT;
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -562,6 +562,8 @@ typedef ulong ha_rows;
#define HA_VARCHAR_PACKLENGTH(field_length) ((field_length) < 256 ? 1 :2) #define HA_VARCHAR_PACKLENGTH(field_length) ((field_length) < 256 ? 1 :2)
/* invalidator function reference for Query Cache */ /* invalidator function reference for Query Cache */
C_MODE_START
typedef void (* invalidator_by_filename)(const char * filename); typedef void (* invalidator_by_filename)(const char * filename);
C_MODE_END
#endif /* _my_base_h */ #endif /* _my_base_h */

View File

@ -64,8 +64,8 @@ struct my_option
if it's NULL the option is not if it's NULL the option is not
visible in --help. visible in --help.
*/ */
uchar **value; /**< A pointer to the variable value */ void *value; /**< A pointer to the variable value */
uchar **u_max_value; /**< The user def. max variable value */ void *u_max_value; /**< The user def. max variable value */
struct st_typelib *typelib; /**< Pointer to possible values */ struct st_typelib *typelib; /**< Pointer to possible values */
ulong var_type; /**< GET_BOOL, GET_ULL, etc */ ulong var_type; /**< GET_BOOL, GET_ULL, etc */
enum get_opt_arg_type arg_type; /**< e.g. REQUIRED_ARG or OPT_ARG */ enum get_opt_arg_type arg_type; /**< e.g. REQUIRED_ARG or OPT_ARG */
@ -77,8 +77,18 @@ struct my_option
void *app_type; /**< To be used by an application */ void *app_type; /**< To be used by an application */
}; };
typedef my_bool (*my_get_one_option) (int, const struct my_option *, char * );
typedef void (*my_error_reporter) (enum loglevel level, const char *format, ... ); typedef my_bool (*my_get_one_option)(int, const struct my_option *, char *);
typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...);
/**
Used to retrieve a reference to the object (variable) that holds the value
for the given option. For example, if var_type is GET_UINT, the function
must return a pointer to a variable of type uint. A argument is stored in
the location pointed to by the returned pointer.
*/
typedef void *(*my_getopt_value)(const char *, uint, const struct my_option *,
int *);
extern char *disabled_my_option; extern char *disabled_my_option;
extern my_bool my_getopt_print_errors; extern my_bool my_getopt_print_errors;
@ -90,8 +100,7 @@ extern int handle_options (int *argc, char ***argv,
extern void my_cleanup_options(const struct my_option *options); extern void my_cleanup_options(const struct my_option *options);
extern void my_print_help(const struct my_option *options); extern void my_print_help(const struct my_option *options);
extern void my_print_variables(const struct my_option *options); extern void my_print_variables(const struct my_option *options);
extern void my_getopt_register_get_addr(uchar ** (*func_addr)(const char *, uint, extern void my_getopt_register_get_addr(my_getopt_value);
const struct my_option *, int *));
ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp, ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
my_bool *fix); my_bool *fix);

View File

@ -60,6 +60,10 @@
#define USE_PRAGMA_INTERFACE #define USE_PRAGMA_INTERFACE
#endif #endif
#if defined(__OpenBSD__) && (OpenBSD >= 200411)
#define HAVE_ERRNO_AS_DEFINE
#endif
#if defined(i386) && !defined(__i386__) #if defined(i386) && !defined(__i386__)
#define __i386__ #define __i386__
#endif #endif
@ -73,6 +77,11 @@
#define C_MODE_END #define C_MODE_END
#endif #endif
#ifdef __cplusplus
#define CPP_UNNAMED_NS_START namespace {
#define CPP_UNNAMED_NS_END }
#endif
#if defined(_WIN32) #if defined(_WIN32)
#include <my_config.h> #include <my_config.h>
#elif defined(__NETWARE__) #elif defined(__NETWARE__)
@ -1070,6 +1079,17 @@ typedef long long my_ptrdiff_t;
#define MY_DIV_UP(A, B) (((A) + (B) - 1) / (B)) #define MY_DIV_UP(A, B) (((A) + (B) - 1) / (B))
#define MY_ALIGNED_BYTE_ARRAY(N, S, T) T N[MY_DIV_UP(S, sizeof(T))] #define MY_ALIGNED_BYTE_ARRAY(N, S, T) T N[MY_DIV_UP(S, sizeof(T))]
#ifdef __cplusplus
template <size_t sz> struct Aligned_char_array
{
union {
void *v; // Ensures alignment.
char arr[sz]; // The actual buffer.
} u;
void* arr() { return &u.arr[0]; }
};
#endif /* __cplusplus */
/* /*
Custom version of standard offsetof() macro which can be used to get Custom version of standard offsetof() macro which can be used to get
offsets of members in class for non-POD types (according to the current offsets of members in class for non-POD types (according to the current

View File

@ -712,7 +712,6 @@ extern my_bool my_thread_init(void);
extern void my_thread_end(void); extern void my_thread_end(void);
extern const char *my_thread_name(void); extern const char *my_thread_name(void);
extern my_thread_id my_thread_dbug_id(void); extern my_thread_id my_thread_dbug_id(void);
extern int pthread_no_free(void *);
extern int pthread_dummy(int); extern int pthread_dummy(int);
/* All thread specific variables are in the following struct */ /* All thread specific variables are in the following struct */

View File

@ -28,6 +28,19 @@ typedef struct my_aio_result {
} my_aio_result; } my_aio_result;
#endif #endif
#ifdef HAVE_VALGRIND
# include <valgrind/memcheck.h>
# define MEM_UNDEFINED(a,len) VALGRIND_MAKE_MEM_UNDEFINED(a,len)
# define MEM_NOACCESS(a,len) VALGRIND_MAKE_MEM_NOACCESS(a,len)
# define MEM_CHECK_ADDRESSABLE(a,len) VALGRIND_CHECK_MEM_IS_ADDRESSABLE(a,len)
# define MEM_CHECK_DEFINED(a,len) VALGRIND_CHECK_MEM_IS_DEFINED(a,len)
#else /* HAVE_VALGRIND */
# define MEM_UNDEFINED(a,len) ((void) 0)
# define MEM_NOACCESS(a,len) ((void) 0)
# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
# define MEM_CHECK_DEFINED(a,len) ((void) 0)
#endif /* HAVE_VALGRIND */
#ifndef THREAD #ifndef THREAD
extern int NEAR my_errno; /* Last error in mysys */ extern int NEAR my_errno; /* Last error in mysys */
#else #else
@ -41,9 +54,7 @@ extern int NEAR my_errno; /* Last error in mysys */
#include <malloc.h> /*for alloca*/ #include <malloc.h> /*for alloca*/
#endif #endif
#define MYSYS_PROGRAM_USES_CURSES() { error_handler_hook = my_message_curses; mysys_uses_curses=1; } #define MY_INIT(name) { my_progname= name; my_init(); }
#define MYSYS_PROGRAM_DONT_USE_CURSES() { error_handler_hook = my_message_no_curses; mysys_uses_curses=0;}
#define MY_INIT(name); { my_progname= name; my_init(); }
/** /**
Max length of an error message generated by mysys utilities. Max length of an error message generated by mysys utilities.
@ -156,7 +167,7 @@ extern int NEAR my_errno; /* Last error in mysys */
#define my_memdup(A,B,C) _my_memdup((A),(B), __FILE__,__LINE__,C) #define my_memdup(A,B,C) _my_memdup((A),(B), __FILE__,__LINE__,C)
#define my_strdup(A,C) _my_strdup((A), __FILE__,__LINE__,C) #define my_strdup(A,C) _my_strdup((A), __FILE__,__LINE__,C)
#define my_strndup(A,B,C) _my_strndup((A),(B),__FILE__,__LINE__,C) #define my_strndup(A,B,C) _my_strndup((A),(B),__FILE__,__LINE__,C)
#define TRASH(A,B) bfill(A, B, 0x8F) #define TRASH(A,B) do { bfill(A, B, 0x8F); MEM_UNDEFINED(A, B); } while (0)
#define QUICK_SAFEMALLOC sf_malloc_quick=1 #define QUICK_SAFEMALLOC sf_malloc_quick=1
#define NORMAL_SAFEMALLOC sf_malloc_quick=0 #define NORMAL_SAFEMALLOC sf_malloc_quick=0
extern uint sf_malloc_prehunc,sf_malloc_endhunc,sf_malloc_quick; extern uint sf_malloc_prehunc,sf_malloc_endhunc,sf_malloc_quick;
@ -184,7 +195,7 @@ extern char *my_strndup(const char *from, size_t length,
#define CALLER_INFO_PROTO /* nothing */ #define CALLER_INFO_PROTO /* nothing */
#define CALLER_INFO /* nothing */ #define CALLER_INFO /* nothing */
#define ORIG_CALLER_INFO /* nothing */ #define ORIG_CALLER_INFO /* nothing */
#define TRASH(A,B) /* nothing */ #define TRASH(A,B) do{MEM_CHECK_ADDRESSABLE(A,B);MEM_UNDEFINED(A,B);} while (0)
#endif #endif
#if defined(ENABLED_DEBUG_SYNC) #if defined(ENABLED_DEBUG_SYNC)
@ -272,7 +283,7 @@ extern int NEAR my_umask_dir,
NEAR my_recived_signals, /* Signals we have got */ NEAR my_recived_signals, /* Signals we have got */
NEAR my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */ NEAR my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */
NEAR my_dont_interrupt; /* call remember_intr when set */ NEAR my_dont_interrupt; /* call remember_intr when set */
extern my_bool NEAR mysys_uses_curses, my_use_symdir; extern my_bool NEAR my_use_symdir;
extern size_t sf_malloc_cur_memory, sf_malloc_max_memory; extern size_t sf_malloc_cur_memory, sf_malloc_max_memory;
extern ulong my_default_record_cache_size; extern ulong my_default_record_cache_size;
@ -669,7 +680,6 @@ extern int nt_share_delete(const char *name,myf MyFlags);
#ifdef _WIN32 #ifdef _WIN32
/* Windows-only functions (CRT equivalents)*/ /* Windows-only functions (CRT equivalents)*/
extern File my_sopen(const char *path, int oflag, int shflag, int pmode);
extern HANDLE my_get_osfhandle(File fd); extern HANDLE my_get_osfhandle(File fd);
extern void my_osmaperr(unsigned long last_error); extern void my_osmaperr(unsigned long last_error);
#endif #endif
@ -698,8 +708,7 @@ extern int my_error_register(const char** (*get_errmsgs) (),
int first, int last); int first, int last);
extern const char **my_error_unregister(int first, int last); extern const char **my_error_unregister(int first, int last);
extern void my_message(uint my_err, const char *str,myf MyFlags); extern void my_message(uint my_err, const char *str,myf MyFlags);
extern void my_message_no_curses(uint my_err, const char *str,myf MyFlags); extern void my_message_stderr(uint my_err, const char *str, myf MyFlags);
extern void my_message_curses(uint my_err, const char *str,myf MyFlags);
extern my_bool my_basic_init(void); extern my_bool my_basic_init(void);
extern my_bool my_init(void); extern my_bool my_init(void);
extern void my_end(int infoflag); extern void my_end(int infoflag);

View File

@ -197,7 +197,14 @@ enum enum_server_command
& ~CLIENT_COMPRESS) \ & ~CLIENT_COMPRESS) \
& ~CLIENT_SSL_VERIFY_SERVER_CERT) & ~CLIENT_SSL_VERIFY_SERVER_CERT)
#define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */ /**
Is raised when a multi-statement transaction
has been started, either explicitly, by means
of BEGIN or COMMIT AND CHAIN, or
implicitly, by the first transactional
statement, when autocommit=off.
*/
#define SERVER_STATUS_IN_TRANS 1
#define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */ #define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */
#define SERVER_MORE_RESULTS_EXISTS 8 /* Multi query - next query exists */ #define SERVER_MORE_RESULTS_EXISTS 8 /* Multi query - next query exists */
#define SERVER_QUERY_NO_GOOD_INDEX_USED 16 #define SERVER_QUERY_NO_GOOD_INDEX_USED 16

View File

@ -20,30 +20,30 @@
{"ssl", OPT_SSL_SSL, {"ssl", OPT_SSL_SSL,
"Enable SSL for connection (automatically enabled with other flags).", "Enable SSL for connection (automatically enabled with other flags).",
(uchar **) &opt_use_ssl, (uchar **) &opt_use_ssl, 0, GET_BOOL, OPT_ARG, 0, 0, 0, &opt_use_ssl, &opt_use_ssl, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
0, 0, 0},
{"ssl-ca", OPT_SSL_CA, {"ssl-ca", OPT_SSL_CA,
"CA file in PEM format (check OpenSSL docs, implies --ssl).", "CA file in PEM format (check OpenSSL docs, implies --ssl).",
(uchar **) &opt_ssl_ca, (uchar **) &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG, &opt_ssl_ca, &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"ssl-capath", OPT_SSL_CAPATH, {"ssl-capath", OPT_SSL_CAPATH,
"CA directory (check OpenSSL docs, implies --ssl).", "CA directory (check OpenSSL docs, implies --ssl).",
(uchar **) &opt_ssl_capath, (uchar **) &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG, &opt_ssl_capath, &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"ssl-cert", OPT_SSL_CERT, "X509 cert in PEM format (implies --ssl).", {"ssl-cert", OPT_SSL_CERT, "X509 cert in PEM format (implies --ssl).",
(uchar **) &opt_ssl_cert, (uchar **) &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG, &opt_ssl_cert, &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"ssl-cipher", OPT_SSL_CIPHER, "SSL cipher to use (implies --ssl).", {"ssl-cipher", OPT_SSL_CIPHER, "SSL cipher to use (implies --ssl).",
(uchar **) &opt_ssl_cipher, (uchar **) &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG, &opt_ssl_cipher, &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl).", {"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl).",
(uchar **) &opt_ssl_key, (uchar **) &opt_ssl_key, 0, GET_STR, REQUIRED_ARG, &opt_ssl_key, &opt_ssl_key, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
#ifdef MYSQL_CLIENT #ifdef MYSQL_CLIENT
{"ssl-verify-server-cert", OPT_SSL_VERIFY_SERVER_CERT, {"ssl-verify-server-cert", OPT_SSL_VERIFY_SERVER_CERT,
"Verify server's \"Common Name\" in its cert against hostname used when connecting. This option is disabled by default.", "Verify server's \"Common Name\" in its cert against hostname used "
(uchar **) &opt_ssl_verify_server_cert, (uchar **) &opt_ssl_verify_server_cert, "when connecting. This option is disabled by default.",
0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, &opt_ssl_verify_server_cert, &opt_ssl_verify_server_cert,
0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
#endif /* HAVE_OPENSSL */ #endif /* HAVE_OPENSSL */
#endif /* SSLOPT_LONGOPTS_INCLUDED */ #endif /* SSLOPT_LONGOPTS_INCLUDED */

View File

@ -56,7 +56,7 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \
my_create.lo my_delete.lo mf_tempfile.lo my_open.lo \ my_create.lo my_delete.lo mf_tempfile.lo my_open.lo \
my_file.lo my_read.lo my_write.lo errors.lo \ my_file.lo my_read.lo my_write.lo errors.lo \
my_error.lo my_getwd.lo my_div.lo \ my_error.lo my_getwd.lo my_div.lo \
mf_pack.lo my_messnc.lo mf_dirname.lo mf_fn_ext.lo\ mf_pack.lo my_mess.lo mf_dirname.lo mf_fn_ext.lo\
mf_wcomp.lo typelib.lo safemalloc.lo my_alloc.lo \ mf_wcomp.lo typelib.lo safemalloc.lo my_alloc.lo \
mf_format.lo mf_path.lo mf_unixpath.lo my_fopen.lo \ mf_format.lo mf_path.lo mf_unixpath.lo my_fopen.lo \
my_symlink.lo my_fstream.lo mf_arr_appstr.lo \ my_symlink.lo my_fstream.lo mf_arr_appstr.lo \

View File

@ -953,7 +953,8 @@ bool Protocol::send_result_set_metadata(List<Item> *list, uint flags)
server_field.type <= (int) MYSQL_TYPE_BLOB) ? server_field.type <= (int) MYSQL_TYPE_BLOB) ?
server_field.length / item->collation.collation->mbminlen : server_field.length / item->collation.collation->mbminlen :
server_field.length / item->collation.collation->mbmaxlen; server_field.length / item->collation.collation->mbmaxlen;
client_field->length= max_char_len * thd_cs->mbmaxlen; client_field->length= char_to_byte_length_safe(max_char_len,
thd_cs->mbmaxlen);
} }
client_field->type= server_field.type; client_field->type= server_field.type;
client_field->flags= server_field.flags; client_field->flags= server_field.flags;

View File

@ -9,7 +9,6 @@ funcs_1.myisam_views @solaris # Bug#50595 2010-03-05 alik funcs_1.myi
innodb.innodb_information_schema # Bug#48883 2010-05-11 alik Test "innodb_information_schema" takes fewer locks than expected innodb.innodb_information_schema # Bug#48883 2010-05-11 alik Test "innodb_information_schema" takes fewer locks than expected
main.func_math @freebsd # Bug#43020 2010-05-04 alik main.func_math fails on FreeBSD in PB2 main.func_math @freebsd # Bug#43020 2010-05-04 alik main.func_math fails on FreeBSD in PB2
main.gis @solaris # Bug#52208 2010-04-26 alik gis fails on some platforms (Solaris, HP-UX, Linux)
main.gis-rtree @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server main.gis-rtree @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server
main.information_schema # Bug#47449 2009-09-19 alik main.information_schema and innodb.innodb_information_schema fail sporadically main.information_schema # Bug#47449 2009-09-19 alik main.information_schema and innodb.innodb_information_schema fail sporadically
main.lock_multi_bug38499 # Bug#47448 2009-09-19 alik main.lock_multi_bug38499 times out sporadically main.lock_multi_bug38499 # Bug#47448 2009-09-19 alik main.lock_multi_bug38499 times out sporadically
@ -25,6 +24,8 @@ main.sp @solaris # Bug#47791 2010-01-20 alik Several tes
main.type_float @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server main.type_float @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server
main.wait_timeout @solaris # Bug#51244 2010-04-26 alik wait_timeout fails on OpenSolaris main.wait_timeout @solaris # Bug#51244 2010-04-26 alik wait_timeout fails on OpenSolaris
perfschema.pfs_upgrade # Bug#53102 2010-06-15 alik perfschema.pfs_upgrade fails on sol10 sparc64 max in parallel mode
rpl.rpl_heartbeat_basic # BUG#43828 2009-10-22 luis fails sporadically rpl.rpl_heartbeat_basic # BUG#43828 2009-10-22 luis fails sporadically
rpl.rpl_heartbeat_2slaves # BUG#43828 2009-10-22 luis fails sporadically rpl.rpl_heartbeat_2slaves # BUG#43828 2009-10-22 luis fails sporadically
rpl.rpl_innodb_bug28430* # Bug#46029 rpl.rpl_innodb_bug28430* # Bug#46029
@ -34,7 +35,7 @@ rpl.rpl_plugin_load* @solaris # Bug#47146
rpl.rpl_row_sp011* @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun rpl.rpl_row_sp011* @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
sys_vars.max_sp_recursion_depth_func @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun sys_vars.max_sp_recursion_depth_func @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
sys_vars.wait_timeout_func @solaris # Bug#41255 2010-04-26 alik wait_timeout_func fails sys_vars.wait_timeout_func # Bug#41255 2010-04-26 alik wait_timeout_func fails
# Declare all NDB-tests in ndb and rpl_ndb test suites experimental. # Declare all NDB-tests in ndb and rpl_ndb test suites experimental.
# Usually the test cases from ndb and rpl_ndb test suites are not run in PB, # Usually the test cases from ndb and rpl_ndb test suites are not run in PB,
@ -91,3 +92,5 @@ parts.partition_mgm_lc1_ndb # joro : NDB tests marked as experiment
parts.partition_mgm_lc2_ndb # joro : NDB tests marked as experimental as agreed with bochklin parts.partition_mgm_lc2_ndb # joro : NDB tests marked as experimental as agreed with bochklin
parts.partition_syntax_ndb # joro : NDB tests marked as experimental as agreed with bochklin parts.partition_syntax_ndb # joro : NDB tests marked as experimental as agreed with bochklin
parts.partition_value_ndb # joro : NDB tests marked as experimental as agreed with bochklin parts.partition_value_ndb # joro : NDB tests marked as experimental as agreed with bochklin
main.mysqlhotcopy_myisam # horst: due to bug#54129
main.mysqlhotcopy_archive # horst: due to bug#54129

View File

@ -41,13 +41,10 @@ while ($1)
--enable_query_log --enable_query_log
commit; commit;
drop table t1; drop table t1;
--replace_column 2 # 5 # --source include/show_binlog_events.inc
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
show binlog events in 'master-bin.000001' from 107; --source include/show_binlog_events.inc
--replace_column 2 # 5 # --let $binlog_file=
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events in 'master-bin.000002' from 107;
# #
# Bug#22540 - Incorrect value in column End_log_pos of # Bug#22540 - Incorrect value in column End_log_pos of
@ -77,8 +74,7 @@ insert into t1 values (2);
insert into t1 values (3); insert into t1 values (3);
commit; commit;
drop table t1; drop table t1;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ --source include/show_binlog_events.inc
show binlog events from 0;
# now show that nothing breaks if we need to read from the cache more # now show that nothing breaks if we need to read from the cache more
# than once, resulting in split event-headers # than once, resulting in split event-headers
@ -100,8 +96,7 @@ while ($1)
commit; commit;
enable_query_log; enable_query_log;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ --source include/show_binlog_events.inc
show binlog events from 0;
drop table t1; drop table t1;
@ -122,8 +117,7 @@ set @b= 14632475938453979136;
execute stmt using @a, @b; execute stmt using @a, @b;
deallocate prepare stmt; deallocate prepare stmt;
drop table t1; drop table t1;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ --source include/show_binlog_events.inc
show binlog events from 0;
# #

View File

@ -127,12 +127,7 @@ select * from t1;
select * from t2; select * from t2;
select * from t3; select * from t3;
let $VERSION=`select version()`; --source include/show_binlog_events.inc
--replace_result $VERSION VERSION
--replace_column 2 # 4 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
--replace_regex /file_id=[0-9]+/file_id=#/
show binlog events;
drop table t1,t2,t3; drop table t1,t2,t3;
@ -170,18 +165,21 @@ set autocommit=0;
start transaction; start transaction;
insert into t1 values(1); insert into t1 values(1);
commit; commit;
let $master_log_pos_1= query_get_value(SHOW MASTER STATUS, Position, 1);
start transaction; start transaction;
insert into t1 values(2); insert into t1 values(2);
rollback; rollback;
let $master_log_pos_2= query_get_value(SHOW MASTER STATUS, Position, 1);
if (`SELECT $master_log_pos_2 <> $master_log_pos_1`)
{
echo $master_log_pos_1 $master_log_pos_2;
die Rollbacked transaction has been binlogged;
}
set autocommit=1; set autocommit=1;
let $VERSION=`select version()`;
--replace_result $VERSION VERSION
--replace_column 2 # 4 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
--replace_regex /file_id=[0-9]+/file_id=#/
show binlog events;
drop table if exists t1; drop table if exists t1;
# #

View File

@ -61,7 +61,7 @@ sync_with_master;
SELECT * FROM t1; SELECT * FROM t1;
SELECT * FROM t3; SELECT * FROM t3;
# Check that no error is reported # Check that no error is reported
--source include/show_slave_status2.inc source include/check_slave_is_running.inc;
--echo --echo
# 2) Test lock wait timeout # 2) Test lock wait timeout
@ -89,7 +89,7 @@ sync_with_master;
SELECT * FROM t1; SELECT * FROM t1;
SELECT * FROM t3; SELECT * FROM t3;
# Check that no error is reported # Check that no error is reported
--source include/show_slave_status2.inc source include/check_slave_is_running.inc;
--echo --echo
# 3) Test lock wait timeout and purged relay log # 3) Test lock wait timeout and purged relay log
@ -103,6 +103,7 @@ SET global max_relay_log_size=0;
--source include/stop_slave.inc --source include/stop_slave.inc
DELETE FROM t2; DELETE FROM t2;
# Set slave position to the BEGIN log event # Set slave position to the BEGIN log event
--replace_result $master_pos_begin MASTER_POS_BEGIN
eval CHANGE MASTER TO MASTER_LOG_POS=$master_pos_begin; eval CHANGE MASTER TO MASTER_LOG_POS=$master_pos_begin;
BEGIN; BEGIN;
# Hold lock # Hold lock
@ -119,7 +120,7 @@ sync_with_master;
SELECT * FROM t1; SELECT * FROM t1;
SELECT * FROM t3; SELECT * FROM t3;
# Check that no error is reported # Check that no error is reported
--source include/show_slave_status2.inc source include/check_slave_is_running.inc;
--echo --echo
# Clean up # Clean up

View File

@ -146,12 +146,7 @@ SELECT COUNT(*) FROM t1;
--echo --echo
SELECT * FROM t1 ORDER BY f3 LIMIT 20; SELECT * FROM t1 ORDER BY f3 LIMIT 20;
--echo --source include/check_slave_is_running.inc
--echo * Show Slave Status *
--echo
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical show slave status;
--echo
### Altering table def scenario ### Altering table def scenario
--echo --echo
@ -431,16 +426,14 @@ connection master;
delete from t4; delete from t4;
delete from t31; delete from t31;
--echo
--echo ** Check slave status **
--echo
#connection slave; #connection slave;
sync_slave_with_master; sync_slave_with_master;
select * from t31; select * from t31;
--replace_result $MASTER_MYPORT MASTER_PORT --echo
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # --echo ** Check slave status **
--query_vertical show slave status; --echo
--source include/check_slave_is_running.inc
#### Clean Up #### #### Clean Up ####
@ -493,16 +486,15 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
--echo --echo
--echo ******************************************** --echo ********************************************
--echo *** Expect slave to fail with Error 1523 *** --echo *** Expect slave to fail with Error 1677 ***
--echo ******************************************** --echo ********************************************
--echo --echo
connection slave; connection slave;
source include/wait_for_slave_sql_to_stop.inc; # 1677 = ER_SLAVE_CONVERSION_FAILED
--replace_result $MASTER_MYPORT MASTER_PORT --let $slave_sql_errno= 1677
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # --let $slave_skip_counter= 2
--query_vertical SHOW SLAVE STATUS --let $show_slave_sql_error= 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; --source include/wait_for_slave_sql_error_and_skip.inc
START SLAVE;
--echo --echo
--echo *** Drop t10 *** --echo *** Drop t10 ***
@ -550,16 +542,15 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
--echo --echo
--echo ******************************************** --echo ********************************************
--echo *** Expect slave to fail with Error 1523 *** --echo *** Expect slave to fail with Error 1677 ***
--echo ******************************************** --echo ********************************************
--echo --echo
connection slave; connection slave;
source include/wait_for_slave_sql_to_stop.inc; # 1677 = ER_SLAVE_CONVERSION_FAILED
--replace_result $MASTER_MYPORT MASTER_PORT --let $slave_sql_errno= 1677
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # --let $slave_skip_counter= 2
--query_vertical SHOW SLAVE STATUS --let $show_slave_sql_error= 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; --source include/wait_for_slave_sql_error_and_skip.inc
START SLAVE;
--echo --echo
--echo *** Drop t11 *** --echo *** Drop t11 ***
@ -697,10 +688,10 @@ SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
# Remove below once fixed # Remove below once fixed
#*************************** #***************************
connection slave; connection slave;
source include/wait_for_slave_sql_to_stop.inc; # 1091 = ER_CANT_DROP_FIELD_OR_KEY
--replace_result $MASTER_MYPORT MASTER_PORT --let $slave_sql_errno= 1091
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # --let $show_slave_sql_error= 1
--query_vertical SHOW SLAVE STATUS --source include/wait_for_slave_sql_error.inc
#*************************** #***************************
STOP SLAVE; STOP SLAVE;
@ -763,10 +754,10 @@ SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
--echo ******************************************** --echo ********************************************
--echo --echo
connection slave; connection slave;
source include/wait_for_slave_sql_to_stop.inc; # 1054 = ER_BAD_FIELD_ERROR
--replace_result $MASTER_MYPORT MASTER_PORT --let $slave_sql_errno= 1054
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # --let $show_slave_sql_error= 1
--query_vertical SHOW SLAVE STATUS --source include/wait_for_slave_sql_error.inc
STOP SLAVE; STOP SLAVE;
RESET SLAVE; RESET SLAVE;
@ -840,10 +831,10 @@ SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
--echo ***************** --echo *****************
--echo --echo
connection slave; connection slave;
source include/wait_for_slave_sql_to_stop.inc; # 1072 = ER_KEY_COLUMN_DOES_NOT_EXITS
--replace_result $MASTER_MYPORT MASTER_PORT --let $slave_sql_errno= 1072
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # --let $show_slave_sql_error= 1
--query_vertical SHOW SLAVE STATUS --source include/wait_for_slave_sql_error.inc
STOP SLAVE; STOP SLAVE;
RESET SLAVE; RESET SLAVE;

View File

@ -101,9 +101,9 @@ SELECT * FROM t2 ORDER BY a;
--echo *** Start Slave *** --echo *** Start Slave ***
connection slave; connection slave;
START SLAVE; START SLAVE;
source include/wait_for_slave_sql_to_stop.inc; --let $slave_sql_errno= 1677
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1) --let $show_slave_sql_error= 1
--echo Slave failed with Error $errno --source include/wait_for_slave_sql_error.inc
STOP SLAVE; STOP SLAVE;
RESET SLAVE; RESET SLAVE;
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
@ -153,11 +153,10 @@ INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TEST
--echo *** Expect slave to fail with Error 1677 *** --echo *** Expect slave to fail with Error 1677 ***
--echo ******************************************** --echo ********************************************
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --let $slave_sql_errno= 1677
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1) --let $slave_skip_counter= 2
--echo Slave failed with Error $errno --let $show_slave_sql_error= 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; --source include/wait_for_slave_sql_error_and_skip.inc
START SLAVE;
--echo *** Drop t3 *** --echo *** Drop t3 ***
connection master; connection master;
@ -197,11 +196,10 @@ INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
--echo *** Expect slave to fail with Error 1677 *** --echo *** Expect slave to fail with Error 1677 ***
--echo ******************************************** --echo ********************************************
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --let $slave_sql_errno= 1677
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1) --let $slave_skip_counter= 2
--echo Slave failed with Error $errno --let $show_slave_sql_error= 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; --source include/wait_for_slave_sql_error_and_skip.inc
START SLAVE;
--echo *** Drop t4 *** --echo *** Drop t4 ***
connection master; connection master;
@ -241,11 +239,10 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
--echo *** Expect slave to fail with Error 1677 *** --echo *** Expect slave to fail with Error 1677 ***
--echo ******************************************** --echo ********************************************
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --let $slave_sql_errno= 1677
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1) --let $slave_skip_counter= 2
--echo Slave failed with Error $errno --let $show_slave_sql_error= 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; --source include/wait_for_slave_sql_error_and_skip.inc
START SLAVE;
--echo *** Drop t5 *** --echo *** Drop t5 ***
connection master; connection master;
@ -286,9 +283,9 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
--echo *** Expect slave to fail with Error 1677 *** --echo *** Expect slave to fail with Error 1677 ***
--echo ******************************************** --echo ********************************************
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --let $slave_sql_errno= 1677
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1) --let $show_slave_sql_error= 1
--echo Slave failed with Error $errno --source include/wait_for_slave_sql_error.inc
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
#START SLAVE; #START SLAVE;
@ -387,12 +384,10 @@ INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
### Uncomment once bug is fixed ### Uncomment once bug is fixed
#connection slave; #connection slave;
#wait_for_slave_to_stop; #--let $slave_sql_errno= SOMETHING
#--replace_result $MASTER_MYPORT MASTER_PORT #--let $slave_skip_counter= 2
#--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # #--let $show_slave_sql_error= 1
#--query_vertical SHOW SLAVE STATUS #--source include/wait_for_slave_sql_error_and_skip.inc
#SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
#START SLAVE;
--echo *** Drop t8 *** --echo *** Drop t8 ***
connection master; connection master;
@ -451,12 +446,10 @@ if (`SELECT $engine_type != 'NDB'`)
# todo: fix Bug #43992 slave sql thread can't tune own sql_mode ... # todo: fix Bug #43992 slave sql thread can't tune own sql_mode ...
# and add/restore waiting for stop test # and add/restore waiting for stop test
#--source include/wait_for_slave_sql_to_stop.inc #--let $slave_sql_errno= SOMETHING
#--replace_result $MASTER_MYPORT MASTER_PORT #--let $slave_skip_counter= 2
#--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # #--let $show_slave_sql_error= 1
#--query_vertical SHOW SLAVE STATUS #--source include/wait_for_slave_sql_error_and_skip.inc
#SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
#START SLAVE;
} }
#--echo *** Drop t9 *** #--echo *** Drop t9 ***
@ -494,11 +487,10 @@ INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
--echo *** Expect slave to fail with Error 1677 *** --echo *** Expect slave to fail with Error 1677 ***
--echo ******************************************** --echo ********************************************
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --let $slave_sql_errno= 1677
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1) --let $slave_skip_counter= 2
--echo Slave failed with Error $errno --let $show_slave_sql_error= 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; --source include/wait_for_slave_sql_error_and_skip.inc
START SLAVE;
--echo *** Drop t10 *** --echo *** Drop t10 ***
connection master; connection master;
@ -537,11 +529,10 @@ INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
--echo *** Expect slave to fail with Error 1677 *** --echo *** Expect slave to fail with Error 1677 ***
--echo ******************************************** --echo ********************************************
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --let $slave_sql_errno= 1677
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1) --let $slave_skip_counter= 2
--echo Slave failed with Error $errno --let $show_slave_sql_error= 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; --source include/wait_for_slave_sql_error_and_skip.inc
START SLAVE;
--echo *** Drop t11 *** --echo *** Drop t11 ***
connection master; connection master;
@ -808,11 +799,10 @@ ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
--echo *** Expect slave to fail with Error 1060 *** --echo *** Expect slave to fail with Error 1060 ***
--echo ******************************************** --echo ********************************************
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --let $slave_sql_errno= 1060
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1) --let $slave_skip_counter= 1
--echo Slave failed with Error $errno --let $show_slave_sql_error= 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; --source include/wait_for_slave_sql_error_and_skip.inc
START SLAVE;
--echo *** Try to insert in master **** --echo *** Try to insert in master ****
connection master; connection master;
@ -918,11 +908,10 @@ INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
--echo *** Expect slave to fail with Error 1677 *** --echo *** Expect slave to fail with Error 1677 ***
--echo ******************************************** --echo ********************************************
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --let $slave_sql_errno= 1677
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1) --let $slave_skip_counter= 2
--echo Slave failed with Error $errno --let $show_slave_sql_error= 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; --source include/wait_for_slave_sql_error_and_skip.inc
START SLAVE;
--echo ** DROP table t17 *** --echo ** DROP table t17 ***
connection master; connection master;

View File

@ -27,8 +27,8 @@ select * from t3;
# This FLUSH should go into the binlog to not confuse the slave. # This FLUSH should go into the binlog to not confuse the slave.
flush tables; flush tables;
# Check that it's in the binlog. # Check that it's in the binlog.
let $binlog_start= $rename_event_pos; let $wait_binlog_event= flush tables;
source include/show_binlog_events.inc; source include/wait_for_binlog_event.inc;
sync_slave_with_master; sync_slave_with_master;
# Check that the slave is not confused. # Check that the slave is not confused.

View File

@ -68,19 +68,15 @@ eval SET DEBUG_SYNC=$debug_sync_action;
# Show slave last IO errno # Show slave last IO errno
connection slave; connection slave;
source include/wait_for_slave_io_error.inc;
let $last_io_errno= query_get_value("show slave status", Last_IO_Errno, 1);
--echo Check network error happened here --echo Check network error happened here
if (`SELECT '$last_io_errno' = '2013' || # CR_SERVER_LOST # '2013' CR_SERVER_LOST
'$last_io_errno' = '2003' || # CR_CONN_HOST_ERROR # '2003' CR_CONN_HOST_ERROR
'$last_io_errno' = '2002' || # CR_CONNECTION_ERROR # '2002' CR_CONNECTION_ERROR
'$last_io_errno' = '2006' || # CR_SERVER_GONE_ERROR # '2006' CR_SERVER_GONE_ERROR
'$last_io_errno' = '1040' || # ER_CON_COUNT_ERROR # '1040' ER_CON_COUNT_ERROR
'$last_io_errno' = '1053' # ER_SERVER_SHUTDOWN # '1053' ER_SERVER_SHUTDOWN
`) let $slave_io_errno= 1040, 1053, 2002, 2003, 2006, 2013;
{ source include/wait_for_slave_io_error.inc;
--echo NETWORK ERROR
}
# deactivate the sync point of get_master_version_and_clock() # deactivate the sync point of get_master_version_and_clock()
# now to avoid restarting IO-thread to re-enter it. # now to avoid restarting IO-thread to re-enter it.

View File

@ -91,7 +91,7 @@ connection master;
# Bug #29571: INSERT DELAYED IGNORE written to binary log on the master but # Bug #29571: INSERT DELAYED IGNORE written to binary log on the master but
# on the slave # on the slave
# #
if (`SELECT @@global.binlog_format != 'ROW'`) if (`SELECT @@global.binlog_format = 'STATEMENT'`)
{ {
#flush the logs before the test #flush the logs before the test
connection slave; connection slave;
@ -101,27 +101,42 @@ if (`SELECT @@global.binlog_format != 'ROW'`)
} }
CREATE TABLE t1(a int, UNIQUE(a)); CREATE TABLE t1(a int, UNIQUE(a));
--let $_start= query_get_value(SHOW MASTER STATUS, Position, 1)
INSERT DELAYED IGNORE INTO t1 VALUES(1); INSERT DELAYED IGNORE INTO t1 VALUES(1);
INSERT DELAYED IGNORE INTO t1 VALUES(1); INSERT DELAYED IGNORE INTO t1 VALUES(1);
flush table t1; # to wait for INSERT DELAYED to be done flush table t1; # to wait for INSERT DELAYED to be done
if (`SELECT @@global.binlog_format = 'STATEMENT'`)
if (`SELECT @@global.binlog_format != 'ROW'`)
{ {
#must show two INSERT DELAYED #must show two INSERT DELAYED
--replace_column 1 x 2 x 3 x 4 x 5 x --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--replace_regex /table_id: [0-9]+/table_id: #/
show binlog events in 'master-bin.000002' LIMIT 2,2; # The first INSERT DELAYED
--let $stmt= query_get_value(SHOW BINLOG EVENTS IN '$binlog_file' FROM $_start, Info, 2)
--echo $stmt
# The second INSERT DELAYED statement is the 3 item if two INSERT DELAYED are
# handled together
--let $stmt= query_get_value(SHOW BINLOG EVENTS IN '$binlog_file' FROM $_start, Info, 3)
# The second INSERT DELAYED statement is the 5 item if two INSERT DELAYED are
# handled separately
if (`SELECT '$stmt' = 'COMMIT'`)
{
--let $stmt= query_get_value(SHOW BINLOG EVENTS IN '$binlog_file' FROM $_start, Info, 5)
}
--echo $stmt
} }
select * from t1; select * from t1;
sync_slave_with_master; sync_slave_with_master;
echo On slave; echo On slave;
if (`SELECT @@global.binlog_format != 'ROW'`) if (`SELECT @@global.binlog_format = 'STATEMENT'`)
{ {
#must show two INSERT DELAYED #must show two INSERT DELAYED
--replace_column 1 x 2 x 3 x 4 x 5 x --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--replace_regex /table_id: [0-9]+/table_id: #/ --let $binlog_limit= 1,6
show binlog events in 'slave-bin.000002' LIMIT 2,2; --source include/show_binlog_events.inc
} }
select * from t1; select * from t1;

View File

@ -31,19 +31,17 @@ eval create table t1 (word char(20) not null)ENGINE=$engine_type;
--replace_result $LOAD_FILE LOAD_FILE --replace_result $LOAD_FILE LOAD_FILE
eval load data infile '$LOAD_FILE' into table t1 ignore 1 lines; eval load data infile '$LOAD_FILE' into table t1 ignore 1 lines;
select count(*) from t1; select count(*) from t1;
--replace_result $VERSION VERSION source include/show_binlog_events.inc;
--replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ let $binlog_limit= 1;
show binlog events; source include/show_binlog_events.inc;
--replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ let $binlog_limit= 2;
show binlog events from 107 limit 1; source include/show_binlog_events.inc;
--replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ let $binlog_limit= 1,4;
show binlog events from 107 limit 2; source include/show_binlog_events.inc;
--replace_column 2 # 5 # let $binlog_limit=;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events from 107 limit 1,4;
flush logs; flush logs;
# We need an extra update before doing save_master_pos. # We need an extra update before doing save_master_pos.
@ -84,27 +82,24 @@ connection master;
eval create table t2 (n int)ENGINE=$engine_type; eval create table t2 (n int)ENGINE=$engine_type;
insert into t2 values (1); insert into t2 values (1);
source include/show_binlog_events.inc; source include/show_binlog_events.inc;
--replace_result $VERSION VERSION
--replace_regex /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /infile '.+'/infile 'words.dat'/ let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
--replace_column 2 # 5 # source include/show_binlog_events.inc;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events in 'master-bin.000002';
--replace_column 2 # --replace_column 2 #
show binary logs; show binary logs;
sync_slave_with_master; sync_slave_with_master;
--source include/wait_for_slave_to_start.inc
--replace_column 2 # --replace_column 2 #
show binary logs; show binary logs;
--replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION
--replace_column 2 # 5 # let $binlog_file=;
--replace_regex /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /INFILE '.+'/INFILE 'words.dat'/ source include/show_binlog_events.inc;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events in 'slave-bin.000001' from 4; let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
--replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION source include/show_binlog_events.inc;
--replace_column 2 # 5 # let $binlog_file=;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events in 'slave-bin.000002' from 4; source include/check_slave_is_running.inc;
source include/show_slave_status2.inc;
# Need to recode the following # Need to recode the following

View File

@ -43,7 +43,7 @@ set global max_relay_log_size=8192-1; # mapped to 4096
select @@global.max_relay_log_size; select @@global.max_relay_log_size;
start slave; start slave;
sync_with_master; sync_with_master;
source include/show_slave_status2.inc; --source include/check_slave_is_running.inc
--echo # --echo #
--echo # Test 2 --echo # Test 2
@ -55,7 +55,7 @@ set global max_relay_log_size=(5*4096);
query_vertical select @@global.max_relay_log_size; query_vertical select @@global.max_relay_log_size;
start slave; start slave;
sync_with_master; sync_with_master;
source include/show_slave_status2.inc; --source include/check_slave_is_running.inc
--echo # --echo #
--echo # Test 3: max_relay_log_size = 0 --echo # Test 3: max_relay_log_size = 0
@ -67,7 +67,7 @@ set global max_relay_log_size=0;
query_vertical select @@global.max_relay_log_size; query_vertical select @@global.max_relay_log_size;
start slave; start slave;
sync_with_master; sync_with_master;
source include/show_slave_status2.inc; --source include/check_slave_is_running.inc
--echo # --echo #
--echo # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions --echo # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
@ -78,7 +78,6 @@ reset slave;
# test of relay log rotation when the slave is stopped # test of relay log rotation when the slave is stopped
# (to make sure it does not crash). # (to make sure it does not crash).
flush logs; flush logs;
source include/show_slave_status2.inc;
--echo # --echo #
--echo # Test 5 --echo # Test 5
@ -93,10 +92,8 @@ flush logs;
# log we just closed. But a trick to achieve this is do an update on the master. # log we just closed. But a trick to achieve this is do an update on the master.
connection master; connection master;
create table t1 (a int); create table t1 (a int);
save_master_pos; sync_slave_with_master;
connection slave; --source include/check_slave_is_running.inc
sync_with_master;
source include/show_slave_status2.inc;
--echo # --echo #
--echo # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated --echo # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
@ -105,10 +102,8 @@ source include/show_slave_status2.inc;
flush logs; flush logs;
connection master; connection master;
drop table t1; drop table t1;
save_master_pos; sync_slave_with_master;
connection slave; --source include/check_slave_is_running.inc
sync_with_master;
source include/show_slave_status2.inc;
connection master; connection master;
# test that the absence of relay logs does not make a master crash # test that the absence of relay logs does not make a master crash

View File

@ -56,24 +56,23 @@ connection master;
--echo # since insert is done with transactional engine, expect a BEGIN --echo # since insert is done with transactional engine, expect a BEGIN
--echo # at <start_pos> --echo # at <start_pos>
--echo --echo
--replace_result $start_pos <start_pos> --let $binlog_start= $start_pos
--replace_column 5 # --let $binlog_limit= 1
--eval show binlog events from $start_pos limit 1 --source include/show_binlog_events.inc
--echo --echo
--echo # Now the insert, one step after --echo # Now the insert, one step after
--echo --echo
--replace_result $start_pos <start_pos> --let $binlog_start= $start_pos
--replace_column 2 # 5 # --let $binlog_limit= 1,1
--eval show binlog events from $start_pos limit 1,1 --source include/show_binlog_events.inc
--echo --echo
--echo # and the COMMIT should be at <end_pos> --echo # and the COMMIT should be at <end_pos>
--echo --echo
--replace_result $start_pos <start_pos> $end_pos <end_pos> --let $binlog_start= $start_pos
--replace_column 2 # --let $binlog_limit= 2,1
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ --source include/show_binlog_events.inc
--eval show binlog events from $start_pos limit 2,1
--echo --echo
@ -89,18 +88,17 @@ commit;
--source include/select_ndb_apply_status.inc --source include/select_ndb_apply_status.inc
connection master; connection master;
--replace_result $start_pos <start_pos> --let $binlog_start= $start_pos
--replace_column 5 # --let $binlog_limit= 1
--eval show binlog events from $start_pos limit 1 --source include/show_binlog_events.inc
--echo --echo
--replace_result $start_pos <start_pos> --let $binlog_start= $start_pos
--replace_column 2 # 4 # 5 # --let $binlog_limit= 1,2
--eval show binlog events from $start_pos limit 1,2 --source include/show_binlog_events.inc
--echo --echo
--replace_result $start_pos <start_pos> $end_pos <end_pos> --let $binlog_start= $start_pos
--replace_column 2 # --let $binlog_limit= 3,1
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ --source include/show_binlog_events.inc
--eval show binlog events from $start_pos limit 3,1
--echo --echo

View File

@ -9,37 +9,33 @@
# RESET SLAVE. # RESET SLAVE.
-- source include/master-slave.inc -- source include/master-slave.inc
connection master; sync_slave_with_master;
save_master_pos; let $status_items= Master_User, Master_Host;
connection slave; source include/show_slave_status.inc;
sync_with_master;
source include/show_slave_status2.inc;
stop slave; source include/stop_slave.inc;
change master to master_user='test'; change master to master_user='test';
source include/show_slave_status2.inc; source include/show_slave_status.inc;
reset slave; reset slave;
source include/show_slave_status2.inc; source include/show_slave_status.inc;
change master to master_user='root'; change master to master_user='root';
start slave; source include/start_slave.inc;
sync_with_master; sync_with_master;
source include/show_slave_status2.inc; source include/show_slave_status.inc;
# test of crash with temp tables & RESET SLAVE # test of crash with temp tables & RESET SLAVE
# (test to see if RESET SLAVE clears temp tables in memory and disk) # (test to see if RESET SLAVE clears temp tables in memory and disk)
stop slave; source include/stop_slave.inc;
reset slave; reset slave;
start slave; source include/start_slave.inc;
connection master; connection master;
create temporary table t1 (a int); create temporary table t1 (a int);
save_master_pos; sync_slave_with_master;
connection slave; source include/stop_slave.inc;
sync_with_master;
stop slave;
reset slave; reset slave;
start slave; source include/start_slave.inc;
sync_with_master; sync_with_master;
show status like 'slave_open_temp_tables'; show status like 'slave_open_temp_tables';
@ -48,10 +44,9 @@ show status like 'slave_open_temp_tables';
# #
# clearing the status # clearing the status
stop slave; source include/stop_slave.inc;
reset slave; reset slave;
let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1); source include/check_slave_no_error.inc;
echo *** errno must be zero: $last_io_errno ***;
# #
# verifying start slave resets Last_IO_Error and Last_IO_Errno. # verifying start slave resets Last_IO_Error and Last_IO_Errno.
@ -59,40 +54,24 @@ echo *** errno must be zero: $last_io_errno ***;
change master to master_user='impossible_user_name'; change master to master_user='impossible_user_name';
start slave; start slave;
let $slave_io_errno= 1045;
source include/wait_for_slave_io_error.inc; source include/wait_for_slave_io_error.inc;
let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
--disable_query_log
eval SELECT $last_io_errno > 0 as ONE;
--enable_query_log
source include/stop_slave.inc; stop slave;
change master to master_user='root'; change master to master_user='root';
source include/start_slave.inc; source include/start_slave.inc;
let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1); source include/check_slave_no_error.inc;
let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
--echo *** last errno must be zero: $last_io_errno ***
--echo *** last error must be blank: $last_io_error ***
# #
# verifying reset slave resets Last_{IO,SQL}_Err{or,no} # verifying reset slave resets Last_{IO,SQL}_Err{or,no}
# #
source include/stop_slave.inc; stop slave;
change master to master_user='impossible_user_name'; change master to master_user='impossible_user_name';
start slave; start slave;
let $slave_io_errno= 1045;
source include/wait_for_slave_io_error.inc; source include/wait_for_slave_io_error.inc;
let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
--disable_query_log
eval SELECT $last_io_errno > 0 as ONE;
--enable_query_log
source include/stop_slave.inc; stop slave;
reset slave; reset slave;
let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1); source include/check_slave_no_error.inc;
let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
let $last_sql_errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
let $last_sql_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
--echo *** io last errno must be zero: $last_io_errno ***
--echo *** io last error must be blank: $last_io_error ***
--echo *** sql last errno must be zero: $last_sql_errno ***
--echo *** sql last error must be blank: $last_sql_error ***

View File

@ -270,10 +270,7 @@ DELETE FROM t1;
query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2; query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
sync_slave_with_master; sync_slave_with_master;
set @@global.slave_exec_mode= default; set @@global.slave_exec_mode= default;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); source include/check_slave_is_running.inc;
disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log;
query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2; query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
# BUG#37076: TIMESTAMP/DATETIME values are not replicated correctly # BUG#37076: TIMESTAMP/DATETIME values are not replicated correctly
@ -412,11 +409,10 @@ INSERT INTO t5 VALUES (1, "", 1);
INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
connection slave; connection slave;
source include/wait_for_slave_sql_to_stop.inc; # 1677 = ER_SLAVE_CONVERSION_FAILED
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); --let $slave_sql_errno= 1677
disable_query_log; --let $show_slave_sql_error= 1
eval SELECT "$last_error" AS Last_SQL_Error; --source include/wait_for_slave_sql_error.inc
enable_query_log;
connection master; connection master;
RESET MASTER; RESET MASTER;
connection slave; connection slave;
@ -431,11 +427,10 @@ INSERT INTO t6 VALUES (1, "", 1);
INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
connection slave; connection slave;
source include/wait_for_slave_sql_to_stop.inc; # 1677 = ER_SLAVE_CONVERSION_FAILED
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); --let $slave_sql_errno= 1677
disable_query_log; --let $show_slave_sql_error= 1
eval SELECT "$last_error" AS Last_SQL_Error; --source include/wait_for_slave_sql_error.inc
enable_query_log;
connection master; connection master;
RESET MASTER; RESET MASTER;
connection slave; connection slave;

View File

@ -138,9 +138,7 @@ SELECT * FROM t2;
sync_slave_with_master; sync_slave_with_master;
--echo **** On Slave **** --echo **** On Slave ****
SELECT * FROM t2; SELECT * FROM t2;
--replace_result $MASTER_MYPORT MASTER_PORT --source include/check_slave_is_running.inc
--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS
connection master; connection master;
INSERT INTO t9 VALUES (4); INSERT INTO t9 VALUES (4);
@ -149,12 +147,10 @@ sync_slave_with_master;
connection master; connection master;
INSERT INTO t4 VALUES (4); INSERT INTO t4 VALUES (4);
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --let $slave_skip_counter= 2
--replace_result $MASTER_MYPORT MASTER_PORT --let $slave_sql_errno= 1677
--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error> --let $show_slave_sql_error= 1
--query_vertical SHOW SLAVE STATUS --source include/wait_for_slave_sql_error_and_skip.inc
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
connection master; connection master;
INSERT INTO t9 VALUES (5); INSERT INTO t9 VALUES (5);
@ -163,12 +159,10 @@ sync_slave_with_master;
connection master; connection master;
INSERT INTO t5 VALUES (5,10,25); INSERT INTO t5 VALUES (5,10,25);
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --let $slave_skip_counter= 2
--replace_result $MASTER_MYPORT MASTER_PORT --let $slave_sql_errno= 1677
--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error> --let $show_slave_sql_error= 1
--query_vertical SHOW SLAVE STATUS --source include/wait_for_slave_sql_error_and_skip.inc
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
connection master; connection master;
INSERT INTO t9 VALUES (6); INSERT INTO t9 VALUES (6);
@ -177,19 +171,15 @@ sync_slave_with_master;
connection master; connection master;
INSERT INTO t6 VALUES (6,12,36); INSERT INTO t6 VALUES (6,12,36);
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --let $slave_skip_counter= 2
--replace_result $MASTER_MYPORT MASTER_PORT --let $slave_sql_errno= 1677
--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error> --let $show_slave_sql_error= 1
--query_vertical SHOW SLAVE STATUS --source include/wait_for_slave_sql_error_and_skip.inc
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
connection master; connection master;
INSERT INTO t9 VALUES (6); INSERT INTO t9 VALUES (6);
sync_slave_with_master; sync_slave_with_master;
--replace_result $SLAVE_MYPORT SLAVE_PORT --source include/check_slave_is_running.inc
--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS
# Testing some tables extra field that can be null and cannot be null # Testing some tables extra field that can be null and cannot be null
# (but have default values) # (but have default values)

View File

@ -9,113 +9,96 @@ INSERT INTO t1 VALUES (5);
INSERT INTO t1 VALUES (6); INSERT INTO t1 VALUES (6);
-- echo [MASTER] ********* SOW BINLOG EVENTS IN ... ********* -- echo [MASTER] ********* SOW BINLOG EVENTS IN ... *********
let $binary_log_file= master-bin.000001;
-- source include/show_binlog_events.inc -- source include/show_binlog_events.inc
-- echo [MASTER] ********* SOW BINLOG EVENTS ********* -- echo [MASTER] ********* SOW BINLOG EVENTS *********
let $binary_log_file= ; let $binlog_file= ;
-- source include/show_binlog_events.inc -- source include/show_binlog_events.inc
-- echo [MASTER] ********* SOW BINLOG EVENTS ... LIMIT rows ********* -- echo [MASTER] ********* SOW BINLOG EVENTS ... LIMIT rows *********
let $binary_log_file= ; let $binlog_limit= 3;
let $binary_log_limit_row= 3;
-- source include/show_binlog_events.inc -- source include/show_binlog_events.inc
-- echo [MASTER] ********* SOW BINLOG EVENTS ... LIMIT offset,rows ********* -- echo [MASTER] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
let $binary_log_file= ; let $binlog_limit= 1,4;
let $binary_log_limit_row= 4;
let $binary_log_limit_offset= 1;
-- source include/show_binlog_events.inc -- source include/show_binlog_events.inc
# clear show_binlog_event/show_relaylog_events parameters # clear show_binlog_event/show_relaylog_events parameters
let $binary_log_file= ; let $binlog_limit= ;
let $binary_log_limit_row= ;
let $binary_log_limit_offset= ;
-- sync_slave_with_master -- sync_slave_with_master
-- echo [SLAVE] ********* SOW BINLOG EVENTS IN ... ********* -- echo [SLAVE] ********* SOW BINLOG EVENTS IN ... *********
let $binary_log_file= slave-bin.000001;
-- source include/show_binlog_events.inc -- source include/show_binlog_events.inc
-- echo [SLAVE] ********* SOW BINLOG EVENTS ********* -- echo [SLAVE] ********* SOW BINLOG EVENTS *********
let $binary_log_file= ; let $binlog_file= ;
-- source include/show_binlog_events.inc -- source include/show_binlog_events.inc
-- echo [SLAVE] ********* SOW BINLOG EVENTS ... LIMIT rows ********* -- echo [SLAVE] ********* SOW BINLOG EVENTS ... LIMIT rows *********
let $binary_log_file= ; let $binlog_limit= 3;
let $binary_log_limit_row= 3;
-- source include/show_binlog_events.inc -- source include/show_binlog_events.inc
-- echo [SLAVE] ********* SOW BINLOG EVENTS ... LIMIT offset,rows ********* -- echo [SLAVE] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
let $binary_log_file= ; let $binlog_limit= 1,4;
let $binary_log_limit_row= 4;
let $binary_log_limit_offset= 1;
-- source include/show_binlog_events.inc -- source include/show_binlog_events.inc
# clear show_binlog_event/show_relaylog_events parameters # clear show_binlog_event/show_relaylog_events parameters
let $binary_log_file= ; let $binlog_limit= ;
let $binary_log_limit_row= ;
let $binary_log_limit_offset= ;
-- echo [SLAVE] ********* SOW RELAYLOG EVENTS IN ... ********* -- echo [SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
let $binary_log_file= slave-relay-bin.000003; let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
-- source include/show_relaylog_events.inc -- source include/show_relaylog_events.inc
-- echo [SLAVE] ********* SOW RELAYLOG EVENTS ********* -- echo [SLAVE] ********* SOW RELAYLOG EVENTS *********
let $binary_log_file= ; let $binlog_file= ;
-- source include/show_relaylog_events.inc -- source include/show_relaylog_events.inc
-- echo [MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT rows ********* -- echo [MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT rows *********
let $binary_log_file= slave-relay-bin.000003; let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
let $binary_log_limit_row= 3; let $binlog_limit= 3;
let $binary_log_limit_offset= ;
-- source include/show_relaylog_events.inc -- source include/show_relaylog_events.inc
-- echo [MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT offset,rows ********* -- echo [MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT offset,rows *********
let $binary_log_file= slave-relay-bin.000003; let $binlog_limit= 1,3;
let $binary_log_limit_offset= 1;
let $binary_log_limit_row= 3;
-- source include/show_relaylog_events.inc -- source include/show_relaylog_events.inc
FLUSH LOGS; FLUSH LOGS;
let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
-- connection master -- connection master
FLUSH LOGS; FLUSH LOGS;
DROP TABLE t1; DROP TABLE t1;
# clear show_binlog_event/show_relaylog_events parameters # clear show_binlog_event/show_relaylog_events parameters
let $binary_log_file= ; let $binlog_file= ;
let $binary_log_limit_row= ; let $binlog_limit= ;
let $binary_log_limit_offset= ;
-- echo [MASTER] ********* SOW BINLOG EVENTS IN ... ********* -- echo [MASTER] ********* SOW BINLOG EVENTS IN ... *********
let $binary_log_file= master-bin.000002; let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
-- source include/show_binlog_events.inc -- source include/show_binlog_events.inc
-- echo [MASTER] ********* SOW BINLOG EVENTS ********* -- echo [MASTER] ********* SOW BINLOG EVENTS *********
let $binary_log_file= ; let $binlog_file= ;
-- source include/show_binlog_events.inc -- source include/show_binlog_events.inc
-- sync_slave_with_master -- sync_slave_with_master
-- echo [SLAVE] ********* SOW BINLOG EVENTS IN ... ********* -- echo [SLAVE] ********* SOW BINLOG EVENTS IN ... *********
let $binary_log_file= slave-bin.000002; let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
-- source include/show_binlog_events.inc -- source include/show_binlog_events.inc
-- echo [SLAVE] ********* SOW BINLOG EVENTS ********* -- echo [SLAVE] ********* SOW BINLOG EVENTS *********
let $binary_log_file= ; let $binlog_file= ;
-- source include/show_binlog_events.inc -- source include/show_binlog_events.inc
-- echo [SLAVE] ********* SOW RELAYLOG EVENTS IN ... ********* -- echo [SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
let $binary_log_file= slave-relay-bin.000005;
-- source include/show_relaylog_events.inc -- source include/show_relaylog_events.inc
-- echo [SLAVE] ********* SOW RELAYLOG EVENTS ********* -- echo [SLAVE] ********* SOW RELAYLOG EVENTS *********
let $binary_log_file= ; let $binlog_file= ;
-- source include/show_relaylog_events.inc -- source include/show_relaylog_events.inc
# clear show_binlog_event/show_relaylog_events parameters # clear show_binlog_event/show_relaylog_events parameters
let $binary_log_name= ; let $binlog_file= ;
let $binary_log_limit_row= ; let $binlog_limit= ;
let $binary_log_limit_offset= ;

View File

@ -0,0 +1,96 @@
#
# SUMMARY
# Check if statement reading table '$table' allows concurrent
# inserts in it.
#
# PARAMETERS
# $table Table in which concurrent inserts should be allowed.
# $con_aux1 Name of the first auxiliary connection to be used by this
# script.
# $con_aux2 Name of the second auxiliary connection to be used by this
# script.
# $statement Statement to be checked.
# $restore_table Table which might be modified affected by statement to be
# checked and thus needs backing up before its execution
# and restoring after it (can be empty).
#
# EXAMPLE
# lock_sync.test
#
--disable_result_log
--disable_query_log
# Reset DEBUG_SYNC facility for safety.
set debug_sync= "RESET";
if (`SELECT '$restore_table' <> ''`)
{
--eval create table t_backup select * from $restore_table;
}
connection $con_aux1;
set debug_sync='after_lock_tables_takes_lock SIGNAL parked WAIT_FOR go';
--send_eval $statement;
connection $con_aux2;
set debug_sync='now WAIT_FOR parked';
--send_eval insert into $table values (0);
--enable_result_log
--enable_query_log
connection default;
# Wait until concurrent insert is successfully executed while
# statement being checked has its tables locked.
# We use wait_condition.inc instead of simply executing
# concurrent insert here in order to avoid deadlocks if test
# fails and timing out instead.
let $wait_condition=
select count(*) = 0 from information_schema.processlist
where info = "insert into $table values (0)";
--source include/wait_condition.inc
--disable_result_log
--disable_query_log
if ($success)
{
# Apparently concurrent insert was successfully executed.
# To be safe against wait_condition.inc succeeding due to
# races let us first reap concurrent insert to ensure that
# it has really been successfully executed.
connection $con_aux2;
--reap
connection default;
set debug_sync= 'now SIGNAL go';
connection $con_aux1;
--reap
connection default;
--echo Success: '$statement' allows concurrent inserts into '$table'.
}
if (!$success)
{
# Waiting has timed out. Apparently concurrent insert was blocked.
# So to be able to continue we need to end our statement first.
set debug_sync= 'now SIGNAL go';
connection $con_aux1;
--reap
connection $con_aux2;
--reap
connection default;
--echo Error: '$statement' doesn't allow concurrent inserts into '$table'!
}
--eval delete from $table where i = 0;
if (`SELECT '$restore_table' <> ''`)
{
--eval truncate table $restore_table;
--eval insert into $restore_table select * from t_backup;
drop table t_backup;
}
# Clean-up. Reset DEBUG_SYNC facility after use.
set debug_sync= "RESET";
--enable_result_log
--enable_query_log

View File

@ -0,0 +1,81 @@
#
# SUMMARY
# Check that statement reading table '$table' doesn't allow concurrent
# inserts in it.
#
# PARAMETERS
# $table Table in which concurrent inserts should be disallowed.
# $con_aux1 Name of the first auxiliary connection to be used by this
# script.
# $con_aux2 Name of the second auxiliary connection to be used by this
# script.
# $statement Statement to be checked.
# $restore_table Table which might be modified affected by statement to be
# checked and thus needs backing up before its execution
# and restoring after it (can be empty).
#
# EXAMPLE
# lock_sync.test
#
--disable_result_log
--disable_query_log
# Reset DEBUG_SYNC facility for safety.
set debug_sync= "RESET";
if (`SELECT '$restore_table' <> ''`)
{
--eval create table t_backup select * from $restore_table;
}
connection $con_aux1;
set debug_sync='after_lock_tables_takes_lock SIGNAL parked WAIT_FOR go';
--send_eval $statement;
connection $con_aux2;
set debug_sync='now WAIT_FOR parked';
--send_eval insert into $table values (0);
--enable_result_log
--enable_query_log
connection default;
# Wait until concurrent insert is successfully blocked because
# of our statement.
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "Table lock" and info = "insert into $table values (0)";
--source include/wait_condition.inc
--disable_result_log
--disable_query_log
set debug_sync= 'now SIGNAL go';
connection $con_aux1;
--reap
connection $con_aux2;
--reap
connection default;
if ($success)
{
--echo Success: '$statement' doesn't allow concurrent inserts into '$table'.
}
if (!$success)
{
--echo Error: '$statement' allows concurrent inserts into '$table'!
}
--eval delete from $table where i = 0;
if (`SELECT '$restore_table' <> ''`)
{
--eval truncate table $restore_table;
--eval insert into $restore_table select * from t_backup;
drop table t_backup;
}
# Clean-up. Reset DEBUG_SYNC facility after use.
set debug_sync= "RESET";
--enable_result_log
--enable_query_log

View File

@ -0,0 +1,71 @@
#
# SUMMARY
# Check if statement affecting or reading table '$table' doesn't
# take any kind of locks on its rows.
#
# PARAMETERS
# $table Table for which presence of row locks should be checked.
# $con_aux Name of auxiliary connection to be used by this script.
# $statement Statement to be checked.
#
# EXAMPLE
# innodb_mysql_lock2.test
#
--disable_result_log
--disable_query_log
connection default;
begin;
--eval select * from $table for update;
connection $con_aux;
begin;
--send_eval $statement;
--enable_result_log
--enable_query_log
connection default;
# Wait until statement is successfully executed while
# all rows in table are X-locked. This means that it
# does not acquire any row locks.
# We use wait_condition.inc instead of simply executing
# statement here in order to avoid deadlocks if test
# fails and timing out instead.
let $wait_condition=
select count(*) = 0 from information_schema.processlist
where info = "$statement";
--source include/wait_condition.inc
--disable_result_log
--disable_query_log
if ($success)
{
# Apparently statement was successfully executed and thus it
# has not required any row locks.
# To be safe against wait_condition.inc succeeding due to
# races let us first reap the statement being checked to
# ensure that it has been successfully executed.
connection $con_aux;
--reap
rollback;
connection default;
rollback;
--echo Success: '$statement' doesn't take row locks on '$table'.
}
if (!$success)
{
# Waiting has timed out. Apparently statement was blocked on
# some row lock. So to be able to continue we need to unlock
# rows first.
rollback;
connection $con_aux;
--reap
rollback;
connection default;
--echo Error: '$statement' takes some row locks on '$table'!
}
--enable_result_log
--enable_query_log

View File

@ -0,0 +1,61 @@
#
# SUMMARY
# Check if statement reading table '$table' takes shared locks
# on some of its rows.
#
# PARAMETERS
# $table Table for which presence of row locks should be checked.
# $con_aux Name of auxiliary connection to be used by this script.
# $statement Statement to be checked.
# $wait_statement Sub-statement which is supposed to acquire locks (should
# be the same as $statement for ordinary statements).
#
# EXAMPLE
# innodb_mysql_lock2.test
#
--disable_result_log
--disable_query_log
connection default;
begin;
--eval select * from $table for update;
connection $con_aux;
begin;
--send_eval $statement;
--enable_result_log
--enable_query_log
connection default;
# Wait until statement is successfully blocked because
# all rows in table are X-locked. This means that at
# least it acquires S-locks on some of rows.
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state in ("Sending data","statistics", "preparing") and
info = "$wait_statement";
--source include/wait_condition.inc
--disable_result_log
--disable_query_log
rollback;
connection $con_aux;
--reap
rollback;
connection default;
--enable_result_log
--enable_query_log
if ($success)
{
--echo Success: '$statement' takes shared row locks on '$table'.
}
if (!$success)
{
--echo Error: '$statement' hasn't taken shared row locks on '$table'!
}

View File

@ -0,0 +1,18 @@
# ==== Purpose ====
#
# Assert that the slave threads are running and don't have any errors.
#
# ==== Usage ====
#
# --source include/check_slave_running.inc
--echo Checking that both slave threads are running.
--let $slave_sql_running = query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1)
--let $slave_io_running = query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1)
if (`SELECT '$slave_sql_running' != 'Yes' OR '$slave_io_running' != 'Yes'`) {
--echo Slave not running: Slave_SQL_Running = $slave_sql_running Slave_IO_Running = $slave_io_running
--source include/show_rpl_debug_info.inc
--die Expected slave to be running, but it was not running.
}

View File

@ -0,0 +1,17 @@
# ==== Purpose ====
#
# Assert that Slave_SQL_Error and Slave_IO_Error are empty.
#
# ==== Usage ====
#
# --let $slave_param= Exec_Master_Log_Pos
# --let $slave_param_value= 4711
# --source include/check_slave_running.inc
--let $slave_param= Last_SQL_Errno
--let $slave_param_value= 0
--source include/check_slave_param.inc
--let $slave_param= Last_IO_Errno
--let $slave_param_value= 0
--source include/check_slave_param.inc

View File

@ -0,0 +1,16 @@
# ==== Purpose ====
#
# Assert that a given column in SHOW SLAVE STATUS has a given value.
#
# ==== Usage ====
#
# --let $slave_param= Exec_Master_Log_Pos
# --let $slave_param_value= 4711
# --source include/check_slave_param.inc
--let $_param_value= query_get_value(SHOW SLAVE STATUS, $slave_param, 1)
if (`SELECT '$_param_value' != '$slave_param_value'`) {
--echo Wrong value for $slave_param. Expected '$slave_param_value', got '$_param_value'
--source include/show_rpl_debug_info.inc
--die Wrong value for slave parameter
}

View File

@ -0,0 +1,70 @@
# For a given event which is at position $master_log_pos in the the master's
# binary log, returns its position in the slave's relay log file
# $relay_log_file.
# The position is stored in the variable $relay_log_pos.
# Usage:
# let $relay_log_file= 'relay-log-bin.000001';
# let $master_log_pos= 106;
# source include/get_relay_log_pos.inc;
# # at this point, get_relay_log_pos.inc sets $relay_log_pos. echo position
# # in $relay_log_file: $relay_log_pos.
if (`SELECT '$relay_log_file' = ''`)
{
--die 'variable $relay_log_file is null'
}
if (`SELECT '$master_log_pos' = ''`)
{
--die 'variable $master_log_pos is null'
}
let $MYSQLD_DATADIR= `select @@datadir`;
let $_suffix= `SELECT UUID()`;
let $_tmp_file= $MYSQLTEST_VARDIR/tmp/mysqlbinlog.$_suffix;
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/$relay_log_file > $_tmp_file
# All queries in this file should not be logged.
--disable_query_log
--disable_warnings
DROP TEMPORARY TABLE IF EXISTS mysqlbinlog_events;
DROP TEMPORARY TABLE IF EXISTS events_at;
DROP TEMPORARY TABLE IF EXISTS events_pos;
CREATE TEMPORARY TABLE mysqlbinlog_events(c1 INT AUTO_INCREMENT KEY, c2 varchar(256));
# Event position is in the comments output by mysqlbinlog, we load this
# comments into the table
# '# at 106'
# '# .... end_log_pos 46'
eval LOAD DATA LOCAL INFILE '$_tmp_file' INTO TABLE mysqlbinlog_events
LINES STARTING BY '#' (c2) SET c1 = NULL;
--enable_warnings
# Event pos in relay log file is inserted into table events_at
CREATE TEMPORARY TABLE events_at(c1 INT AUTO_INCREMENT KEY, c2 varchar(256))
SELECT c2 FROM mysqlbinlog_events WHERE c2 LIKE ' at%' ORDER BY c1;
# Event pos in master log file is inserted into table events_pos
CREATE TEMPORARY TABLE events_pos(c1 INT AUTO_INCREMENT KEY, c2 varchar(256))
SELECT c2 FROM mysqlbinlog_events WHERE c2 LIKE '% end_log_pos %' ORDER BY c1;
# events_at events_pos
# c1------c2-------------------------- c1------c2------------------------
# 1 ev1's begin pos in relay log 1 ev1's end pos in master log
# 2 ev2's begin pos in relay log 2 ev2's end pos in master log
# 3 ev3's begin pos in relay log 3 ev3's end pos in master log
# events always keep the same sequence.
# Because event[N]'s end pos is equal to event[N+1]'s begin pos we want to
# find event's end pos in relay log, we can find the right relay_log_pos
# using the relationship that 'events_pos.c1 = events_at.c1 + 1'
#
# There is a fault that we can't get the relay log position of the last event,
# as it is not output by mysqlbinlog
let $relay_log_pos= `SELECT SUBSTRING(a.c2, 5)
FROM events_at a, events_pos b
WHERE a.c1=b.c1+1 and b.c2 LIKE '% $master_log_pos%'`;
DROP TEMPORARY TABLE mysqlbinlog_events, events_at, events_pos;
--remove_file $_tmp_file
--enable_query_log

View File

@ -0,0 +1,121 @@
# Test of mysqlhotcopy (perl script)
# Author: Horst Hunger
# Created: 2010-05-10
--source include/not_windows.inc
--source include/not_embedded.inc
if ($MYSQLHOTCOPY)
{
die due to missing mysqlhotcopy tool;
}
let $MYSQLD_DATADIR= `SELECT @@datadir`;
--disable_warnings
DROP DATABASE IF EXISTS hotcopy_test;
--enable_warnings
CREATE DATABASE hotcopy_test;
USE hotcopy_test;
eval CREATE TABLE t1 (c1 int, c2 varchar(20)) ENGINE=$engine;
eval CREATE TABLE t2 (c1 int, c2 varchar(20)) ENGINE=$engine;
eval CREATE TABLE t3 (c1 int, c2 varchar(20)) ENGINE=$engine;
INSERT INTO t1 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb');
INSERT INTO t2 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb');
INSERT INTO t3 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb');
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--list_files $MYSQLD_DATADIR/hotcopy_test
# backup into another database in the same directory
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
--exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--list_files $MYSQLD_DATADIR/hotcopy_save
USE hotcopy_save;
SELECT * FROM t1;
SELECT * FROM t2;
SELECT * FROM t3;
# restore data into the original database with mysqlhotcopy
if(`SELECT engine= 'MyISAM' FROM information_schema.tables WHERE table_name='t1'`)
{
USE hotcopy_test;
DELETE FROM t1;
SELECT * FROM t1;
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
--exec $MYSQLHOTCOPY --quiet --addtodest -S $MASTER_MYSOCK -u root hotcopy_save hotcopy_test
USE hotcopy_save;
SELECT * FROM t1;
SELECT * FROM t2;
SELECT * FROM t3;
}
USE hotcopy_test;
DROP TABLE t2;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--list_files $MYSQLD_DATADIR/hotcopy_test
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
--exec $MYSQLHOTCOPY --quiet --addtodest -S $MASTER_MYSOCK -u root hotcopy_save hotcopy_test
FLUSH TABLES;
SELECT * FROM t1;
SELECT * FROM t2;
SELECT * FROM t3;
# backup of db into a directory
USE hotcopy_test;
--replace_result $MASTER_MYSOCK MASTER_MYSOCK $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test $MYSQLTEST_VARDIR/tmp
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--list_files $MYSQLTEST_VARDIR/tmp/hotcopy_test
#--exec rm -rf $MYSQLTEST_VARDIR/tmp/hotcopy_test
--remove_files_wildcard $MYSQLTEST_VARDIR/tmp/hotcopy_test *
--rmdir $MYSQLTEST_VARDIR/tmp/hotcopy_test
# backup without full index files
# reproduction of bug#53556, "--list_files" shows MYI files, which is wrong.
DROP DATABASE hotcopy_save;
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
--exec $MYSQLHOTCOPY --quiet --noindices -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--list_files $MYSQLD_DATADIR/hotcopy_save
# test of option "allowold"
DROP DATABASE hotcopy_save;
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
--exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--list_files $MYSQLD_DATADIR/hotcopy_save
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
--error 9,2304
--exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
--exec $MYSQLHOTCOPY --quiet --allowold -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--list_files $MYSQLD_DATADIR/hotcopy_save
# test of option "keepold"
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
--exec $MYSQLHOTCOPY --quiet --keepold -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--list_files $MYSQLD_DATADIR/hotcopy_save_old
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--list_files $MYSQLD_DATADIR/hotcopy_save
# test of option "suffix"
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
--exec $MYSQLHOTCOPY --quiet --suffix=_cpy -S $MASTER_MYSOCK -u root hotcopy_test
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--list_files $MYSQLD_DATADIR/hotcopy_test_cpy
DROP DATABASE hotcopy_test_cpy;
DROP DATABASE hotcopy_test;
DROP DATABASE hotcopy_save;
DROP DATABASE hotcopy_save_old;

View File

@ -1,6 +1,11 @@
# Test if MYSQLTEST_VARDIR is a soft link
# If we run in parallel, we have a suffix "/$child_num", so chop off that.
perl; perl;
my $path= $ENV{'MYSQLTEST_VARDIR'};
$path=~ s|/\d+$||;
open (ISLINK, ">" . $ENV{'MYSQL_TMP_DIR'} . "/mtr_var_link"); open (ISLINK, ">" . $ENV{'MYSQL_TMP_DIR'} . "/mtr_var_link");
my $mvr= -l $ENV{'MYSQLTEST_VARDIR'} ? 1 : 0; my $mvr= -l $path ? 1 : 0;
print ISLINK "let \$mtr_var_link= $mvr;\n"; print ISLINK "let \$mtr_var_link= $mvr;\n";
close ISLINK; close ISLINK;
EOF EOF

View File

@ -80,9 +80,8 @@ eval INSERT INTO t1 SET f1= $MAX + 1;
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
if ($show_binlog) if ($show_binlog)
{ {
--replace_result $VERSION VERSION --let $binlog_file= master-bin.$_log_num_s
--replace_column 2 # 5 # --source include/show_binlog_events.inc
eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
} }
sync_slave_with_master; sync_slave_with_master;
@ -93,9 +92,8 @@ connection slave;
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
if ($show_binlog) if ($show_binlog)
{ {
--replace_result $VERSION VERSION --let $binlog_file= slave-bin.$_log_num_s
--replace_column 2 # 5 # --source include/show_binlog_events.inc
eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
} }
############################################################### ###############################################################
@ -111,9 +109,8 @@ let $my_stmt= ERROR: YOU FORGOT TO FILL IN THE STATEMENT;
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
if ($show_binlog) if ($show_binlog)
{ {
--replace_result $VERSION VERSION --let $binlog_file= master-bin.$_log_num_s
--replace_column 2 # 5 # --source include/show_binlog_events.inc
eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
} }
sync_slave_with_master; sync_slave_with_master;
@ -124,9 +121,8 @@ connection slave;
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
if ($show_binlog) if ($show_binlog)
{ {
--replace_result $VERSION VERSION --let $binlog_file= slave-bin.$_log_num_s
--replace_column 2 # 5 # --source include/show_binlog_events.inc
eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
} }
############################################################### ###############################################################
@ -150,9 +146,8 @@ eval SELECT CONCAT(CONCAT('TEST-INFO: MASTER: The INSERT is ',
--enable_query_log --enable_query_log
if ($show_binlog) if ($show_binlog)
{ {
--replace_result $VERSION VERSION --let $binlog_file= master-bin.$_log_num_s
--replace_column 2 # 5 # --source include/show_binlog_events.inc
eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
} }
sync_slave_with_master; sync_slave_with_master;
@ -171,9 +166,8 @@ eval SELECT CONCAT(CONCAT('TEST-INFO: SLAVE: The INSERT is ',
--enable_query_log --enable_query_log
if ($show_binlog) if ($show_binlog)
{ {
--replace_result $VERSION VERSION --let $binlog_file= slave-bin.$_log_num_s
--replace_column 2 # 5 # --source include/show_binlog_events.inc
eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
} }
############################################################### ###############################################################

View File

@ -1,35 +1,21 @@
# $binlog_start can be set by caller or take a default value ##############################################################################
# $binary_log_file the name of the log file show # Show binary log events
# $binary_log_limit_row - sets the number of binlog rows to be returned #
# $binary_log_limit_offset - sets the offset where to start returning events # Useage:
# let $binlog_file= master-bin.000002;
# let $binlog_start= 106;
# let $binlog_limit= 1, 3;
# source include/show_binlog_events.inc;
#
# It shows the first binary log file if $binlog_file is not given.
#
# It shows events from the end position of the description event if
# $binlog_start is not given.
#
# It shows all of the events if $binlog_limit is not given.
# $binlog_format has the same semantic with 'LIMIT' option.
#
##############################################################################
let $show_binlog_events= show binlog events; --let $is_relay_log= 0
--source include/show_events.inc
if (!$binlog_start)
{
# defaults to chop the first event in the binary log
let $binlog_start=107;
}
if (!`SELECT '$binary_log_file' = ''`)
{
let $show_binlog_events= $show_binlog_events in '$binary_log_file';
}
let $show_binlog_events= $show_binlog_events from $binlog_start;
if ($binary_log_limit_row)
{
let $limit= limit;
if ($binary_log_limit_offset)
{
let $limit= $limit $binary_log_limit_offset, ;
}
let $limit= $limit $binary_log_limit_row;
let $show_binlog_events= $show_binlog_events $limit;
}
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start <binlog_start>
--replace_column 2 # 4 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/
--eval $show_binlog_events

View File

@ -0,0 +1,36 @@
##############################################################################
# It's an auxiliary file used to show binary log events or relay log events.
# It is only called by show_binlog_events.inc and show_relaylog_events.inc.
##############################################################################
if (!$binlog_start)
{
# If $binlog_start is not set, we will set it as the second event's
# position. The first event(Description Event) is always ignored. For
# description event's length might be changed because of adding new events,
# 'SHOW BINLOG EVENTS LIMIT 1' is used to get the right value.
--let $binlog_start= query_get_value(SHOW BINLOG EVENTS LIMIT 1, End_log_pos, 1)
}
--let $_statement=show binlog events
if ($is_relay_log)
{
--let $_statement=show relaylog events
}
if (`SELECT '$binlog_file' <> ''`)
{
--let $_statement= $_statement in '$binlog_file'
}
--let $_statement= $_statement from $binlog_start
if (`SELECT '$binlog_limit' <> ''`)
{
--let $_statement= $_statement limit $binlog_limit
}
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start <binlog_start>
--replace_column 2 # 4 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /Server ver:.*$/SERVER_VERSION, BINLOG_VERSION/
--eval $_statement

View File

@ -1,35 +1,21 @@
# $binlog_start can be set by caller or take a default value ##############################################################################
# $binary_log_file the name of the log file show # Show relay log events
# $binary_log_limit_row - sets the number of binlog rows to be returned #
# $binary_log_limit_offset - sets the offset where to start returning events # Useage:
# let $binlog_file= slave-relay-bin.000002;
# let $binlog_start= 106;
# let $binlog_limit= 1, 3;
# source include/show_relaylog_events.inc;
#
# It shows the first relay log file if $binlog_file is not given.
#
# It shows events from the end position of the description event if
# $binlog_start is not given.
#
# It shows all of the events if $binlog_limit is not given.
# $binlog_format has the same semantic with 'LIMIT' option.
#
##############################################################################
let $show_binlog_events= show relaylog events; --let $is_relay_log= 1
--source include/show_events.inc
if (!$binlog_start)
{
# defaults to chop the first event in the binary log
let $binlog_start=106;
}
if (!`SELECT '$binary_log_file' = ''`)
{
let $show_binlog_events= $show_binlog_events in '$binary_log_file';
}
let $show_binlog_events= $show_binlog_events from $binlog_start;
if ($binary_log_limit_row)
{
let $limit= limit;
if ($binary_log_limit_offset)
{
let $limit= $limit $binary_log_limit_offset, ;
}
let $limit= $limit $binary_log_limit_row;
let $show_binlog_events= $show_binlog_events $limit;
}
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start <binlog_start>
--replace_column 2 # 4 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /Server ver:.*$/SERVER_VERSION, BINLOG_VERSION/
--eval $show_binlog_events

View File

@ -36,6 +36,7 @@ let $_con= $CURRENT_CONNECTION;
--echo --echo
--echo [on $_con] --echo [on $_con]
--echo --echo
SELECT NOW();
--echo **** SHOW SLAVE STATUS on $_con **** --echo **** SHOW SLAVE STATUS on $_con ****
query_vertical SHOW SLAVE STATUS; query_vertical SHOW SLAVE STATUS;
--echo --echo
@ -70,6 +71,7 @@ if (`SELECT '$_master_con' != ''`)
--echo [on $_master_con] --echo [on $_master_con]
connection $_master_con; connection $_master_con;
--echo --echo
SELECT NOW();
--echo **** SHOW MASTER STATUS on $_master_con **** --echo **** SHOW MASTER STATUS on $_master_con ****
query_vertical SHOW MASTER STATUS; query_vertical SHOW MASTER STATUS;
--echo --echo

View File

@ -1,6 +1,25 @@
# Include file to show the slave status, masking out some information # Include file to show the slave status, masking out some information
# that varies depending on where the test is executed. # that varies depending on where the test is executed.
--replace_result $MASTER_MYPORT MASTER_PORT --let $_items=$status_items
--replace_column 1 # 8 # 9 # 16 # 23 # 33 # 35 # 36 # if (`SELECT "XX$status_items" = "XX"`)
query_vertical SHOW SLAVE STATUS; {
--die 'Variable status_items is NULL'
}
--disable_query_log
--vertical_results
while (`SELECT "XX$_items" <> "XX"`)
{
--let $_name= `SELECT SUBSTRING_INDEX('$_items', ',', 1)`
--let $_items= `SELECT LTRIM(SUBSTRING('$_items', LENGTH('$_name') + 2))`
--let $_value= query_get_value(SHOW SLAVE STATUS, $_name, 1)
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--eval SELECT "$_value" AS $_name
}
--horizontal_results
--enable_query_log

View File

@ -1,8 +0,0 @@
# Include file to show the slave status, masking out some information
# that varies depending on where the test is executed.
# masked out log positions
--replace_result $MASTER_MYPORT MASTER_PORT $DEFAULT_MASTER_PORT 3306
--replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
query_vertical SHOW SLAVE STATUS;

View File

@ -22,10 +22,9 @@ eval $test_insert;
connection slave; connection slave;
START SLAVE; START SLAVE;
--source include/wait_for_slave_sql_to_stop.inc --let $slave_sql_errno= 1677
--replace_result $MASTER_MYPORT MASTER_PORT --let $show_slave_sql_error= 1
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # --source include/wait_for_slave_sql_error.inc
--query_vertical SHOW SLAVE STATUS
# The following should be 0 # The following should be 0
SELECT COUNT(*) FROM t1; SELECT COUNT(*) FROM t1;

View File

@ -18,7 +18,7 @@ while (`SELECT INSTR("$_last_event","$wait_binlog_event") = 0`)
dec $_loop_count; dec $_loop_count;
if (!$_loop_count) if (!$_loop_count)
{ {
SHOW BINLOG EVENTS; --source include/show_rpl_debug_info.inc
--die ERROR: failed while waiting for $wait_binlog_event in binlog --die ERROR: failed while waiting for $wait_binlog_event in binlog
} }
real_sleep 0.1; real_sleep 0.1;

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