automerge

This commit is contained in:
unknown 2010-03-30 18:16:57 +02:00
commit 5a3b3d9afb
861 changed files with 26446 additions and 8918 deletions

View file

@ -40,15 +40,15 @@
*.dsp
*.Po
*.Plo
*/*.dir/*
*.dir/
*/*_pure_*warnings
*/.deps
*/.libs/*
*/.pure
*/debug/*
*/minsizerel/*
*/release/*
*/relwithdebinfo/*
debug/
MinSizeRel/
Release/
RelWithDebInfo/
*~
.*.swp
./CMakeCache.txt
@ -96,7 +96,7 @@ BitKeeper/tmp/gone
BitKeeper/tmp
BitKeeper/log
BitKeeper/etc/SCCS
CMakeFiles/*
CMakeFiles/
COPYING
COPYING.LIB
Docs/#manual.texi#

View file

@ -34,6 +34,7 @@ EXTRA_DIST = FINISH.sh \
compile-amd64-max \
compile-amd64-max-sci \
compile-amd64-valgrind-max \
compile-bintar \
compile-darwin-mwcc \
compile-dist \
compile-hpux11-parisc2-aCC \
@ -80,7 +81,8 @@ EXTRA_DIST = FINISH.sh \
compile-solaris-x86-32 \
compile-solaris-x86-32-debug \
compile-solaris-x86-32-debug-forte \
compile-solaris-x86-forte-32
compile-solaris-x86-forte-32 \
util.sh
# Don't update the files from bitkeeper
%::SCCS/s.%

View file

@ -86,15 +86,9 @@ set -e
#
path=`dirname $0`
. "$path/check-cpu"
. "$path/util.sh"
export AM_MAKEFLAGS
# Default to a parallel build, but only if AM_MAKEFLAGS is not set.
# (So buildbots can easily disable this behaviour if required.)
if test -z "$AM_MAKEFLAGS"
then
AM_MAKEFLAGS="-j 6"
fi
get_make_parallel_flag
# SSL library to use.--with-ssl will select our bundled yaSSL
# implementation of SSL. To use openSSl you will nee too point out

81
BUILD/compile-bintar Executable file
View file

@ -0,0 +1,81 @@
#!/bin/bash
#
# MariaDB SQL server.
# Copyright (C) 2010 Kristian Nielsen and Monty Program AB
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# This script's purpose is to build the binary tarball packages for MariaDB
# (currently only on Linux systems).
#
# Thus BUILD/compile-bintar from the appropriate source tarball will reproduce
# such a release, provided the build environment (gcc version etc.) matches
# (use scripts/make_binary_distribution after running this script to actually
# create the binary tarball package).
#
# Note that packages are built from source tarballs not bzr checkouts.
# Therefore, this script assumes autotools have already been run.
#
# We link libc dynamically, otherwise we get lots of problems loading
# .so files at runtime (either system stuff like NSS, or server
# plugins).
#
# We link libgcc statically (and avoid linking libstdc++ at all by
# CXX=gcc), to avoid reduce nasty library version dependencies.
test -f Makefile && make distclean
path=`dirname $0`
. $path/util.sh
SYSTEM_TYPE="$(uname -o)"
MACHINE_TYPE="$(uname -m)"
# We cannot have a slash '/' in tarfile name.
SYSTEM_TYPE="$(echo ${SYSTEM_TYPE} | sed -e 's/GNU\///')"
# Get correct options for architecture into CPUOPT.
get_cpuopt
# Get correct -j option into AM_MAKEFLAGS
get_make_parallel_flag
# Use gcc rather than g++ to avoid linking libstdc++.so (which we don't need).
COMP="gcc -static-libgcc"
FLAGS="-O2 -fno-omit-frame-pointer -g -pipe -Wall $CPUOPT"
# Don't press on in case of error.
set -e
CC="$COMP" CXX="$COMP" CFLAGS="$FLAGS" CXXFLAGS="$FLAGS" \
./configure \
--prefix=/usr/local/mysql \
--exec-prefix=/usr/local/mysql \
--libexecdir=/usr/local/mysql/bin \
--localstatedir=/usr/local/mysql/data \
\
--with-comment="(MariaDB - http://mariadb.com/)" \
--with-system-type="${SYSTEM_TYPE}" \
--with-machine-type="${MACHINE_TYPE}" \
\
--enable-shared --enable-static \
--with-client-ldflags=-static --with-mysqld-ldflags=-static \
--enable-thread-safe-client --enable-local-infile --with-big-tables \
--without-docs --with-extra-charsets=all \
--with-libwrap --with-ssl --with-readline --with-libevent --with-zlib-dir=bundled \
--with-partition --with-embedded-server \
--with-plugins=max-no-ndb \
--without-plugin-innodb_plugin
make $AM_MAKEFLAGS

View file

@ -9,9 +9,9 @@ export CCACHE_DISABLE
export LDFLAGS="$gcov_link_flags"
extra_flags="$pentium64_cflags $debug_cflags $max_cflags $gcov_compile_flags"
extra_flags="$pentium64_cflags $max_cflags $gcov_compile_flags"
c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium64_configs $debug_configs $gcov_configs $max_configs"
extra_configs="$pentium_configs $debug_configs $gcov_configs $max_configs --with-zlib-dir=bundled"
. "$path/FINISH.sh"

View file

@ -4,6 +4,6 @@ path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium64_cflags $gprof_compile_flags"
extra_configs="$pentium64_configs $debug_configs $gprof_link_flags"
extra_configs="$pentium_configs $max_configs $gprof_link_flags --with-zlib-dir=bundled"
. "$path/FINISH.sh"

0
BUILD/compile-solaris-amd64-debug-forte Normal file → Executable file
View file

0
BUILD/compile-solaris-x86-32 Normal file → Executable file
View file

0
BUILD/compile-solaris-x86-32-debug Normal file → Executable file
View file

0
BUILD/compile-solaris-x86-32-debug-forte Normal file → Executable file
View file

0
BUILD/compile-solaris-x86-forte-32 Normal file → Executable file
View file

48
BUILD/util.sh Normal file
View file

@ -0,0 +1,48 @@
# MariaDB SQL server.
# Copyright (C) 2010 Kristian Nielsen and Monty Program AB
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Setting cpu options.
get_cpuopt () {
case "$(uname -o)" in
*Linux*)
case "$(gcc -dumpmachine)" in
x86_64-*)
# gcc barfs on -march=... on x64
CPUOPT="-m64 -mtune=generic"
;;
*)
# we'd use i586 to not trip up mobile/lowpower devices
CPUOPT="-m32 -march=i586 -mtune=generic"
;;
esac
;;
*Solaris*)
# ToDo: handle 32-bit build? For now default to 64-bit.
CPUOPT="-D__sun -m64 -mtune=athlon64"
;;
esac
return 0
}
# Default to a parallel build, but only if AM_MAKEFLAGS is not set.
# (So buildbots can easily disable this behaviour if required.)
get_make_parallel_flag () {
if test -z "$AM_MAKEFLAGS"
then
AM_MAKEFLAGS="-j 6"
fi
return 0
}

View file

@ -208,10 +208,6 @@ test-bt-fast:
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=stress --suite=stress
test-bt-fast2:
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=ps --ps-protocol --report-features
test-bt-debug:
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=debug --force --timer \

View file

@ -31,6 +31,15 @@
# endif
#endif
/* Version numbers for deprecation messages */
#define VER_CELOSIA "5.6"
#define WARN_DEPRECATED(Ver,Old,New) \
do { \
printf("Warning: The option '%s' is deprecated and will be removed " \
"in a future release. Please use %s instead.\n", (Old), (New)); \
} while(0);
enum options_client
{
OPT_CHARSETS_DIR=256, OPT_DEFAULT_CHARSET,
@ -48,8 +57,8 @@ enum options_client
OPT_PROMPT, OPT_IGN_LINES,OPT_TRANSACTION,OPT_MYSQL_PROTOCOL,
OPT_SHARED_MEMORY_BASE_NAME, OPT_FRM, OPT_SKIP_OPTIMIZATION,
OPT_COMPATIBLE, OPT_RECONNECT, OPT_DELIMITER, OPT_SECURE_AUTH,
OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_CREATE_OPTIONS, OPT_SERVER_ARG,
OPT_START_POSITION, OPT_STOP_POSITION, OPT_START_DATETIME, OPT_STOP_DATETIME,
OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_SERVER_ARG,
OPT_POSITION, OPT_STOP_POSITION, OPT_START_DATETIME, OPT_STOP_DATETIME,
OPT_SIGINT_IGNORE, OPT_HEXBLOB, OPT_ORDER_BY_PRIMARY, OPT_COUNT,
#ifdef HAVE_NDBCLUSTER_DB
OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING,
@ -81,5 +90,7 @@ enum options_client
OPT_DEBUG_INFO, OPT_DEBUG_CHECK, OPT_COLUMN_TYPES, OPT_ERROR_LOG_FILE,
OPT_WRITE_BINLOG, OPT_DUMP_DATE,
OPT_ABORT_SOURCE_ON_ERROR,
OPT_FIRST_SLAVE,
OPT_ALL,
OPT_MAX_CLIENT_OPTION
};

View file

@ -54,6 +54,9 @@ static char *server_version= NULL;
/* Array of options to pass to libemysqld */
#define MAX_SERVER_ARGS 64
/* Version numbers for deprecation messages */
#define VER_CELOSIA "5.6"
void* sql_alloc(unsigned size); // Don't use mysqld alloc for these
void sql_element_free(void *ptr);
#include "sql_string.h"
@ -1349,7 +1352,7 @@ static struct my_option my_long_options[] =
(uchar**) &opt_rehash, (uchar**) &opt_rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
0, 0},
{"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. WARNING: options deprecated; use --disable-auto-rehash instead.",
"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},
{"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},
@ -1418,7 +1421,7 @@ static struct my_option my_long_options[] =
{"line-numbers", OPT_LINE_NUMBERS, "Write line numbers for errors.",
(uchar**) &line_numbers, (uchar**) &line_numbers, 0, GET_BOOL,
NO_ARG, 1, 0, 0, 0, 0, 0},
{"skip-line-numbers", 'L', "Don't write line number for errors. WARNING: -L is deprecated, use long version of this option instead.", 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},
{"unbuffered", 'n', "Flush buffer after each query.", (uchar**) &unbuffered,
(uchar**) &unbuffered, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
@ -1426,7 +1429,7 @@ static struct my_option my_long_options[] =
(uchar**) &column_names, (uchar**) &column_names, 0, GET_BOOL,
NO_ARG, 1, 0, 0, 0, 0, 0},
{"skip-column-names", 'N',
"Don't write column names in results. WARNING: -N is deprecated, use long version of this options instead.",
"Don't write column names in results.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"set-variable", 'O',
"Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
@ -1633,7 +1636,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
init_tee(argument);
break;
case OPT_NOTEE:
printf("WARNING: option deprecated; use --disable-tee instead.\n");
WARN_DEPRECATED(VER_CELOSIA, "--no-tee", "--disable-tee");
if (opt_outfile)
end_tee();
break;
@ -1656,7 +1659,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
}
break;
case OPT_NOPAGER:
printf("WARNING: option deprecated; use --disable-pager instead.\n");
WARN_DEPRECATED(VER_CELOSIA, "--no-pager", "--disable-pager");
opt_nopager= 1;
break;
case OPT_MYSQL_PROTOCOL:
@ -1702,12 +1705,18 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
if (!(status.line_buff= batch_readline_command(status.line_buff, argument)))
return 1;
break;
case 'g':
WARN_DEPRECATED(VER_CELOSIA, "-g, --no-named-commands", "--skip-named-commands");
break;
case 'o':
if (argument == disabled_my_option)
one_database= 0;
else
one_database= skip_updates= 1;
break;
case 'O':
WARN_DEPRECATED(VER_CELOSIA, "-O, --set-variable", "--variable-name=value");
break;
case 'p':
if (argument == disabled_my_option)
argument= (char*) ""; // Don't require password
@ -3530,7 +3539,8 @@ print_table_data_vertically(MYSQL_RES *result)
for (uint off=0; off < mysql_num_fields(result); off++)
{
field= mysql_fetch_field(result);
tee_fprintf(PAGER, "%*s: ",(int) max_length,field->name);
if (column_names)
tee_fprintf(PAGER, "%*s: ",(int) max_length,field->name);
if (cur[off])
{
unsigned int i;
@ -4215,7 +4225,7 @@ char *get_arg(char *line, my_bool get_next_arg)
if (*ptr == '\\' && ptr[1]) // escaped character
{
// Remove the backslash
strmov(ptr, ptr+1);
strmov_overlapp(ptr, ptr+1);
}
else if ((!quoted && *ptr == ' ') || (quoted && *ptr == qtype))
{
@ -4356,7 +4366,7 @@ com_status(String *buffer __attribute__((unused)),
Don't remove "limit 1",
it is protection againts SQL_SELECT_LIMIT=0
*/
if (mysql_store_result_for_lazy(&result))
if (!mysql_store_result_for_lazy(&result))
{
MYSQL_ROW cur=mysql_fetch_row(result);
if (cur)
@ -4401,7 +4411,7 @@ com_status(String *buffer __attribute__((unused)),
if (mysql_errno(&mysql) == CR_SERVER_GONE_ERROR)
return 0;
}
if (mysql_store_result_for_lazy(&result))
if (!mysql_store_result_for_lazy(&result))
{
MYSQL_ROW cur=mysql_fetch_row(result);
if (cur)
@ -4496,9 +4506,7 @@ server_version_string(MYSQL *con)
*/
if (server_version == NULL)
{
server_version= strdup(mysql_get_server_info(con));
}
server_version= my_strdup(mysql_get_server_info(con), MYF(MY_WME));
}
return server_version ? server_version : "";

View file

@ -776,6 +776,10 @@ static int run_sql_fix_privilege_tables(void)
found_real_errors++;
print_line(line);
}
else if (strncmp(line, "WARNING", 7) == 0)
{
print_line(line);
}
} while ((line= get_line(line)) && *line);
}

View file

@ -282,6 +282,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
charsets_dir = argument;
#endif
break;
case 'O':
WARN_DEPRECATED(VER_CELOSIA, "--set-variable", "--variable-name=value");
break;
case OPT_MYSQL_PROTOCOL:
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
opt->name);

View file

@ -41,6 +41,7 @@
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_LOCAL_FILES)
char server_version[SERVER_VERSION_LENGTH];
ulong server_id = 0;
@ -1060,7 +1061,7 @@ static struct my_option my_long_options[] =
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
(uchar**) &port, (uchar**) &port, 0, GET_INT, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"position", 'j', "Deprecated. Use --start-position instead.",
{"position", OPT_POSITION, "Deprecated. Use --start-position instead.",
(uchar**) &start_position, (uchar**) &start_position, 0, GET_ULL,
REQUIRED_ARG, BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE,
/* COM_BINLOG_DUMP accepts only 4 bytes for the position */
@ -1103,7 +1104,7 @@ static struct my_option my_long_options[] =
"(you should probably use quotes for your shell to set it properly).",
(uchar**) &start_datetime_str, (uchar**) &start_datetime_str,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"start-position", OPT_START_POSITION,
{"start-position", 'j',
"Start reading the binlog at position N. Applies to the first binlog "
"passed on the command line.",
(uchar**) &start_position, (uchar**) &start_position, 0, GET_ULL,
@ -1314,6 +1315,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case 'R':
remote_opt= 1;
break;
case OPT_POSITION:
WARN_DEPRECATED(VER_CELOSIA, "--position", "--start-position");
break;
case OPT_MYSQL_PROTOCOL:
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
opt->name);
@ -1378,6 +1382,10 @@ static int parse_args(int *argc, char*** argv)
*/
static Exit_status safe_connect()
{
/* Close and old connections to MySQL */
if (mysql)
mysql_close(mysql);
mysql= mysql_init(NULL);
if (!mysql)

View file

@ -179,7 +179,7 @@ HASH ignore_table;
static struct my_option my_long_options[] =
{
{"all", 'a', "Deprecated. Use --create-options instead.",
{"all", OPT_ALL, "Deprecated. Use --create-options instead.",
(uchar**) &create_options, (uchar**) &create_options, 0, GET_BOOL, NO_ARG, 1,
0, 0, 0, 0, 0},
{"all-databases", 'A',
@ -230,7 +230,7 @@ static struct my_option my_long_options[] =
{"compress", 'C', "Use compression in server/client protocol.",
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"create-options", OPT_CREATE_OPTIONS,
{"create-options", 'a',
"Include all MySQL specific create options.",
(uchar**) &create_options, (uchar**) &create_options, 0, GET_BOOL, NO_ARG, 1,
0, 0, 0, 0, 0},
@ -268,7 +268,7 @@ static struct my_option my_long_options[] =
(uchar**) &opt_events, (uchar**) &opt_events, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"extended-insert", 'e',
"Allows utilization of the new, much faster INSERT syntax.",
"Use multiple-row INSERT syntax that include several VALUES lists.",
(uchar**) &extended_insert, (uchar**) &extended_insert, 0, GET_BOOL, NO_ARG,
1, 0, 0, 0, 0, 0},
{"fields-terminated-by", OPT_FTB,
@ -282,7 +282,7 @@ static struct my_option my_long_options[] =
(uchar**) &opt_enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
{"fields-escaped-by", OPT_ESC, "Fields in the i.file are escaped by ...",
(uchar**) &escaped, (uchar**) &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"first-slave", 'x', "Deprecated, renamed to --lock-all-tables.",
{"first-slave", OPT_FIRST_SLAVE, "Deprecated, renamed to --lock-all-tables.",
(uchar**) &opt_lock_all_tables, (uchar**) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"flush-logs", 'F', "Flush logs file in server before starting dump. "
@ -366,8 +366,7 @@ static struct my_option my_long_options[] =
NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-data", 'd', "No row information.", (uchar**) &opt_no_data,
(uchar**) &opt_no_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-set-names", 'N',
"Deprecated. Use --skip-set-charset instead.",
{"no-set-names", 'N',"Suppress the SET NAMES statement",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"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.",
@ -760,6 +759,15 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case '?':
usage();
exit(0);
case 'O':
WARN_DEPRECATED(VER_CELOSIA, "--set-variable", "--variable-name=value");
break;
case (int) OPT_ALL:
WARN_DEPRECATED(VER_CELOSIA, "--all", "--create-options");
break;
case (int) OPT_FIRST_SLAVE:
WARN_DEPRECATED(VER_CELOSIA, "--first-slave", "--lock-all-tables");
break;
case (int) OPT_MASTER_DATA:
if (!argument) /* work like in old versions */
opt_master_data= MYSQL_OPT_MASTER_DATA_EFFECTIVE_SQL;
@ -808,7 +816,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
&err_ptr, &err_len);
if (err_len)
{
strmake(buff, err_ptr, min(sizeof(buff), err_len));
strmake(buff, err_ptr, min(sizeof(buff) - 1, err_len));
fprintf(stderr, "Invalid mode to --compatible: %s\n", buff);
exit(1);
}
@ -4486,7 +4494,7 @@ static ulong find_set(TYPELIB *lib, const char *x, uint length,
for (; pos != end && *pos != ','; pos++) ;
var_len= (uint) (pos - start);
strmake(buff, start, min(sizeof(buff), var_len));
strmake(buff, start, min(sizeof(buff) - 1, var_len));
find= find_type(buff, lib, var_len);
if (!find)
{

View file

@ -292,6 +292,25 @@ static int gettimeofday(struct timeval *tp, void *tzp)
}
#endif
void set_mysql_connect_options(MYSQL *mysql)
{
if (opt_compress)
mysql_options(mysql,MYSQL_OPT_COMPRESS,NullS);
#ifdef HAVE_OPENSSL
if (opt_use_ssl)
mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
#endif
if (opt_protocol)
mysql_options(mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
#ifdef HAVE_SMEM
if (shared_memory_base_name)
mysql_options(mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset);
}
int main(int argc, char **argv)
{
MYSQL mysql;
@ -323,20 +342,7 @@ int main(int argc, char **argv)
exit(1);
}
mysql_init(&mysql);
if (opt_compress)
mysql_options(&mysql,MYSQL_OPT_COMPRESS,NullS);
#ifdef HAVE_OPENSSL
if (opt_use_ssl)
mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
#endif
if (opt_protocol)
mysql_options(&mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
#ifdef HAVE_SMEM
if (shared_memory_base_name)
mysql_options(&mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
set_mysql_connect_options(&mysql);
if (!opt_only_print)
{
@ -1815,6 +1821,7 @@ pthread_handler_t run_task(void *p)
my_progname, mysql_error(mysql));
exit(0);
}
set_mysql_connect_options(mysql);
if (mysql_thread_init())
{
@ -1855,7 +1862,6 @@ limit_not_met:
my_progname, mysql_error(mysql));
exit(0);
}
if (slap_connect(mysql))
goto end;
}
@ -2223,6 +2229,7 @@ slap_connect(MYSQL *mysql)
int x, connect_error= 1;
for (x= 0; x < 10; x++)
{
set_mysql_connect_options(mysql);
if (mysql_real_connect(mysql, host, user, opt_password,
create_schema_string,
opt_mysql_port,

View file

@ -657,7 +657,9 @@ public:
}
while ((bytes= fread(buf, 1, sizeof(buf), m_file)) > 0)
fwrite(buf, 1, bytes, stderr);
if (fwrite(buf, 1, bytes, stderr))
die("Failed to write to '%s', errno: %d",
m_file_name, errno);
if (!lines)
{
@ -1267,6 +1269,7 @@ void abort_not_supported_test(const char *fmt, ...)
DBUG_ENTER("abort_not_supported_test");
/* Print include filestack */
fflush(stdout);
fprintf(stderr, "The test '%s' is not supported by this installation\n",
file_stack->file_name);
fprintf(stderr, "Detected in file %s at line %d\n",
@ -8098,7 +8101,10 @@ int main(int argc, char **argv)
abort_flag= 1;
break;
case Q_SKIP:
abort_not_supported_test("%s", command->first_argument);
/* Eval the query, thus replacing all environment variables */
dynstr_set(&ds_res, 0);
do_eval(&ds_res, command->first_argument, command->end, FALSE);
abort_not_supported_test("%s",ds_res.str);
break;
case Q_RESULT:

View file

@ -14,13 +14,6 @@ AC_DEFUN([MYSQL_USE_BUNDLED_LIBEVENT], [
libevent_libs="\$(top_builddir)/extra/libevent/libevent.a"
libevent_includes="-I\$(top_srcdir)/extra/libevent"
libevent_test_option="--mysqld=--thread-handling=pool-of-threads"
AC_SUBST(libevent_libs)
AC_SUBST(libevent_includes)
AC_SUBST(libevent_test_option)
AC_DEFINE([HAVE_LIBEVENT], [1], [If we want to use libevent and have connection pooling])
AC_MSG_RESULT([using bundled libevent])
dnl Get the upstream file with the original libevent configure macros.
dnl Use builtin include for this, to work around path problems in old versions of aclocal.
@ -39,17 +32,64 @@ AC_DEFUN([MYSQL_CHECK_LIBEVENT], [
AC_CONFIG_FILES(extra/libevent/Makefile)
AC_MSG_CHECKING(for libevent)
AC_ARG_WITH([libevent],
[ --with-libevent use libevent and have connection pooling],
[with_libevent=$withval],
[with_libevent=no]
)
AC_MSG_NOTICE([checking what libevent library to use])
if test "$with_libevent" != "no"; then
MYSQL_USE_BUNDLED_LIBEVENT
else
AC_MSG_RESULT([disabled])
AC_ARG_WITH([libevent],
AC_HELP_STRING([--with-libevent=yes|no|bundled|DIR],
[Use libevent and have connection pooling.
A location of libevent library can be specified.
Given DIR, libevent library is
assumed to be in $DIR/lib and header files
in $DIR/include.]),
[with_libevent=${withval}],
[with_libevent=no])
case "$with_libevent" in
"no")
with_libevent=disabled
;;
"bundled")
MYSQL_USE_BUNDLED_LIBEVENT
;;
"" | "yes")
libevent_includes=""
libevent_libs="-levent"
AC_CHECK_LIB(event, evutil_socketpair,[with_libevent=system],
[with_libevent=bundled])
AC_CHECK_HEADER(evutil.h,,[with_libevent=bundled])
if test "$with_libevent" = "bundled"; then
MYSQL_USE_BUNDLED_LIBEVENT
fi
;;
*)
# Test for libevent using all known library file endings
if test \( -f "$with_libevent/lib/libevent.a" -o \
-f "$with_libevent/lib/libevent.so" -o \
-f "$with_libevent/lib/libevent.sl" -o \
-f "$with_libevent/lib/libevent.dylib" \) \
-a -f "$with_libevent/include/evutil.h"; then
libevent_includes="-I$with_libevent/include"
libevent_libs="-L$with_libevent/lib -levent"
AC_CHECK_LIB(event, evutil_socketpair,[with_libevent=$with_libevent],
[with_libevent=no], [$libevent_libs])
else
with_libevent=no
fi
if test "$with_libevent" = "no"; then
AC_MSG_ERROR([libevent headers or binaries were not found])
fi
;;
esac
AC_MSG_CHECKING(for libevent)
AC_MSG_RESULT([$with_libevent])
if test "$with_libevent" != "disabled"; then
libevent_test_option="--mysqld=--thread-handling=pool-of-threads"
AC_SUBST(libevent_libs)
AC_SUBST(libevent_includes)
AC_SUBST(libevent_test_option)
AC_DEFINE([HAVE_LIBEVENT], [1], [If we want to use libevent and have connection pooling])
fi
AM_CONDITIONAL([HAVE_LIBEVENT], [ test "$with_libevent" != "no" ])
AM_CONDITIONAL([HAVE_LIBEVENT], [ test "$with_libevent" != "disabled" ])
])

View file

@ -1,22 +1,28 @@
dnl -*- ksh -*-
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.52)dnl Minimum Autoconf version required.
# Minimum Autoconf version required.
AC_PREREQ(2.59)
AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line!
# remember to also update version.c in ndb
#
# Remember to also update version.c in ndb.
# When changing major version number please also check switch statement
# in mysqlbinlog.cc / check_master_version().
#
# When merging new MySQL releases, update the version number to match the
# MySQL version number.
#
# Note: the following line must be parseable by win/configure.js:GetVersion()
AM_INIT_AUTOMAKE(mysql, 5.1.41-MariaDB-rc)
AM_CONFIG_HEADER([include/config.h:config.h.in])
# in mysqlbinlog::check_master_version().
AC_INIT([MariaDB Server], [5.1.44-MariaDB], [], [mysql])
AC_CONFIG_SRCDIR([sql/mysqld.cc])
AC_CANONICAL_SYSTEM
# USTAR format gives us the possibility to store longer path names in
# TAR files, the path name is split into two parts, a 155 chacater
# first part and a 100 character second part.
AM_INIT_AUTOMAKE([1.9 tar-ustar])
AC_PROG_LIBTOOL
AM_CONFIG_HEADER([include/config.h])
# Request support for automake silent-rules if available.
# Default to verbose output. One can use the configure-time
# option --enable-silent-rules or make V=0 to activate
# silent rules.
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])])
PROTOCOL_VERSION=10
DOT_FRM_VERSION=6
@ -30,12 +36,14 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0
# Remember that regexps needs to quote [ and ] since this is run through m4
# We take some made up examples
#
# VERSION 5.1.40sp1-alpha 5.0.34a
# MYSQL_NO_DASH_VERSION 5.1.40sp1 5.0.34a
# MYSQL_NUMERIC_VERSION 5.1.40 5.0.34
# MYSQL_BASE_VERSION 5.1 5.0
# MYSQL_VERSION_ID 50140 50034
# VERSION 5.1.40sp1-alpha 5.0.34a 5.5.1-m2
# MYSQL_U_SCORE_VERSION 5.1.40sp1_alpha 5.0.34a 5.5.1_m2
# MYSQL_NO_DASH_VERSION 5.1.40sp1 5.0.34a 5.5.1
# MYSQL_NUMERIC_VERSION 5.1.40 5.0.34 5.5.1
# MYSQL_BASE_VERSION 5.1 5.0 5.5
# MYSQL_VERSION_ID 50140 50034 50501
#
MYSQL_U_SCORE_VERSION=`echo $VERSION | sed -e "s|-|_|"`
MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
MYSQL_NUMERIC_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
MYSQL_BASE_VERSION=`echo $MYSQL_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
@ -73,6 +81,7 @@ romanian russian serbian slovak spanish swedish ukrainian"
#####
#####
AC_SUBST(MYSQL_U_SCORE_VERSION)
AC_SUBST(MYSQL_NO_DASH_VERSION)
AC_SUBST(MYSQL_BASE_VERSION)
AC_SUBST(MYSQL_VERSION_ID)
@ -224,14 +233,6 @@ then
GXX="no"
fi
if test "$ac_cv_prog_gcc" = "yes"
then
AS="$CC -c"
AC_SUBST(AS)
else
AC_PATH_PROG(AS, as, as)
fi
# Still need ranlib for readline; local static use only so no libtool.
AC_PROG_RANLIB
# We use libtool
@ -611,7 +612,7 @@ AC_CHECK_TOOL([NM], [nm])
if test "$TARGET_LINUX" = "true" -a "$static_nss" = ""
then
tmp=`$NM ${other_libc_lib:-/usr/lib*}/libc.a | grep _nss_files_getaliasent_r1`
tmp=`$NM ${other_libc_lib:-/usr/lib*}/libc.a 2>&1 | grep _nss_files_getaliasent_r1`
if test -n "$tmp"
then
STATIC_NSS_FLAGS="-lc -lnss_files -lnss_dns -lresolv"
@ -688,7 +689,7 @@ AC_ARG_ENABLE(assembler,
AC_MSG_CHECKING(if we should use assembler functions)
# For now we only support assembler on i386 and sparc systems
AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS strings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;))
AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $CCAS $CCASFLAGS -c strings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;))
AM_CONDITIONAL(ASSEMBLER_sparc32, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparc")
AM_CONDITIONAL(ASSEMBLER_sparc64, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparcv9")
AM_CONDITIONAL(ASSEMBLER, test "$ASSEMBLER_x86_TRUE" = "" -o "$ASSEMBLER_sparc32_TRUE" = "")
@ -2102,7 +2103,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \
sighold sigset sigthreadmask port_create sleep thr_yield \
snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr \
strtol strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr \
posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd)
posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd printstack)
#
#
@ -2945,7 +2946,8 @@ echo " * Community Features: $ENABLE_COMMUNITY_FEATURES"
echo ""
echo "---"
# The following text is checked in ./Do-compile to verify that configure
# The first line "Thank you ..." is checked in ./Do-compile to verify that configure
# ended sucessfully - don't remove it.
echo
echo "Thank you for choosing MariaDB!"
echo

View file

@ -660,7 +660,7 @@ static ha_checksum checksum_format_specifier(const char* msg)
case 'u':
case 'x':
case 's':
chksum= my_checksum(chksum, start, (uint) (p - start));
chksum= my_checksum(chksum, (uchar*) start, (uint) (p + 1 - start));
start= 0; /* Not in format specifier anymore */
break;
@ -1030,8 +1030,10 @@ static char *parse_text_line(char *pos)
{
int i, nr;
char *row= pos;
size_t len;
DBUG_ENTER("parse_text_line");
len= strlen (pos);
while (*pos)
{
if (*pos == '\\')
@ -1039,11 +1041,11 @@ static char *parse_text_line(char *pos)
switch (*++pos) {
case '\\':
case '"':
VOID(strmov(pos - 1, pos));
VOID(memmove (pos - 1, pos, len - (row - pos)));
break;
case 'n':
pos[-1]= '\n';
VOID(strmov(pos, pos + 1));
VOID(memmove (pos, pos + 1, len - (row - pos)));
break;
default:
if (*pos >= '0' && *pos < '8')
@ -1053,10 +1055,10 @@ static char *parse_text_line(char *pos)
nr= nr * 8 + (*(pos++) - '0');
pos -= i;
pos[-1]= nr;
VOID(strmov(pos, pos + i));
VOID(memmove (pos, pos + i, len - (row - pos)));
}
else if (*pos)
VOID(strmov(pos - 1, pos)); /* Remove '\' */
VOID(memmove (pos - 1, pos, len - (row - pos))); /* Remove '\' */
}
}
else

View file

@ -140,7 +140,7 @@ devpoll_init(struct event_base *base)
return (NULL);
if (getrlimit(RLIMIT_NOFILE, &rl) == 0 &&
rl.rlim_cur != RLIM_INFINITY)
(unsigned long long) rl.rlim_cur != (unsigned long long) RLIM_INFINITY)
nfiles = rl.rlim_cur - 1;
/* Initialize the kernel queue */

View file

@ -25,12 +25,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/types.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <sys/types.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif

View file

@ -144,7 +144,7 @@ kq_init(struct event_base *base)
*/
if (kevent(kq,
kqueueop->changes, 1, kqueueop->events, NEVENT, NULL) != 1 ||
kqueueop->events[0].ident != -1 ||
((int) kqueueop->events[0].ident) != -1 ||
kqueueop->events[0].flags != EV_ERROR) {
event_warn("%s: detected broken kqueue; not using.", __func__);
free(kqueueop->changes);

View file

@ -266,7 +266,7 @@ select_add(void *arg, struct event *ev)
* of the fd_sets for select(2)
*/
if (sop->event_fds < ev->ev_fd) {
int fdsz = sop->event_fdsz;
unsigned int fdsz = sop->event_fdsz;
if (fdsz < sizeof(fd_mask))
fdsz = sizeof(fd_mask);
@ -275,7 +275,7 @@ select_add(void *arg, struct event *ev)
(howmany(ev->ev_fd + 1, NFDBITS) * sizeof(fd_mask)))
fdsz *= 2;
if (fdsz != sop->event_fdsz) {
if (fdsz != (unsigned int) sop->event_fdsz) {
if (select_resize(sop, fdsz)) {
check_selectop(sop);
return (-1);

View file

@ -60,7 +60,7 @@ void SetErrorString(YasslError error, char* buffer)
using namespace TaoCrypt;
const int max = MAX_ERROR_SZ; // shorthand
switch (error) {
switch ((int) error) {
// yaSSL proper errors
case range_error :

View file

@ -305,6 +305,7 @@ private:
bool ValidateSignature(SignerList*);
bool ConfirmSignature(Source&);
void GetKey();
char* AddTag(char*, const char*, const char*, word32, word32);
void GetName(NameType);
void GetValidity();
void GetDate(DateType);

View file

@ -652,6 +652,23 @@ word32 CertDecoder::GetDigest()
}
char *CertDecoder::AddTag(char *ptr, const char *buf_end,
const char *tag_name, word32 tag_name_length,
word32 tag_value_length)
{
if (ptr + tag_name_length + tag_value_length > buf_end)
return 0;
memcpy(ptr, tag_name, tag_name_length);
ptr+= tag_name_length;
memcpy(ptr, source_.get_current(), tag_value_length);
ptr+= tag_value_length;
return ptr;
}
// process NAME, either issuer or subject
void CertDecoder::GetName(NameType nt)
{
@ -659,11 +676,21 @@ void CertDecoder::GetName(NameType nt)
SHA sha;
word32 length = GetSequence(); // length of all distinguished names
assert (length < ASN_NAME_MAX);
if (length >= ASN_NAME_MAX)
goto err;
length += source_.get_index();
char* ptr = (nt == ISSUER) ? issuer_ : subject_;
word32 idx = 0;
char *ptr, *buf_end;
if (nt == ISSUER) {
ptr= issuer_;
buf_end= ptr + sizeof(issuer_) - 1; // 1 byte for trailing 0
}
else {
ptr= subject_;
buf_end= ptr + sizeof(subject_) - 1; // 1 byte for trailing 0
}
while (source_.get_index() < length) {
GetSet();
@ -685,47 +712,36 @@ void CertDecoder::GetName(NameType nt)
byte id = source_.next();
b = source_.next(); // strType
word32 strLen = GetLength(source_);
bool copy = false;
if (id == COMMON_NAME) {
memcpy(&ptr[idx], "/CN=", 4);
idx += 4;
copy = true;
}
else if (id == SUR_NAME) {
memcpy(&ptr[idx], "/SN=", 4);
idx += 4;
copy = true;
}
else if (id == COUNTRY_NAME) {
memcpy(&ptr[idx], "/C=", 3);
idx += 3;
copy = true;
}
else if (id == LOCALITY_NAME) {
memcpy(&ptr[idx], "/L=", 3);
idx += 3;
copy = true;
}
else if (id == STATE_NAME) {
memcpy(&ptr[idx], "/ST=", 4);
idx += 4;
copy = true;
}
else if (id == ORG_NAME) {
memcpy(&ptr[idx], "/O=", 3);
idx += 3;
copy = true;
}
else if (id == ORGUNIT_NAME) {
memcpy(&ptr[idx], "/OU=", 4);
idx += 4;
copy = true;
}
if (copy) {
memcpy(&ptr[idx], source_.get_current(), strLen);
idx += strLen;
switch (id) {
case COMMON_NAME:
if (!(ptr= AddTag(ptr, buf_end, "/CN=", 4, strLen)))
goto err;
break;
case SUR_NAME:
if (!(ptr= AddTag(ptr, buf_end, "/SN=", 4, strLen)))
goto err;
break;
case COUNTRY_NAME:
if (!(ptr= AddTag(ptr, buf_end, "/C=", 3, strLen)))
goto err;
break;
case LOCALITY_NAME:
if (!(ptr= AddTag(ptr, buf_end, "/L=", 3, strLen)))
goto err;
break;
case STATE_NAME:
if (!(ptr= AddTag(ptr, buf_end, "/ST=", 4, strLen)))
goto err;
break;
case ORG_NAME:
if (!(ptr= AddTag(ptr, buf_end, "/O=", 3, strLen)))
goto err;
break;
case ORGUNIT_NAME:
if (!(ptr= AddTag(ptr, buf_end, "/OU=", 4, strLen)))
goto err;
break;
}
sha.Update(source_.get_current(), strLen);
@ -739,23 +755,20 @@ void CertDecoder::GetName(NameType nt)
source_.advance(oidSz + 1);
word32 length = GetLength(source_);
if (email) {
memcpy(&ptr[idx], "/emailAddress=", 14);
idx += 14;
memcpy(&ptr[idx], source_.get_current(), length);
idx += length;
}
if (email && !(ptr= AddTag(ptr, buf_end, "/emailAddress=", 14, length)))
goto err;
source_.advance(length);
}
}
ptr[idx++] = 0;
*ptr= 0;
if (nt == ISSUER)
sha.Final(issuerHash_);
else
sha.Final(subjectHash_);
sha.Final(nt == ISSUER ? issuerHash_ : subjectHash_);
return;
err:
source_.SetError(CONTENT_E);
}

View file

@ -192,7 +192,7 @@ typedef SSIZE_T ssize_t;
#define isnan(X) _isnan(X)
#define finite(X) _finite(X)
#ifndef UNDEF_THREAD_HACK
#ifndef MYSQL_CLIENT_NO_THREADS
#define THREAD
#endif
#define VOID_SIGHANDLER

View file

@ -62,7 +62,8 @@ void ft_free_stopwords(void);
#define FT_SORTED 2
#define FT_EXPAND 4 /* query expansion */
FT_INFO *ft_init_search(uint,void *, uint, uchar *, uint,CHARSET_INFO *, uchar *);
FT_INFO *ft_init_search(uint,void *, uint, uchar *, size_t,
CHARSET_INFO *, uchar *);
my_bool ft_boolean_check_syntax_string(const uchar *);
/* Internal symbols for fulltext between maria and MyISAM */

View file

@ -95,13 +95,7 @@ extern char NEAR _dig_vec_lower[];
/* Defined in strtod.c */
extern const double log_10[309];
#ifdef BAD_STRING_COMPILER
#define strmov(A,B) (memccpy(A,B,0,INT_MAX)-1)
#else
extern char *strmov_overlapp(char *dest, const char *src);
/* Warning: the following is likely not to work: */
#define strmake_overlapp(A,B,C) strmake(A,B,C)
#endif
#ifdef BAD_MEMCPY /* Problem with gcc on Alpha */
#define memcpy_fixed(A,B,C) bmove((A),(B),(C))
@ -162,9 +156,6 @@ extern size_t strinstr(const char *str,const char *search);
extern size_t r_strinstr(const char *str, size_t from, const char *search);
extern char *strkey(char *dst,char *head,char *tail,char *flags);
extern char *strmake(char *dst,const char *src,size_t length);
#ifndef strmake_overlapp
extern char *strmake_overlapp(char *dst,const char *src, size_t length);
#endif
#ifndef strmov
extern char *strmov(char *dst,const char *src);

View file

@ -462,7 +462,7 @@ void maria_versioning(MARIA_HA *info, my_bool versioning);
void maria_ignore_trids(MARIA_HA *info);
/* fulltext functions */
FT_INFO *maria_ft_init_search(uint,void *, uint, uchar *, uint,
FT_INFO *maria_ft_init_search(uint,void *, uint, uchar *, size_t,
CHARSET_INFO *, uchar *);
/* 'Almost-internal' Maria functions */

View file

@ -111,7 +111,7 @@ enum ha_storage_media {
enum ha_extra_function {
HA_EXTRA_NORMAL=0, /* Optimize for space (def) */
HA_EXTRA_QUICK=1, /* Optimize for speed */
HA_EXTRA_NOT_USED=2,
HA_EXTRA_NOT_USED=2, /* Should be ignored by handler */
HA_EXTRA_CACHE=3, /* Cache record in HA_rrnd() */
HA_EXTRA_NO_CACHE=4, /* End caching of records (def) */
HA_EXTRA_NO_READCHECK=5, /* No readcheck on update */

View file

@ -889,7 +889,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define FLT_MAX ((float)3.40282346638528860e+38)
#endif
#ifndef SIZE_T_MAX
#define SIZE_T_MAX ~((size_t) 0)
#define SIZE_T_MAX (~((size_t) 0))
#endif
#ifndef isfinite
@ -1260,9 +1260,9 @@ do { doubleget_union _tmp; \
} while (0)
#define float4get(V,M) do { *((float *) &(V)) = *((const float*) (M)); } while(0)
#define float8get(V,M) doubleget((V),(M))
#define float4store(V,M) memcpy((uchar*) V,(const uchar*) (&M),sizeof(float))
#define floatstore(T,V) memcpy((uchar*)(T), (const uchar*)(&V),sizeof(float))
#define floatget(V,M) memcpy((uchar*) &V,(const uchar*) (M),sizeof(float))
#define float4store(V,M) memcpy((uchar*) V,(uchar*) (&M),sizeof(float))
#define floatstore(T,V) memcpy((uchar*)(T), (uchar*)(&V),sizeof(float))
#define floatget(V,M) memcpy((uchar*) &V,(uchar*) (M),sizeof(float))
#define float8store(V,M) doublestore((V),(M))
#else

View file

@ -47,4 +47,12 @@
#define rw_unlock(A)
#define rwlock_destroy(A)
typedef int my_pthread_once_t;
#define MY_PTHREAD_ONCE_INIT 0
#define MY_PTHREAD_ONCE_DONE 1
#define my_pthread_once(C,F) do { \
if (*(C) != MY_PTHREAD_ONCE_DONE) { F(); *(C)= MY_PTHREAD_ONCE_DONE; } \
} while(0)
#endif

View file

@ -69,6 +69,11 @@ typedef int pthread_mutexattr_t;
#define pthread_handler_t EXTERNC void * __cdecl
typedef void * (__cdecl *pthread_handler)(void *);
typedef volatile LONG my_pthread_once_t;
#define MY_PTHREAD_ONCE_INIT 0
#define MY_PTHREAD_ONCE_INPROGRESS 1
#define MY_PTHREAD_ONCE_DONE 2
/*
Struct and macros to be used in combination with the
windows implementation of pthread_cond_timedwait
@ -116,6 +121,7 @@ int pthread_attr_init(pthread_attr_t *connect_att);
int pthread_attr_setstacksize(pthread_attr_t *connect_att,DWORD stack);
int pthread_attr_setprio(pthread_attr_t *connect_att,int priority);
int pthread_attr_destroy(pthread_attr_t *connect_att);
int my_pthread_once(my_pthread_once_t *once_control,void (*init_routine)(void));
struct tm *localtime_r(const time_t *timep,struct tm *tmp);
struct tm *gmtime_r(const time_t *timep,struct tm *tmp);
@ -215,6 +221,10 @@ extern int my_pthread_getprio(pthread_t thread_id);
#define pthread_handler_t EXTERNC void *
typedef void *(* pthread_handler)(void *);
#define my_pthread_once_t pthread_once_t
#define MY_PTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
#define my_pthread_once(C,F) pthread_once(C,F)
/* Test first for RTS or FSU threads */
#if defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM)
@ -543,9 +553,9 @@ void safe_mutex_free_deadlock_data(safe_mutex_t *mp);
#else
#define my_pthread_mutex_init(A,B,C,D) pthread_mutex_init((A),(B))
#define my_pthread_mutex_lock(A,B) pthread_mutex_lock(A)
#define safe_mutex_assert_owner(mp)
#define safe_mutex_assert_not_owner(mp)
#define safe_mutex_free_deadlock_data(mp)
#define safe_mutex_assert_owner(mp) do {} while(0)
#define safe_mutex_assert_not_owner(mp) do {} while(0)
#define safe_mutex_free_deadlock_data(mp) do {} while(0)
#endif /* SAFE_MUTEX */
#if defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX)

View file

@ -23,7 +23,7 @@
(defined(__alpha__) && defined(__GNUC__))
#define HAVE_STACKTRACE 1
#endif
#elif defined(__WIN__)
#elif defined(__WIN__) || defined(HAVE_PRINTSTACK)
#define HAVE_STACKTRACE 1
#endif

View file

@ -247,6 +247,7 @@ extern CHARSET_INFO compiled_charsets[];
/* statistics */
extern ulong my_file_opened,my_stream_opened, my_tmp_file_created;
extern ulong my_file_total_opened;
extern ulong my_sync_count;
extern uint mysys_usage_id;
extern my_bool my_init_done;
@ -998,7 +999,6 @@ extern my_bool resolve_collation(const char *cl_name,
CHARSET_INFO *default_cl,
CHARSET_INFO **cl);
extern void free_charsets(void);
extern char *get_charsets_dir(char *buf);
extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
extern my_bool init_compiled_charsets(myf flags);

View file

@ -251,6 +251,8 @@ extern ulong myisam_bulk_insert_tree_size, myisam_data_pointer_size;
/* usually used to check if a symlink points into the mysql data home */
/* which is normally forbidden */
extern int (*myisam_test_invalid_symlink)(const char *filename);
extern ulonglong myisam_mmap_size, myisam_mmap_used;
extern pthread_mutex_t THR_LOCK_myisam_mmap;
/* Prototypes for myisam-functions */
@ -296,6 +298,7 @@ extern int mi_delete_all_rows(struct st_myisam_info *info);
extern ulong _mi_calc_blob_length(uint length , const uchar *pos);
extern uint mi_get_pointer_length(ulonglong file_length, uint def);
#define MEMMAP_EXTRA_MARGIN 7 /* Write this as a suffix for mmap file */
/* this is used to pass to mysql_myisamchk_table */
#define MYISAMCHK_REPAIR 1 /* equivalent to myisamchk -r */

View file

@ -558,16 +558,6 @@ unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql,
char *to,const char *from,
unsigned long length);
void STDCALL mysql_debug(const char *debug);
char * STDCALL mysql_odbc_escape_string(MYSQL *mysql,
char *to,
unsigned long to_length,
const char *from,
unsigned long from_length,
void *param,
char *
(*extend_buffer)
(void *, char *to,
unsigned long *length));
void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name);
unsigned int STDCALL mysql_thread_safe(void);
my_bool STDCALL mysql_embedded(void);

View file

@ -28,7 +28,7 @@ typedef struct st_net {
unsigned int *return_status;
unsigned char reading_or_writing;
char save_char;
my_bool unused0;
char net_skip_rest_factor;
my_bool unused;
my_bool compress;
my_bool unused1;
@ -518,16 +518,6 @@ unsigned long mysql_real_escape_string(MYSQL *mysql,
char *to,const char *from,
unsigned long length);
void mysql_debug(const char *debug);
char * mysql_odbc_escape_string(MYSQL *mysql,
char *to,
unsigned long to_length,
const char *from,
unsigned long from_length,
void *param,
char *
(*extend_buffer)
(void *, char *to,
unsigned long *length));
void myodbc_remove_escape(MYSQL *mysql,char *name);
unsigned int mysql_thread_safe(void);
my_bool mysql_embedded(void);

View file

@ -254,7 +254,7 @@ typedef struct st_net {
unsigned int *return_status;
unsigned char reading_or_writing;
char save_char;
my_bool unused0; /* Please remove with the next incompatible ABI change. */
char net_skip_rest_factor;
my_bool unused; /* Please remove with the next incompatible ABI change */
my_bool compress;
my_bool unused1; /* Please remove with the next incompatible ABI change. */

View file

@ -123,8 +123,8 @@ struct st_VioSSLFd
SSL_CTX *ssl_context;
};
int sslaccept(struct st_VioSSLFd*, Vio *, long timeout);
int sslconnect(struct st_VioSSLFd*, Vio *, long timeout);
int sslaccept(struct st_VioSSLFd*, Vio *, long timeout, char *error_string);
int sslconnect(struct st_VioSSLFd*, Vio *, long timeout, char *error_string);
struct st_VioSSLFd
*new_VioSSLConnectorFd(const char *key_file, const char *cert_file,
@ -225,8 +225,8 @@ struct st_vio
#endif /* HAVE_SMEM */
#ifdef _WIN32
OVERLAPPED pipe_overlapped;
DWORD read_timeout_millis;
DWORD write_timeout_millis;
DWORD read_timeout_ms;
DWORD write_timeout_ms;
#endif
};
#endif /* vio_violite_h_ */

View file

@ -211,7 +211,6 @@ void STDCALL mysql_server_end()
}
else
{
free_charsets();
mysql_thread_end();
}
@ -719,7 +718,10 @@ my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
if (!passwd)
passwd="";
/* Store user into the buffer */
/*
Store user into the buffer.
Advance position as strmake returns a pointer to the closing NUL.
*/
end= strmake(end, user, USERNAME_LENGTH) + 1;
/* write scrambled password according to server capabilities */
@ -1269,7 +1271,7 @@ mysql_list_fields(MYSQL *mysql, const char *table, const char *wild)
{
MYSQL_RES *result;
MYSQL_FIELD *fields;
char buff[257],*end;
char buff[258],*end;
DBUG_ENTER("mysql_list_fields");
DBUG_PRINT("enter",("table: '%s' wild: '%s'",table,wild ? wild : ""));
@ -1642,20 +1644,6 @@ mysql_real_escape_string(MYSQL *mysql, char *to,const char *from,
return (uint) escape_string_for_mysql(mysql->charset, to, 0, from, length);
}
char * STDCALL
mysql_odbc_escape_string(MYSQL *mysql __attribute__((unused)),
char *to __attribute__((unused)),
ulong to_length __attribute__((unused)),
const char *from __attribute__((unused)),
ulong from_length __attribute__((unused)),
void *param __attribute__((unused)),
char * (*extend_buffer)(void *, char *, ulong *)
__attribute__((unused)))
{
return NULL;
}
void STDCALL
myodbc_remove_escape(MYSQL *mysql,char *name)
{
@ -2298,7 +2286,7 @@ mysql_stmt_param_metadata(MYSQL_STMT *stmt)
/* Store type of parameter in network buffer. */
static void store_param_type(uchar **pos, MYSQL_BIND *param)
static void store_param_type(unsigned char **pos, MYSQL_BIND *param)
{
uint typecode= param->buffer_type | (param->is_unsigned ? 32768 : 0);
int2store(*pos, typecode);

View file

@ -78,7 +78,6 @@ EXPORTS
mysql_next_result
mysql_num_fields
mysql_num_rows
mysql_odbc_escape_string
mysql_options
mysql_stmt_param_count
mysql_stmt_param_metadata

View file

@ -153,7 +153,7 @@ FILE(WRITE cmake_dummy.c " ")
# custom targets to "sql/CMakeLists.txt" and reference them here.
ADD_LIBRARY(mysqlserver STATIC ${LIBMYSQLD_SOURCES})
ADD_DEPENDENCIES(mysqlserver GenServerSource GenError)
TARGET_LINK_LIBRARIES(mysqlserver)
TARGET_LINK_LIBRARIES(mysqlserver psapi.lib)
# Add any additional libraries requested by engine(s)
FOREACH (ENGINE_LIB ${MYSQLD_STATIC_ENGINE_LIBS})

View file

@ -50,7 +50,6 @@ EXPORTS
mysql_next_result
mysql_num_fields
mysql_num_rows
mysql_odbc_escape_string
mysql_options
mysql_ping
mysql_query

View file

@ -13,16 +13,12 @@ funcs_1.ndb* # joro : NDB tests marked as experiment
funcs_2.ndb_charset # joro : NDB tests marked as experimental as agreed with bochklin
main.ctype_gbk_binlog @solaris # Bug#46010: main.ctype_gbk_binlog fails sporadically : Table 't2' already exists
main.innodb-autoinc* # Bug#47809 2009-10-04 joro innodb-autoinc.test fails with valgrind errors with the innodb plugin
main.plugin_load @solaris # Bug#42144
main.outfile_loaddata @solaris # joro : Bug #46895
ndb.* # joro : NDB tests marked as experimental as agreed with bochklin
rpl.rpl_cross_version* # Bug #43913 2009-10-26 joro rpl_cross_version can't pass on conflicts complainig clash with --slave-load-tm
rpl.rpl_get_master_version_and_clock* # Bug#46931 2009-08-26 alik rpl.rpl_get_master_version_and_clock fails on hpux11.31
rpl.rpl_innodb_bug28430* @solaris # Bug#46029
rpl.rpl_row_create_table* # Bug#45576: rpl_row_create_table fails on PB2
rpl.rpl_trigger* # Bug#47810 2009-10-04 joro rpl.rpl_trigger.test fails with valgrind errors with the innodb plugin
rpl_ndb.* # joro : NDB tests marked as experimental as agreed with bochklin
rpl_ndb.rpl_ndb_log # Bug#38998

View file

@ -407,37 +407,57 @@ sync_slave_with_master;
###########################################
# Bug#22234, Bug#23907 Extra Slave Col is not
# erroring on extra col with no default values.
########################################################
###############################################################
# Error reaction is up to sql_mode of the slave sql (bug#38173)
#--echo *** Create t9 on slave ***
STOP SLAVE;
RESET SLAVE;
eval CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
d TIMESTAMP,
e INT NOT NULL) ENGINE=$engine_type;
# Please, check BUG#47741 to see why you are not testing NDB.
if (`SELECT $engine_type != 'NDB'`)
{
STOP SLAVE;
RESET SLAVE;
eval CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
d TIMESTAMP,
e INT NOT NULL,
f text not null,
g text,
h blob not null,
i blob) ENGINE=$engine_type;
--echo *** Create t9 on Master ***
connection master;
eval CREATE TABLE t9 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
--echo *** Create t9 on Master ***
connection master;
eval CREATE TABLE t9 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
) ENGINE=$engine_type;
RESET MASTER;
RESET MASTER;
--echo *** Start Slave ***
connection slave;
START SLAVE;
--echo *** Start Slave ***
connection slave;
START SLAVE;
--echo *** Master Data Insert ***
connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
--echo *** Master Data Insert ***
connection master;
set @b1 = 'b1b1b1b1';
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
set @b1 = concat(@b1,@b1);
INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
# the test would stop slave if @@sql_mode for the sql thread
# was set to strict. Otherwise, as with this tests setup,
# the implicit defaults will be inserted into fields even though
# they are declared without DEFAULT clause.
sync_slave_with_master;
select * from t9;
# todo: fix Bug #43992 slave sql thread can't tune own sql_mode ...
# and add/restore waiting for stop test
#--source include/wait_for_slave_sql_to_stop.inc
#--replace_result $MASTER_MYPORT MASTER_PORT
#--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
#--query_vertical SHOW SLAVE STATUS
#SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
#START SLAVE;
}
#--echo *** Drop t9 ***
#connection master;

View file

@ -21,14 +21,26 @@ connection slave;
reset master;
connection master;
# MTR is not case-sensitive.
let $lower_stmt_head= load data;
let $UPPER_STMT_HEAD= LOAD DATA;
if (`SELECT '$lock_option' <> ''`)
{
#if $lock_option is null, an extra blank is added into the statement,
#this will change the result of rpl_loaddata test case. so $lock_option
#is set only when it is not null.
let $lower_stmt_head= load data $lock_option;
let $UPPER_STMT_HEAD= LOAD DATA $lock_option;
}
select last_insert_id();
create table t1(a int not null auto_increment, b int, primary key(a) );
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1;
# verify that LAST_INSERT_ID() is set by LOAD DATA INFILE
select last_insert_id();
create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60));
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
eval $lower_stmt_head infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
insert into t3 select * from t2;
@ -56,7 +68,7 @@ sync_with_master;
insert into t1 values(1,10);
connection master;
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1;
save_master_pos;
connection slave;
@ -70,9 +82,11 @@ connection slave;
set global sql_slave_skip_counter=1;
start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
show slave status;
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
echo Last_SQL_Errno=$last_error;
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
echo Last_SQL_Error;
echo $last_error;
# Trigger error again to test CHANGE MASTER
@ -80,7 +94,7 @@ connection master;
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1;
save_master_pos;
connection slave;
# The SQL slave thread should be stopped now.
@ -92,9 +106,11 @@ connection slave;
stop slave;
change master to master_user='test';
change master to master_user='root';
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
show slave status;
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
echo Last_SQL_Errno=$last_error;
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
echo Last_SQL_Error;
echo $last_error;
# Trigger error again to test RESET SLAVE
@ -105,7 +121,7 @@ connection master;
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1;
save_master_pos;
connection slave;
# The SQL slave thread should be stopped now.
@ -114,9 +130,11 @@ connection slave;
# RESET SLAVE and see if error is cleared in SHOW SLAVE STATUS.
stop slave;
reset slave;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
show slave status;
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
echo Last_SQL_Errno=$last_error;
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
echo Last_SQL_Error;
echo $last_error;
# Finally, see if logging is done ok on master for a failing LOAD DATA INFILE
@ -125,7 +143,7 @@ reset master;
eval create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=$engine_type; # no transactions
--error ER_DUP_ENTRY
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
eval $lower_stmt_head infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines;
select * from t2;
@ -141,7 +159,7 @@ alter table t2 drop key day;
connection master;
delete from t2;
--error ER_DUP_ENTRY
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
eval $lower_stmt_head infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines;
connection slave;
@ -154,7 +172,7 @@ drop table t1, t2;
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
--error ER_DUP_ENTRY
LOAD DATA INFILE "../../std_data/words.dat" INTO TABLE t1;
eval $UPPER_STMT_HEAD INFILE "../../std_data/words.dat" INTO TABLE t1;
DROP TABLE IF EXISTS t1;
@ -182,17 +200,17 @@ DROP TABLE IF EXISTS t1;
-- echo ### assertion: works with cross-referenced database
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
-- eval $UPPER_STMT_HEAD LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
-- eval use $db1
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- echo ### assertion: works with fully qualified name on current database
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
-- eval $UPPER_STMT_HEAD LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
-- echo ### assertion: works without fully qualified name on current database
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1
-- eval $UPPER_STMT_HEAD LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1
-- echo ### create connection without default database
-- echo ### connect (conn2,localhost,root,,*NO-ONE*);
@ -200,7 +218,7 @@ connect (conn2,localhost,root,,*NO-ONE*);
-- connection conn2
-- echo ### assertion: works without stating the default database
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
-- eval $UPPER_STMT_HEAD LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
-- echo ### disconnect and switch back to master connection
-- disconnect conn2
-- connection master
@ -219,4 +237,18 @@ source include/diff_tables.inc;
-- sync_slave_with_master
# BUG#49479: LOAD DATA INFILE is binlogged without escaping field names
-- source include/master-slave-reset.inc
-- connection master
use test;
CREATE TABLE t1 (`key` TEXT, `text` TEXT);
LOAD DATA INFILE '../../std_data/loaddata2.dat' REPLACE INTO TABLE `t1` FIELDS TERMINATED BY ',';
SELECT * FROM t1;
-- sync_slave_with_master
-- connection master
DROP TABLE t1;
-- sync_slave_with_master
# End of 4.1 tests

View file

@ -0,0 +1,554 @@
################################################################################
# This is an auxiliary file used by rpl_mixing_engines.test, and that it
# executes SQL statements according to a format string, as specified in
# rpl_mixing_engines.test. In addition, it accepts the special format
# strings 'configure' and 'clean', used before and after everything else.
################################################################################
if (`SELECT HEX(@commands) = HEX('configure')`)
{
connection master;
SET SQL_LOG_BIN=0;
eval CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
eval CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
eval CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
eval CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
eval CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
eval CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
eval CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
eval CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
eval CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
eval CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
eval CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
eval CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
eval SET SQL_LOG_BIN=1;
connection slave;
SET SQL_LOG_BIN=0;
eval CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
eval CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
eval CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
eval CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
eval CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
eval CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
eval CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
eval CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
eval CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
eval CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
eval CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
eval CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
SET SQL_LOG_BIN=1;
connection master;
INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1);
INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1);
INSERT INTO nt_3(trans_id, stmt_id) VALUES(1,1);
INSERT INTO nt_4(trans_id, stmt_id) VALUES(1,1);
INSERT INTO nt_5(trans_id, stmt_id) VALUES(1,1);
INSERT INTO nt_6(trans_id, stmt_id) VALUES(1,1);
INSERT INTO tt_1(trans_id, stmt_id) VALUES(1,1);
INSERT INTO tt_2(trans_id, stmt_id) VALUES(1,1);
INSERT INTO tt_3(trans_id, stmt_id) VALUES(1,1);
INSERT INTO tt_4(trans_id, stmt_id) VALUES(1,1);
INSERT INTO tt_5(trans_id, stmt_id) VALUES(1,1);
INSERT INTO tt_6(trans_id, stmt_id) VALUES(1,1);
DELIMITER |;
CREATE PROCEDURE pc_i_tt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER)
BEGIN
DECLARE in_stmt_id INTEGER;
SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id;
SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
END|
CREATE PROCEDURE pc_i_nt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER)
BEGIN
DECLARE in_stmt_id INTEGER;
SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id;
SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
END|
CREATE FUNCTION fc_i_tt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64)
BEGIN
DECLARE in_stmt_id INTEGER;
SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id;
SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
RETURN "fc_i_tt_5_suc";
END|
CREATE FUNCTION fc_i_nt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64)
BEGIN
DECLARE in_stmt_id INTEGER;
SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id;
SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
RETURN "fc_i_nt_5_suc";
END|
CREATE TRIGGER tr_i_tt_3_to_nt_3 AFTER INSERT ON tt_3 FOR EACH ROW
BEGIN
DECLARE in_stmt_id INTEGER;
SELECT max(stmt_id) INTO in_stmt_id FROM nt_3 WHERE trans_id= NEW.trans_id;
SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id;
INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
END|
CREATE TRIGGER tr_i_nt_4_to_tt_4 AFTER INSERT ON nt_4 FOR EACH ROW
BEGIN
DECLARE in_stmt_id INTEGER;
SELECT max(stmt_id) INTO in_stmt_id FROM tt_4 WHERE trans_id= NEW.trans_id;
SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id;
INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
END|
CREATE TRIGGER tr_i_tt_5_to_tt_6 AFTER INSERT ON tt_5 FOR EACH ROW
BEGIN
DECLARE in_stmt_id INTEGER;
SELECT max(stmt_id) INTO in_stmt_id FROM tt_6 WHERE trans_id= NEW.trans_id;
SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id, 1), 1) INTO in_stmt_id;
INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
END|
CREATE TRIGGER tr_i_nt_5_to_nt_6 AFTER INSERT ON nt_5 FOR EACH ROW
BEGIN
DECLARE in_stmt_id INTEGER;
SELECT max(stmt_id) INTO in_stmt_id FROM nt_6 WHERE trans_id= NEW.trans_id;
SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id;
INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
END|
DELIMITER ;|
let $pos_trans_command= query_get_value("SHOW MASTER STATUS", Position, 1);
let $trans_id= 7;
let $tb_id= 1;
let $stmt_id= 1;
let $commands= '';
SET @commands= '';
}
if (`SELECT HEX(@commands) = HEX('clean')`)
{
connection master;
DROP TABLE tt_1;
DROP TABLE tt_2;
DROP TABLE tt_3;
DROP TABLE tt_4;
DROP TABLE tt_5;
DROP TABLE tt_6;
DROP TABLE nt_1;
DROP TABLE nt_2;
DROP TABLE nt_3;
DROP TABLE nt_4;
DROP TABLE nt_5;
DROP TABLE nt_6;
DROP PROCEDURE pc_i_tt_5_suc;
DROP PROCEDURE pc_i_nt_5_suc;
DROP FUNCTION fc_i_tt_5_suc;
DROP FUNCTION fc_i_nt_5_suc;
sync_slave_with_master;
SET @commands= '';
}
while (`SELECT HEX(@commands) != HEX('')`)
{
--disable_query_log
SET @command= SUBSTRING_INDEX(@commands, ' ', 1);
let $command= `SELECT @command`;
--eval SET @check_commands= '$commands'
if (`SELECT HEX(@check_commands) = HEX('''')`)
{
let $commands= `SELECT @commands`;
}
--echo -b-b-b-b-b-b-b-b-b-b-b- >> $command << -b-b-b-b-b-b-b-b-b-b-b-
let $pos_command= query_get_value("SHOW MASTER STATUS", Position, 1);
--enable_query_log
if (`SELECT HEX(@command) = HEX('B')`)
{
eval BEGIN;
}
if (`SELECT HEX(@command) = HEX('T')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
eval INSERT INTO tt_1(trans_id, stmt_id) VALUES ($trans_id, $stmt_id);
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('T-trig')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
eval INSERT INTO tt_5(trans_id, stmt_id) VALUES ($trans_id, $stmt_id);
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('T-func')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
eval SELECT fc_i_tt_5_suc ($trans_id, $stmt_id);
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('T-proc')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
eval CALL pc_i_tt_5_suc ($trans_id, $stmt_id);
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('eT')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
let $old_trans_id= `SELECT max(trans_id) from tt_1`;
let $old_stmt_id= `SELECT max(stmt_id) from tt_1 where trans_id= $old_trans_id`;
--error ER_DUP_ENTRY, ER_DUP_KEY
eval INSERT INTO tt_1(trans_id, stmt_id) VALUES ($old_trans_id, $old_stmt_id);
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('Te')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
let $old_trans_id= `SELECT max(trans_id) from tt_1`;
let $old_stmt_id= `SELECT max(stmt_id) from tt_1 where trans_id= $old_trans_id`;
--error ER_DUP_ENTRY, ER_DUP_KEY
eval INSERT INTO tt_1(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id);
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('Te-trig')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
let $old_trans_id= `SELECT max(trans_id) from tt_5`;
let $old_stmt_id= `SELECT max(stmt_id) from tt_5 where trans_id= $old_trans_id`;
--error ER_DUP_ENTRY, ER_DUP_KEY
eval INSERT INTO tt_5(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id);
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('Te-func')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
let $old_trans_id= `SELECT max(trans_id) from tt_1`;
let $old_stmt_id= `SELECT max(stmt_id) from tt_1 where trans_id= $old_trans_id`;
--error ER_DUP_ENTRY, ER_DUP_KEY
eval INSERT INTO tt_1(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, ''), ($old_trans_id, $old_stmt_id, fc_i_tt_5_suc ($trans_id, $stmt_id));
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('N')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
eval INSERT INTO nt_1(trans_id, stmt_id) VALUES ($trans_id, $stmt_id);
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('N-trig')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
eval INSERT INTO nt_5(trans_id, stmt_id) VALUES ($trans_id, $stmt_id);
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('N-func')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
eval SELECT fc_i_nt_5_suc ($trans_id, $stmt_id);
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('N-proc')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
eval CALL pc_i_nt_5_suc ($trans_id, $stmt_id);
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('eN')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
let $old_trans_id= `SELECT max(trans_id) from nt_1`;
let $old_stmt_id= `SELECT max(stmt_id) from nt_1 where trans_id= $old_trans_id`;
--error ER_DUP_ENTRY, ER_DUP_KEY
eval INSERT INTO nt_1(trans_id, stmt_id) VALUES ($old_trans_id, $old_stmt_id);
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('Ne')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
let $old_trans_id= `SELECT max(trans_id) from nt_1`;
let $old_stmt_id= `SELECT max(stmt_id) from nt_1 where trans_id= $old_trans_id`;
--error ER_DUP_ENTRY, ER_DUP_KEY
eval INSERT INTO nt_1(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id);
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('Ne-trig')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
let $old_trans_id= `SELECT max(trans_id) from nt_5`;
let $old_stmt_id= `SELECT max(stmt_id) from nt_5 where trans_id= $old_trans_id`;
--error ER_DUP_ENTRY, ER_DUP_KEY
eval INSERT INTO nt_5(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id);
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('Ne-func')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
let $old_trans_id= `SELECT max(trans_id) from nt_1`;
let $old_stmt_id= `SELECT max(stmt_id) from nt_1 where trans_id= $old_trans_id`;
--error ER_DUP_ENTRY, ER_DUP_KEY
eval INSERT INTO nt_1(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, ''), ($old_trans_id, $old_stmt_id, fc_i_nt_5_suc ($trans_id, $stmt_id));
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('tN')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
eval INSERT INTO nt_1(trans_id, stmt_id, info) SELECT $trans_id, $stmt_id, COUNT(*) FROM tt_1;
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('tNe')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
let $old_trans_id= `SELECT max(trans_id) from nt_1`;
let $old_stmt_id= `SELECT max(stmt_id) from nt_1 where trans_id= $old_trans_id`;
--error ER_DUP_ENTRY, ER_DUP_KEY
eval INSERT INTO nt_1(trans_id, stmt_id, info) SELECT $trans_id, $stmt_id, COUNT(*) FROM tt_1 UNION SELECT $old_trans_id, $old_stmt_id, COUNT(*) FROM tt_1;
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('nT')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
eval INSERT INTO tt_1(trans_id, stmt_id, info) SELECT $trans_id, $stmt_id, COUNT(*) FROM nt_1;
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('nTe')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
let $old_trans_id= `SELECT max(trans_id) from tt_1`;
let $old_stmt_id= `SELECT max(stmt_id) from tt_1 where trans_id= $old_trans_id`;
--error ER_DUP_ENTRY, ER_DUP_KEY
eval INSERT INTO tt_1(trans_id, stmt_id, info) SELECT $trans_id, $stmt_id, COUNT(*) FROM nt_1 UNION SELECT $old_trans_id, $old_stmt_id, COUNT(*) FROM nt_1;
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('NT')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
eval UPDATE nt_3, tt_3 SET nt_3.info= "new text $trans_id --> $stmt_id", tt_3.info= "new text $trans_id --> $stmt_id" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1;
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('NT-trig')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
eval INSERT INTO nt_4(trans_id, stmt_id) VALUES ($trans_id, $stmt_id);
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('NT-func')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
eval INSERT INTO nt_5(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, fc_i_tt_5_suc($trans_id, $stmt_id));
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('NeT-trig')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
let $old_trans_id= `SELECT max(trans_id) from nt_4`;
let $old_stmt_id= `SELECT max(stmt_id) from nt_4 where trans_id= $old_trans_id`;
--error ER_DUP_ENTRY, ER_DUP_KEY
eval INSERT INTO nt_4(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id);
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('NeT-func')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
let $old_trans_id= `SELECT max(trans_id) from nt_5`;
let $old_stmt_id= `SELECT max(stmt_id) from nt_5 where trans_id= $old_trans_id`;
--error ER_DUP_ENTRY, ER_DUP_KEY
eval INSERT INTO nt_5(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, ''), ($old_trans_id, $old_stmt_id, fc_i_tt_5_suc ($trans_id, $stmt_id));
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('TN')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
eval UPDATE tt_4, nt_4 SET tt_4.info= "new text $trans_id --> $stmt_id", nt_4.info= "new text $trans_id --> $stmt_id" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1;
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('TN-trig')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
eval INSERT INTO tt_3(trans_id, stmt_id) VALUES ($trans_id, $stmt_id);
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('TN-func')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
eval INSERT INTO tt_5(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, fc_i_nt_5_suc($trans_id, $stmt_id));
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('TeN-trig')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
let $old_trans_id= `SELECT max(trans_id) from tt_3`;
let $old_stmt_id= `SELECT max(stmt_id) from tt_3 where trans_id= $old_trans_id`;
--error ER_DUP_ENTRY, ER_DUP_KEY
eval INSERT INTO tt_3(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id);
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('TeN-func')`)
{
#--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id)
let $old_trans_id= `SELECT max(trans_id) from tt_5`;
let $old_stmt_id= `SELECT max(stmt_id) from tt_5 where trans_id= $old_trans_id`;
--error ER_DUP_ENTRY, ER_DUP_KEY
eval INSERT INTO tt_5(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, ''), ($old_trans_id, $old_stmt_id, fc_i_nt_5_suc ($trans_id, $stmt_id));
inc $stmt_id;
}
if (`SELECT HEX(@command) = HEX('CS-T->T')`)
{
--eval CREATE TABLE tt_xx_$tb_id (PRIMARY KEY(trans_id, stmt_id)) engine=$engine_type SELECT * FROM tt_1;
}
if (`SELECT HEX(@command) = HEX('CS-N->N')`)
{
--eval CREATE TABLE nt_xx_$tb_id (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1;
}
if (`SELECT HEX(@command) = HEX('CS-T->N')`)
{
--eval CREATE TABLE tt_xx_$tb_id (PRIMARY KEY(trans_id, stmt_id)) engine=$engine_type SELECT * FROM nt_1;
}
if (`SELECT HEX(@command) = HEX('CS-N->T')`)
{
--eval CREATE TABLE nt_xx_$tb_id (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM tt_1;
}
if (`SELECT HEX(@command) = HEX('CSe-T->T')`)
{
--error ER_DUP_ENTRY, ER_DUP_KEY
--eval CREATE TABLE tt_xx_$tb_id (PRIMARY KEY (stmt_id)) engine=$engine_type SELECT stmt_id FROM tt_1;
}
if (`SELECT HEX(@command) = HEX('CSe-N->N')`)
{
--error ER_DUP_ENTRY, ER_DUP_KEY
--eval CREATE TABLE nt_xx_$tb_id (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM nt_1;
}
if (`SELECT HEX(@command) = HEX('CSe-T->N')`)
{
--error ER_DUP_ENTRY, ER_DUP_KEY
--eval CREATE TABLE tt_xx_$tb_id (PRIMARY KEY (stmt_id)) engine=$engine_type SELECT stmt_id FROM nt_1;
}
if (`SELECT HEX(@command) = HEX('CSe-N->T')`)
{
--error ER_DUP_ENTRY, ER_DUP_KEY
--eval CREATE TABLE nt_xx_$tb_id (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;
}
if (`SELECT HEX(@command) = HEX('CT')`)
{
--eval CREATE TEMPORARY TABLE tt_xx_$tb_id (a int) engine=$engine_type;
}
if (`SELECT HEX(@command) = HEX('IS-T<-N')`)
{
--eval INSERT INTO tt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;
}
if (`SELECT HEX(@command) = HEX('ISe-T<-N')`)
{
--error ER_DUP_ENTRY, ER_DUP_KEY
--eval INSERT INTO tt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1;
}
if (`SELECT HEX(@command) = HEX('IS-N<-T')`)
{
--eval INSERT INTO nt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;
}
if (`SELECT HEX(@command) = HEX('ISe-N<-T')`)
{
--error ER_DUP_ENTRY, ER_DUP_KEY
--eval INSERT INTO nt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1;
}
if (`SELECT HEX(@command) = HEX('IS-T<-T')`)
{
--eval INSERT INTO tt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;
}
if (`SELECT HEX(@command) = HEX('ISe-T<-T')`)
{
--error ER_DUP_ENTRY, ER_DUP_KEY
--eval INSERT INTO tt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1;
}
if (`SELECT HEX(@command) = HEX('IS-N<-N')`)
{
--eval INSERT INTO nt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;
}
if (`SELECT HEX(@command) = HEX('ISe-N<-N')`)
{
--error ER_DUP_ENTRY, ER_DUP_KEY
--eval INSERT INTO nt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1;
}
if (`SELECT HEX(@command) = HEX('trunc-CS-T')`)
{
eval TRUNCATE TABLE tt_xx_$tb_id;
}
if (`SELECT HEX(@command) = HEX('trunc-CS-N')`)
{
eval TRUNCATE TABLE nt_xx_$tb_id;
}
if (`SELECT HEX(@command) = HEX('trunc-CT')`)
{
eval TRUNCATE TABLE tt_xx_$tb_id;
}
if (`SELECT HEX(@command) = HEX('drop-CS')`)
{
--disable_warnings
eval DROP TABLE IF EXISTS tt_xx_$tb_id, nt_xx_$tb_id;
inc $tb_id;
--enable_warnings
}
if (`SELECT HEX(@command) = HEX('drop-CT')`)
{
--disable_warnings
eval DROP TEMPORARY TABLE IF EXISTS tt_xx_$tb_id;
inc $tb_id;
--enable_warnings
}
if (`SELECT HEX(@command) = HEX('C')`)
{
--error 0, ER_GET_ERRMSG
eval COMMIT;
}
if (`SELECT HEX(@command) = HEX('R')`)
{
--error 0, ER_GET_ERRMSG
eval ROLLBACK;
}
if (`SELECT HEX(@command) = HEX('S1')`)
{
eval SAVEPOINT s1;
}
if (`SELECT HEX(@command) = HEX('R1')`)
{
eval ROLLBACK TO s1;
}
--disable_query_log
SET @commands= LTRIM(SUBSTRING(@commands, LENGTH(@command) + 1));
inc $stmt_id;
let $binlog_start= $pos_command;
--source include/show_binlog_events.inc
--echo -e-e-e-e-e-e-e-e-e-e-e- >> $command << -e-e-e-e-e-e-e-e-e-e-e-
if (`SELECT HEX(@commands) = HEX('')`)
{
let $binlog_start= $pos_trans_command;
--echo -b-b-b-b-b-b-b-b-b-b-b- >> $commands << -b-b-b-b-b-b-b-b-b-b-b-
--source include/show_binlog_events.inc
--echo -e-e-e-e-e-e-e-e-e-e-e- >> $commands << -e-e-e-e-e-e-e-e-e-e-e-
--echo
let $pos_trans_command= query_get_value("SHOW MASTER STATUS", Position, 1);
let $stmt_id= 1;
inc $trans_id;
let $commands= '';
}
}

View file

@ -0,0 +1,364 @@
#################################################################################
# This test checks if the replication between "null" fields to either "null"
# fields or "not null" fields works properly. In the first case, the execution
# should work fine. In the second case, it may fail according to the sql_mode
# being used.
#
# The test is devided in three main parts:
#
# 1 - NULL --> NULL (no failures)
# 2 - NULL --> NOT NULL ( sql-mode = STRICT and failures)
# 3 - NULL --> NOT NULL ( sql-mode != STRICT and no failures)
#
#################################################################################
connection master;
SET SQL_LOG_BIN= 0;
eval CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL,
`c` INT DEFAULT NULL,
PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
eval CREATE TABLE t2(`a` INT, `b` DATE DEFAULT NULL,
PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
eval CREATE TABLE t3(`a` INT, `b` DATE DEFAULT NULL,
PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
eval CREATE TABLE t4(`a` INT, `b` DATE DEFAULT NULL,
`c` INT DEFAULT NULL,
PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
SET SQL_LOG_BIN= 1;
connection slave;
eval CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL,
`c` INT DEFAULT NULL,
PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
eval CREATE TABLE t2(`a` INT, `b` DATE DEFAULT NULL,
PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
eval CREATE TABLE t3(`a` INT, `b` DATE DEFAULT '0000-00-00',
`c` INT DEFAULT 500,
PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
eval CREATE TABLE t4(`a` INT, `b` DATE DEFAULT '0000-00-00',
PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
--echo ************* EXECUTION WITH INSERTS *************
connection master;
INSERT INTO t1(a,b,c) VALUES (1, null, 1);
INSERT INTO t1(a,b,c) VALUES (2,'1111-11-11', 2);
INSERT INTO t1(a,b) VALUES (3, null);
INSERT INTO t1(a,c) VALUES (4, 4);
INSERT INTO t1(a) VALUES (5);
INSERT INTO t2(a,b) VALUES (1, null);
INSERT INTO t2(a,b) VALUES (2,'1111-11-11');
INSERT INTO t2(a) VALUES (3);
INSERT INTO t3(a,b) VALUES (1, null);
INSERT INTO t3(a,b) VALUES (2,'1111-11-11');
INSERT INTO t3(a) VALUES (3);
INSERT INTO t4(a,b,c) VALUES (1, null, 1);
INSERT INTO t4(a,b,c) VALUES (2,'1111-11-11', 2);
INSERT INTO t4(a,b) VALUES (3, null);
INSERT INTO t4(a,c) VALUES (4, 4);
INSERT INTO t4(a) VALUES (5);
--echo ************* SHOWING THE RESULT SETS WITH INSERTS *************
sync_slave_with_master;
--echo TABLES t1 and t2 must be equal otherwise an error will be thrown.
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
source include/diff_tables.inc;
let $diff_table_1=master:test.t2;
let $diff_table_2=slave:test.t2;
source include/diff_tables.inc;
--echo TABLES t2 and t3 must be different.
connection master;
SELECT * FROM t3 ORDER BY a;
connection slave;
SELECT * FROM t3 ORDER BY a;
connection master;
SELECT * FROM t4 ORDER BY a;
connection slave;
SELECT * FROM t4 ORDER BY a;
--echo ************* EXECUTION WITH UPDATES and REPLACES *************
connection master;
DELETE FROM t1;
INSERT INTO t1(a,b,c) VALUES (1,'1111-11-11', 1);
REPLACE INTO t1(a,b,c) VALUES (2,'1111-11-11', 2);
UPDATE t1 set b= NULL, c= 300 where a= 1;
REPLACE INTO t1(a,b,c) VALUES (2, NULL, 300);
--echo ************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
sync_slave_with_master;
--echo TABLES t1 and t2 must be equal otherwise an error will be thrown.
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
source include/diff_tables.inc;
--echo ************* CLEANING *************
connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP TABLE t4;
sync_slave_with_master;
connection master;
SET SQL_LOG_BIN= 0;
eval CREATE TABLE t1 (`a` INT, `b` BIT DEFAULT NULL, `c` BIT DEFAULT NULL,
PRIMARY KEY (`a`)) ENGINE= $engine;
SET SQL_LOG_BIN= 1;
connection slave;
eval CREATE TABLE t1 (`a` INT, `b` BIT DEFAULT b'01', `c` BIT DEFAULT NULL,
PRIMARY KEY (`a`)) ENGINE= $engine;
--echo ************* EXECUTION WITH INSERTS *************
connection master;
INSERT INTO t1(a,b,c) VALUES (1, null, b'01');
INSERT INTO t1(a,b,c) VALUES (2,b'00', b'01');
INSERT INTO t1(a,b) VALUES (3, null);
INSERT INTO t1(a,c) VALUES (4, b'01');
INSERT INTO t1(a) VALUES (5);
--echo ************* SHOWING THE RESULT SETS WITH INSERTS *************
--echo TABLES t1 and t2 must be different.
sync_slave_with_master;
connection master;
SELECT a,b+0,c+0 FROM t1 ORDER BY a;
connection slave;
SELECT a,b+0,c+0 FROM t1 ORDER BY a;
--echo ************* EXECUTION WITH UPDATES and REPLACES *************
connection master;
DELETE FROM t1;
INSERT INTO t1(a,b,c) VALUES (1,b'00', b'01');
REPLACE INTO t1(a,b,c) VALUES (2,b'00',b'01');
UPDATE t1 set b= NULL, c= b'00' where a= 1;
REPLACE INTO t1(a,b,c) VALUES (2, NULL, b'00');
--echo ************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
--echo TABLES t1 and t2 must be equal otherwise an error will be thrown.
sync_slave_with_master;
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
source include/diff_tables.inc;
connection master;
DROP TABLE t1;
sync_slave_with_master;
--echo ################################################################################
--echo # NULL ---> NOT NULL (STRICT MODE)
--echo # UNCOMMENT THIS AFTER FIXING BUG#43992
--echo ################################################################################
#connection slave;
#SET GLOBAL sql_mode="TRADITIONAL";
#
#STOP SLAVE;
#--source include/wait_for_slave_to_stop.inc
#START SLAVE;
#--source include/wait_for_slave_to_start.inc
#
#let $y=0;
#while (`select $y < 6`)
#{
# connection master;
#
# SET SQL_LOG_BIN= 0;
# eval CREATE TABLE t1(`a` INT NOT NULL, `b` INT,
# PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
# eval CREATE TABLE t2(`a` INT NOT NULL, `b` INT,
# PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
# eval CREATE TABLE t3(`a` INT NOT NULL, `b` INT,
# PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
# SET SQL_LOG_BIN= 1;
#
# connection slave;
#
# eval CREATE TABLE t1(`a` INT NOT NULL, `b` INT NOT NULL,
# `c` INT NOT NULL,
# PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
# eval CREATE TABLE t2(`a` INT NOT NULL, `b` INT NOT NULL,
# `c` INT,
# PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
# eval CREATE TABLE t3(`a` INT NOT NULL, `b` INT NOT NULL,
# `c` INT DEFAULT 500,
# PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
#
# if (`select $y=0`)
# {
# --echo ************* EXECUTION WITH INSERTS *************
# connection master;
# INSERT INTO t1(a) VALUES (1);
# }
#
# if (`select $y=1`)
# {
# --echo ************* EXECUTION WITH INSERTS *************
# connection master;
# INSERT INTO t1(a, b) VALUES (1, NULL);
# }
#
# if (`select $y=2`)
# {
# --echo ************* EXECUTION WITH UPDATES *************
# connection master;
# INSERT INTO t3(a, b) VALUES (1, 1);
# INSERT INTO t3(a, b) VALUES (2, 1);
# UPDATE t3 SET b = NULL where a= 1;
# }
#
# if (`select $y=3`)
# {
# --echo ************* EXECUTION WITH INSERTS/REPLACES *************
# connection master;
# REPLACE INTO t3(a, b) VALUES (1, null);
# }
#
# if (`select $y=4`)
# {
# --echo ************* EXECUTION WITH UPDATES/REPLACES *************
# connection master;
# INSERT INTO t3(a, b) VALUES (1, 1);
# REPLACE INTO t3(a, b) VALUES (1, null);
# }
#
# if (`select $y=5`)
# {
# --echo ************* EXECUTION WITH MULTI-ROW INSERTS *************
# connection master;
#
# SET SQL_LOG_BIN= 0;
# INSERT INTO t2(a, b) VALUES (1, 1);
# INSERT INTO t2(a, b) VALUES (2, 1);
# INSERT INTO t2(a, b) VALUES (3, null);
# INSERT INTO t2(a, b) VALUES (4, 1);
# INSERT INTO t2(a, b) VALUES (5, 1);
# SET SQL_LOG_BIN= 1;
#
# INSERT INTO t2 SELECT a + 10, b from t2;
# --echo The statement below is just executed to stop processing
# INSERT INTO t1(a) VALUES (1);
# }
#
# --echo ************* SHOWING THE RESULT SETS *************
# connection slave;
# --source include/wait_for_slave_sql_to_stop.inc
# connection master;
# SELECT * FROM t1 ORDER BY a;
# connection slave;
# SELECT * FROM t1 ORDER BY a;
# connection master;
# SELECT * FROM t2 ORDER BY a;
# connection slave;
# SELECT * FROM t2 ORDER BY a;
# connection master;
# SELECT * FROM t3 ORDER BY a;
# connection slave;
# SELECT * FROM t3 ORDER BY a;
# --source include/reset_master_and_slave.inc
#
# connection master;
#
# DROP TABLE t1;
# DROP TABLE t2;
# DROP TABLE t3;
#
# sync_slave_with_master;
#
# inc $y;
#}
#connection slave;
#SET GLOBAL sql_mode="";
#
#STOP SLAVE;
#source include/wait_for_slave_to_stop.inc;
#START SLAVE;
#--source include/wait_for_slave_to_start.inc
--echo ################################################################################
--echo # NULL ---> NOT NULL (NON-STRICT MODE)
--echo ################################################################################
connection master;
SET SQL_LOG_BIN= 0;
eval CREATE TABLE t1(`a` INT NOT NULL, `b` INT,
PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
eval CREATE TABLE t2(`a` INT NOT NULL, `b` INT,
PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
eval CREATE TABLE t3(`a` INT NOT NULL, `b` INT,
PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
SET SQL_LOG_BIN= 1;
connection slave;
eval CREATE TABLE t1(`a` INT NOT NULL, `b` INT NOT NULL,
`c` INT NOT NULL,
PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
eval CREATE TABLE t2(`a` INT NOT NULL, `b` INT NOT NULL,
`c` INT,
PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
eval CREATE TABLE t3(`a` INT NOT NULL, `b` INT NOT NULL,
`c` INT DEFAULT 500,
PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
--echo ************* EXECUTION WITH INSERTS *************
connection master;
INSERT INTO t1(a) VALUES (1);
INSERT INTO t1(a, b) VALUES (2, NULL);
INSERT INTO t1(a, b) VALUES (3, 1);
INSERT INTO t2(a) VALUES (1);
INSERT INTO t2(a, b) VALUES (2, NULL);
INSERT INTO t2(a, b) VALUES (3, 1);
INSERT INTO t3(a) VALUES (1);
INSERT INTO t3(a, b) VALUES (2, NULL);
INSERT INTO t3(a, b) VALUES (3, 1);
INSERT INTO t3(a, b) VALUES (4, 1);
REPLACE INTO t3(a, b) VALUES (5, null);
REPLACE INTO t3(a, b) VALUES (3, null);
UPDATE t3 SET b = NULL where a = 4;
--echo ************* SHOWING THE RESULT SETS *************
connection master;
sync_slave_with_master;
connection master;
SELECT * FROM t1 ORDER BY a;
connection slave;
SELECT * FROM t1 ORDER BY a;
connection master;
SELECT * FROM t2 ORDER BY a;
connection slave;
SELECT * FROM t2 ORDER BY a;
connection master;
SELECT * FROM t3 ORDER BY a;
connection slave;
SELECT * FROM t3 ORDER BY a;
connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
sync_slave_with_master;

View file

@ -18,6 +18,8 @@
# Vs slave. #
#############################################################################
CALL mtr.add_suppression('Statement may not be safe to log in statement format.');
# Begin clean up test section
connection master;
--disable_warnings
@ -43,10 +45,12 @@ RETURN tmp;
END|
delimiter ;|
--disable_warnings
INSERT INTO test.t1 VALUES (null,test.f1()),(null,test.f1()),(null,test.f1());
sleep 6;
INSERT INTO test.t1 VALUES (null,test.f1()),(null,test.f1()),(null,test.f1());
sleep 6;
--enable_warnings
#Select in this test are used for debugging
#select * from test.t1;
@ -56,7 +60,9 @@ sleep 6;
connection master;
SET AUTOCOMMIT=0;
START TRANSACTION;
--disable_warnings
INSERT INTO test.t1 VALUES (null,test.f1());
--enable_warnings
ROLLBACK;
SET AUTOCOMMIT=1;
#select * from test.t1;

View file

@ -111,21 +111,18 @@ SELECT a,b,x FROM t1_int ORDER BY a;
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
SELECT a,b,x FROM t1_char ORDER BY a;
# Each of these inserts should generate an error and stop the slave
connection master;
INSERT INTO t9 VALUES (2);
sync_slave_with_master;
# Now slave is guaranteed to be running
connection master;
INSERT INTO t1_nodef VALUES (1,2);
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--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
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
# Last insert on wider slave table succeeds while slave sql sql_mode permits.
# The previous version of the above test expected slave sql to stop.
# bug#38173 relaxed conditions to stop only with the strict mode.
sync_slave_with_master;
select count(*) from t1_nodef;
#
# Replicating to tables with fewer columns at the end works as of WL#3228

View file

@ -0,0 +1,86 @@
# Both of the following tests check that comparison of binlog BI
# against SE record will not fail due to remains from previous values
# in the SE record (before a given field was set to null).
#
# In MIXED mode:
# - Insert and update are executed as statements
# - Delete is executed as a row event
# - Assertion: checks that comparison will not fail because the update
# statement will clear the record contents for the nulled
# field. If data was not cleared, some engines may keep
# the value and return it later as garbage - despite the
# fact that field is null. This may cause slave to
# falsely fail in the comparison (memcmp would fail
# because of "garbage" in record data).
#
# In ROW mode:
# - Insert, update and delete are executed as row events.
# - Assertion: checks that comparison will not fail because the update
# rows event will clear the record contents before
# feeding the new value to the SE. This protects against
# SEs that do not clear record contents when storing
# nulled fields. If the engine did not clear the data it
# would cause slave to falsely fail in the comparison
# (memcmp would fail because of "garbage" in record
# data). This scenario is pretty much the same described
# above in MIXED mode, but checks different execution
# path in the slave.
# BUG#49481: RBR: MyISAM and bit fields may cause slave to stop on
# delete cant find record
-- source include/master-slave-reset.inc
-- connection master
-- eval CREATE TABLE t1 (c1 BIT, c2 INT) Engine=$engine
INSERT INTO `t1` VALUES ( 1, 1 );
UPDATE t1 SET c1=NULL where c2=1;
-- sync_slave_with_master
-- let $diff_table_1=master:test.t1
-- let $diff_table_2=slave:test.t1
-- source include/diff_tables.inc
-- connection master
# triggers switch to row mode when on mixed
DELETE FROM t1 WHERE c2=1 LIMIT 1;
-- sync_slave_with_master
-- let $diff_table_1=master:test.t1
-- let $diff_table_2=slave:test.t1
-- source include/diff_tables.inc
-- connection master
DROP TABLE t1;
-- sync_slave_with_master
-- source include/master-slave-reset.inc
-- connection master
# BUG#49482: RBR: Replication may break on deletes when MyISAM tables
# + char field are used
-- eval CREATE TABLE t1 (c1 CHAR) Engine=$engine
INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ;
SELECT * FROM t1;
UPDATE t1 SET c1=NULL WHERE c1='w';
-- sync_slave_with_master
-- let $diff_table_1=master:test.t1
-- let $diff_table_2=slave:test.t1
-- source include/diff_tables.inc
-- connection master
# triggers switch to row mode when on mixed
DELETE FROM t1 LIMIT 2;
-- sync_slave_with_master
-- let $diff_table_1=master:test.t1
-- let $diff_table_2=slave:test.t1
-- source include/diff_tables.inc
-- connection master
DROP TABLE t1;
-- sync_slave_with_master

View file

@ -1,6 +1,11 @@
-- source include/have_binlog_format_mixed_or_statement.inc
# Requires binlog_format=statement format since query involving
# get_lock() is logged in row format if binlog_format=mixed or row.
-- source include/have_binlog_format_statement.inc
-- source include/master-slave.inc
CALL mtr.add_suppression("Statement may not be safe to log in statement format.");
# Load some data into t1
create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
@ -10,9 +15,7 @@ select * from t1 limit 10;
#
# Test slave with wrong password
#
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
stop slave;
connection master;
set password for root@"localhost" = password('foo');
@ -29,16 +32,12 @@ sleep 2;
create table t3(n int);
insert into t3 values(1),(2);
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t3;
select sum(length(word)) from t1;
connection master;
drop table t1,t3;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
# Test if the slave SQL thread can be more than 16K behind the slave
# I/O thread (> IO_SIZE)
@ -77,12 +76,13 @@ unlock tables;
connection master;
create table t2(id int);
insert into t2 values(connection_id());
save_master_pos;
connection master1;
# Avoid generating result
create temporary table t3(n int);
--disable_warnings
insert into t3 select get_lock('crash_lock%20C', 1) from t2;
--enable_warnings
connection master;
send update t1 set n = n + get_lock('crash_lock%20C', 2);
@ -93,8 +93,11 @@ kill @id;
# We don't drop t3 as this is a temporary table
drop table t2;
connection master;
# The get_lock function causes warning for unsafe statement.
--disable_warnings
--error 1317,2013
reap;
--enable_warnings
connection slave;
# The SQL slave thread should now have stopped because the query was killed on
# the master (so it has a non-zero error code in the binlog).
@ -117,16 +120,12 @@ insert into mysql.user (Host, User, Password)
select select_priv,user from mysql.user where user = _binary'blafasel2';
update mysql.user set Select_priv = "Y" where User= _binary"blafasel2";
select select_priv,user from mysql.user where user = _binary'blafasel2';
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select n from t1;
select select_priv,user from mysql.user where user = _binary'blafasel2';
connection master1;
drop table t1;
delete from mysql.user where user="blafasel2";
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
# End of 4.1 tests

View file

@ -0,0 +1,160 @@
#
# This test verify if executing DDL statement before trying to manipulate
# a temporary table causes row-based replication to break with error 'table
# does not exist'.
#
# CREATE TABLE when a temporary table is open.
CREATE TEMPORARY TABLE t1 (a INT);
EVAL CREATE TABLE t2 (a INT, b INT) ENGINE= $ENGINE_TYPE;
INSERT INTO t1 VALUES (1);
# CREATE EVENT when a temporary table is open.
CREATE EVENT e1 ON SCHEDULE EVERY 10 HOUR DO SELECT 1;
INSERT INTO t1 VALUES (1);
# ALTER EVENT when a temporary table is open.
ALTER EVENT e1 ON SCHEDULE EVERY 20 HOUR DO SELECT 1;
INSERT INTO t1 VALUES (1);
# DROP EVENT when a temporary table is open.
DROP EVENT IF EXISTS e1;
INSERT INTO t1 VALUES (1);
# CREATE PROCEDURE when a temporary table is open.
CREATE PROCEDURE p1() SELECT 1;
INSERT INTO t1 VALUES (1);
# Alter PROCEDURE when a temporary table is open.
ALTER PROCEDURE p1 SQL SECURITY INVOKER;
INSERT INTO t1 VALUES (1);
# CREATE FUNCTION when a temporary table is open.
CREATE FUNCTION f1() RETURNS INT RETURN 123;
INSERT INTO t1 VALUES (1);
# ALTER FUNCTION when a temporary table is open.
ALTER FUNCTION f1 SQL SECURITY INVOKER;
INSERT INTO t1 VALUES (1);
# CREATE DATABASE when a temporary table is open.
CREATE DATABASE mysqltest1;
INSERT INTO t1 VALUES (1);
# DROP DATABASE when a temporary table is open.
DROP DATABASE mysqltest1;
INSERT INTO t1 VALUES (1);
# CREATE USER when a temporary table is open.
CREATE USER test_1@localhost;
INSERT INTO t1 VALUES (1);
# GRANT select on table to user when a temporary table is open.
GRANT SELECT ON t2 TO test_1@localhost;
INSERT INTO t1 VALUES (1);
# GRANT all on function to user when a temporary table is open.
GRANT ALL ON f1 TO test_1@localhost;
INSERT INTO t1 VALUES (1);
# GRANT all on procedure to user when a temporary table is open.
GRANT ALL ON p1 TO test_1@localhost;
INSERT INTO t1 VALUES (1);
# GRANT usage on *.* to user when a temporary table is open.
GRANT USAGE ON *.* TO test_1@localhost;
INSERT INTO t1 VALUES (1);
# REVOKE ALL PRIVILEGES on function to user when a temporary table is open.
REVOKE ALL PRIVILEGES ON f1 FROM test_1@localhost;
INSERT INTO t1 VALUES (1);
# REVOKE ALL PRIVILEGES on procedure to user when a temporary table is open.
REVOKE ALL PRIVILEGES ON p1 FROM test_1@localhost;
INSERT INTO t1 VALUES (1);
# REVOKE ALL PRIVILEGES on table to user when a temporary table is open.
REVOKE ALL PRIVILEGES ON t2 FROM test_1@localhost;
INSERT INTO t1 VALUES (1);
# REVOKE usage on *.* from user when a temporary table is open.
REVOKE USAGE ON *.* FROM test_1@localhost;
INSERT INTO t1 VALUES (1);
# RENAME USER when a temporary table is open.
RENAME USER test_1@localhost TO test_2@localhost;
INSERT INTO t1 VALUES (1);
# DROP USER when a temporary table is open.
DROP USER test_2@localhost;
INSERT INTO t1 VALUES (1);
# Test ACL statement in sub statement
DELIMITER |;
CREATE PROCEDURE p2()
BEGIN
# CREATE USER when a temporary table is open.
CREATE TEMPORARY TABLE t3 (a INT);
CREATE USER test_2@localhost;
INSERT INTO t1 VALUES (1);
# GRANT select on table to user when a temporary table is open.
GRANT SELECT ON t2 TO test_2@localhost;
INSERT INTO t1 VALUES (1);
# GRANT all on function to user when a temporary table is open.
GRANT ALL ON f1 TO test_2@localhost;
INSERT INTO t1 VALUES (1);
# GRANT all on procedure to user when a temporary table is open.
GRANT ALL ON p1 TO test_2@localhost;
INSERT INTO t1 VALUES (1);
# GRANT usage on *.* to user when a temporary table is open.
GRANT USAGE ON *.* TO test_2@localhost;
INSERT INTO t1 VALUES (1);
# REVOKE ALL PRIVILEGES on function to user when a temporary table is open.
REVOKE ALL PRIVILEGES ON f1 FROM test_2@localhost;
INSERT INTO t1 VALUES (1);
# REVOKE ALL PRIVILEGES on procedure to user when a temporary table is open.
REVOKE ALL PRIVILEGES ON p1 FROM test_2@localhost;
INSERT INTO t1 VALUES (1);
# REVOKE ALL PRIVILEGES on table to user when a temporary table is open.
REVOKE ALL PRIVILEGES ON t2 FROM test_2@localhost;
INSERT INTO t1 VALUES (1);
# REVOKE usage on *.* from user when a temporary table is open.
REVOKE USAGE ON *.* FROM test_2@localhost;
INSERT INTO t1 VALUES (1);
# RENAME USER when a temporary table is open.
RENAME USER test_2@localhost TO test_3@localhost;
INSERT INTO t1 VALUES (1);
# DROP USER when a temporary table is open.
DROP USER test_3@localhost;
INSERT INTO t1 VALUES (1);
DROP TEMPORARY TABLE t3;
END |
DELIMITER ;|
# DROP PROCEDURE when a temporary table is open.
DROP PROCEDURE p1;
INSERT INTO t1 VALUES (1);
DROP PROCEDURE p2;
INSERT INTO t1 VALUES (1);
# DROP FUNCTION when a temporary table is open.
DROP FUNCTION f1;
INSERT INTO t1 VALUES (1);
# DROP TABLE when a temporary table is open.
DROP TABLE t2;
INSERT INTO t1 VALUES (1);
DROP TEMPORARY TABLE t1;
--sync_slave_with_master

View file

@ -0,0 +1,22 @@
#
# === Name
#
# binlog_inject_error.inc
#
# === Description
#
# Inject binlog write error when running the query, verifies that the
# query is ended with the proper error (ER_ERROR_ON_WRITE).
#
# === Usage
#
# let query= 'CREATE TABLE t1 (a INT)';
# source include/binlog_inject_error.inc;
#
SET GLOBAL debug='d,injecting_fault_writing';
--echo $query;
--replace_regex /(errno: .*)/(errno: #)/
--error ER_ERROR_ON_WRITE
--eval $query
SET GLOBAL debug='';

View file

@ -2,7 +2,7 @@
[mysqld]
open-files-limit= 1024
local-infile
default-character-set= latin1
character-set-server= latin1
# Increase default connect_timeout to avoid intermittent
# disconnects when test servers are put under load see BUG#28359

View file

@ -1,4 +1,2 @@
-- require r/have_big5.require
disable_query_log;
show collation like 'big5_chinese_ci';
enable_query_log;
let collation=big5_chinese_ci;
--source include/have_collation.inc

View file

@ -0,0 +1,3 @@
if (!`SELECT count(*) AS 'true' FROM information_schema.collations WHERE collation_name LIKE '$collation'`) {
skip Test needs character set '$collation';
}

View file

@ -1,4 +1,2 @@
-- require r/have_cp1250_ch.require
disable_query_log;
show collation like 'cp1250_czech_cs';
enable_query_log;
let collation=cp1250_czech_cs;
--source include/have_collation.inc

View file

@ -1,7 +1,2 @@
--require r/have_cp1251.require
--disable_query_log
SHOW COLLATION LIKE 'cp1251_general_ci';
--enable_query_log
let collation=cp1251_general_ci;
--source include/have_collation.inc

View file

@ -1,7 +1,2 @@
--require r/have_cp866.require
--disable_query_log
SHOW COLLATION LIKE 'cp866_general_ci';
--enable_query_log
let collation=cp866_general_ci;
--source include/have_collation.inc

View file

@ -1,4 +1,2 @@
-- require r/have_cp932.require
disable_query_log;
show collation like 'cp932_japanese_ci';
enable_query_log;
let collation=cp932_japanese_ci;
--source include/have_collation.inc

View file

@ -1,4 +1,2 @@
-- require r/have_eucjpms.require
disable_query_log;
show collation like 'eucjpms_japanese_ci';
enable_query_log;
let collation=eucjpms_japanese_ci;
--source include/have_collation.inc

View file

@ -1,4 +1,2 @@
-- require r/have_euckr.require
disable_query_log;
show collation like 'euckr_korean_ci';
enable_query_log;
let collation=euckr_korean_ci;
--source include/have_collation.inc

View file

@ -1,4 +1,2 @@
-- require r/have_gb2312.require
disable_query_log;
show collation like 'gb2312_chinese_ci';
enable_query_log;
let collation=gb2312_chinese_ci;
--source include/have_collation.inc

View file

@ -1,4 +1,2 @@
-- require r/have_gbk.require
disable_query_log;
show collation like 'gbk_chinese_ci';
enable_query_log;
let collation=gbk_chinese_ci;
--source include/have_collation.inc

View file

@ -1,7 +1,2 @@
--require r/have_koi8r.require
--disable_query_log
SHOW COLLATION LIKE 'koi8r_general_ci';
--enable_query_log
let collation=koi8r_general_ci;
--source include/have_collation.inc

View file

@ -1,4 +1,2 @@
-- require r/have_latin2_ch.require
disable_query_log;
show collation like 'latin2_czech_cs';
enable_query_log;
let collation=latin2_czech_cs;
--source include/have_collation.inc

View file

@ -1,4 +1,2 @@
-- require r/have_sjis.require
disable_query_log;
show collation like 'sjis_japanese_ci';
enable_query_log;
let collation=sjis_japanese_ci;
--source include/have_collation.inc

View file

@ -1,4 +1,2 @@
-- require r/have_tis620.require
disable_query_log;
show collation like 'tis620_thai_ci';
enable_query_log;
let collation=tis620_thai_ci;
--source include/have_collation.inc

View file

@ -1,4 +1,2 @@
-- require r/have_ucs2.require
disable_query_log;
show collation like 'ucs2_general_ci';
enable_query_log;
let collation=ucs2_general_ci;
--source include/have_collation.inc

View file

@ -1,4 +1,2 @@
-- require r/have_ujis.require
disable_query_log;
show collation like 'ujis_japanese_ci';
enable_query_log;
let collation=ujis_japanese_ci;
--source include/have_collation.inc

View file

@ -1,7 +1,2 @@
--require r/have_utf8.require
--disable_query_log
SHOW COLLATION LIKE 'utf8_general_ci';
--enable_query_log
let collation=utf8_general_ci;
--source include/have_collation.inc

View file

@ -52,7 +52,7 @@ if (`SELECT '$debug_lock' != ''`)
# reap the result of the waiting query
connection $connection_name;
error 0, 1317, 1307, 1306, 1334, 1305;
error 0, 1317, 1307, 1306, 1334, 1305, 1034;
reap;
connection master;

View file

@ -175,6 +175,8 @@ INSERT INTO global_suppressions VALUES
("Can't find file: '.\\\\test\\\\\\?{8}.frm'"),
("Slave: Unknown table 't1' Error_code: 1051"),
/* Maria storage engine dependent tests */
/* maria-recovery.test has warning about missing log file */
("File '.*maria_log.000.*' not found \\(Errcode: 2\\)"),
/* and about marked-corrupted table */
@ -184,6 +186,14 @@ INSERT INTO global_suppressions VALUES
("Table '..mysqltest.t_corrupted2' is marked as crashed and should be"),
("Incorrect key file for table '..mysqltest.t_corrupted2.MAI'"),
/*
Transient network failures that cause warnings on reconnect.
BUG#47743 and BUG#47983.
*/
("Slave I/O: Get master SERVER_ID failed with error:.*"),
("Slave I/O: Get master clock failed with error:.*"),
("Slave I/O: Get master COLLATION_SERVER failed with error:.*"),
("Slave I/O: Get master TIME_ZONE failed with error:.*"),
("THE_LAST_SUPPRESSION")||

View file

@ -30,6 +30,9 @@
--disable_warnings
drop table if exists t5 ;
--enable_warnings
--disable_query_log
SET TIME_ZONE= '+03:00';
--enable_query_log
set @arg01= 8;
set @arg02= 8.0;
set @arg03= 80.00000000000e-1;

View file

@ -69,7 +69,22 @@ let $_fake_relay_log_purge= `SELECT @@global.relay_log_purge`;
# Create relay log file.
copy_file $fake_relay_log $_fake_relay_log;
# Create relay log index.
--exec echo $_fake_filename-fake.000001 > $_fake_relay_index
if (`SELECT LENGTH(@@secure_file_priv) > 0`)
{
-- let $_file_priv_dir= `SELECT @@secure_file_priv`;
-- let $_suffix= `SELECT UUID()`
-- let $_tmp_file= $_file_priv_dir/fake-index.$_suffix
-- eval select '$_fake_filename-fake.000001\n' into dumpfile '$_tmp_file'
-- copy_file $_tmp_file $_fake_relay_index
-- remove_file $_tmp_file
}
if (`SELECT LENGTH(@@secure_file_priv) = 0`)
{
-- eval select '$_fake_filename-fake.000001\n' into dumpfile '$_fake_relay_index'
}
# Setup replication from existing relay log.
eval CHANGE MASTER TO MASTER_HOST='dummy.localdomain', RELAY_LOG_FILE='$_fake_filename-fake.000001', RELAY_LOG_POS=4;

View file

@ -0,0 +1,16 @@
# truncate a giving file, all contents of the file are be cleared
if (`SELECT 'x$file' = 'x'`)
{
--echo Please assign a file name to $file!!
exit;
}
let TRUNCATE_FILE= $file;
perl;
use Env;
Env::import('TRUNCATE_FILE');
open FILE, '>', $TRUNCATE_FILE || die "Can not open file $file";
close FILE;
EOF

View file

@ -384,9 +384,9 @@ sub kill {
sub _collect {
my ($self)= @_;
my ($self, $exit_code)= @_;
$self->{EXIT_STATUS}= $?;
$self->{EXIT_STATUS}= $exit_code;
_verbose("_collect: $self");
# Take the process out of running list
@ -453,6 +453,7 @@ sub wait_one {
#_verbose("blocking: $blocking, use_alarm: $use_alarm");
my $retpid;
my $exit_code;
eval
{
# alarm should break the wait
@ -461,6 +462,7 @@ sub wait_one {
alarm($timeout) if $use_alarm;
$retpid= waitpid($pid, $blocking ? 0 : &WNOHANG);
$exit_code= $?;
alarm(0) if $use_alarm;
};
@ -492,7 +494,7 @@ sub wait_one {
#warn "wait_one: expected pid $pid but got $retpid"
# unless( $retpid == $pid );
$self->_collect();
$self->_collect($exit_code);
return 0;
}
@ -505,6 +507,8 @@ sub wait_one {
#
sub wait_any {
my $ret_pid;
my $exit_code;
if (IS_WIN32PERL) {
# Can't wait for -1 => use a polling loop
do {
@ -514,6 +518,7 @@ sub wait_any {
last if $pid == $ret_pid;
}
} while ($ret_pid == 0);
$exit_code= $?;
}
else
{
@ -523,6 +528,7 @@ sub wait_any {
print STDERR "wait_any, got invalid pid: $ret_pid\n";
return undef;
}
$exit_code= $?;
}
# Look it up in "running" table
@ -532,7 +538,7 @@ sub wait_any {
print STDERR "running: ". join(", ", keys(%running)). "\n";
return undef;
}
$proc->_collect;
$proc->_collect($exit_code);
return $proc;
}

View file

@ -159,7 +159,7 @@ int main(int argc, char* const argv[] )
signal(SIGCHLD, handle_signal);
signal(SIGABRT, handle_abort);
sprintf(safe_process_name, "safe_process[%d]", own_pid);
sprintf(safe_process_name, "safe_process[%d]", (int) own_pid);
message("Started");

View file

@ -524,6 +524,10 @@ sub collect_one_suite
next if ($test->{'name'} eq 'sys_vars.innodb_thread_concurrency_basic');
# Can't work with InnoPlug. Test framework needs to be re-designed.
next if ($test->{'name'} eq 'main.innodb_bug46000');
# Fails with innodb plugin
next if ($test->{'name'} eq 'main.innodb-autoinc');
# Fails with innodb plugin: r6185 Testcases changes not included
next if ($test->{'name'} eq 'main.innodb_bug44369');
# Copy test options
my $new_test= My::Test->new();
while (my ($key, $value) = each(%$test))
@ -677,6 +681,8 @@ sub optimize_cases {
if ( $default_engine =~ /^ndb/i );
$tinfo->{'innodb_test'}= 1
if ( $default_engine =~ /^innodb/i );
$tinfo->{'pbxt_test'}= 1
if ( $default_engine =~ /^pbxt/i );
}
}
@ -774,6 +780,8 @@ sub collect_one_test_case {
my $disabled= shift;
my $suite_opts= shift;
my $local_default_storage_engine= $default_storage_engine;
#print "collect_one_test_case\n";
#print " suitedir: $suitedir\n";
#print " testdir: $testdir\n";
@ -928,15 +936,26 @@ sub collect_one_test_case {
tags_from_test_file($tinfo,"$testdir/${tname}.test");
if ( defined $default_storage_engine )
# Get default storage engine from suite.opt file
if (defined $suite_opts &&
"@$suite_opts" =~ "default-storage-engine=\s*([^\s]*)")
{
$local_default_storage_engine= $1;
}
if ( defined $local_default_storage_engine )
{
# Different default engine is used
# tag test to require that engine
$tinfo->{'ndb_test'}= 1
if ( $default_storage_engine =~ /^ndb/i );
if ( $local_default_storage_engine =~ /^ndb/i );
$tinfo->{'innodb_test'}= 1
if ( $default_storage_engine =~ /^innodb/i );
if ( $local_default_storage_engine =~ /^innodb/i );
$tinfo->{'pbxt_test'}= 1
if ( $local_default_storage_engine =~ /^pbxt/i );
}
@ -1099,6 +1118,28 @@ sub collect_one_test_case {
$tinfo->{template_path}= $config;
}
if ( $tinfo->{'pbxt_test'} )
{
# This is a test that needs pbxt
if ( $::mysqld_variables{'pbxt'} eq "OFF" ||
! exists $::mysqld_variables{'pbxt'} )
{
# Engine is not supported, skip it
$tinfo->{'skip'}= 1;
return $tinfo;
}
}
else
{
# Only disable engine if it's on by default (to avoid warnings about
# not existing loose options
if ( $::mysqld_variables{'pbxt'} eq "ON")
{
push(@{$tinfo->{'master_opt'}}, "--loose-skip-pbxt");
push(@{$tinfo->{'slave_opt'}}, "--loose-skip-pbxt");
}
}
if ( $tinfo->{'example_plugin_test'} )
{
if ( !$ENV{'EXAMPLE_PLUGIN'} )
@ -1162,6 +1203,7 @@ my @tags=
["include/have_log_bin.inc", "need_binlog", 1],
["include/have_innodb.inc", "innodb_test", 1],
["include/have_pbxt.inc", "pbxt_test", 1],
["include/big_test.inc", "big_test", 1],
["include/have_debug.inc", "need_debug", 1],
["include/have_ndb.inc", "ndb_test", 1],

View file

@ -1117,14 +1117,16 @@ sub command_line_setup () {
if ( ! $opt_testcase_timeout )
{
$opt_testcase_timeout= $default_testcase_timeout;
$opt_testcase_timeout=
$ENV{MTR_TESTCASE_TIMEOUT} || $default_testcase_timeout;
$opt_testcase_timeout*= 10 if $opt_valgrind;
$opt_testcase_timeout*= 10 if ($opt_debug and $glob_win32);
}
if ( ! $opt_suite_timeout )
{
$opt_suite_timeout= $default_suite_timeout;
$opt_suite_timeout=
$ENV{MTR_SUITE_TIMEOUT} || $default_suite_timeout;
$opt_suite_timeout*= 6 if $opt_valgrind;
$opt_suite_timeout*= 6 if ($opt_debug and $glob_win32);
}
@ -3963,7 +3965,7 @@ sub mysqld_arguments ($$$$) {
}
}
mtr_add_arg($args, "%s--default-character-set=latin1", $prefix);
mtr_add_arg($args, "%s--character-set-server-set=latin1", $prefix);
mtr_add_arg($args, "%s--language=%s", $prefix, $path_language);
mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix);

View file

@ -126,7 +126,7 @@ my $path_config_file; # The generated config file, var/my.cnf
# executables will be used by the test suite.
our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
my $DEFAULT_SUITES= "main,binlog,federated,rpl,innodb,maria,parts,oqgraph";
my $DEFAULT_SUITES= "main,binlog,federated,rpl,maria,parts,oqgraph";
my $opt_suites;
our $opt_verbose= 0; # Verbose output, enable with --verbose
@ -201,10 +201,10 @@ my $opt_mark_progress;
my $opt_sleep;
my $opt_testcase_timeout= 15; # 15 minutes
my $opt_suite_timeout = 360; # 6 hours
my $opt_shutdown_timeout= 10; # 10 seconds
my $opt_start_timeout = 180; # 180 seconds
my $opt_testcase_timeout= $ENV{MTR_TESTCASE_TIMEOUT} || 15; # minutes
my $opt_suite_timeout = $ENV{MTR_SUITE_TIMEOUT} || 360; # minutes
my $opt_shutdown_timeout= $ENV{MTR_SHUTDOWN_TIMEOUT} || 10; # seconds
my $opt_start_timeout = $ENV{MTR_START_TIMEOUT} || 180; # seconds
sub testcase_timeout { return $opt_testcase_timeout * 60; };
sub suite_timeout { return $opt_suite_timeout * 60; };
@ -413,7 +413,6 @@ sub main {
# Not all tests completed, failure
mtr_report();
mtr_report("Only ", int(@$completed), " of $num_tests completed.");
mtr_error("Not all tests completed");
}
mtr_print_line();
@ -425,6 +424,10 @@ sub main {
mtr_report_stats($fail, $completed, $extra_warnings);
if ( @$completed != $num_tests)
{
mtr_error("Not all tests completed");
}
exit(0);
}
@ -3452,7 +3455,7 @@ sub restart_forced_by_test
# Return timezone value of tinfo or default value
sub timezone {
my ($tinfo)= @_;
return $tinfo->{timezone} || "GMT-3";
return $tinfo->{timezone} || "DEFAULT";
}
@ -3482,7 +3485,11 @@ sub run_testcase ($$) {
# Init variables that can change between each test case
# -------------------------------------------------------
my $timezone= timezone($tinfo);
$ENV{'TZ'}= $timezone;
if ($timezone ne 'DEFAULT') {
$ENV{'TZ'}= $timezone;
} else {
delete($ENV{'TZ'});
}
mtr_verbose("Setting timezone: $timezone");
if ( ! using_extern() )
@ -4037,6 +4044,9 @@ sub extract_warning_lines ($) {
qr/Slave I\/O: error reconnecting to master '.*' - retry-time: [1-3] retries/,
qr/Error reading packet/,
qr/Slave: Can't drop database.* database doesn't exist/,
qr/Slave: Operation DROP USER failed for 'create_rout_db'/,
qr|Checking table: '\./mtr/test_suppressions'|,
qr|mysqld: Table '\./mtr/test_suppressions' is marked as crashed and should be repaired|
);
my $matched_lines= [];
@ -4119,7 +4129,7 @@ sub start_check_warnings ($$) {
error => $errfile,
output => $errfile,
args => \$args,
user_data => $errfile,
user_data => [$errfile, $mysqld],
verbose => $opt_verbose,
);
mtr_verbose("Started $proc");
@ -4165,7 +4175,7 @@ sub check_warnings ($) {
if ( delete $started{$proc->pid()} ) {
# One check warning process returned
my $res= $proc->exit_status();
my $err_file= $proc->user_data();
my ($err_file, $mysqld)= @{$proc->user_data()};
if ( $res == 0 or $res == 62 ){
@ -4201,7 +4211,8 @@ sub check_warnings ($) {
my $report= mtr_grab_file($err_file);
$tinfo->{comment}.=
"Could not execute 'check-warnings' for ".
"testcase '$tname' (res: $res):\n";
"testcase '$tname' (res: $res) server: '".
$mysqld->name() .":\n";
$tinfo->{comment}.= $report;
$result= 2;
@ -5561,6 +5572,8 @@ sub usage ($) {
if ( $message )
{
print STDERR "$message\n";
print STDERR "For full list of options, use $0 --help\n";
exit;
}
print <<HERE;

View file

@ -1245,4 +1245,11 @@ ALTER TABLE t1 CHANGE COLUMN f1 f1_no_real_change TIMESTAMP NULL DEFAULT NULL;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
DROP TABLE t1;
#
# Bug #31145: ALTER TABLE DROP COLUMN, ADD COLUMN crashes (linux)
# or freezes (win) the server
#
CREATE TABLE t1 (a TEXT, id INT, b INT);
ALTER TABLE t1 DROP COLUMN a, ADD COLUMN c TEXT FIRST;
DROP TABLE t1;
End of 5.1 tests

View file

@ -12717,3 +12717,14 @@ COUNT(t1.a)
729
DROP TABLE t1;
SET @@join_buffer_size= @save_join_buffer_size;
SHOW CREATE TABLE t1;
ERROR HY000: Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
SELECT * FROM t1;
ERROR HY000: Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
INSERT INTO t1 (col1, col2) VALUES (1, "value");
ERROR HY000: Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
REPAIR TABLE t1;
Table Op Msg_type Msg_text
test.t1 repair Error Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
test.t1 repair error Corrupt
DROP TABLE t1;

4
mysql-test/r/bug46080.result Normal file → Executable file
View file

@ -2,8 +2,8 @@
# Bug #46080: group_concat(... order by) crashes server when
# sort_buffer_size cannot allocate
#
call mtr.add_suppression("Out of memory at line .*, 'my_alloc.c'");
call mtr.add_suppression("needed .* byte .*k., memory in use: .* bytes .*k");
call mtr.add_suppression("Out of memory at line .*, '.*my_alloc.c'");
call mtr.add_suppression("needed .* byte (.*k)., memory in use: .* bytes (.*k)");
CREATE TABLE t1(a CHAR(255));
INSERT INTO t1 VALUES ('a');
SET @@SESSION.sort_buffer_size=5*16*1000000;

View file

@ -0,0 +1,14 @@
#
# Bug#47671 - wrong character-set after upgrade from 5.1.34 to 5.1.39
#
# Extract only charset information from 'status' command output using regex
--------------
Server: MariaDB
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
--------------

View file

@ -40,6 +40,26 @@ select t2.isbn,city,t1.libname,count(distinct t1.libname) as a from t3 left join
isbn city libname a
007 Berkeley Berkeley Public1 2
000 New York New York Public Libra 2
select t2.isbn,city,@bar:=t1.libname,count(distinct t1.libname) as a
from t3 left join t1 on t3.libname=t1.libname left join t2
on t3.isbn=t2.isbn group by city having count(distinct
t1.libname) > 1;
isbn city @bar:=t1.libname a
007 Berkeley Berkeley Public1 2
000 New York New York Public Libra 2
SELECT @bar;
@bar
Berkeley Public2
select t2.isbn,city,concat(@bar:=t1.libname),count(distinct t1.libname) as a
from t3 left join t1 on t3.libname=t1.libname left join t2
on t3.isbn=t2.isbn group by city having count(distinct
t1.libname) > 1;
isbn city concat(@bar:=t1.libname) a
007 Berkeley Berkeley Public1 2
000 New York New York Public Libra 2
SELECT @bar;
@bar
Berkeley Public2
drop table t1, t2, t3;
create table t1 (f1 int);
insert into t1 values (1);

View file

@ -0,0 +1,31 @@
drop table if exists t1,t2;
CREATE TABLE t1(
c1 INT DEFAULT 12 COMMENT 'column1',
c2 INT NULL COMMENT 'column2',
c3 INT NOT NULL COMMENT 'column3',
c4 VARCHAR(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
c5 VARCHAR(255) COLLATE utf8_unicode_ci NULL DEFAULT 'b',
c6 VARCHAR(255))
COLLATE latin1_bin;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) DEFAULT '12' COMMENT 'column1',
`c2` int(11) DEFAULT NULL COMMENT 'column2',
`c3` int(11) NOT NULL COMMENT 'column3',
`c4` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
`c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'b',
`c6` varchar(255) COLLATE latin1_bin DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin
CREATE TABLE t2 AS SELECT * FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`c1` int(11) DEFAULT '12' COMMENT 'column1',
`c2` int(11) DEFAULT NULL COMMENT 'column2',
`c3` int(11) NOT NULL COMMENT 'column3',
`c4` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
`c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'b',
`c6` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;

View file

@ -820,16 +820,13 @@ i
drop table t1;
create temporary table t1 (j int);
create table if not exists t1 select 1;
Warnings:
Note 1050 Table 't1' already exists
select * from t1;
j
1
drop temporary table t1;
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
1
1
drop table t1;
ERROR 42S02: Unknown table 't1'
create table t1 (i int);
insert into t1 values (1), (2);
lock tables t1 read;
@ -1792,52 +1789,6 @@ t1 CREATE TABLE `t1` (
) ENGINE=MEMORY DEFAULT CHARSET=utf8
drop table t1;
# --
# -- Bug#21380: DEFAULT definition not always transfered by CREATE
# -- TABLE/SELECT to the new table.
# --
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
CREATE TABLE t1(
c1 INT DEFAULT 12 COMMENT 'column1',
c2 INT NULL COMMENT 'column2',
c3 INT NOT NULL COMMENT 'column3',
c4 VARCHAR(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
c5 VARCHAR(255) COLLATE utf8_unicode_ci NULL DEFAULT 'b',
c6 VARCHAR(255))
COLLATE latin1_bin;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) DEFAULT '12' COMMENT 'column1',
`c2` int(11) DEFAULT NULL COMMENT 'column2',
`c3` int(11) NOT NULL COMMENT 'column3',
`c4` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
`c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'b',
`c6` varchar(255) COLLATE latin1_bin DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin
CREATE TABLE t2 AS SELECT * FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`c1` int(11) DEFAULT '12' COMMENT 'column1',
`c2` int(11) DEFAULT NULL COMMENT 'column2',
`c3` int(11) NOT NULL COMMENT 'column3',
`c4` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
`c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'b',
`c6` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
DROP TABLE t1;
# -- End of test case for Bug#21380.
# --
# -- Bug#18834: ALTER TABLE ADD INDEX on table with two timestamp fields
# --

View file

@ -116,6 +116,26 @@ select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a';
binary 'a a' > 'a' binary 'a \0' > 'a' binary 'a\0' > 'a'
1 1 1
SET CHARACTER SET koi8r;
create table t1 (a varchar(2) character set ucs2 collate ucs2_bin, key(a));
insert into t1 values ('A'),('A'),('B'),('C'),('D'),('A\t');
insert into t1 values ('A\0'),('A\0'),('A\0'),('A\0'),('AZ');
select hex(a) from t1 where a like 'A_' order by a;
hex(a)
00410000
00410000
00410000
00410000
00410009
0041005A
select hex(a) from t1 ignore key(a) where a like 'A_' order by a;
hex(a)
00410000
00410000
00410000
00410000
00410009
0041005A
drop table t1;
CREATE TABLE t1 (word VARCHAR(64) CHARACTER SET ucs2, word2 CHAR(64) CHARACTER SET ucs2);
INSERT INTO t1 VALUES (_koi8r'ò',_koi8r'ò'), (X'2004',X'2004');
SELECT hex(word) FROM t1 ORDER BY word;

View file

@ -1,3 +1,5 @@
drop table if exists t1,t2,t3,t4;
drop database if exists mysqltest;
drop table if exists t1,t2;
set names utf8;
select left(_utf8 0xD0B0D0B1D0B2,1);
@ -1848,6 +1850,24 @@ select hex(_utf8 B'001111111111');
ERROR HY000: Invalid utf8 character string: 'FF'
select (_utf8 X'616263FF');
ERROR HY000: Invalid utf8 character string: 'FF'
#
# Bug#44131 Binary-mode "order by" returns records in incorrect order for UTF-8 strings
#
CREATE TABLE t1 (id int not null primary key, name varchar(10)) character set utf8;
INSERT INTO t1 VALUES
(2,'一二三01'),(3,'一二三09'),(4,'一二三02'),(5,'一二三08'),
(6,'一二三11'),(7,'一二三91'),(8,'一二三21'),(9,'一二三81');
SELECT * FROM t1 ORDER BY BINARY(name);
id name
2 一二三01
4 一二三02
5 一二三08
3 一二三09
6 一二三11
8 一二三21
9 一二三81
7 一二三91
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL);
INSERT INTO t1 VALUES (70000, 1092), (70001, 1085), (70002, 1065);
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;

View file

@ -314,4 +314,16 @@ a b
2 2
drop table t1;
set global low_priority_updates = @old_delayed_updates;
#
# Bug #47682 strange behaviour of INSERT DELAYED
#
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (f1 integer);
CREATE TABLE t2 (f1 integer);
FLUSH TABLES WITH READ LOCK;
LOCK TABLES t1 READ;
INSERT DELAYED INTO t2 VALUES (1);
Got one of the listed errors
UNLOCK TABLES;
DROP TABLE t1, t2;
End of 5.1 tests

View file

@ -324,3 +324,29 @@ a
1
2
DROP TABLE t1, t2, t3;
#
# Bug #46425 crash in Diagnostics_area::set_ok_status,
# empty statement, DELETE IGNORE
#
CREATE table t1 (i INTEGER);
INSERT INTO t1 VALUES (1);
CREATE TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW
BEGIN
INSERT INTO t1 SELECT * FROM t1 AS A;
END |
DELETE IGNORE FROM t1;
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
DROP TABLE t1;
#
# Bug #49552 : sql_buffer_result cause crash + not found records
# in multitable delete/subquery
#
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (1),(2),(3);
SET SESSION SQL_BUFFER_RESULT=1;
DELETE t1 FROM (SELECT SUM(a) a FROM t1) x,t1;
SET SESSION SQL_BUFFER_RESULT=DEFAULT;
SELECT * FROM t1;
a
DROP TABLE t1;
End of 5.1 tests

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