mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
Merge with base MySQL 5.1
Contains fixes for test cases Changed release tag to beta configure.in: change release tag to beta
This commit is contained in:
commit
a8fdaa6f2c
1466 changed files with 34375 additions and 19043 deletions
|
@ -748,6 +748,7 @@ mysql-test/.DS_Store
|
|||
mysql-test/funcs_1.log
|
||||
mysql-test/funcs_1.tar
|
||||
mysql-test/install_test_db
|
||||
mysql-test/lib/My/SafeProcess/my_safe_process
|
||||
mysql-test/lib/init_db.sql
|
||||
mysql-test/linux_sys_vars.inc
|
||||
mysql-test/load_sysvars.inc
|
||||
|
@ -1221,9 +1222,12 @@ sql/*.ds?
|
|||
sql/*.vcproj
|
||||
sql/.gdbinit
|
||||
sql/client.c
|
||||
sql/Doxyfile
|
||||
sql/f.c
|
||||
sql/gen_lex_hash
|
||||
sql/handlerton.cc
|
||||
sql/html
|
||||
sql/latex
|
||||
sql/lex_hash.h
|
||||
sql/link_sources
|
||||
sql/max/*
|
||||
|
@ -1897,3 +1901,4 @@ sql/share/slovak
|
|||
sql/share/spanish
|
||||
sql/share/swedish
|
||||
sql/share/ukrainian
|
||||
libmysqld/examples/mysqltest.cc
|
||||
|
|
|
@ -11,16 +11,33 @@ test -f Makefile && make maintainer-clean
|
|||
path=`dirname $0`
|
||||
. $path/autorun.sh
|
||||
|
||||
gmake=
|
||||
for x in gmake gnumake make; do
|
||||
if $x --version 2>/dev/null | grep GNU > /dev/null; then
|
||||
gmake=$x
|
||||
break;
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$gmake" ]; then
|
||||
# Our build may not depend on GNU make, but I wouldn't count on it
|
||||
echo "Please install GNU make, and ensure it is in your path as gnumake, gmake, or make" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Default to gcc for CC and CXX
|
||||
if test -z "$CXX" ; then
|
||||
export CXX
|
||||
CXX=gcc
|
||||
# Set some required compile options
|
||||
if test -z "$CXXFLAGS" ; then
|
||||
export CXXFLAGS
|
||||
CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$CC" ; then
|
||||
export CC
|
||||
CC=gcc
|
||||
fi
|
||||
|
||||
|
@ -28,37 +45,23 @@ fi
|
|||
# Use ccache, if available
|
||||
if ccache -V > /dev/null 2>&1
|
||||
then
|
||||
if echo "$CC" | grep "ccache" > /dev/null
|
||||
if echo "$CC" | grep -v ccache > /dev/null
|
||||
then
|
||||
:
|
||||
else
|
||||
export CC
|
||||
CC="ccache $CC"
|
||||
fi
|
||||
if echo "$CXX" | grep "ccache" > /dev/null
|
||||
if echo "$CXX" | grep -v ccache > /dev/null
|
||||
then
|
||||
:
|
||||
else
|
||||
export CXX
|
||||
CXX="ccache $CXX"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$MAKE"
|
||||
then
|
||||
if gmake -v > /dev/null 2>&1
|
||||
then
|
||||
MAKE="gmake"
|
||||
else
|
||||
MAKE="make"
|
||||
fi
|
||||
fi
|
||||
|
||||
export CC CXX MAKE
|
||||
|
||||
# Make sure to enable all features that affect "make dist"
|
||||
# Remember that configure restricts the man pages to the configured features !
|
||||
./configure \
|
||||
--with-maria-storage-engine \
|
||||
--with-embedded-server \
|
||||
--with-ndbcluster
|
||||
$MAKE
|
||||
$gmake
|
||||
|
||||
|
|
|
@ -105,6 +105,10 @@ IF(CYBOZU)
|
|||
ADD_DEFINITIONS(-DCYBOZU)
|
||||
ENDIF(CYBOZU)
|
||||
|
||||
IF(EXTRA_DEBUG)
|
||||
ADD_DEFINITIONS(-D EXTRA_DEBUG)
|
||||
ENDIF(EXTRA_DEBUG)
|
||||
|
||||
# in some places we use DBUG_OFF
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DDBUG_OFF")
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDBUG_OFF")
|
||||
|
@ -269,3 +273,4 @@ IF(WITH_EMBEDDED_SERVER)
|
|||
ADD_SUBDIRECTORY(libmysqld)
|
||||
ADD_SUBDIRECTORY(libmysqld/examples)
|
||||
ENDIF(WITH_EMBEDDED_SERVER)
|
||||
ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess)
|
||||
|
|
27
Makefile.am
27
Makefile.am
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2000-2006 MySQL AB
|
||||
# Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
#
|
||||
# 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
|
||||
|
@ -124,6 +124,10 @@ test-reprepare:
|
|||
|
||||
test: test-ns test-pr
|
||||
|
||||
smoke:
|
||||
cd mysql-test ; \
|
||||
@PERL@ ./mysql-test-run.pl --do-test=s
|
||||
|
||||
test-full: test test-nr test-ps
|
||||
|
||||
test-force:
|
||||
|
@ -162,6 +166,8 @@ test-bt:
|
|||
@PERL@ ./mysql-test-run.pl --force --comment=partitions --suite=parts
|
||||
-cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
@PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress
|
||||
-cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
@PERL@ ./mysql-test-run.pl --force --comment=jp --suite=jp
|
||||
-if [ -d mysql-test/suite/nist ] ; then \
|
||||
cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
@PERL@ ./mysql-test-run.pl --comment=nist --force --suite=nist ; \
|
||||
|
@ -178,15 +184,28 @@ test-bt:
|
|||
echo "no program found for 'embedded' tests - skipped testing" ; \
|
||||
fi
|
||||
|
||||
# Re-enable the "jp" suite when bug#28563 is fixed
|
||||
# -cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
# @PERL@ ./mysql-test-run.pl --force --comment=jp --suite=jp
|
||||
test-bt-fast:
|
||||
-cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
@PERL@ ./mysql-test-run.pl --comment=ps --force --timer \
|
||||
--skip-ndbcluster --ps-protocol --report-features
|
||||
-if [ -e bin/ndbd -o -e storage/ndb/src/kernel/ndbd ] ; then \
|
||||
cd mysql-test ; \
|
||||
MTR_BUILD_THREAD=auto \
|
||||
@PERL@ ./mysql-test-run.pl --comment=ndb --force --timer \
|
||||
--with-ndbcluster-only ; \
|
||||
else \
|
||||
echo "no program found for 'ndbcluster' tests - skipped testing" ; \
|
||||
fi
|
||||
-cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
@PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress
|
||||
|
||||
test-bt-debug:
|
||||
-cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
@PERL@ ./mysql-test-run.pl --comment=debug --force --timer \
|
||||
--skip-ndbcluster --skip-rpl --report-features
|
||||
|
||||
test-bt-debug-fast:
|
||||
|
||||
# Keep these for a while
|
||||
test-pl: test
|
||||
test-full-pl: test-full
|
||||
|
|
|
@ -32,8 +32,8 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
|
|||
ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc ../mysys/my_conio.c)
|
||||
TARGET_LINK_LIBRARIES(mysql mysqlclient_notls wsock32)
|
||||
|
||||
ADD_EXECUTABLE(mysqltest mysqltest.c)
|
||||
SET_SOURCE_FILES_PROPERTIES(mysqltest.c PROPERTIES COMPILE_FLAGS "-DTHREADS")
|
||||
ADD_EXECUTABLE(mysqltest mysqltest.cc)
|
||||
SET_SOURCE_FILES_PROPERTIES(mysqltest.cc PROPERTIES COMPILE_FLAGS "-DTHREADS")
|
||||
TARGET_LINK_LIBRARIES(mysqltest mysqlclient mysys regex wsock32 dbug)
|
||||
|
||||
ADD_EXECUTABLE(mysqlcheck mysqlcheck.c)
|
||||
|
|
|
@ -86,9 +86,9 @@ mysqlslap_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
|
|||
$(LIBMYSQLCLIENT_LA) \
|
||||
$(top_builddir)/mysys/libmysys.a
|
||||
|
||||
mysqltest_SOURCES= mysqltest.c
|
||||
mysqltest_CFLAGS= -DTHREAD -UUNDEF_THREADS_HACK
|
||||
mysqltest_LDADD = $(CXXLDFLAGS) \
|
||||
mysqltest_SOURCES= mysqltest.cc
|
||||
mysqltest_CXXFLAGS= -DTHREAD -UUNDEF_THREADS_HACK
|
||||
mysqltest_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
|
||||
@CLIENT_EXTRA_LDFLAGS@ \
|
||||
$(LIBMYSQLCLIENT_LA) \
|
||||
$(top_builddir)/mysys/libmysys.a \
|
||||
|
|
|
@ -1539,7 +1539,7 @@ static void usage(int version)
|
|||
if (version)
|
||||
return;
|
||||
printf("\
|
||||
Copyright (C) 2000-2008 MySQL AB\n\
|
||||
Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.\n\
|
||||
This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\
|
||||
and you are welcome to modify and redistribute it under the GPL license\n");
|
||||
printf("Usage: %s [OPTIONS] [database]\n", my_progname);
|
||||
|
@ -2028,7 +2028,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
|
|||
{
|
||||
if (!preserve_comments)
|
||||
{
|
||||
// Skip spaces at the beggining of a statement
|
||||
// Skip spaces at the beginning of a statement
|
||||
if (my_isspace(charset_info,inchar) && (out == line) &&
|
||||
buffer.is_empty())
|
||||
continue;
|
||||
|
@ -2111,37 +2111,6 @@ static bool add_line(String &buffer,char *line,char *in_string,
|
|||
continue;
|
||||
}
|
||||
}
|
||||
else if (!*ml_comment && !*in_string &&
|
||||
(end_of_line - pos) >= 10 &&
|
||||
!my_strnncoll(charset_info, (uchar*) pos, 10,
|
||||
(const uchar*) "delimiter ", 10))
|
||||
{
|
||||
// Flush previously accepted characters
|
||||
if (out != line)
|
||||
{
|
||||
buffer.append(line, (uint32) (out - line));
|
||||
out= line;
|
||||
}
|
||||
|
||||
// Flush possible comments in the buffer
|
||||
if (!buffer.is_empty())
|
||||
{
|
||||
if (com_go(&buffer, 0) > 0) // < 0 is not fatal
|
||||
DBUG_RETURN(1);
|
||||
buffer.length(0);
|
||||
}
|
||||
|
||||
/*
|
||||
Delimiter wants the get rest of the given line as argument to
|
||||
allow one to change ';' to ';;' and back
|
||||
*/
|
||||
buffer.append(pos);
|
||||
if (com_delimiter(&buffer, pos) > 0)
|
||||
DBUG_RETURN(1);
|
||||
|
||||
buffer.length(0);
|
||||
break;
|
||||
}
|
||||
else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter))
|
||||
{
|
||||
// Found a statement. Continue parsing after the delimiter
|
||||
|
@ -2206,8 +2175,24 @@ static bool add_line(String &buffer,char *line,char *in_string,
|
|||
|
||||
// comment to end of line
|
||||
if (preserve_comments)
|
||||
{
|
||||
bool started_with_nothing= !buffer.length();
|
||||
|
||||
buffer.append(pos);
|
||||
|
||||
/*
|
||||
A single-line comment by itself gets sent immediately so that
|
||||
client commands (delimiter, status, etc) will be interpreted on
|
||||
the next line.
|
||||
*/
|
||||
if (started_with_nothing)
|
||||
{
|
||||
if (com_go(&buffer, 0) > 0) // < 0 is not fatal
|
||||
DBUG_RETURN(1);
|
||||
buffer.length(0);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
else if (!*in_string && inchar == '/' && *(pos+1) == '*' &&
|
||||
|
|
|
@ -620,6 +620,20 @@ static int run_mysqlcheck_upgrade(void)
|
|||
}
|
||||
|
||||
|
||||
static int run_mysqlcheck_fixnames(void)
|
||||
{
|
||||
verbose("Running 'mysqlcheck'...");
|
||||
return run_tool(mysqlcheck_path,
|
||||
NULL, /* Send output from mysqlcheck directly to screen */
|
||||
"--no-defaults",
|
||||
ds_args.str,
|
||||
"--all-databases",
|
||||
"--fix-db-names",
|
||||
"--fix-table-names",
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
||||
static const char *expected_errors[]=
|
||||
{
|
||||
"ERROR 1060", /* Duplicate column name */
|
||||
|
@ -782,7 +796,8 @@ int main(int argc, char **argv)
|
|||
/*
|
||||
Run "mysqlcheck" and "mysql_fix_privilege_tables.sql"
|
||||
*/
|
||||
if (run_mysqlcheck_upgrade() ||
|
||||
if (run_mysqlcheck_fixnames() ||
|
||||
run_mysqlcheck_upgrade() ||
|
||||
run_sql_fix_privilege_tables())
|
||||
{
|
||||
/*
|
||||
|
|
|
@ -23,10 +23,6 @@
|
|||
#include <sys/stat.h>
|
||||
#include <mysql.h>
|
||||
|
||||
#ifdef LATER_HAVE_NDBCLUSTER_DB
|
||||
#include "../ndb/src/mgmclient/ndb_mgmclient.h"
|
||||
#endif
|
||||
|
||||
#define ADMIN_VERSION "8.42"
|
||||
#define MAX_MYSQL_VAR 256
|
||||
#define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */
|
||||
|
@ -46,10 +42,6 @@ static uint tcp_port = 0, option_wait = 0, option_silent=0, nr_iterations;
|
|||
static uint opt_count_iterations= 0, my_end_arg;
|
||||
static ulong opt_connect_timeout, opt_shutdown_timeout;
|
||||
static char * unix_port=0;
|
||||
#ifdef LATER_HAVE_NDBCLUSTER_DB
|
||||
static my_bool opt_ndbcluster=0;
|
||||
static char *opt_ndb_connectstring=0;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SMEM
|
||||
static char *shared_memory_base_name=0;
|
||||
|
@ -105,9 +97,6 @@ enum commands {
|
|||
ADMIN_PING, ADMIN_EXTENDED_STATUS, ADMIN_FLUSH_STATUS,
|
||||
ADMIN_FLUSH_PRIVILEGES, ADMIN_START_SLAVE, ADMIN_STOP_SLAVE,
|
||||
ADMIN_FLUSH_THREADS, ADMIN_OLD_PASSWORD
|
||||
#ifdef LATER_HAVE_NDBCLUSTER_DB
|
||||
,ADMIN_NDB_MGM
|
||||
#endif
|
||||
};
|
||||
static const char *command_names[]= {
|
||||
"create", "drop", "shutdown",
|
||||
|
@ -118,9 +107,6 @@ static const char *command_names[]= {
|
|||
"ping", "extended-status", "flush-status",
|
||||
"flush-privileges", "start-slave", "stop-slave",
|
||||
"flush-threads","old-password",
|
||||
#ifdef LATER_HAVE_NDBCLUSTER_DB
|
||||
"ndb-mgm",
|
||||
#endif
|
||||
NullS
|
||||
};
|
||||
|
||||
|
@ -224,14 +210,6 @@ static struct my_option my_long_options[] =
|
|||
{"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", (uchar**) &opt_shutdown_timeout,
|
||||
(uchar**) &opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG,
|
||||
SHUTDOWN_DEF_TIMEOUT, 0, 3600*12, 0, 1, 0},
|
||||
#ifdef LATER_HAVE_NDBCLUSTER_DB
|
||||
{"ndbcluster", OPT_NDBCLUSTER, ""
|
||||
"", (uchar**) &opt_ndbcluster,
|
||||
(uchar**) &opt_ndbcluster, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"ndb-connectstring", OPT_NDB_CONNECTSTRING, ""
|
||||
"", (uchar**) &opt_ndb_connectstring,
|
||||
(uchar**) &opt_ndb_connectstring, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
|
@ -634,7 +612,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
case ADMIN_VER:
|
||||
new_line=1;
|
||||
print_version();
|
||||
puts("Copyright (C) 2000-2006 MySQL AB");
|
||||
puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
|
||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
|
||||
printf("Server version\t\t%s\n", mysql_get_server_info(mysql));
|
||||
printf("Protocol version\t%d\n", mysql_get_proto_info(mysql));
|
||||
|
@ -984,24 +962,6 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
}
|
||||
mysql->reconnect=1; /* Automatic reconnect is default */
|
||||
break;
|
||||
#ifdef LATER_HAVE_NDBCLUSTER_DB
|
||||
case ADMIN_NDB_MGM:
|
||||
{
|
||||
if (argc < 2)
|
||||
{
|
||||
my_printf_error(0, "Too few arguments to ndb-mgm", error_flags);
|
||||
return 1;
|
||||
}
|
||||
{
|
||||
Ndb_mgmclient_handle cmd=
|
||||
ndb_mgmclient_handle_create(opt_ndb_connectstring);
|
||||
ndb_mgmclient_execute(cmd, --argc, ++argv);
|
||||
ndb_mgmclient_handle_destroy(cmd);
|
||||
}
|
||||
argc= 0;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
my_printf_error(0, "Unknown command: '%-.60s'", error_flags, argv[0]);
|
||||
return 1;
|
||||
|
@ -1023,7 +983,7 @@ static void print_version(void)
|
|||
static void usage(void)
|
||||
{
|
||||
print_version();
|
||||
puts("Copyright (C) 2000-2006 MySQL AB");
|
||||
puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
|
||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
|
||||
puts("Administration program for the mysqld daemon.");
|
||||
printf("Usage: %s [OPTIONS] command command....\n", my_progname);
|
||||
|
|
|
@ -40,15 +40,13 @@ static uint verbose = 0, opt_mysql_port=0;
|
|||
static int my_end_arg;
|
||||
static char * opt_mysql_unix_port = 0;
|
||||
static char *opt_password = 0, *current_user = 0,
|
||||
*default_charset = (char *)MYSQL_DEFAULT_CHARSET_NAME,
|
||||
*current_host = 0;
|
||||
*default_charset= 0, *current_host= 0;
|
||||
static int first_error = 0;
|
||||
DYNAMIC_ARRAY tables4repair;
|
||||
#ifdef HAVE_SMEM
|
||||
static char *shared_memory_base_name=0;
|
||||
#endif
|
||||
static uint opt_protocol=0;
|
||||
static CHARSET_INFO *charset_info= &my_charset_latin1;
|
||||
|
||||
enum operations { DO_CHECK, DO_REPAIR, DO_ANALYZE, DO_OPTIMIZE, DO_UPGRADE };
|
||||
|
||||
|
@ -282,12 +280,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||
break;
|
||||
case OPT_FIX_DB_NAMES:
|
||||
what_to_do= DO_UPGRADE;
|
||||
default_charset= (char*) "utf8";
|
||||
opt_databases= 1;
|
||||
break;
|
||||
case OPT_FIX_TABLE_NAMES:
|
||||
what_to_do= DO_UPGRADE;
|
||||
default_charset= (char*) "utf8";
|
||||
break;
|
||||
case 'p':
|
||||
if (argument)
|
||||
|
@ -367,11 +363,20 @@ static int get_options(int *argc, char ***argv)
|
|||
what_to_do = DO_CHECK;
|
||||
}
|
||||
|
||||
/* TODO: This variable is not yet used */
|
||||
if (strcmp(default_charset, charset_info->csname) &&
|
||||
!(charset_info= get_charset_by_csname(default_charset,
|
||||
MY_CS_PRIMARY, MYF(MY_WME))))
|
||||
exit(1);
|
||||
/*
|
||||
If there's no --default-character-set option given with
|
||||
--fix-table-name or --fix-db-name set the default character set to "utf8".
|
||||
*/
|
||||
if (!default_charset && (opt_fix_db_names || opt_fix_table_names))
|
||||
{
|
||||
default_charset= (char*) "utf8";
|
||||
}
|
||||
if (default_charset && !get_charset_by_csname(default_charset, MY_CS_PRIMARY,
|
||||
MYF(MY_WME)))
|
||||
{
|
||||
printf("Unsupported character set: %s\n", default_charset);
|
||||
return 1;
|
||||
}
|
||||
if (*argc > 0 && opt_alldbs)
|
||||
{
|
||||
printf("You should give only options, no arguments at all, with option\n");
|
||||
|
@ -779,6 +784,8 @@ static int dbConnect(char *host, char *user, char *passwd)
|
|||
if (shared_memory_base_name)
|
||||
mysql_options(&mysql_connection,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
|
||||
#endif
|
||||
if (default_charset)
|
||||
mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset);
|
||||
if (!(sock = mysql_real_connect(&mysql_connection, host, user, passwd,
|
||||
NULL, opt_mysql_port, opt_mysql_unix_port, 0)))
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
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
|
||||
|
|
|
@ -193,7 +193,7 @@ static void print_version(void)
|
|||
static void usage(void)
|
||||
{
|
||||
print_version();
|
||||
puts("Copyright (C) 2000-2006 MySQL AB");
|
||||
puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
|
||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
|
||||
printf("\
|
||||
Loads tables from text files in various formats. The base name of the\n\
|
||||
|
|
|
@ -249,7 +249,7 @@ static void print_version(void)
|
|||
static void usage(void)
|
||||
{
|
||||
print_version();
|
||||
puts("Copyright (C) 2000-2006 MySQL AB");
|
||||
puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
|
||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
|
||||
puts("Shows the structure of a mysql database (databases,tables and columns)\n");
|
||||
printf("Usage: %s [OPTIONS] [database [table [column]]]\n",my_progname);
|
||||
|
|
|
@ -688,9 +688,7 @@ static void usage(void)
|
|||
{
|
||||
print_version();
|
||||
puts("Copyright (C) 2005 MySQL AB");
|
||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\
|
||||
\nand you are welcome to modify and redistribute it under the GPL \
|
||||
license\n");
|
||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
|
||||
puts("Run a query multiple times against the server\n");
|
||||
printf("Usage: %s [OPTIONS]\n",my_progname);
|
||||
print_defaults("my",load_default_groups);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -280,7 +280,7 @@ AC_DEFUN([MYSQL_SETUP_NDBCLUSTER], [
|
|||
esac
|
||||
|
||||
# libndbclient versioning when linked with GNU ld.
|
||||
if $LD --version 2>/dev/null|grep -q GNU; then
|
||||
if $LD --version 2>/dev/null|grep GNU >/dev/null 2>&1 ; then
|
||||
NDB_LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/storage/ndb/src/libndb.ver"
|
||||
AC_CONFIG_FILES(storage/ndb/src/libndb.ver)
|
||||
fi
|
||||
|
|
14
configure.in
14
configure.in
|
@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM
|
|||
#
|
||||
# When changing major version number please also check switch statement
|
||||
# in mysqlbinlog::check_master_version().
|
||||
AM_INIT_AUTOMAKE(mysql, 5.1.31-maria-alpha)
|
||||
AM_INIT_AUTOMAKE(mysql, 5.1.32-maria-beta)
|
||||
AM_CONFIG_HEADER([include/config.h:config.h.in])
|
||||
|
||||
PROTOCOL_VERSION=10
|
||||
|
@ -375,7 +375,7 @@ fi
|
|||
MYSQL_PROG_AR
|
||||
|
||||
# libmysqlclient versioning when linked with GNU ld.
|
||||
if $LD --version 2>/dev/null|grep -q GNU; then
|
||||
if $LD --version 2>/dev/null| grep GNU >/dev/null 2>&1; then
|
||||
LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/libmysql/libmysql.ver"
|
||||
AC_CONFIG_FILES(libmysql/libmysql.ver)
|
||||
fi
|
||||
|
@ -447,11 +447,11 @@ AC_SUBST(PERL5)
|
|||
|
||||
# Enable the abi_check rule only if gcc is available
|
||||
|
||||
if expr "$CC" : ".*gcc.*"
|
||||
if test "$GCC" != "yes" || expr "$CC" : ".*icc.*"
|
||||
then
|
||||
ABI_CHECK="abi_check"
|
||||
else
|
||||
ABI_CHECK=""
|
||||
else
|
||||
ABI_CHECK="abi_check"
|
||||
fi
|
||||
|
||||
AC_SUBST(ABI_CHECK)
|
||||
|
@ -2805,8 +2805,8 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
|
|||
server-tools/Makefile server-tools/instance-manager/Makefile dnl
|
||||
cmd-line-utils/Makefile cmd-line-utils/libedit/Makefile dnl
|
||||
libmysqld/Makefile libmysqld/examples/Makefile dnl
|
||||
mysql-test/Makefile dnl
|
||||
mysql-test/ndb/Makefile netware/Makefile sql-bench/Makefile dnl
|
||||
mysql-test/Makefile mysql-test/lib/My/SafeProcess/Makefile dnl
|
||||
netware/Makefile sql-bench/Makefile dnl
|
||||
include/mysql_version.h plugin/Makefile win/Makefile)
|
||||
|
||||
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
|
||||
|
|
|
@ -290,7 +290,8 @@ static void do_resolve()
|
|||
char buf[1024], *p;
|
||||
while (fgets(buf, sizeof(buf), fp_dump))
|
||||
{
|
||||
p = buf;
|
||||
/* skip bracket */
|
||||
p= (p= strchr(buf, '[')) ? p+1 : buf;
|
||||
/* skip space */
|
||||
while (my_isspace(&my_charset_latin1,*p))
|
||||
++p;
|
||||
|
|
|
@ -203,8 +203,8 @@ SSL_CTX* SSL_CTX_new(SSL_METHOD*);
|
|||
SSL* SSL_new(SSL_CTX*);
|
||||
int SSL_set_fd (SSL*, YASSL_SOCKET_T);
|
||||
YASSL_SOCKET_T SSL_get_fd(const SSL*);
|
||||
int SSL_connect(SSL*); // if you get an error from connect
|
||||
// see note at top of REAMDE
|
||||
int SSL_connect(SSL*); /* if you get an error from connect
|
||||
see note at top of REAMDE */
|
||||
int SSL_write(SSL*, const void*, int);
|
||||
int SSL_read(SSL*, void*, int);
|
||||
int SSL_accept(SSL*);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
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
|
||||
|
@ -260,6 +260,15 @@ inline double ulonglong2double(ulonglong value)
|
|||
#define my_off_t2double(A) ulonglong2double(A)
|
||||
#endif /* _WIN64 */
|
||||
|
||||
inline ulonglong double2ulonglong(double d)
|
||||
{
|
||||
double t= d - (double) 0x8000000000000000ULL;
|
||||
|
||||
if (t >= 0)
|
||||
return ((ulonglong) t) + 0x8000000000000000ULL;
|
||||
return (ulonglong) d;
|
||||
}
|
||||
|
||||
#if SIZEOF_OFF_T > 4
|
||||
#define lseek(A,B,C) _lseeki64((A),(longlong) (B),(C))
|
||||
#define tell(A) _telli64(A)
|
||||
|
@ -381,6 +390,9 @@ inline double ulonglong2double(ulonglong value)
|
|||
#define HAVE_OPENSSL 1
|
||||
#define HAVE_YASSL 1
|
||||
|
||||
#define COMMUNITY_SERVER 1
|
||||
#define ENABLED_PROFILING 1
|
||||
|
||||
/* Define charsets you want */
|
||||
/* #undef HAVE_CHARSET_armscii8 */
|
||||
/* #undef HAVE_CHARSET_ascii */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
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
|
||||
|
|
|
@ -472,6 +472,7 @@ my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, size_t len);
|
|||
uint my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong len);
|
||||
my_bool my_charset_is_ascii_based(CHARSET_INFO *cs);
|
||||
my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs);
|
||||
uint my_charset_repertoire(CHARSET_INFO *cs);
|
||||
|
||||
|
||||
#define _MY_U 01 /* Upper case */
|
||||
|
|
|
@ -798,6 +798,9 @@ typedef SOCKET_SIZE_TYPE size_socket;
|
|||
#define ulonglong2double(A) ((double) (ulonglong) (A))
|
||||
#define my_off_t2double(A) ((double) (my_off_t) (A))
|
||||
#endif
|
||||
#ifndef double2ulonglong
|
||||
#define double2ulonglong(A) ((ulonglong) (double) (A))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef offsetof
|
||||
|
@ -1138,6 +1141,9 @@ typedef char bool; /* Ordinary boolean values 0 1 */
|
|||
#define dbug_volatile
|
||||
#endif
|
||||
|
||||
/* Some helper macros */
|
||||
#define YESNO(X) ((X) ? "yes" : "no")
|
||||
|
||||
/* Defines for time function */
|
||||
#define SCALE_SEC 100
|
||||
#define SCALE_USEC 10000
|
||||
|
|
|
@ -679,6 +679,8 @@ extern const char *my_thread_name(void);
|
|||
extern my_thread_id my_thread_dbug_id(void);
|
||||
extern int pthread_no_free(void *);
|
||||
extern int pthread_dummy(int);
|
||||
extern void my_mutex_init();
|
||||
extern void my_mutex_end();
|
||||
|
||||
/* All thread specific variables are in the following struct */
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
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
|
||||
|
|
|
@ -32,7 +32,7 @@ ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc
|
|||
TARGET_LINK_LIBRARIES(mysql_embedded debug dbug strings mysys vio yassl taocrypt regex ws2_32)
|
||||
ADD_DEPENDENCIES(mysql_embedded libmysqld)
|
||||
|
||||
ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.c)
|
||||
ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc)
|
||||
TARGET_LINK_LIBRARIES(mysqltest_embedded debug dbug strings mysys vio yassl taocrypt regex ws2_32)
|
||||
ADD_DEPENDENCIES(mysqltest_embedded libmysqld)
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @LIBDL@ $(CXXLDFLAGS) \
|
|||
@NDB_SCI_LIBS@
|
||||
|
||||
mysqltest_embedded_LINK = $(CXXLINK)
|
||||
nodist_mysqltest_embedded_SOURCES = mysqltest.c
|
||||
nodist_mysqltest_embedded_SOURCES = mysqltest.cc
|
||||
mysqltest_embedded_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a
|
||||
|
||||
nodist_mysql_SOURCES = mysql.cc readline.cc completion_hash.cc \
|
||||
|
|
|
@ -17,132 +17,110 @@
|
|||
|
||||
## Process this file with automake to create Makefile.in
|
||||
|
||||
SUBDIRS = ndb
|
||||
testdir = $(prefix)/mysql-test
|
||||
|
||||
benchdir_root= $(prefix)
|
||||
testdir = $(benchdir_root)/mysql-test
|
||||
EXTRA_SCRIPTS = mysql-test-run-shell.sh install_test_db.sh \
|
||||
valgrind.supp $(PRESCRIPTS)
|
||||
EXTRA_DIST = $(EXTRA_SCRIPTS) suite
|
||||
GENSCRIPTS = mysql-test-run-shell install_test_db mtr mysql-test-run
|
||||
PRESCRIPTS = mysql-test-run.pl mysql-stress-test.pl
|
||||
test_SCRIPTS = $(GENSCRIPTS) $(PRESCRIPTS)
|
||||
CLEANFILES = $(GENSCRIPTS)
|
||||
test_SCRIPTS = mtr \
|
||||
mysql-test-run \
|
||||
mysql-test-run.pl \
|
||||
mysql-stress-test.pl
|
||||
|
||||
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I..
|
||||
nobase_test_DATA = \
|
||||
lib/v1/mysql-test-run.pl \
|
||||
lib/v1/mtr_cases.pl \
|
||||
lib/v1/mtr_io.pl \
|
||||
lib/v1/mtr_report.pl \
|
||||
lib/v1/My/Config.pm \
|
||||
lib/v1/mtr_gcov.pl \
|
||||
lib/v1/mtr_match.pl \
|
||||
lib/v1/mtr_stress.pl \
|
||||
lib/v1/ndb_config_1_node.ini \
|
||||
lib/v1/ndb_config_2_node.ini \
|
||||
lib/v1/mtr_gprof.pl \
|
||||
lib/v1/mtr_misc.pl \
|
||||
lib/v1/mtr_timer.pl \
|
||||
lib/v1/mtr_im.pl \
|
||||
lib/v1/mtr_process.pl \
|
||||
lib/v1/mtr_unique.pl \
|
||||
\
|
||||
lib/mtr_cases.pm \
|
||||
lib/mtr_gcov.pl \
|
||||
lib/mtr_gprof.pl \
|
||||
lib/mtr_io.pl \
|
||||
lib/mtr_match.pm \
|
||||
lib/mtr_misc.pl \
|
||||
lib/mtr_process.pl \
|
||||
lib/mtr_report.pm \
|
||||
lib/mtr_stress.pl \
|
||||
lib/mtr_unique.pm \
|
||||
lib/My/ConfigFactory.pm \
|
||||
lib/My/Config.pm \
|
||||
lib/My/Find.pm \
|
||||
lib/My/Handles.pm \
|
||||
lib/My/Options.pm \
|
||||
lib/My/Test.pm \
|
||||
lib/My/Platform.pm \
|
||||
lib/My/SafeProcess.pm \
|
||||
lib/My/File/Path.pm \
|
||||
lib/My/SysInfo.pm \
|
||||
lib/My/CoreDump.pm \
|
||||
lib/My/SafeProcess/Base.pm \
|
||||
lib/My/SafeProcess/safe_process.pl
|
||||
|
||||
SUBDIRS = lib/My/SafeProcess
|
||||
|
||||
EXTRA_DIST = README \
|
||||
valgrind.supp \
|
||||
$(test_SCRIPTS) \
|
||||
$(nobase_test_DATA)
|
||||
|
||||
# List of directories containing test + result files and the
|
||||
# related test data files that should be copied
|
||||
TEST_DIRS = t r include std_data std_data/parts \
|
||||
std_data/ndb_backup50 std_data/ndb_backup51 \
|
||||
std_data/ndb_backup51_data_be std_data/ndb_backup51_data_le \
|
||||
extra/binlog_tests/ extra/rpl_tests \
|
||||
suite/binlog suite/binlog/t suite/binlog/r suite/binlog/std_data \
|
||||
suite/bugs/data suite/bugs/t suite/bugs/r \
|
||||
suite/federated \
|
||||
suite/funcs_1 suite/funcs_1/bitdata \
|
||||
suite/funcs_1/include suite/funcs_1/lib suite/funcs_1/r \
|
||||
suite/funcs_1/t suite/funcs_1/views suite/funcs_1/cursors \
|
||||
suite/funcs_1/datadict suite/funcs_1/storedproc suite/funcs_1/triggers \
|
||||
suite/funcs_2 suite/funcs_2/charset suite/funcs_2/data \
|
||||
suite/funcs_2/include suite/funcs_2/lib suite/funcs_2/r \
|
||||
suite/funcs_2/t \
|
||||
suite/jp suite/jp/t suite/jp/r suite/jp/std_data \
|
||||
suite/manual/t suite/manual/r \
|
||||
suite/ndb_team suite/ndb_team/t suite/ndb_team/r \
|
||||
suite/rpl suite/rpl/data suite/rpl/include suite/rpl/r \
|
||||
suite/rpl/t \
|
||||
suite/stress/include suite/stress/t suite/stress/r \
|
||||
suite/ndb suite/ndb/t suite/ndb/r \
|
||||
suite/rpl_ndb suite/rpl_ndb/t suite/rpl_ndb/r \
|
||||
suite/parts suite/parts/t suite/parts/r suite/parts/inc
|
||||
|
||||
# Used by dist-hook and install-data-local to copy all
|
||||
# test files into either dist or install directory
|
||||
install_test_files:
|
||||
@if test -z "$(INSTALL_TO_DIR)"; then \
|
||||
echo "Set INSTALL_TO_DIR!" && exit 1; \
|
||||
fi
|
||||
@for dir in $(TEST_DIRS); do \
|
||||
from_dir="$(srcdir)/$$dir"; \
|
||||
to_dir="$(INSTALL_TO_DIR)/$$dir"; \
|
||||
$(mkinstalldirs) "$$to_dir"; \
|
||||
for f in `(cd $$from_dir && ls)`; do \
|
||||
if test -f "$$from_dir/$$f"; then \
|
||||
$(INSTALL_DATA) "$$from_dir/$$f" "$$to_dir/$$f" ; \
|
||||
fi; \
|
||||
done \
|
||||
done
|
||||
|
||||
dist-hook:
|
||||
mkdir -p \
|
||||
$(distdir)/t \
|
||||
$(distdir)/extra/binlog_tests \
|
||||
$(distdir)/extra/rpl_tests \
|
||||
$(distdir)/r \
|
||||
$(distdir)/include \
|
||||
$(distdir)/std_data \
|
||||
$(distdir)/std_data/ndb_backup50 \
|
||||
$(distdir)/std_data/ndb_backup51 \
|
||||
$(distdir)/std_data/ndb_backup51_data_be \
|
||||
$(distdir)/std_data/ndb_backup51_data_le \
|
||||
$(distdir)/std_data/parts \
|
||||
$(distdir)/lib \
|
||||
$(distdir)/std_data/funcs_1 \
|
||||
$(distdir)/lib/My
|
||||
-$(INSTALL_DATA) $(srcdir)/t/*.def $(distdir)/t
|
||||
$(INSTALL_DATA) $(srcdir)/t/*.test $(distdir)/t
|
||||
-$(INSTALL_DATA) $(srcdir)/t/*.imtest $(distdir)/t
|
||||
$(INSTALL_DATA) $(srcdir)/t/*.sql $(distdir)/t
|
||||
-$(INSTALL_DATA) $(srcdir)/t/*.disabled $(distdir)/t
|
||||
-$(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.slave-mi $(distdir)/t
|
||||
-$(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(distdir)/t
|
||||
$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.test $(distdir)/extra/binlog_tests
|
||||
$(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.test $(distdir)/extra/rpl_tests
|
||||
-$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.opt $(distdir)/extra/binlog_tests
|
||||
-$(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.opt $(distdir)/extra/rpl_tests
|
||||
$(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include
|
||||
$(INSTALL_DATA) $(srcdir)/include/*.sql $(distdir)/include
|
||||
$(INSTALL_DATA) $(srcdir)/include/*.test $(distdir)/include
|
||||
$(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(distdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/Index.xml $(distdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/*.dat $(srcdir)/std_data/*.000001 $(distdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(distdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/*.pem $(distdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/*.frm $(distdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/*.MY* $(distdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(distdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/*.txt $(distdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50/BACKUP* $(distdir)/std_data/ndb_backup50
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51/BACKUP* $(distdir)/std_data/ndb_backup51
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_be/BACKUP* $(distdir)/std_data/ndb_backup51_data_be
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_le/BACKUP* $(distdir)/std_data/ndb_backup51_data_le
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/parts/part_* $(distdir)/std_data/parts
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/parts/*.MY* $(distdir)/std_data/parts
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/funcs_1/* $(distdir)/std_data/funcs_1
|
||||
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib
|
||||
$(INSTALL_DATA) $(srcdir)/lib/My/*.pm $(distdir)/lib/My
|
||||
-rm -rf `find $(distdir)/suite -type d -name SCCS` $(distdir)/suite/row_lock
|
||||
$(MAKE) INSTALL_TO_DIR="$(distdir)" install_test_files
|
||||
|
||||
install-data-local:
|
||||
$(mkinstalldirs) \
|
||||
$(DESTDIR)$(testdir)/t \
|
||||
$(DESTDIR)$(testdir)/extra/binlog_tests \
|
||||
$(DESTDIR)$(testdir)/extra/rpl_tests \
|
||||
$(DESTDIR)$(testdir)/r \
|
||||
$(DESTDIR)$(testdir)/include \
|
||||
$(DESTDIR)$(testdir)/std_data \
|
||||
$(DESTDIR)$(testdir)/std_data/ndb_backup50 \
|
||||
$(DESTDIR)$(testdir)/std_data/ndb_backup51 \
|
||||
$(DESTDIR)$(testdir)/std_data/ndb_backup51_data_be \
|
||||
$(DESTDIR)$(testdir)/std_data/ndb_backup51_data_le \
|
||||
$(DESTDIR)$(testdir)/std_data/parts \
|
||||
$(DESTDIR)$(testdir)/lib \
|
||||
$(DESTDIR)$(testdir)/std_data/funcs_1 \
|
||||
$(DESTDIR)$(testdir)/lib/My
|
||||
$(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(testdir)
|
||||
-$(INSTALL_DATA) $(srcdir)/t/*.def $(DESTDIR)$(testdir)/t
|
||||
$(INSTALL_DATA) $(srcdir)/t/*.test $(DESTDIR)$(testdir)/t
|
||||
-$(INSTALL_DATA) $(srcdir)/t/*.imtest $(DESTDIR)$(testdir)/t
|
||||
$(INSTALL_DATA) $(srcdir)/t/*.sql $(DESTDIR)$(testdir)/t
|
||||
-$(INSTALL_DATA) $(srcdir)/t/*.disabled $(DESTDIR)$(testdir)/t
|
||||
-$(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t
|
||||
-$(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t
|
||||
-$(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t
|
||||
$(INSTALL_DATA) $(srcdir)/r/*.result $(DESTDIR)$(testdir)/r
|
||||
$(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r
|
||||
$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.test $(DESTDIR)$(testdir)/extra/binlog_tests
|
||||
$(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.test $(DESTDIR)$(testdir)/extra/rpl_tests
|
||||
-$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.opt $(DESTDIR)$(testdir)/extra/binlog_tests
|
||||
-$(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.opt $(DESTDIR)$(testdir)/extra/rpl_tests
|
||||
$(INSTALL_DATA) $(srcdir)/include/*.inc $(DESTDIR)$(testdir)/include
|
||||
$(INSTALL_DATA) $(srcdir)/include/*.sql $(DESTDIR)$(testdir)/include
|
||||
$(INSTALL_DATA) $(srcdir)/include/*.test $(DESTDIR)$(testdir)/include
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/*.dat $(DESTDIR)$(testdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/*.*001 $(DESTDIR)$(testdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(DESTDIR)$(testdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(DESTDIR)$(testdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/Index.xml $(DESTDIR)$(testdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/*.pem $(DESTDIR)$(testdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/*.frm $(DESTDIR)$(testdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/*.MY* $(DESTDIR)$(testdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/*.txt $(DESTDIR)$(testdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup50
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_be/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_be
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_le/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_le
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/parts/part_* $(DESTDIR)$(testdir)/std_data/parts
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/parts/*.MY* $(DESTDIR)$(testdir)/std_data/parts
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/funcs_1/* $(DESTDIR)$(testdir)/std_data/funcs_1
|
||||
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib
|
||||
$(INSTALL_DATA) $(srcdir)/lib/My/*.pm $(DESTDIR)$(testdir)/lib/My
|
||||
for f in `(cd $(srcdir); find suite -type f | egrep -v 'SCCS|row_lock')`; \
|
||||
do \
|
||||
d=$(DESTDIR)$(testdir)/`dirname $$f`; \
|
||||
mkdir -p $$d ; \
|
||||
$(INSTALL_DATA) $(srcdir)/$$f $$d ; \
|
||||
done
|
||||
$(MAKE) INSTALL_TO_DIR="$(DESTDIR)$(testdir)" install_test_files
|
||||
|
||||
uninstall-local:
|
||||
@RM@ -f -r $(DESTDIR)$(testdir)
|
||||
|
@ -157,31 +135,5 @@ mysql-test-run:
|
|||
$(RM) -f mysql-test-run
|
||||
$(LN_S) mysql-test-run.pl mysql-test-run
|
||||
|
||||
SUFFIXES = .sh
|
||||
|
||||
.sh:
|
||||
@RM@ -f $@ $@-t
|
||||
@SED@ \
|
||||
-e 's!@''testdir''@!$(testdir)!g' \
|
||||
-e 's!@''bindir''@!$(bindir)!g' \
|
||||
-e 's!@''scriptdir''@!$(bindir)!g' \
|
||||
-e 's!@''prefix''@!$(prefix)!g' \
|
||||
-e 's!@''datadir''@!$(datadir)!g' \
|
||||
-e 's!@''localstatedir''@!$(localstatedir)!g' \
|
||||
-e 's!@''libexecdir''@!$(libexecdir)!g' \
|
||||
-e 's!@''PERL''@!@PERL@!' \
|
||||
-e 's!@''VERSION''@!@VERSION@!' \
|
||||
-e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
|
||||
-e 's!@''MYSQL_TCP_PORT_DEFAULT''@!@MYSQL_TCP_PORT_DEFAULT@!' \
|
||||
-e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \
|
||||
-e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \
|
||||
-e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
|
||||
-e 's!@''MYSQL_NO_DASH_VERSION''@!@MYSQL_NO_DASH_VERSION@!' \
|
||||
-e 's!@''MYSQL_SERVER_SUFFIX''@!@MYSQL_SERVER_SUFFIX@!' \
|
||||
-e 's!@''USE_NDBCLUSTER''@!@TEST_NDBCLUSTER@!g' \
|
||||
$< > $@-t
|
||||
@CHMOD@ +x $@-t
|
||||
@MV@ $@-t $@
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
|
|
@ -1,65 +0,0 @@
|
|||
#! /bin/sh
|
||||
|
||||
# This script is a hack for lazy developers who want to get a quick
|
||||
# start on the result file. The code here is rather dirty, but it works
|
||||
# If you have a spare moment feel free to improve it - the right way is
|
||||
# to start mysqld yourself and run mysqltest -r
|
||||
|
||||
RESULT_DIR=r
|
||||
if [ -z "$EDITOR" ] ; then
|
||||
EDITOR=vi
|
||||
fi
|
||||
|
||||
function die()
|
||||
{
|
||||
echo $1
|
||||
exit 1
|
||||
}
|
||||
|
||||
function usage()
|
||||
{
|
||||
echo "Usage: $0 test_name"
|
||||
exit 1
|
||||
}
|
||||
|
||||
test_name=$1
|
||||
|
||||
[ -z "$test_name" ] && usage
|
||||
|
||||
result_file=$RESULT_DIR/$test_name.result
|
||||
reject_file=$RESULT_DIR/$test_name.reject
|
||||
|
||||
[ -f $result_file ] && die "result file $result_file has already been created"
|
||||
|
||||
touch $result_file
|
||||
echo "Running the test case against empty file, will fail, but don't worry"
|
||||
./mysql-test-run --local $test_name
|
||||
|
||||
if [ -f $reject_file ] ; then
|
||||
echo "Below are the contents of the reject file:"
|
||||
echo "-----start---------------------"
|
||||
cat $reject_file
|
||||
echo "-----end-----------------------"
|
||||
echo "Is this the output you expected from your test case?(y/n)[n]"
|
||||
read yes_no
|
||||
if [ x$yes_no = xy ] ; then
|
||||
echo "Press any key to edit it in $EDITOR, or Ctrl-C to abort"
|
||||
read junk
|
||||
$EDITOR $reject_file
|
||||
edited="edited"
|
||||
fi
|
||||
echo "Save $edited file as master result? (y/n)[y]"
|
||||
read yes_no
|
||||
if [ x$yes_no != xn ]; then
|
||||
mv $reject_file $result_file
|
||||
fi
|
||||
else
|
||||
echo "Your test failed so bad, it did not even produce a reject file"
|
||||
echo "You need to fix your bugs in the test case, the code, or both"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
-- source include/have_log_bin.inc
|
||||
|
||||
# The server need to be started in $MYSQLTEST_VARDIR since it
|
||||
# uses ../std_data_ln/
|
||||
# uses ../../std_data/
|
||||
-- source include/uses_vardir.inc
|
||||
|
||||
--disable_warnings
|
||||
|
@ -114,7 +114,7 @@ insert into t1 values(1);
|
|||
insert ignore into t1 values(1);
|
||||
replace into t1 values(100);
|
||||
create table t2 (a varchar(200)) engine=blackhole;
|
||||
eval load data infile '../std_data_ln/words.dat' into table t2;
|
||||
eval load data infile '../../std_data/words.dat' into table t2;
|
||||
alter table t1 add b int;
|
||||
alter table t1 drop b;
|
||||
create table t3 like t1;
|
||||
|
|
|
@ -16,7 +16,8 @@ source include/show_binlog_events.inc;
|
|||
# escaped).
|
||||
flush logs;
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||
--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000001
|
||||
drop table t2;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
|
|
@ -28,3 +28,5 @@ enable_warnings;
|
|||
insert into t1 values (1);
|
||||
drop table tt1, t1;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
FLUSH STATUS;
|
||||
|
|
|
@ -317,17 +317,18 @@ connection con4;
|
|||
select get_lock("a",10); # wait for rollback to finish
|
||||
flush logs;
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
# we check that the error code of the "ROLLBACK" event is 0 and not
|
||||
# ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction
|
||||
# and does not make slave to stop)
|
||||
if (`select @@binlog_format = 'ROW'`)
|
||||
{
|
||||
--exec $MYSQL_BINLOG --start-position=524 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
|
||||
--exec $MYSQL_BINLOG --start-position=524 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
|
||||
}
|
||||
|
||||
if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
|
||||
{
|
||||
--exec $MYSQL_BINLOG --start-position=555 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
|
||||
--exec $MYSQL_BINLOG --start-position=555 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
|
||||
}
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
|
@ -618,7 +619,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
|
|||
|
||||
# execute
|
||||
--error ER_DUP_ENTRY
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
|
||||
# check
|
||||
select * from t4;
|
||||
select count(*) from t1 /* must be 2 */;
|
||||
|
|
|
@ -278,7 +278,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
|
|||
|
||||
# execute
|
||||
--error ER_DUP_ENTRY
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
|
||||
# check
|
||||
select * from t4;
|
||||
select count(*) from t1 /* must be 2 */;
|
||||
|
|
|
@ -20,7 +20,8 @@
|
|||
|
||||
eval create table t1 (a int) engine=$engine_type;
|
||||
flush tables;
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
remove_file $MYSQLD_DATADIR/test/t1.MYI ;
|
||||
drop table if exists t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
|
|
|
@ -145,6 +145,23 @@ select * from t3 order by a;
|
|||
connection master;
|
||||
|
||||
drop table t1,t2,t3;
|
||||
sync_slave_with_master;
|
||||
|
||||
#
|
||||
# BUG#41986 Replication slave does not pick up proper AUTO_INCREMENT value for Innodb tables
|
||||
#
|
||||
connection master;
|
||||
set auto_increment_increment=1;
|
||||
set auto_increment_offset=1;
|
||||
CREATE TABLE t1 (id MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=innodb;
|
||||
INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
|
||||
show create table t1;
|
||||
|
||||
sync_slave_with_master;
|
||||
show create table t1;
|
||||
|
||||
connection master;
|
||||
drop table t1;
|
||||
|
||||
# End cleanup
|
||||
sync_slave_with_master;
|
||||
|
|
168
mysql-test/extra/rpl_tests/rpl_conflicts.test
Normal file
168
mysql-test/extra/rpl_tests/rpl_conflicts.test
Normal file
|
@ -0,0 +1,168 @@
|
|||
# ==== Purpose ====
|
||||
#
|
||||
# Test that slave behaves well in some conflict situations. The
|
||||
# following are tested:
|
||||
#
|
||||
# - The slave SQL thread sees an 'INSERT' of a row with a key that
|
||||
# already exists in the table;
|
||||
#
|
||||
# - The slave SQL thread sees a 'DELETE' of a row that does not
|
||||
# exist in the table.
|
||||
#
|
||||
# In statement-logging mode, the first conflict type causes the slave
|
||||
# to stop with an error and the second conflict is ignored.
|
||||
#
|
||||
# In row-logging mode, the slave behavior depends the value of
|
||||
# @@slave_exec_mode on the slave: if @@slave_exec_mode is IDEMPOTENT,
|
||||
# the slave should ignore the conflicting statement and continue
|
||||
# normally. If @@slave_exec_mode is STRICT, the slave should stop
|
||||
# with an error.
|
||||
#
|
||||
# This test was previously named rpl_stm_mystery22/rpl_row_mystery22.
|
||||
#
|
||||
#
|
||||
# ==== Method ====
|
||||
#
|
||||
# Create a table on master and slave, insert a row on slave, and
|
||||
# insert the same row on master.
|
||||
#
|
||||
# Create a table on master and slave, insert a row on master with
|
||||
# binlogging turned off, and remove the row on master with binlogging
|
||||
# turned on.
|
||||
#
|
||||
#
|
||||
# ==== Related bugs ====
|
||||
#
|
||||
# BUG#31552: Replication breaks when deleting rows from out-of-sync table without PK
|
||||
# BUG#31609: Not all RBR slave errors reported as errors
|
||||
#
|
||||
# Bug in this test case:
|
||||
# BUG#37718: rpl.rpl_stm_mystery22 fails sporadically on pushbuild
|
||||
#
|
||||
#
|
||||
# ==== Usage ====
|
||||
#
|
||||
# This file assumes the following:
|
||||
#
|
||||
# - The test language variable $slave_is_idempotent is set to 1 if the
|
||||
# slave is expected to stop on duplicate key errors (i.e., if the
|
||||
# binlog is in statement mode or
|
||||
# @@global.slave_exec_mode=STRICT). It is set to 0 otherwise.
|
||||
#
|
||||
# - Replication has been initialized by include/master-slave.inc
|
||||
#
|
||||
# - The test adds a suppression for the following warning:
|
||||
# Slave: Can't find record in 't1' Error_code: 1032
|
||||
|
||||
|
||||
--echo ==== Initialize ====
|
||||
|
||||
--echo [on master]
|
||||
connection master;
|
||||
CREATE TABLE t1(a INT PRIMARY KEY);
|
||||
--echo [on slave]
|
||||
sync_slave_with_master;
|
||||
|
||||
|
||||
--echo ==== Test: SQL thread sees 'INSERT' of existing key ====
|
||||
|
||||
--echo ---- Prepare slave so that it will get duplicate key error ----
|
||||
# This row will be in the way of the row inserted by master.
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
--echo ---- Insert rows on master ----
|
||||
--echo [on master]
|
||||
connection master;
|
||||
# Insert the same row on master
|
||||
INSERT INTO t1 VALUES (1);
|
||||
save_master_pos;
|
||||
SELECT * FROM t1;
|
||||
|
||||
--echo [on slave]
|
||||
connection slave;
|
||||
|
||||
# If we are statement-logging or if slave_exec_mode=STRICT, we now
|
||||
# expect to see an error on the slave. Otherwise (i.e., we are
|
||||
# row-logging and slave_exec_mode=IDEMPOTENT), we expect that the
|
||||
# duplicate row is ignored by the slave and replication continues.
|
||||
if (`SELECT @@global.binlog_format != 'ROW' OR @@global.slave_exec_mode = 'STRICT'`) {
|
||||
--echo ---- Wait until slave stops with an error ----
|
||||
# Wait until the slave tries to run the query, fails with duplicate
|
||||
# key error, and stops the SQL thread.
|
||||
let $slave_sql_errno= 1062; # ER_DUP_ENTRY
|
||||
source include/wait_for_slave_sql_error.inc;
|
||||
let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
|
||||
--echo Last_SQL_Error = $err (expected "duplicate key" error)
|
||||
SELECT * FROM t1;
|
||||
|
||||
--echo ---- Resolve the conflict on the slave and restart SQL thread ----
|
||||
DELETE FROM t1 WHERE a = 1;
|
||||
START SLAVE SQL_THREAD;
|
||||
source include/wait_for_slave_sql_to_start.inc;
|
||||
}
|
||||
|
||||
--echo ---- Sync slave and verify that there is no error ----
|
||||
sync_with_master;
|
||||
let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
|
||||
--echo Last_SQL_Error = '$err' (expected no error)
|
||||
SELECT * FROM t1;
|
||||
|
||||
|
||||
--echo ==== Test: SQL thread sees 'DELETE' of non-existing row ====
|
||||
|
||||
--echo ---- On master, insert two rows, the second with binlogging off ----
|
||||
--echo [on master]
|
||||
connection master;
|
||||
DELETE FROM t1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
--echo [on slave]
|
||||
sync_slave_with_master;
|
||||
DELETE FROM t1 WHERE a = 1;
|
||||
|
||||
--echo ---- On master, remove the row that does not exist on slave ----
|
||||
--echo [on master]
|
||||
connection master;
|
||||
DELETE FROM t1 WHERE a = 1;
|
||||
SELECT * FROM t1;
|
||||
save_master_pos;
|
||||
|
||||
--echo [on slave]
|
||||
connection slave;
|
||||
|
||||
# If we are row-logging and slave_exec_mode is STRICT, we now expect
|
||||
# an error since the row to delete does not exist on slave. Otherwise
|
||||
# (i.e., either we are statement-logging or slave_exec_mode is
|
||||
# IDEMPOTENT), the absence of the row to delete is ignored and
|
||||
# replication continues.
|
||||
if (`SELECT @@global.binlog_format = 'ROW' AND @@global.slave_exec_mode = 'STRICT'`) {
|
||||
--echo ---- Wait until slave stops with an error ----
|
||||
let $slave_sql_errno= 1032; # ER_KEY_NOT_FOUND
|
||||
source include/wait_for_slave_sql_error.inc;
|
||||
let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
|
||||
--echo Last_SQL_Error = $err (expected "can't find record" error)
|
||||
SELECT * FROM t1;
|
||||
|
||||
--echo ---- Resolve the conflict on the slave and restart SQL thread ----
|
||||
INSERT INTO t1 VALUES (1);
|
||||
START SLAVE SQL_THREAD;
|
||||
source include/wait_for_slave_sql_to_start.inc;
|
||||
}
|
||||
|
||||
--echo ---- Sync slave and verify that there is no error ----
|
||||
# The slave should sync ok, and SHOW SLAVE STATUS should give no
|
||||
# error.
|
||||
sync_with_master;
|
||||
let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
|
||||
--echo Last_SQL_Error = $err (expected no error)
|
||||
SELECT * FROM t1;
|
||||
|
||||
|
||||
--echo ==== Clean up ====
|
||||
|
||||
--echo [on master]
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo [on slave]
|
||||
sync_slave_with_master;
|
|
@ -497,7 +497,7 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
|
|||
--echo ********************************************
|
||||
--echo
|
||||
connection slave;
|
||||
wait_for_slave_to_stop;
|
||||
source include/wait_for_slave_sql_to_stop.inc;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
|
||||
--query_vertical SHOW SLAVE STATUS
|
||||
|
@ -554,7 +554,7 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
|
|||
--echo ********************************************
|
||||
--echo
|
||||
connection slave;
|
||||
wait_for_slave_to_stop;
|
||||
source include/wait_for_slave_sql_to_stop.inc;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
|
||||
--query_vertical SHOW SLAVE STATUS
|
||||
|
@ -697,7 +697,7 @@ SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
|
|||
# Remove below once fixed
|
||||
#***************************
|
||||
connection slave;
|
||||
wait_for_slave_to_stop;
|
||||
source include/wait_for_slave_sql_to_stop.inc;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
|
||||
--query_vertical SHOW SLAVE STATUS
|
||||
|
@ -763,7 +763,7 @@ SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
|
|||
--echo ********************************************
|
||||
--echo
|
||||
connection slave;
|
||||
wait_for_slave_to_stop;
|
||||
source include/wait_for_slave_sql_to_stop.inc;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
|
||||
--query_vertical SHOW SLAVE STATUS
|
||||
|
@ -840,7 +840,7 @@ SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
|
|||
--echo *****************
|
||||
--echo
|
||||
connection slave;
|
||||
wait_for_slave_to_stop;
|
||||
source include/wait_for_slave_sql_to_stop.inc;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
|
||||
--query_vertical SHOW SLAVE STATUS
|
||||
|
|
|
@ -94,7 +94,7 @@ SELECT * FROM t2 ORDER BY a;
|
|||
--echo *** Start Slave ***
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
wait_for_slave_to_stop;
|
||||
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
|
||||
|
@ -429,6 +429,7 @@ set @b1 = 'b1b1b1b1';
|
|||
set @b1 = concat(@b1,@b1);
|
||||
INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
|
||||
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 #
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
# Test of FLUSH NO_WRITE_TO_BINLOG by the way.
|
||||
#
|
||||
|
||||
|
||||
-- source include/master-slave.inc
|
||||
source include/master-slave.inc;
|
||||
|
||||
let $SERVER_VERSION=`select version()`;
|
||||
|
||||
|
@ -34,26 +33,32 @@ flush tables;
|
|||
--replace_column 2 # 5 #
|
||||
--replace_regex /table_id: [0-9]+/table_id: #/
|
||||
eval SHOW BINLOG EVENTS FROM $rename_event_pos ;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
|
||||
sync_slave_with_master;
|
||||
# Check that the slave is not confused.
|
||||
select * from t3;
|
||||
# Note that all this confusion may cause warnings 'table xx is open on rename'
|
||||
# in the .err files; these are not fatal and are not reported by mysql-test-run.
|
||||
|
||||
stop slave;
|
||||
source include/wait_for_slave_to_stop.inc;
|
||||
|
||||
connection master;
|
||||
drop table t1;
|
||||
|
||||
connection slave;
|
||||
flush tables with read lock;
|
||||
start slave;
|
||||
sleep 1;
|
||||
source include/wait_for_slave_to_start.inc;
|
||||
--error 1192
|
||||
stop slave;
|
||||
|
||||
# Cleanup
|
||||
unlock tables;
|
||||
|
||||
connection master;
|
||||
drop table t3, t4, t5;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
|
|
|
@ -23,12 +23,12 @@ connection master;
|
|||
|
||||
select last_insert_id();
|
||||
create table t1(a int not null auto_increment, b int, primary key(a) );
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
|
||||
load data 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_ln/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
|
||||
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;
|
||||
|
||||
create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
|
||||
insert into t3 select * from t2;
|
||||
|
@ -56,7 +56,7 @@ sync_with_master;
|
|||
insert into t1 values(1,10);
|
||||
|
||||
connection master;
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
|
@ -80,7 +80,7 @@ connection master;
|
|||
set sql_log_bin=0;
|
||||
delete from t1;
|
||||
set sql_log_bin=1;
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
# The SQL slave thread should be stopped now.
|
||||
|
@ -105,7 +105,7 @@ connection master;
|
|||
set sql_log_bin=0;
|
||||
delete from t1;
|
||||
set sql_log_bin=1;
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
# The SQL slave thread should be stopped now.
|
||||
|
@ -125,7 +125,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_ln/rpl_loaddata2.dat' into table t2 fields
|
||||
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;
|
||||
select * from t2;
|
||||
|
@ -141,24 +141,21 @@ alter table t2 drop key day;
|
|||
connection master;
|
||||
delete from t2;
|
||||
--error ER_DUP_ENTRY
|
||||
load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields
|
||||
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;
|
||||
connection slave;
|
||||
--source include/wait_for_slave_sql_to_stop.inc
|
||||
drop table t2;
|
||||
drop table t1, t2;
|
||||
connection master;
|
||||
drop table t2;
|
||||
drop table t1;
|
||||
drop table t1, t2;
|
||||
|
||||
# BUG#17233 LOAD DATA INFILE: failure causes mysqld dbug_assert, binlog not flushed
|
||||
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
|
||||
|
||||
--error ER_DUP_ENTRY
|
||||
LOAD DATA INFILE "../std_data_ln/words.dat" INTO TABLE t1;
|
||||
LOAD DATA INFILE "../../std_data/words.dat" INTO TABLE t1;
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
# End of 4.1 tests
|
||||
|
|
|
@ -9,10 +9,8 @@
|
|||
# test the slave immediately writes DROP TEMPORARY TABLE this_old_table).
|
||||
# We wait for the slave to have written all he wants to the binlog
|
||||
# (otherwise RESET MASTER may come too early).
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
stop slave;
|
||||
sync_slave_with_master;
|
||||
source include/stop_slave.inc;
|
||||
--source include/wait_for_slave_to_stop.inc
|
||||
reset master;
|
||||
reset slave;
|
||||
|
@ -25,8 +23,13 @@ connection master;
|
|||
eval create table t1(n int not null auto_increment primary key)ENGINE=$engine_type;
|
||||
insert into t1 values (NULL);
|
||||
drop table t1;
|
||||
let $LOAD_FILE= ../../std_data/words.dat;
|
||||
if (!`SELECT length(load_file('$LOAD_FILE'))`){
|
||||
let $LOAD_FILE= ../$LOAD_FILE;
|
||||
}
|
||||
eval create table t1 (word char(20) not null)ENGINE=$engine_type;
|
||||
load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
|
||||
--replace_result $LOAD_FILE LOAD_FILE
|
||||
eval load data infile '$LOAD_FILE' into table t1 ignore 1 lines;
|
||||
select count(*) from t1;
|
||||
--replace_result $VERSION VERSION
|
||||
--replace_column 2 # 5 #
|
||||
|
@ -67,19 +70,12 @@ eval create table t3 (a int)ENGINE=$engine_type;
|
|||
connection master;
|
||||
select * from t1 order by 1 asc;
|
||||
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
# Note that the above 'slave start' will cause a 3rd rotate event (a fake one)
|
||||
# to go into the relay log (the master always sends a fake one when replication
|
||||
# starts).
|
||||
let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%';
|
||||
--source include/wait_slave_status.inc
|
||||
sync_with_master;
|
||||
sync_slave_with_master;
|
||||
#check t1 on slave to ensure whether it's identical with on master
|
||||
select * from t1 order by 1 asc;
|
||||
flush logs;
|
||||
stop slave;
|
||||
--source include/wait_for_slave_to_stop.inc
|
||||
source include/stop_slave.inc;
|
||||
source include/start_slave.inc;
|
||||
connection master;
|
||||
|
||||
# Create some entries for second log
|
||||
|
@ -93,11 +89,8 @@ source include/show_binlog_events.inc;
|
|||
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
|
||||
show binlog events in 'master-bin.000002';
|
||||
show binary logs;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
start slave;
|
||||
sync_slave_with_master;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
sync_with_master;
|
||||
show binary logs;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION
|
||||
--replace_column 2 # 5 #
|
||||
|
@ -133,9 +126,13 @@ DROP TABLE t3;
|
|||
# Bug #6880: LAST_INSERT_ID() within a statement
|
||||
#
|
||||
|
||||
# Reset binlog so that show binlog events will not show the tests
|
||||
# above.
|
||||
source include/master-slave-reset.inc;
|
||||
connection master;
|
||||
|
||||
create table t1(a int auto_increment primary key, b int);
|
||||
insert into t1 values (NULL, 1);
|
||||
reset master;
|
||||
set insert_id=5;
|
||||
insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
|
||||
source include/show_binlog_events.inc;
|
||||
|
@ -145,4 +142,3 @@ drop table t1;
|
|||
# End of 4.1 tests
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
let $LOAD_FILE= $MYSQLTEST_VARDIR/std_data/words.dat;
|
||||
CREATE TABLE t1 (word CHAR(20) NOT NULL);
|
||||
LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||
eval LOAD DATA LOCAL INFILE '$MYSQL_TEST_DIR/std_data/words.dat' INTO TABLE t1;
|
||||
--replace_result $LOAD_FILE LOAD_FILE
|
||||
eval LOAD DATA INFILE '$LOAD_FILE' INTO TABLE t1;
|
||||
--replace_result $LOAD_FILE LOAD_FILE
|
||||
eval LOAD DATA INFILE '$LOAD_FILE' INTO TABLE t1;
|
||||
SELECT * FROM t1 ORDER BY word LIMIT 10;
|
||||
|
||||
#
|
||||
|
|
|
@ -206,7 +206,7 @@ START TRANSACTION;
|
|||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
let $n=50;
|
||||
while ($n>3)
|
||||
while ($n)
|
||||
{
|
||||
eval call test.p3($n);
|
||||
dec $n;
|
||||
|
|
|
@ -122,7 +122,7 @@ 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 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
|
||||
--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;
|
||||
|
@ -142,7 +142,7 @@ sync_slave_with_master;
|
|||
--echo **** On Slave ****
|
||||
SELECT * FROM t2;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
|
||||
--query_vertical SHOW SLAVE STATUS
|
||||
|
||||
connection master;
|
||||
|
@ -154,7 +154,7 @@ INSERT INTO t4 VALUES (4);
|
|||
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 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
|
||||
--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;
|
||||
|
@ -168,7 +168,7 @@ INSERT INTO t5 VALUES (5,10,25);
|
|||
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 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
|
||||
--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;
|
||||
|
@ -182,7 +182,7 @@ INSERT INTO t6 VALUES (6,12,36);
|
|||
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 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
|
||||
--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;
|
||||
|
@ -191,7 +191,7 @@ connection master;
|
|||
INSERT INTO t9 VALUES (6);
|
||||
sync_slave_with_master;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
|
||||
--query_vertical SHOW SLAVE STATUS
|
||||
|
||||
# Testing some tables extra field that can be null and cannot be null
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
-- source include/master-slave.inc
|
||||
|
||||
create table t1 (word char(20) not null);
|
||||
load data infile '../std_data_ln/words.dat' into table t1;
|
||||
load data infile '../../std_data/words.dat' into table t1;
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||
eval load data local infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1;
|
||||
select * from t1 limit 10;
|
||||
|
|
|
@ -18,13 +18,18 @@ eval create table t1 (a int, unique(a)) engine=$engine_type;
|
|||
set sql_log_bin=0;
|
||||
insert into t1 values(2);
|
||||
set sql_log_bin=1;
|
||||
save_master_pos;
|
||||
|
||||
--error ER_DUP_ENTRY
|
||||
insert into t1 values(1),(2);
|
||||
drop table t1;
|
||||
save_master_pos;
|
||||
|
||||
connection slave;
|
||||
--source include/wait_for_slave_sql_to_stop.inc
|
||||
let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
|
||||
let $errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
|
||||
--echo Error: "$error" (expected different error codes on master and slave)
|
||||
--echo Errno: "$errno" (expected 0)
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
|
|
|
@ -14,6 +14,9 @@ START SLAVE;
|
|||
|
||||
--echo **** On Master ****
|
||||
connection master;
|
||||
SET @old_session_binlog_format= @@session.binlog_format;
|
||||
SET @old_global_binlog_format= @@global.binlog_format;
|
||||
|
||||
eval SET SESSION BINLOG_FORMAT=$format;
|
||||
eval SET GLOBAL BINLOG_FORMAT=$format;
|
||||
|
||||
|
@ -40,3 +43,5 @@ source include/show_binlog_events.inc;
|
|||
|
||||
connection master;
|
||||
RESET MASTER;
|
||||
SET @@session.binlog_format= @old_session_binlog_format;
|
||||
SET @@global.binlog_format= @old_global_binlog_format;
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
#! /bin/sh
|
||||
|
||||
# Sasha's hack to fix results generated with mysql-test-run --record
|
||||
# to be version and test port independent. In some cases, further minor
|
||||
# manual edititing may be required, but most of the time it should not
|
||||
# happen
|
||||
|
||||
#It is assumed we are running the script in mysql-test directory
|
||||
|
||||
VERSION=4.0.1-alpha-debug-log
|
||||
TEST_CASE=$1
|
||||
|
||||
if [ -z "$TEST_CASE" ] ;
|
||||
then
|
||||
echo "usage: $0 test_case_name"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
../extra/replace $VERSION '$VERSION' 9306 '$MASTER_MYPORT' 9307 \
|
||||
'$SLAVE_MYPORT' \\ \\\\ -- r/$TEST_CASE.result
|
||||
|
||||
|
6
mysql-test/include/analyze-sync_with_master.test
Normal file
6
mysql-test/include/analyze-sync_with_master.test
Normal file
|
@ -0,0 +1,6 @@
|
|||
SHOW PROCESSLIST;
|
||||
|
||||
let $binlog_name= query_get_value("SHOW MASTER STATUS", File, 1);
|
||||
eval SHOW BINLOG EVENTS IN '$binlog_name';
|
||||
|
||||
exit;
|
3
mysql-test/include/analyze-timeout.test
Normal file
3
mysql-test/include/analyze-timeout.test
Normal file
|
@ -0,0 +1,3 @@
|
|||
SHOW PROCESSLIST;
|
||||
|
||||
exit;
|
|
@ -1,15 +0,0 @@
|
|||
# Connect to both master and slave
|
||||
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
|
||||
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
|
||||
|
||||
vertical_results;
|
||||
|
||||
echo == MASTER ===========================================================;
|
||||
connection master;
|
||||
show master status;
|
||||
show slave status;
|
||||
|
||||
echo == SLAVE ===========================================================;
|
||||
connection slave;
|
||||
show master status;
|
||||
show slave status;
|
|
@ -1,51 +1,15 @@
|
|||
|
||||
#
|
||||
# This test is executed twice for each test case if mysql-test-run is passed
|
||||
# the flag --check-testcase.
|
||||
# Before every testcase it's run with mysqltest in record mode and will
|
||||
# thus produce an output file
|
||||
# that can be compared to output from after the tescase.
|
||||
# In that way it's possible to check that a testcase does not have
|
||||
# the flag --check-testcase. Before every testcase it is run with mysqltest
|
||||
# in record mode and will thus produce an output file that can be compared
|
||||
# to output from after the tescase.
|
||||
# In that way its possible to check that a testcase does not have
|
||||
# any unwanted side affects.
|
||||
#
|
||||
|
||||
#
|
||||
# Dump all global variables
|
||||
#
|
||||
SHOW GLOBAL VARIABLES WHERE variable_name != 'timestamp';
|
||||
|
||||
#
|
||||
# Dump all databases
|
||||
#
|
||||
SHOW DATABASES;
|
||||
|
||||
#
|
||||
# Dump the "test" database, all it's tables and their data
|
||||
#
|
||||
--exec $MYSQL_DUMP --skip-comments --skip-lock-tables test
|
||||
|
||||
#
|
||||
# Dump the "mysql" database and it's tables
|
||||
# Select data separately to add "order by"
|
||||
#
|
||||
--exec $MYSQL_DUMP --skip-comments --skip-lock-tables --no-data mysql
|
||||
use mysql;
|
||||
SELECT * FROM columns_priv;
|
||||
SELECT * FROM db ORDER BY host, db, user;
|
||||
SELECT * FROM func;
|
||||
SELECT * FROM help_category;
|
||||
SELECT * FROM help_keyword;
|
||||
SELECT * FROM help_relation;
|
||||
SELECT * FROM help_relation;
|
||||
SELECT * FROM host;
|
||||
SELECT * FROM proc;
|
||||
SELECT * FROM procs_priv;
|
||||
SELECT * FROM tables_priv;
|
||||
SELECT * FROM time_zone;
|
||||
SELECT * FROM time_zone_leap_second;
|
||||
SELECT * FROM time_zone_name;
|
||||
SELECT * FROM time_zone_transition;
|
||||
SELECT * FROM time_zone_transition_type;
|
||||
SELECT * FROM user;
|
||||
--disable_query_log
|
||||
call mtr.check_testcase();
|
||||
--enable_query_log
|
||||
|
||||
|
||||
|
||||
|
|
61
mysql-test/include/check-warnings.test
Normal file
61
mysql-test/include/check-warnings.test
Normal file
|
@ -0,0 +1,61 @@
|
|||
#
|
||||
# This test is executed once after each test to check the servers
|
||||
# for unexpected warnings found in the servers error log
|
||||
#
|
||||
# NOTE! mysql-test-run.pl has already done a rough filtering
|
||||
# of the file and written any suspicious lines
|
||||
# to $error_log.warnings file
|
||||
#
|
||||
--disable_query_log
|
||||
|
||||
# Don't write these queries to binlog
|
||||
set SQL_LOG_BIN=0;
|
||||
|
||||
# Turn off any debug crashes, allow the variable to be
|
||||
# non existent in release builds
|
||||
--error 0,1193
|
||||
set debug="";
|
||||
|
||||
use mtr;
|
||||
|
||||
create temporary table error_log (
|
||||
row int auto_increment primary key,
|
||||
suspicious int default 1,
|
||||
file_name varchar(255),
|
||||
line varchar(1024) default null
|
||||
) engine=myisam;
|
||||
|
||||
# Get the name of servers error log
|
||||
let $log_error= query_get_value(show variables like 'log_error', Value, 1);
|
||||
let $log_warning= $log_error.warnings;
|
||||
|
||||
# Try tload the warnings into a temporary table,
|
||||
# it might fail with error saying "The MySQL server is
|
||||
# running with the --secure-file-priv" in which case
|
||||
# an attempt to load the file using LOAD DATA LOCAL is made
|
||||
--error 0,1290
|
||||
eval load data infile '$log_warning' into table error_log
|
||||
fields terminated by 'xykls37' escaped by ''
|
||||
ignore 1 lines
|
||||
(line)
|
||||
set file_name='$log_error';
|
||||
|
||||
if ($mysql_errno)
|
||||
{
|
||||
# Try LOAD DATA LOCAL
|
||||
eval load data local infile '$log_warning' into table error_log
|
||||
fields terminated by 'xykls37' escaped by ''
|
||||
ignore 1 lines
|
||||
(line)
|
||||
set file_name='$log_error';
|
||||
}
|
||||
|
||||
# Call check_warnings to filter out any warning in
|
||||
# the error_log table
|
||||
call mtr.check_warnings(@result);
|
||||
if (`select @result = 0`){
|
||||
skip OK;
|
||||
}
|
||||
--enable_query_log
|
||||
echo ^ Found warnings!!;
|
||||
exit;
|
31
mysql-test/include/check_events_off.inc
Normal file
31
mysql-test/include/check_events_off.inc
Normal file
|
@ -0,0 +1,31 @@
|
|||
########## include/check_events_off.inc ####################################
|
||||
# #
|
||||
# Purpose: #
|
||||
# Wait till we can expect that we have no event activity till the scheduler is #
|
||||
# switched on again. #
|
||||
# = There will be no modifications of user tables by existing events #
|
||||
# except they use "INSERT DELAYED" or the server system variable #
|
||||
# "concurrent_inserts" is not switched off. #
|
||||
# Only some storage engines support concurrent_inserts" or "INSERT DELAYED". #
|
||||
# #
|
||||
# Creation: #
|
||||
# 2008-12-19 mleich Implement this check needed for bug fixes in tests #
|
||||
# #
|
||||
################################################################################
|
||||
|
||||
# 1. Check that the server system variable shows the state needed
|
||||
if (`SELECT @@global.event_scheduler <> 'OFF'`)
|
||||
{
|
||||
--echo # Error: We expect here that the event scheduler is switched off.
|
||||
SELECT @@global.event_scheduler;
|
||||
--echo # Thinkable reasons:
|
||||
--echo # 1. SET GLOBAL event_scheduler = OFF had not the expected effect.
|
||||
--echo # 2. Use of the current routine (include/check_events_off.inc)
|
||||
--echo # within the wrong situation
|
||||
--die
|
||||
}
|
||||
# 2. Wait till we have no event_scheduler session within the processlist
|
||||
--source include/no_running_event_scheduler.inc
|
||||
# 3. Wait till we have no event executor sessions within the processlist
|
||||
--source include/no_running_events.inc
|
||||
|
130
mysql-test/include/circular_rpl_for_4_hosts_init.inc
Normal file
130
mysql-test/include/circular_rpl_for_4_hosts_init.inc
Normal file
|
@ -0,0 +1,130 @@
|
|||
#############################################################
|
||||
#
|
||||
# Author: Serge Kozlov <skozlov@mysql.com>
|
||||
# Date: 03/11/2008
|
||||
# Purpose: Set up circular replication based on schema
|
||||
# A->B->C->D->A
|
||||
#
|
||||
# Notes:
|
||||
# 1. --slave-num=3 must be added to *-master.opt file
|
||||
# 2. Even the test uses new names for servers but file names
|
||||
# of log files are still old:
|
||||
# master_a -> master.[log|err]
|
||||
# master_b -> slave.[log|err]
|
||||
# master_c -> slave1.[log|err]
|
||||
# master_d -> slave2.[log|err]
|
||||
#
|
||||
#############################################################
|
||||
--source include/master-slave.inc
|
||||
|
||||
#
|
||||
# Set up circular ring by schema A->B->C->D->A
|
||||
#
|
||||
|
||||
--connection slave
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
|
||||
# master a
|
||||
--connection master
|
||||
--disconnect master
|
||||
connect (master_a,127.0.0.1,root,,test,$MASTER_MYPORT,);
|
||||
RESET MASTER;
|
||||
--disable_warnings
|
||||
STOP SLAVE;
|
||||
--enable_warnings
|
||||
RESET SLAVE;
|
||||
SET auto_increment_increment = 4;
|
||||
SET auto_increment_offset = 1;
|
||||
let $_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
|
||||
|
||||
# master b
|
||||
--connection slave
|
||||
--disconnect slave
|
||||
connect (master_b,127.0.0.1,root,,test,$SLAVE_MYPORT,);
|
||||
RESET MASTER;
|
||||
RESET SLAVE;
|
||||
--replace_result $MASTER_MYPORT MASTER_A_PORT $_binlog_file MASTER_A_LOG_FILE
|
||||
--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$MASTER_MYPORT,master_user='root',MASTER_LOG_FILE='$_binlog_file'
|
||||
SET auto_increment_increment = 4;
|
||||
SET auto_increment_offset = 2;
|
||||
let $_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
|
||||
|
||||
# master c
|
||||
--connection slave1
|
||||
--disconnect slave1
|
||||
connect (master_c,127.0.0.1,root,,test,$SLAVE_MYPORT1,);
|
||||
RESET MASTER;
|
||||
--disable_warnings
|
||||
STOP SLAVE;
|
||||
--enable_warnings
|
||||
RESET SLAVE;
|
||||
--replace_result $SLAVE_MYPORT MASTER_B_PORT $_binlog_file MASTER_B_LOG_FILE
|
||||
--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SLAVE_MYPORT,master_user='root',MASTER_LOG_FILE='$_binlog_file'
|
||||
SET auto_increment_increment = 4;
|
||||
SET auto_increment_offset = 3;
|
||||
let $_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
|
||||
|
||||
# master d
|
||||
connect (master_d,127.0.0.1,root,,test,$SLAVE_MYPORT2,);
|
||||
RESET MASTER;
|
||||
--disable_warnings
|
||||
STOP SLAVE;
|
||||
--enable_warnings
|
||||
RESET SLAVE;
|
||||
--replace_result $SLAVE_MYPORT1 MASTER_C_PORT $_binlog_file MASTER_C_LOG_FILE
|
||||
--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SLAVE_MYPORT1,master_user='root',MASTER_LOG_FILE='$_binlog_file'
|
||||
SET auto_increment_increment = 4;
|
||||
SET auto_increment_offset = 4;
|
||||
let $_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
|
||||
|
||||
# master a
|
||||
--connection master_a
|
||||
--replace_result $SLAVE_MYPORT2 MASTER_D_PORT $_binlog_file MASTER_D_LOG_FILE
|
||||
--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SLAVE_MYPORT2,master_user='root',MASTER_LOG_FILE='$_binlog_file'
|
||||
|
||||
|
||||
|
||||
# Check server_ids: they should be different
|
||||
--connection master_a
|
||||
let $_id_a= query_get_value(SHOW VARIABLES LIKE 'server_id', Value, 1);
|
||||
SHOW VARIABLES LIKE 'auto_increment_%';
|
||||
--connection master_b
|
||||
let $_id_b= query_get_value(SHOW VARIABLES LIKE 'server_id', Value, 1);
|
||||
SHOW VARIABLES LIKE 'auto_increment_%';
|
||||
--connection master_c
|
||||
let $_id_c= query_get_value(SHOW VARIABLES LIKE 'server_id', Value, 1);
|
||||
SHOW VARIABLES LIKE 'auto_increment_%';
|
||||
--connection master_d
|
||||
let $_id_d= query_get_value(SHOW VARIABLES LIKE 'server_id', Value, 1);
|
||||
SHOW VARIABLES LIKE 'auto_increment_%';
|
||||
--connection master_a
|
||||
let $_compared_ids= (($_id_a <> $_id_b) AND ($_id_a <> $_id_c) AND ($_id_a <> $_id_d) AND ($_id_b <> $_id_c) AND ($_id_b <> $_id_d) AND ($_id_c <> $_id_d)) AS a;
|
||||
let $_compared_ids_result= query_get_value(SELECT $_compared_ids, a, 1);
|
||||
--echo $_compared_ids_result
|
||||
|
||||
# Start ring
|
||||
--connection master_a
|
||||
connect(slave,127.0.0.1,root,,test,$MASTER_MYPORT);
|
||||
START SLAVE;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
--disconnect slave
|
||||
|
||||
--connection master_b
|
||||
connect(slave,127.0.0.1,root,,test,$SLAVE_MYPORT1);
|
||||
START SLAVE;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
--disconnect slave
|
||||
|
||||
--connection master_c
|
||||
connect(slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
|
||||
START SLAVE;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
--disconnect slave
|
||||
|
||||
--connection master_d
|
||||
connect(slave,127.0.0.1,root,,test,$SLAVE_MYPORT2);
|
||||
START SLAVE;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
--disconnect slave
|
||||
|
23
mysql-test/include/circular_rpl_for_4_hosts_sync.inc
Normal file
23
mysql-test/include/circular_rpl_for_4_hosts_sync.inc
Normal file
|
@ -0,0 +1,23 @@
|
|||
#############################################################
|
||||
#
|
||||
# Author: Serge Kozlov <skozlov@mysql.com>
|
||||
# Date: 03/11/2008
|
||||
# Purpose: Sync all hosts for circular replication based on
|
||||
# schema A->B->C->D->A
|
||||
#
|
||||
# Notes: see include/circular_rpl_for_4_hosts_init.inc
|
||||
#
|
||||
#############################################################
|
||||
|
||||
# Make the full loop of sync
|
||||
--connection master_a
|
||||
--disable_query_log
|
||||
--sync_slave_with_master master_b
|
||||
--sync_slave_with_master master_c
|
||||
--sync_slave_with_master master_d
|
||||
--sync_slave_with_master master_a
|
||||
--sync_slave_with_master master_b
|
||||
--sync_slave_with_master master_c
|
||||
--save_master_pos
|
||||
--connection master_a
|
||||
--enable_query_log
|
16
mysql-test/include/cleanup_fake_relay_log.inc
Normal file
16
mysql-test/include/cleanup_fake_relay_log.inc
Normal file
|
@ -0,0 +1,16 @@
|
|||
# ==== Purpose ====
|
||||
#
|
||||
# Clean up files create by setup_fake_relay_log.inc.
|
||||
#
|
||||
# ==== Usage ====
|
||||
#
|
||||
# See setup_fake_relay_log.inc
|
||||
|
||||
--echo Cleaning up after setup_fake_relay_log.inc
|
||||
|
||||
# Remove files.
|
||||
remove_file $_fake_relay_log;
|
||||
remove_file $_fake_relay_index;
|
||||
--disable_query_log
|
||||
eval SET @@global.relay_log_purge= $_fake_relay_log_purge;
|
||||
--enable_query_log
|
|
@ -267,7 +267,7 @@ select * from t2;
|
|||
insert into t2 (a) values (1026);
|
||||
--replace_result $MYSQLTEST_VARDIR ..
|
||||
--error ER_DUP_ENTRY
|
||||
eval load data infile "../std_data_ln/words.dat" into table t1 (a) set a:=f2(26);
|
||||
eval load data infile "../../std_data/words.dat" into table t1 (a) set a:=f2(26);
|
||||
|
||||
select * from t2;
|
||||
rollback;
|
||||
|
@ -617,10 +617,10 @@ call p_verify_status_increment(0, 0, 0, 0);
|
|||
--echo
|
||||
--echo # No test because of Bug#8729 "rename table fails on temporary table"
|
||||
|
||||
--echo # 24. DDL: TRUNCATE TEMPORARY TABLE, does not start a transaction
|
||||
--echo # 24. DDL: TRUNCATE TEMPORARY TABLE
|
||||
--echo
|
||||
truncate table t2;
|
||||
call p_verify_status_increment(2, 0, 2, 0);
|
||||
call p_verify_status_increment(4, 0, 4, 0);
|
||||
commit;
|
||||
--echo # There is nothing left to commit
|
||||
call p_verify_status_increment(0, 0, 0, 0);
|
||||
|
@ -671,8 +671,11 @@ call p_verify_status_increment(2, 2, 2, 2);
|
|||
savepoint a;
|
||||
call p_verify_status_increment(0, 0, 0, 0);
|
||||
insert t1 set a=4;
|
||||
--echo # Sic: a bug. Binlog did not register itself this time.
|
||||
call p_verify_status_increment(1, 0, 1, 0);
|
||||
--echo # Binlog does not register itself this time for other than the 1st
|
||||
--echo # statement of the transaction with MIXED/STATEMENT binlog_format.
|
||||
--echo # It needs registering with the ROW format. Therefore 1,0,2,2 are
|
||||
--echo # the correct arguments to this test after bug#40221 fixed.
|
||||
call p_verify_status_increment(1, 0, 2, 2);
|
||||
release savepoint a;
|
||||
rollback;
|
||||
call p_verify_status_increment(0, 0, 0, 0);
|
||||
|
@ -730,7 +733,7 @@ call p_verify_status_increment(1, 0, 1, 0);
|
|||
rename table t4 to t3;
|
||||
call p_verify_status_increment(1, 0, 1, 0);
|
||||
truncate table t3;
|
||||
call p_verify_status_increment(2, 2, 2, 2);
|
||||
call p_verify_status_increment(4, 4, 4, 4);
|
||||
create view v1 as select * from t2;
|
||||
call p_verify_status_increment(1, 0, 1, 0);
|
||||
check table t1;
|
||||
|
|
|
@ -638,7 +638,7 @@ drop table t1;
|
|||
connection default;
|
||||
drop table t1;
|
||||
|
||||
DROP user mysqltest@localhost;
|
||||
|
||||
disconnect thread1;
|
||||
disconnect thread2;
|
||||
|
||||
|
|
25
mysql-test/include/default_my.cnf
Normal file
25
mysql-test/include/default_my.cnf
Normal file
|
@ -0,0 +1,25 @@
|
|||
# Use default setting for mysqld processes
|
||||
!include default_mysqld.cnf
|
||||
|
||||
[mysqld.1]
|
||||
|
||||
# Run the master.sh script before starting this process
|
||||
#!run-master-sh
|
||||
|
||||
log-bin= master-bin
|
||||
|
||||
|
||||
[mysqlbinlog]
|
||||
disable-force-if-open
|
||||
|
||||
# mysql_fix_privilege_tables.sh does not read from [client] so it
|
||||
# need its own section
|
||||
[mysql_fix_privilege_tables]
|
||||
socket= @client.socket
|
||||
port= @client.port
|
||||
user= @client.user
|
||||
password= @client.password
|
||||
|
||||
[ENV]
|
||||
MASTER_MYPORT= @mysqld.1.port
|
||||
MASTER_MYSOCK= @mysqld.1.socket
|
21
mysql-test/include/default_mysqld.cnf
Normal file
21
mysql-test/include/default_mysqld.cnf
Normal file
|
@ -0,0 +1,21 @@
|
|||
# Default values that applies to all MySQL Servers
|
||||
[mysqld]
|
||||
open-files-limit= 1024
|
||||
local-infile
|
||||
default-character-set= latin1
|
||||
|
||||
# Increase default connect_timeout to avoid intermittent
|
||||
# disconnects when test servers are put under load see BUG#28359
|
||||
connect-timeout= 60
|
||||
|
||||
log-bin-trust-function-creators=1
|
||||
key_buffer_size= 1M
|
||||
sort_buffer= 256K
|
||||
max_heap_table_size= 1M
|
||||
|
||||
loose-innodb_data_file_path= ibdata1:10M:autoextend
|
||||
|
||||
slave-net-timeout=120
|
||||
|
||||
log-bin=mysqld-bin
|
||||
|
27
mysql-test/include/default_ndbd.cnf
Normal file
27
mysql-test/include/default_ndbd.cnf
Normal file
|
@ -0,0 +1,27 @@
|
|||
|
||||
[cluster_config]
|
||||
MaxNoOfSavedMessages= 1000
|
||||
MaxNoOfConcurrentTransactions= 128
|
||||
MaxNoOfConcurrentOperations= 10000
|
||||
DataMemory= 20M
|
||||
IndexMemory= 1M
|
||||
Diskless= 0
|
||||
TimeBetweenWatchDogCheck= 30000
|
||||
MaxNoOfOrderedIndexes= 32
|
||||
MaxNoOfAttributes= 2048
|
||||
TimeBetweenGlobalCheckpoints= 500
|
||||
NoOfFragmentLogFiles= 4
|
||||
FragmentLogFileSize= 12M
|
||||
DiskPageBufferMemory= 4M
|
||||
|
||||
# O_DIRECT has issues on 2.4 whach have not been handled, Bug #29612
|
||||
#ODirect= 1
|
||||
# the following parametes just function as a small regression
|
||||
# test that the parameter exists
|
||||
InitialNoOfOpenFiles= 27
|
||||
|
||||
# Increase timeouts for slow test-machines
|
||||
HeartbeatIntervalDbDb= 30000
|
||||
HeartbeatIntervalDbApi= 30000
|
||||
|
||||
#TransactionDeadlockDetectionTimeout= 7500
|
|
@ -1,28 +0,0 @@
|
|||
--source include/have_log_bin.inc
|
||||
--source include/not_embedded.inc
|
||||
--source ./include/have_federated_db.inc
|
||||
|
||||
source ./include/master-slave.inc;
|
||||
|
||||
# remote table creation
|
||||
|
||||
# We have to sync with master, to ensure slave had time to start properly
|
||||
# before we stop it. If not, we get errors about UNIX_TIMESTAMP() in the log.
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
|
||||
connection slave;
|
||||
#--replicate-ignore-db=federated
|
||||
stop slave;
|
||||
|
||||
--disable_warnings
|
||||
# at this point, we are connected to master
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
--enable_warnings
|
||||
CREATE DATABASE federated;
|
||||
|
||||
connection master;
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
--enable_warnings
|
||||
CREATE DATABASE federated;
|
|
@ -11,6 +11,6 @@ eval SET @@global.sort_buffer_size = $save;
|
|||
--enable_query_log
|
||||
if (!$mach32)
|
||||
{
|
||||
skip Need a 32 bit machine;
|
||||
skip Need a 32 bit machine/binary;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,6 @@ eval SET @@session.sort_buffer_size = $save;
|
|||
--enable_query_log
|
||||
if (!$mach64)
|
||||
{
|
||||
skip Need a 64 bit machine;
|
||||
skip Need a 64 binary ;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
disable_query_log;
|
||||
--require r/true.require
|
||||
select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'blackhole';
|
||||
enable_query_log;
|
||||
if (!`SELECT count(*) FROM information_schema.engines WHERE
|
||||
(support = 'YES' OR support = 'DEFAULT') AND
|
||||
engine = 'blackhole'`){
|
||||
skip Need blackhole engine;
|
||||
}
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
#
|
||||
# Check if the variable MYSQL_BUG25714 is set
|
||||
#
|
||||
--require r/have_bug25714.require
|
||||
disable_query_log;
|
||||
eval select LENGTH('$MYSQL_BUG25714') > 0 as 'have_bug25714_exe';
|
||||
enable_query_log;
|
|
@ -1,4 +0,0 @@
|
|||
disable_query_log;
|
||||
--require r/true.require
|
||||
select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'federated';
|
||||
enable_query_log;
|
|
@ -1,3 +1,11 @@
|
|||
# ==== Purpose ====
|
||||
#
|
||||
# Ensure that the server is running with binlogging on
|
||||
#
|
||||
# ==== Usage ====
|
||||
#
|
||||
# source include/have_log_bin.inc;
|
||||
|
||||
-- require r/have_log_bin.require
|
||||
disable_query_log;
|
||||
show variables like 'log_bin';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
--require r/have_ndbapi_examples.require
|
||||
disable_query_log;
|
||||
eval select LENGTH('$MY_NDB_EXAMPLES_BINARY') > 0 as 'have_ndb_example';
|
||||
eval select LENGTH('$NDB_EXAMPLES_BINARY') > 0 as 'have_ndb_example';
|
||||
enable_query_log;
|
||||
|
|
16
mysql-test/include/have_simple_parser.inc
Normal file
16
mysql-test/include/have_simple_parser.inc
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
# Check if server has support for loading udf's
|
||||
# i.e it will support dlopen
|
||||
#
|
||||
--require r/have_dynamic_loading.require
|
||||
disable_query_log;
|
||||
show variables like 'have_dynamic_loading';
|
||||
enable_query_log;
|
||||
|
||||
#
|
||||
# Check if the variable SIMPLE_PARSER is set
|
||||
#
|
||||
--require r/have_simple_parser.require
|
||||
disable_query_log;
|
||||
eval select LENGTH('$SIMPLE_PARSER') > 0 as 'have_simple_parser';
|
||||
enable_query_log;
|
|
@ -501,4 +501,30 @@ SELECT b,a from t1 WHERE (b!='c' AND b!='f' && b!='h') OR
|
|||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # BUG#40974: Incorrect query results when using clause evaluated using range check
|
||||
--echo #
|
||||
create table t0 (a int);
|
||||
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1),(2);
|
||||
create table t2(a int, b int);
|
||||
insert into t2 values (1,1), (2, 1000);
|
||||
create table t3 (a int, b int, filler char(100), key(a), key(b));
|
||||
|
||||
insert into t3 select 1000, 1000,'filler' from t0 A, t0 B, t0 C;
|
||||
insert into t3 values (1,1,'data');
|
||||
insert into t3 values (1,1,'data');
|
||||
-- echo The plan should be ALL/ALL/ALL(Range checked for each record (index map: 0x3)
|
||||
explain select * from t1
|
||||
where exists (select 1 from t2, t3
|
||||
where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
|
||||
|
||||
select * from t1
|
||||
where exists (select 1 from t2, t3
|
||||
where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
|
||||
|
||||
drop table t0, t1, t2, t3;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
|
|
@ -9,7 +9,6 @@ SET @min_flush_time = 0;
|
|||
#SET @max_flush_time = 0;
|
||||
|
||||
SET @default_key_buffer_size = 131072;
|
||||
SET @min_key_buffer_size = 36;
|
||||
|
||||
#SET @default_join_buffer_size = 131072;
|
||||
#SET @min_join_buffer_size = 8200;
|
||||
|
|
|
@ -7,16 +7,20 @@ eval SET SESSION STORAGE_ENGINE = $engine_type;
|
|||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
let $load_file= $MYSQLTEST_VARDIR/std_data/loaddata2.dat;
|
||||
|
||||
# NDB does not support the create option 'Binlog of table with BLOB attribute and no PK'
|
||||
# So use a dummy PK here.
|
||||
create table t1 (id int unsigned not null auto_increment primary key, a text, b text);
|
||||
start transaction;
|
||||
load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''' (a, b);
|
||||
--replace_result $load_file LOAD_FILE
|
||||
eval load data infile '$load_file' into table t1 fields terminated by ',' enclosed by '''' (a, b);
|
||||
commit;
|
||||
select count(*) from t1;
|
||||
truncate table t1;
|
||||
start transaction;
|
||||
load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''' (a, b);
|
||||
--replace_result $load_file LOAD_FILE
|
||||
eval load data infile '$load_file' into table t1 fields terminated by ',' enclosed by '''' (a, b);
|
||||
rollback;
|
||||
select count(*) from t1;
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ let $default_db=`select database()`;
|
|||
|
||||
connection admin;
|
||||
-- echo * shut down mysqld, removed logs, restarted it
|
||||
append_file $MYSQLTEST_VARDIR/tmp/master0.expect;
|
||||
append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
|
||||
wait-maria_empty_logs.inc
|
||||
EOF
|
||||
|
||||
|
@ -17,54 +17,54 @@ EOF
|
|||
|
||||
if (!$mel_keep_control_file)
|
||||
{
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log_control;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log_control;
|
||||
}
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000001;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log.00000001;
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000002;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log.00000002;
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000003;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log.00000003;
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000004;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log.00000004;
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000005;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log.00000005;
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000006;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log.00000006;
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000007;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log.00000007;
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000008;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log.00000008;
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000009;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log.00000009;
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000010;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log.00000010;
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000011;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log.00000011;
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000012;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log.00000012;
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000013;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log.00000013;
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000014;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log.00000014;
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000015;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log.00000015;
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000016;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log.00000016;
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000017;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log.00000017;
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000018;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log.00000018;
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000019;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log.00000019;
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log.00000020;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log.00000020;
|
||||
# hope there are not more than these logs...
|
||||
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/maria_recovery.trace;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/maria_recovery.trace;
|
||||
|
||||
append_file $MYSQLTEST_VARDIR/tmp/master0.expect;
|
||||
append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
|
||||
restart-maria_empty_logs.inc
|
||||
EOF
|
||||
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
if ($mms_copy)
|
||||
{
|
||||
--echo * copied $mms_tname$mms_table_to_use for $mms_purpose
|
||||
copy_file $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAD $MYSQLTEST_VARDIR/master-data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAD;
|
||||
copy_file $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAI $MYSQLTEST_VARDIR/master-data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAI;
|
||||
copy_file $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.frm $MYSQLTEST_VARDIR/master-data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.frm;
|
||||
copy_file $MYSQLTEST_VARDIR/mysqld.1/data/mysqltest/$mms_tname$mms_table_to_use.MAD $MYSQLTEST_VARDIR/mysqld.1/data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAD;
|
||||
copy_file $MYSQLTEST_VARDIR/mysqld.1/data/mysqltest/$mms_tname$mms_table_to_use.MAI $MYSQLTEST_VARDIR/mysqld.1/data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAI;
|
||||
copy_file $MYSQLTEST_VARDIR/mysqld.1/data/mysqltest/$mms_tname$mms_table_to_use.frm $MYSQLTEST_VARDIR/mysqld.1/data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.frm;
|
||||
}
|
||||
|
||||
if ($mms_reverse_copy)
|
||||
|
@ -28,11 +28,11 @@ if ($mms_reverse_copy)
|
|||
# do not call this without flushing target table first!
|
||||
--echo * copied $mms_tname$mms_table_to_use back for $mms_purpose
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAD;
|
||||
copy_file $MYSQLTEST_VARDIR/master-data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAD $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAD;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/mysqltest/$mms_tname$mms_table_to_use.MAD;
|
||||
copy_file $MYSQLTEST_VARDIR/mysqld.1/data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAD $MYSQLTEST_VARDIR/mysqld.1/data/mysqltest/$mms_tname$mms_table_to_use.MAD;
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAI;
|
||||
copy_file $MYSQLTEST_VARDIR/master-data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAI $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAI;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/mysqltest/$mms_tname$mms_table_to_use.MAI;
|
||||
copy_file $MYSQLTEST_VARDIR/mysqld.1/data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAI $MYSQLTEST_VARDIR/mysqld.1/data/mysqltest/$mms_tname$mms_table_to_use.MAI;
|
||||
}
|
||||
|
||||
if ($mms_compare_physically)
|
||||
|
@ -43,7 +43,7 @@ if ($mms_compare_physically)
|
|||
# If UNDO phase, we nevertheless compare checksums
|
||||
# (see maria_verify_recovery.inc).
|
||||
--echo * compared $mms_tname$mms_table_to_use to old version
|
||||
diff_files $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAD $MYSQLTEST_VARDIR/master-data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAD;
|
||||
diff_files $MYSQLTEST_VARDIR/mysqld.1/data/mysqltest/$mms_tname$mms_table_to_use.MAD $MYSQLTEST_VARDIR/mysqld.1/data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAD;
|
||||
# index file not yet recovered
|
||||
# diff_files $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAI $MYSQLTEST_VARDIR/master-data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAI;
|
||||
# diff_files $MYSQLTEST_VARDIR/mysqld.1/data/mysqltest/$mms_tname$mms_table_to_use.MAI $MYSQLTEST_VARDIR/mysqld.1/data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAI;
|
||||
}
|
||||
|
|
|
@ -32,6 +32,6 @@ let $mms_copy=0;
|
|||
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/tmp/mms_for_$mms_purpose.maria_log_control;
|
||||
copy_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log_control $MYSQLTEST_VARDIR/tmp/mms_for_$mms_purpose.maria_log_control;
|
||||
copy_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log_control $MYSQLTEST_VARDIR/tmp/mms_for_$mms_purpose.maria_log_control;
|
||||
|
||||
connection default;
|
||||
|
|
|
@ -20,11 +20,11 @@ let $mms_compare_physically_save=$mms_compare_physically;
|
|||
let $mms_compare_physically=0;
|
||||
|
||||
# warn mtr that mysqld is going to die and should not be restarted immediately
|
||||
#append_file $MYSQLTEST_VARDIR/tmp/master0.expect;
|
||||
#append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
|
||||
#wait-maria_verify_recovery.inc
|
||||
#EOF
|
||||
# todo: remove this "system" and uncomment above when BUG#32296 is fixed
|
||||
system echo wait-maria_verify_recovery.inc >> $MYSQLTEST_VARDIR/tmp/master0.expect;
|
||||
system echo wait-maria_verify_recovery.inc >> $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
|
||||
|
||||
# flush page cache and log, only log, or nothing, and kill mysqld with
|
||||
# abort().
|
||||
|
@ -56,16 +56,16 @@ if ($mvr_restore_old_snapshot)
|
|||
# also copy back control file, to force recovery to start from an early
|
||||
# point, ignoring further checkpoints.
|
||||
-- error 0,1
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log_control;
|
||||
copy_file $MYSQLTEST_VARDIR/tmp/mms_for_$mms_purpose.maria_log_control $MYSQLTEST_VARDIR/master-data/$MARIA_LOG/maria_log_control;
|
||||
remove_file $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log_control;
|
||||
copy_file $MYSQLTEST_VARDIR/tmp/mms_for_$mms_purpose.maria_log_control $MYSQLTEST_VARDIR/mysqld.1/data/$MARIA_LOG/maria_log_control;
|
||||
}
|
||||
|
||||
--echo * recovery happens
|
||||
# let mtr restart mysqld (and thus execute the maria log)
|
||||
#append_file $MYSQLTEST_VARDIR/tmp/master0.expect;
|
||||
#append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
|
||||
#restart-maria_verify_recovery.inc
|
||||
#EOF
|
||||
system echo restart-maria_verify_recovery.inc >> $MYSQLTEST_VARDIR/tmp/master0.expect;
|
||||
system echo restart-maria_verify_recovery.inc >> $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
|
||||
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
# Reset the master and the slave to start fresh.
|
||||
#
|
||||
# It is necessary to execute RESET MASTER and RESET SLAVE on both
|
||||
# master and slave since the replication setup might be circular.
|
||||
#
|
||||
# Since we expect STOP SLAVE to produce a warning as the slave is
|
||||
# stopped (the server was started with skip-slave-start), we disable
|
||||
# warnings when doing STOP SLAVE.
|
||||
|
||||
connection slave;
|
||||
#we expect STOP SLAVE to produce a warning as the slave is stopped
|
||||
#(the server was started with skip-slave-start)
|
||||
--disable_warnings
|
||||
stop slave;
|
||||
source include/wait_for_slave_to_stop.inc;
|
||||
|
@ -13,11 +20,17 @@ use test;
|
|||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
--enable_warnings
|
||||
reset master;
|
||||
--disable_query_log
|
||||
reset slave;
|
||||
--enable_query_log
|
||||
connection slave;
|
||||
reset slave;
|
||||
# Clean up old test tables
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
--enable_warnings
|
||||
--disable_query_log
|
||||
reset master;
|
||||
--enable_query_log
|
||||
start slave;
|
||||
source include/wait_for_slave_to_start.inc;
|
||||
|
|
|
@ -623,7 +623,8 @@ DROP TABLE t1,t2,t3;
|
|||
#
|
||||
|
||||
create table t1 (a int) engine=innodb;
|
||||
copy_file $MYSQLTEST_VARDIR/master-data/test/t1.frm $MYSQLTEST_VARDIR/master-data/test/bug29807.frm;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
copy_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/bug29807.frm;
|
||||
--error 1146
|
||||
select * from bug29807;
|
||||
drop table t1;
|
||||
|
|
|
@ -1222,7 +1222,7 @@ drop table t2;
|
|||
|
||||
# Clean up filename -- embedded server reports whole path without .frm,
|
||||
# regular server reports relative path with .frm (argh!)
|
||||
--replace_result \\ / $MYSQL_TEST_DIR . /var/master-data/ / t2.frm t2
|
||||
--replace_result \\ / $MYSQL_TEST_DIR . /var/mysqld.1/data/ / t2.frm t2
|
||||
--error 1005
|
||||
eval create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = $engine_type;
|
||||
|
||||
|
@ -1467,7 +1467,7 @@ source include/varchar.inc;
|
|||
|
||||
# Clean up filename -- embedded server reports whole path without .frm,
|
||||
# regular server reports relative path with .frm (argh!)
|
||||
--replace_result \\ / $MYSQL_TEST_DIR . /var/master-data/ / t1.frm t1
|
||||
--replace_result \\ / $MYSQL_TEST_DIR . /var/mysqld.1/data/ / t1.frm t1
|
||||
create table t1 (v varchar(65530), key(v));
|
||||
drop table t1;
|
||||
create table t1 (v varchar(65536));
|
||||
|
@ -1778,7 +1778,7 @@ if ($test_foreign_keys)
|
|||
|
||||
set foreign_key_checks=0;
|
||||
eval create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = $engine_type;
|
||||
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
|
||||
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
|
||||
-- error 1005
|
||||
eval create table t1(a char(10) primary key, b varchar(20)) engine = $engine_type;
|
||||
set foreign_key_checks=1;
|
||||
|
@ -1789,7 +1789,7 @@ drop table t2;
|
|||
|
||||
set foreign_key_checks=0;
|
||||
eval create table t1(a varchar(10) primary key) engine = $engine_type DEFAULT CHARSET=latin1;
|
||||
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
|
||||
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
|
||||
-- error 1005
|
||||
eval create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = $engine_type DEFAULT CHARSET=utf8;
|
||||
set foreign_key_checks=1;
|
||||
|
@ -1819,7 +1819,7 @@ drop table t2,t1;
|
|||
set foreign_key_checks=0;
|
||||
eval create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = $engine_type DEFAULT CHARSET=latin1;
|
||||
eval create table t3(a varchar(10) primary key) engine = $engine_type DEFAULT CHARSET=utf8;
|
||||
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
|
||||
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
|
||||
-- error 1025
|
||||
rename table t3 to t1;
|
||||
set foreign_key_checks=1;
|
||||
|
|
59
mysql-test/include/mtr_check.sql
Normal file
59
mysql-test/include/mtr_check.sql
Normal file
|
@ -0,0 +1,59 @@
|
|||
delimiter ||;
|
||||
|
||||
use mtr||
|
||||
|
||||
--
|
||||
-- Procedure used to check if server has been properly
|
||||
-- restored after testcase has been run
|
||||
--
|
||||
CREATE DEFINER=root@localhost PROCEDURE check_testcase()
|
||||
BEGIN
|
||||
|
||||
-- Dump all global variables except those
|
||||
-- that are supposed to change
|
||||
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
||||
WHERE variable_name != 'timestamp' and variable_name != "debug" order by variable_name;
|
||||
|
||||
-- Dump all databases, there should be none
|
||||
-- except those that was created during bootstrap
|
||||
SELECT * FROM INFORMATION_SCHEMA.SCHEMATA;
|
||||
|
||||
-- The test database should not contain any tables
|
||||
SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE table_schema='test';
|
||||
|
||||
-- Show "mysql" database, tables and columns
|
||||
SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql
|
||||
FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE table_schema='mysql' AND table_name != 'ndb_apply_status'
|
||||
ORDER BY tables_in_mysql;
|
||||
SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql,
|
||||
column_name, ordinal_position, column_default, is_nullable,
|
||||
data_type, character_maximum_length, character_octet_length,
|
||||
numeric_precision, numeric_scale, character_set_name,
|
||||
collation_name, column_type, column_key, extra, column_comment
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE table_schema='mysql' AND table_name != 'ndb_apply_status'
|
||||
ORDER BY columns_in_mysql;
|
||||
|
||||
-- Checksum system tables to make sure they have been properly
|
||||
-- restored after test
|
||||
checksum table
|
||||
mysql.columns_priv,
|
||||
mysql.db,
|
||||
mysql.func,
|
||||
mysql.help_category,
|
||||
mysql.help_keyword,
|
||||
mysql.help_relation,
|
||||
mysql.host,
|
||||
mysql.proc,
|
||||
mysql.procs_priv,
|
||||
mysql.tables_priv,
|
||||
mysql.time_zone,
|
||||
mysql.time_zone_leap_second,
|
||||
mysql.time_zone_name,
|
||||
mysql.time_zone_transition,
|
||||
mysql.time_zone_transition_type,
|
||||
mysql.user;
|
||||
|
||||
END||
|
248
mysql-test/include/mtr_warnings.sql
Normal file
248
mysql-test/include/mtr_warnings.sql
Normal file
|
@ -0,0 +1,248 @@
|
|||
delimiter ||;
|
||||
|
||||
use mtr||
|
||||
|
||||
--
|
||||
-- Create table where testcases can insert patterns to
|
||||
-- be suppressed
|
||||
--
|
||||
CREATE TABLE test_suppressions (
|
||||
pattern VARCHAR(255)
|
||||
) ENGINE=MyISAM||
|
||||
|
||||
|
||||
--
|
||||
-- Declare a trigger that makes sure
|
||||
-- no invalid patterns can be inserted
|
||||
-- into test_suppressions
|
||||
--
|
||||
/*!50002
|
||||
CREATE DEFINER=root@localhost TRIGGER ts_insert
|
||||
BEFORE INSERT ON test_suppressions
|
||||
FOR EACH ROW BEGIN
|
||||
DECLARE dummy INT;
|
||||
SELECT "" REGEXP NEW.pattern INTO dummy;
|
||||
END
|
||||
*/||
|
||||
|
||||
|
||||
--
|
||||
-- Load table with patterns that will be suppressed globally(always)
|
||||
--
|
||||
CREATE TABLE global_suppressions (
|
||||
pattern VARCHAR(255)
|
||||
) ENGINE=MyISAM||
|
||||
|
||||
|
||||
-- Declare a trigger that makes sure
|
||||
-- no invalid patterns can be inserted
|
||||
-- into global_suppressions
|
||||
--
|
||||
/*!50002
|
||||
CREATE DEFINER=root@localhost TRIGGER gs_insert
|
||||
BEFORE INSERT ON global_suppressions
|
||||
FOR EACH ROW BEGIN
|
||||
DECLARE dummy INT;
|
||||
SELECT "" REGEXP NEW.pattern INTO dummy;
|
||||
END
|
||||
*/||
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Insert patterns that should always be suppressed
|
||||
--
|
||||
INSERT INTO global_suppressions VALUES
|
||||
("'SELECT UNIX_TIMESTAMP\\(\\)' failed on master"),
|
||||
("Aborted connection"),
|
||||
("Client requested master to start replication from impossible position"),
|
||||
("Could not find first log file name in binary log"),
|
||||
("Enabling keys got errno"),
|
||||
("Error reading master configuration"),
|
||||
("Error reading packet"),
|
||||
("Event Scheduler"),
|
||||
("Failed to open log"),
|
||||
("Failed to open the existing master info file"),
|
||||
("Forcing shutdown of [0-9]* plugins"),
|
||||
("Forcing close of thread"),
|
||||
|
||||
/*
|
||||
Due to timing issues, it might be that this warning
|
||||
is printed when the server shuts down and the
|
||||
computer is loaded.
|
||||
*/
|
||||
|
||||
("Got error [0-9]* when reading table"),
|
||||
("Incorrect definition of table"),
|
||||
("Incorrect information in file"),
|
||||
("InnoDB: Warning: we did not need to do crash recovery"),
|
||||
("Invalid \\(old\\?\\) table or database name"),
|
||||
("Lock wait timeout exceeded"),
|
||||
("Log entry on master is longer than max_allowed_packet"),
|
||||
("unknown option '--loose-"),
|
||||
("unknown variable 'loose-"),
|
||||
("You have forced lower_case_table_names to 0 through a command-line option"),
|
||||
("Setting lower_case_table_names=2"),
|
||||
("NDB Binlog:"),
|
||||
("NDB: failed to setup table"),
|
||||
("NDB: only row based binary logging"),
|
||||
("Neither --relay-log nor --relay-log-index were used"),
|
||||
("Query partially completed"),
|
||||
("Slave I.O thread aborted while waiting for relay log"),
|
||||
("Slave SQL thread is stopped because UNTIL condition"),
|
||||
("Slave SQL thread retried transaction"),
|
||||
("Slave \\(additional info\\)"),
|
||||
("Slave: .*Duplicate column name"),
|
||||
("Slave: .*master may suffer from"),
|
||||
("Slave: According to the master's version"),
|
||||
("Slave: Column [0-9]* type mismatch"),
|
||||
("Slave: Error .* doesn't exist"),
|
||||
("Slave: Error .*Unknown table"),
|
||||
("Slave: Error in Write_rows event: "),
|
||||
("Slave: Field .* of table .* has no default value"),
|
||||
("Slave: Field .* doesn't have a default value"),
|
||||
("Slave: Query caused different errors on master and slave"),
|
||||
("Slave: Table .* doesn't exist"),
|
||||
("Slave: Table width mismatch"),
|
||||
("Slave: The incident LOST_EVENTS occured on the master"),
|
||||
("Slave: Unknown error.* 1105"),
|
||||
("Slave: Can't drop database.* database doesn't exist"),
|
||||
("Slave SQL:.*(Error_code: \[\[:digit:\]\]+|Query:.*)"),
|
||||
("Sort aborted"),
|
||||
("Time-out in NDB"),
|
||||
("Warning:\s+One can only use the --user.*root"),
|
||||
("Warning:\s+Setting lower_case_table_names=2"),
|
||||
("Warning:\s+Table:.* on (delete|rename)"),
|
||||
("You have an error in your SQL syntax"),
|
||||
("deprecated"),
|
||||
("description of time zone"),
|
||||
("equal MySQL server ids"),
|
||||
("error .*connecting to master"),
|
||||
("error reading log entry"),
|
||||
("lower_case_table_names is set"),
|
||||
("skip-name-resolve mode"),
|
||||
("slave SQL thread aborted"),
|
||||
("Slave: .*Duplicate entry"),
|
||||
|
||||
/*
|
||||
Special case, made as specific as possible, for:
|
||||
Bug #28436: Incorrect position in SHOW BINLOG EVENTS causes
|
||||
server coredump
|
||||
*/
|
||||
|
||||
("Error in Log_event::read_log_event\\\(\\\): 'Sanity check failed', data_len: 258, event_type: 49"),
|
||||
|
||||
("Statement is not safe to log in statement format"),
|
||||
|
||||
/* test case for Bug#bug29807 copies a stray frm into database */
|
||||
("InnoDB: Error: table `test`.`bug29807` does not exist in the InnoDB internal"),
|
||||
("Cannot find or open table test\/bug29807 from"),
|
||||
|
||||
/* innodb foreign key tests that fail in ALTER or RENAME produce this */
|
||||
("InnoDB: Error: in ALTER TABLE `test`.`t[12]`"),
|
||||
("InnoDB: Error: in RENAME TABLE table `test`.`t1`"),
|
||||
("InnoDB: Error: table `test`.`t[12]` does not exist in the InnoDB internal"),
|
||||
|
||||
/* Test case for Bug#14233 produces the following warnings: */
|
||||
("Stored routine 'test'.'bug14233_1': invalid value in column mysql.proc"),
|
||||
("Stored routine 'test'.'bug14233_2': invalid value in column mysql.proc"),
|
||||
("Stored routine 'test'.'bug14233_3': invalid value in column mysql.proc"),
|
||||
|
||||
/*
|
||||
BUG#32080 - Excessive warnings on Solaris: setrlimit could not
|
||||
change the size of core files
|
||||
*/
|
||||
("setrlimit could not change the size of core files to 'infinity'"),
|
||||
|
||||
/*
|
||||
rpl_extrColmaster_*.test, the slave thread produces warnings
|
||||
when it get updates to a table that has more columns on the
|
||||
master
|
||||
*/
|
||||
("Slave: Unknown column 'c7' in 't15' Error_code: 1054"),
|
||||
("Slave: Can't DROP 'c7'.* 1091"),
|
||||
("Slave: Key column 'c6'.* 1072"),
|
||||
|
||||
/* Test case for Bug#31590 in order_by.test produces the following error */
|
||||
("Out of sort memory; increase server sort buffer size"),
|
||||
|
||||
/* Special case for Bug #26402 in show_check.test
|
||||
- Question marks are not valid file name parts on Windows. Ignore
|
||||
this error message.
|
||||
*/
|
||||
("Can't find file: '.\\\\test\\\\\\?{8}.frm'"),
|
||||
|
||||
/* maria-recovery.test has warning about missing log file */
|
||||
("File '.*maria_log.000.*' not found \\(Errcode: 2\\)"),
|
||||
/* and about marked-corrupted table */
|
||||
("Table '..mysqltest.t_corrupted1' is crashed, skipping it. Please repair"),
|
||||
/* maria-recover.test corrupts tables on purpose */
|
||||
("Checking table: '..mysqltest.t_corrupted2'"),
|
||||
("Table '..mysqltest.t_corrupted2' is marked as crashed and should be"),
|
||||
("Incorrect key file for table '..mysqltest.t_corrupted2.MAI'"),
|
||||
|
||||
|
||||
("THE_LAST_SUPPRESSION")||
|
||||
|
||||
|
||||
--
|
||||
-- Procedure that uses the above created tables to check
|
||||
-- the servers error log for warnings
|
||||
--
|
||||
CREATE DEFINER=root@localhost PROCEDURE check_warnings(OUT result INT)
|
||||
BEGIN
|
||||
DECLARE `pos` bigint unsigned;
|
||||
|
||||
-- Don't write these queries to binlog
|
||||
SET SQL_LOG_BIN=0;
|
||||
|
||||
--
|
||||
-- Remove mark from lines that are suppressed by global suppressions
|
||||
--
|
||||
UPDATE error_log el, global_suppressions gs
|
||||
SET suspicious=0
|
||||
WHERE el.suspicious=1 AND el.line REGEXP gs.pattern;
|
||||
|
||||
--
|
||||
-- Remove mark from lines that are suppressed by test specific suppressions
|
||||
--
|
||||
UPDATE error_log el, test_suppressions ts
|
||||
SET suspicious=0
|
||||
WHERE el.suspicious=1 AND el.line REGEXP ts.pattern;
|
||||
|
||||
--
|
||||
-- Get the number of marked lines and return result
|
||||
--
|
||||
SELECT COUNT(*) INTO @num_warnings FROM error_log
|
||||
WHERE suspicious=1;
|
||||
|
||||
IF @num_warnings > 0 THEN
|
||||
SELECT file_name, line
|
||||
FROM error_log WHERE suspicious=1;
|
||||
--SELECT * FROM test_suppressions;
|
||||
-- Return 2 -> check failed
|
||||
SELECT 2 INTO result;
|
||||
ELSE
|
||||
-- Return 0 -> OK
|
||||
SELECT 0 INTO RESULT;
|
||||
END IF;
|
||||
|
||||
-- Cleanup for next test
|
||||
TRUNCATE test_suppressions;
|
||||
DROP TABLE error_log;
|
||||
|
||||
END||
|
||||
|
||||
--
|
||||
-- Declare a procedure testcases can use to insert test
|
||||
-- specific suppressions
|
||||
--
|
||||
/*!50001
|
||||
CREATE DEFINER=root@localhost
|
||||
PROCEDURE add_suppression(pattern VARCHAR(255))
|
||||
BEGIN
|
||||
INSERT INTO test_suppressions (pattern) VALUES (pattern);
|
||||
END
|
||||
*/||
|
||||
|
||||
|
|
@ -1651,7 +1651,7 @@ FLUSH LOGS;
|
|||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9-]*[.][0-9]{1,3})[0-9e+-]*[^ ]*[ ]*(.*(FLOAT|DOUBLE).*[*].)/\1... \2/
|
||||
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLTEST_VARDIR/log/master-bin.000001
|
||||
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
|
||||
|
||||
--echo #
|
||||
--echo # Cleanup.
|
||||
|
@ -1731,7 +1731,7 @@ FLUSH LOGS;
|
|||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9-]*[.][0-9]{1,3})[0-9e+-]*[^ ]*[ ]*(.*(FLOAT|DOUBLE).*[*].)/\1... \2/
|
||||
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLTEST_VARDIR/log/master-bin.000001
|
||||
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
|
||||
|
||||
--echo #
|
||||
--echo # Cleanup.
|
||||
|
@ -1854,7 +1854,7 @@ FLUSH LOGS;
|
|||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9-]*[.][0-9]{1,3})[0-9e+-]*[^ ]*[ ]*(.*(FLOAT|DOUBLE).*[*].)/\1... \2/
|
||||
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLTEST_VARDIR/log/master-bin.000001
|
||||
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
|
||||
|
||||
--echo #
|
||||
--echo # Cleanup.
|
||||
|
@ -1887,7 +1887,7 @@ eval CREATE TABLE t1 (
|
|||
--echo #
|
||||
--echo # Load data.
|
||||
--echo #
|
||||
LOAD DATA INFILE '../std_data_ln/loaddata5.dat'
|
||||
LOAD DATA INFILE '../../std_data/loaddata5.dat'
|
||||
INTO TABLE t1 FIELDS TERMINATED BY '' ENCLOSED BY '' (c1,c2)
|
||||
SET c3 = 'Wow';
|
||||
|
||||
|
@ -1912,7 +1912,7 @@ FLUSH LOGS;
|
|||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9-]*[.][0-9]{1,3})[0-9e+-]*[^ ]*[ ]*(.*(FLOAT|DOUBLE).*[*].)/\1... \2/
|
||||
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLTEST_VARDIR/log/master-bin.000001
|
||||
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
|
||||
|
||||
--echo #
|
||||
--echo # Cleanup.
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
echo Output from mysqltest-x.inc;
|
||||
exit;
|
||||
|
||||
|
|
|
@ -2,23 +2,21 @@
|
|||
# By JBM 2006-02-16 So that the code is not repeated #
|
||||
# in test cases and can be reused. #
|
||||
######################################################
|
||||
--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT
|
||||
--exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "start backup" >> $NDB_TOOLS_OUTPUT
|
||||
|
||||
# there is no neat way to find the backupid, this is a hack to find it...
|
||||
let $dump_file= $MYSQLTEST_VARDIR/tmp/tmp.dat;
|
||||
--exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="$NDB_CONNECTSTRING" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $dump_file
|
||||
|
||||
--exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $MYSQLTEST_VARDIR/tmp.dat
|
||||
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
||||
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
||||
|
||||
DELETE FROM test.backup_info;
|
||||
|
||||
LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
|
||||
--replace_column 1 <the_backup_id>
|
||||
|
||||
SELECT @the_backup_id:=backup_id FROM test.backup_info;
|
||||
|
||||
let the_backup_id=`select @the_backup_id`;
|
||||
--replace_result $dump_file DUMP_FILE
|
||||
eval LOAD DATA INFILE '$dump_file' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
|
||||
# Load backup id into environment variable
|
||||
let the_backup_id=`SELECT backup_id from test.backup_info`;
|
||||
DROP TABLE test.backup_info;
|
||||
|
||||
remove_file $dump_file;
|
||||
|
||||
|
||||
|
|
136
mysql-test/include/ndb_master-slave_2ch.inc
Normal file
136
mysql-test/include/ndb_master-slave_2ch.inc
Normal file
|
@ -0,0 +1,136 @@
|
|||
#############################################################
|
||||
# Author: Serge Kozlov <skozlov@mysql.com>
|
||||
# Date: 03/17/2008
|
||||
# Purpose: Set up circular cluster replication where each
|
||||
# cluster has two mysqlds and replication directions are
|
||||
# following:
|
||||
# master ---> slave
|
||||
# / \
|
||||
# cluster A cluster B
|
||||
# \ /
|
||||
# master1 <--- slave1
|
||||
#############################################################
|
||||
|
||||
--source include/have_log_bin.inc
|
||||
|
||||
# Make connections to mysqlds
|
||||
|
||||
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
|
||||
connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT1,);
|
||||
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
|
||||
connect (slave1,127.0.0.1,root,,test,$SLAVE_MYPORT1,);
|
||||
|
||||
# Check that all mysqld compiled with ndb support
|
||||
|
||||
--connection master
|
||||
--disable_query_log
|
||||
--require r/true.require
|
||||
SELECT (support = 'YES' or support = 'DEFAULT') AS `TRUE` FROM information_schema.engines WHERE engine = 'ndbcluster';
|
||||
--source include/ndb_not_readonly.inc
|
||||
--enable_query_log
|
||||
|
||||
--connection master1
|
||||
--disable_query_log
|
||||
--require r/true.require
|
||||
SELECT (support = 'YES' or support = 'DEFAULT') AS `TRUE` FROM information_schema.engines WHERE engine = 'ndbcluster';
|
||||
--source include/ndb_not_readonly.inc
|
||||
--enable_query_log
|
||||
|
||||
--connection slave
|
||||
--disable_query_log
|
||||
--require r/true.require
|
||||
SELECT (support = 'YES' or support = 'DEFAULT') AS `TRUE` FROM information_schema.engines WHERE engine = 'ndbcluster';
|
||||
--source include/ndb_not_readonly.inc
|
||||
--enable_query_log
|
||||
|
||||
--connection slave1
|
||||
--disable_query_log
|
||||
--require r/true.require
|
||||
SELECT (support = 'YES' or support = 'DEFAULT') AS `TRUE` FROM information_schema.engines WHERE engine = 'ndbcluster';
|
||||
--source include/ndb_not_readonly.inc
|
||||
--enable_query_log
|
||||
|
||||
# Stop slaves
|
||||
|
||||
--connection master
|
||||
--disable_warnings
|
||||
STOP SLAVE;
|
||||
--wait_for_slave_to_stop
|
||||
--enable_warnings
|
||||
|
||||
--connection master1
|
||||
--disable_warnings
|
||||
STOP SLAVE;
|
||||
--wait_for_slave_to_stop
|
||||
--enable_warnings
|
||||
|
||||
--connection slave
|
||||
--disable_warnings
|
||||
STOP SLAVE;
|
||||
--wait_for_slave_to_stop
|
||||
--enable_warnings
|
||||
|
||||
--connection slave1
|
||||
--disable_warnings
|
||||
STOP SLAVE;
|
||||
--wait_for_slave_to_stop
|
||||
--enable_warnings
|
||||
|
||||
# Reset masters
|
||||
|
||||
--connection master
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
USE test;
|
||||
--enable_query_log
|
||||
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
--enable_warnings
|
||||
RESET MASTER;
|
||||
|
||||
--connection master1
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
USE test;
|
||||
--enable_query_log
|
||||
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
--enable_warnings
|
||||
RESET MASTER;
|
||||
|
||||
--connection slave
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
USE test;
|
||||
--enable_query_log
|
||||
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
--enable_warnings
|
||||
RESET MASTER;
|
||||
|
||||
--connection slave1
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
USE test;
|
||||
--enable_query_log
|
||||
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
--enable_warnings
|
||||
RESET MASTER;
|
||||
|
||||
# Start slaves
|
||||
|
||||
--connection slave
|
||||
RESET SLAVE;
|
||||
--replace_result $MASTER_MYPORT MASTER_MYPORT
|
||||
--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$MASTER_MYPORT,master_user='root'
|
||||
START SLAVE;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
|
||||
--connection master1
|
||||
RESET SLAVE;
|
||||
--replace_result $SLAVE_MYPORT1 SLAVE_MYPORT1
|
||||
--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SLAVE_MYPORT1,master_user='root'
|
||||
START SLAVE;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
|
||||
|
||||
# Set the default connection to 'master' (cluster A)
|
||||
connection master;
|
||||
|
|
@ -17,7 +17,7 @@ while ($mysql_errno)
|
|||
{
|
||||
if (!$counter)
|
||||
{
|
||||
die("Failed while waiting for mysqld to come out of readonly mode");
|
||||
die Failed while waiting for mysqld to come out of readonly mode;
|
||||
}
|
||||
dec $counter;
|
||||
--sleep 0.1
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
# in test cases and can be reused. #
|
||||
######################################################
|
||||
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -p 8 -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -p 8 -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
|
||||
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -p 8 -b $the_backup_id -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -p 8 -b $the_backup_id -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
# in test cases and can be reused. #
|
||||
######################################################
|
||||
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -p 8 -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING_SLAVE" -p 8 -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
|
||||
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -p 8 -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING_SLAVE" -p 8 -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
|
||||
|
||||
|
||||
|
||||
|
|
23
mysql-test/include/no_running_event_scheduler.inc
Normal file
23
mysql-test/include/no_running_event_scheduler.inc
Normal file
|
@ -0,0 +1,23 @@
|
|||
########## include/no_running_event_scheduler.inc ##########################
|
||||
# #
|
||||
# Wait till the event scheduler disappeared from processlist. #
|
||||
# #
|
||||
# The characteristics of the event_scheduler entry within the processlist is #
|
||||
# user = 'event_scheduler' and command = 'Daemon'. I am not 100% sure if #
|
||||
# ther is no short phase with command <> 'Daemon'. #
|
||||
# A query with WHERE user = 'event_scheduler' only will also catch events in #
|
||||
# startup phase. This is no problem since this phase is very short. #
|
||||
# #
|
||||
# A wait_timeout of >= 3 seconds was within experiments sufficient even on a #
|
||||
# testing box with heavy parallel load. Therefore 5 seconds should be enough. #
|
||||
# #
|
||||
# Creation: #
|
||||
# 2008-12-19 mleich Implement this check needed for test bug fixes #
|
||||
# #
|
||||
################################################################################
|
||||
|
||||
let $wait_timeout= 5;
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 0 FROM information_schema.processlist
|
||||
WHERE user = 'event_scheduler';
|
||||
--source include/wait_condition.inc
|
25
mysql-test/include/no_running_events.inc
Normal file
25
mysql-test/include/no_running_events.inc
Normal file
|
@ -0,0 +1,25 @@
|
|||
########## include/no_running_events.inc ###################################
|
||||
# #
|
||||
# Wait till all event executors have finished their work. #
|
||||
# #
|
||||
# Different event executors share the characteristics that their entry within #
|
||||
# processlist contains command = 'Connect'. #
|
||||
# Of course the corresponding query will also catch other connections being #
|
||||
# within the connect phase. This is no problem since the connect phase is #
|
||||
# usually very short. #
|
||||
# #
|
||||
# A wait_timeout of >= 3 seconds was during experiments in case of "simple" #
|
||||
# SQL commands sufficient even on a testing box with heavy parallel load. #
|
||||
# "simple" = no sleeps, no long running commands, no waiting for lock ... #
|
||||
# We use here the default of 30 seconds because this wastes some time only in #
|
||||
# case of unexpected situations. #
|
||||
# #
|
||||
# Creation: #
|
||||
# 2008-12-19 mleich Implement this check needed for test bug fixes #
|
||||
# #
|
||||
################################################################################
|
||||
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 0 FROM information_schema.processlist
|
||||
WHERE command = 'Connect';
|
||||
--source include/wait_condition.inc
|
|
@ -1,4 +1,3 @@
|
|||
-- require r/not_as_root.require
|
||||
disable_query_log;
|
||||
eval select "$MYSQL_TEST_ROOT" as running_as_root;
|
||||
enable_query_log;
|
||||
if ($MYSQL_TEST_ROOT){
|
||||
skip Not as root;
|
||||
}
|
||||
|
|
|
@ -176,6 +176,7 @@ show status like "Qcache_queries_in_cache";
|
|||
show status like "Qcache_hits";
|
||||
|
||||
# Final cleanup
|
||||
eval set GLOBAL query_cache_size=$save_query_cache_size;
|
||||
connection default;
|
||||
drop table t2;
|
||||
disconnect connection1;
|
||||
|
|
|
@ -9,3 +9,4 @@ show engines;
|
|||
show variables;
|
||||
--echo ===== STOP =====
|
||||
--enable_query_log
|
||||
exit;
|
|
@ -1,10 +1,8 @@
|
|||
--echo **** Resetting master and slave ****
|
||||
connection slave;
|
||||
STOP SLAVE;
|
||||
source include/wait_for_slave_to_stop.inc;
|
||||
source include/stop_slave.inc;
|
||||
RESET SLAVE;
|
||||
connection master;
|
||||
RESET MASTER;
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
source include/wait_for_slave_to_start.inc;
|
||||
source include/start_slave.inc;
|
||||
|
|
25
mysql-test/include/restart_mysqld.inc
Normal file
25
mysql-test/include/restart_mysqld.inc
Normal file
|
@ -0,0 +1,25 @@
|
|||
|
||||
# Write file to make mysql-test-run.pl expect the "crash", but don't start
|
||||
# it until it's told to
|
||||
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
wait
|
||||
EOF
|
||||
|
||||
# Send shutdown to the connected server and give
|
||||
# it 10 seconds to die before zapping it
|
||||
shutdown_server 10;
|
||||
|
||||
# Write file to make mysql-test-run.pl start up the server again
|
||||
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
restart
|
||||
EOF
|
||||
|
||||
# Turn on reconnect
|
||||
--enable_reconnect
|
||||
|
||||
# Call script that will poll the server waiting for it to be back online again
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
# Turn off reconnect again
|
||||
--disable_reconnect
|
||||
|
|
@ -62,7 +62,9 @@ SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name
|
|||
DROP EVENT IF EXISTS test.slave_once;
|
||||
--enable_warnings
|
||||
|
||||
CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO
|
||||
# Create an event on slave and check its state. An event shouldn't be executed
|
||||
# so set start time in 1 hour.
|
||||
CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
|
||||
INSERT IGNORE INTO t1(id, c) VALUES (3, 'from slave_once');
|
||||
|
||||
--echo "Checking event status on the slave for originator value = slave's server_id"
|
||||
|
@ -81,8 +83,11 @@ connection master;
|
|||
DROP EVENT IF EXISTS test.justonce;
|
||||
--enable_warnings
|
||||
|
||||
# Create an event on master and check its state on slave. An event shouldn't be executed
|
||||
# so set start time in 1 hour. Check that changes of event statement replicated to slave
|
||||
|
||||
--echo "Creating event test.er on the master"
|
||||
CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO
|
||||
CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
|
||||
INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er');
|
||||
|
||||
--echo "Checking event status on the master"
|
||||
|
@ -95,7 +100,7 @@ SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND
|
|||
|
||||
connection master;
|
||||
--echo "Altering event test.er on the master"
|
||||
ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO
|
||||
ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
|
||||
INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er');
|
||||
|
||||
--echo "Checking event status on the master"
|
||||
|
@ -123,8 +128,11 @@ SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
|
|||
# test the DISABLE ON SLAVE for setting event SLAVESIDE_DISABLED as status
|
||||
# on CREATE EVENT
|
||||
|
||||
# Create an event on slave and check its status. An event shouldn't be executed
|
||||
# so set start time in 1 hour.
|
||||
|
||||
--echo "Creating event test.slave_terminate on the slave"
|
||||
CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND DO
|
||||
CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
|
||||
INSERT IGNORE INTO t1(id, c) VALUES (6, 'from slave_terminate');
|
||||
|
||||
--echo "Checking event status on the slave"
|
||||
|
|
|
@ -9,7 +9,7 @@ select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
|
|||
sync_slave_with_master;
|
||||
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
|
||||
connection master;
|
||||
DELETE FROM mysqltest1.t1 WHERE id = 42;
|
||||
DELETE FROM t1 WHERE id = 42;
|
||||
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
|
||||
sync_slave_with_master;
|
||||
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue