Commit 09271b1e authored by Mats Kindahl's avatar Mats Kindahl

Merging with 5.1-rpl

parents 5cd9d96a 5e4d34d7
...@@ -92,7 +92,8 @@ mysqltest_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \ ...@@ -92,7 +92,8 @@ mysqltest_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
@CLIENT_EXTRA_LDFLAGS@ \ @CLIENT_EXTRA_LDFLAGS@ \
$(LIBMYSQLCLIENT_LA) \ $(LIBMYSQLCLIENT_LA) \
$(top_builddir)/mysys/libmysys.a \ $(top_builddir)/mysys/libmysys.a \
$(top_builddir)/regex/libregex.a $(top_builddir)/regex/libregex.a \
$(CLIENT_THREAD_LIBS)
mysql_upgrade_SOURCES= mysql_upgrade.c \ mysql_upgrade_SOURCES= mysql_upgrade.c \
$(top_srcdir)/mysys/my_getpagesize.c $(top_srcdir)/mysys/my_getpagesize.c
......
...@@ -269,6 +269,10 @@ get_one_option(int optid, const struct my_option *opt, ...@@ -269,6 +269,10 @@ get_one_option(int optid, const struct my_option *opt,
} }
/**
Run a command using the shell, storing its output in the supplied dynamic
string.
*/
static int run_command(char* cmd, static int run_command(char* cmd,
DYNAMIC_STRING *ds_res) DYNAMIC_STRING *ds_res)
{ {
...@@ -341,37 +345,15 @@ static int run_tool(char *tool_path, DYNAMIC_STRING *ds_res, ...) ...@@ -341,37 +345,15 @@ static int run_tool(char *tool_path, DYNAMIC_STRING *ds_res, ...)
} }
/* /**
Try to get the full path to this exceutable Look for the filename of given tool, with the presumption that it is in the
same directory as mysql_upgrade and that the same executable-searching
Return 0 if path found mechanism will be used when we run our sub-shells with popen() later.
*/ */
static void find_tool(char *tool_executable_name, const char *tool_name,
static my_bool get_full_path_to_executable(char* path) const char *self_name)
{ {
my_bool ret; char *last_fn_libchar;
DBUG_ENTER("get_full_path_to_executable");
#ifdef __WIN__
ret= (GetModuleFileName(NULL, path, FN_REFLEN) == 0);
#else
/* my_readlink returns 0 if a symlink was read */
ret= (my_readlink(path, "/proc/self/exe", MYF(0)) != 0);
/* Might also want to try with /proc/$$/exe if the above fails */
#endif
DBUG_PRINT("exit", ("path: %s", path));
DBUG_RETURN(ret);
}
/*
Look for the tool in the same directory as mysql_upgrade.
*/
static void find_tool(char *tool_path, const char *tool_name)
{
size_t path_len;
char path[FN_REFLEN];
DYNAMIC_STRING ds_tmp; DYNAMIC_STRING ds_tmp;
DBUG_ENTER("find_tool"); DBUG_ENTER("find_tool");
DBUG_PRINT("enter", ("progname: %s", my_progname)); DBUG_PRINT("enter", ("progname: %s", my_progname));
...@@ -379,36 +361,24 @@ static void find_tool(char *tool_path, const char *tool_name) ...@@ -379,36 +361,24 @@ static void find_tool(char *tool_path, const char *tool_name)
if (init_dynamic_string(&ds_tmp, "", 32, 32)) if (init_dynamic_string(&ds_tmp, "", 32, 32))
die("Out of memory"); die("Out of memory");
/* Initialize path with the full path to this program */ last_fn_libchar= strrchr(self_name, FN_LIBCHAR);
if (get_full_path_to_executable(path))
if (last_fn_libchar == NULL)
{ {
/* /*
Easy way to get full executable path failed, try mysql_upgrade was found by the shell searching the path. A sibling
other methods next to us should be found the same way.
*/ */
if (my_progname[0] == FN_LIBCHAR) strncpy(tool_executable_name, tool_name, FN_REFLEN);
{
/* 1. my_progname contains full path */
strmake(path, my_progname, FN_REFLEN);
}
else if (my_progname[0] == '.')
{
/* 2. my_progname contains relative path, prepend wd */
char buf[FN_REFLEN];
my_getwd(buf, FN_REFLEN, MYF(0));
my_snprintf(path, FN_REFLEN, "%s%s", buf, my_progname);
} }
else else
{ {
/* 3. Just go for it and hope tool is in path */ int len;
path[0]= 0;
}
}
DBUG_PRINT("info", ("path: '%s'", path)); /*
mysql_upgrade was run absolutely or relatively. We can find a sibling
/* Chop off binary name (i.e mysql-upgrade) from path */ by replacing our name after the LIBCHAR with the new tool name.
dirname_part(path, path, &path_len); */
/* /*
When running in a not yet installed build and using libtool, When running in a not yet installed build and using libtool,
...@@ -418,38 +388,32 @@ static void find_tool(char *tool_path, const char *tool_name) ...@@ -418,38 +388,32 @@ static void find_tool(char *tool_path, const char *tool_name)
mysqlcheck). Thus if path ends in .libs/, step up one directory mysqlcheck). Thus if path ends in .libs/, step up one directory
and execute the tools from there and execute the tools from there
*/ */
path[max(path_len-1, 0)]= 0; /* Chop off last / */ if (((last_fn_libchar - 6) >= self_name) &&
if (strncmp(path + dirname_length(path), ".libs", 5) == 0) (strncmp(last_fn_libchar - 5, ".libs", 5) == 0) &&
(*(last_fn_libchar - 6) == FN_LIBCHAR))
{ {
DBUG_PRINT("info", ("Chopping off .libs from '%s'", path)); DBUG_PRINT("info", ("Chopping off \".libs\" from end of path"));
last_fn_libchar -= 6;
/* Chop off .libs */
dirname_part(path, path, &path_len);
} }
len= last_fn_libchar - self_name;
DBUG_PRINT("info", ("path: '%s'", path)); my_snprintf(tool_executable_name, FN_REFLEN, "%.*s%c%s",
len, self_name, FN_LIBCHAR, tool_name);
/* Format name of the tool to search for */ }
fn_format(tool_path, tool_name,
path, "", MYF(MY_REPLACE_DIR));
verbose("Looking for '%s' in: %s", tool_name, tool_path);
/* Make sure the tool exists */ verbose("Looking for '%s' as: %s", tool_name, tool_executable_name);
if (my_access(tool_path, F_OK) != 0)
die("Can't find '%s'", tool_path);
/* /*
Make sure it can be executed Make sure it can be executed
*/ */
if (run_tool(tool_path, if (run_tool(tool_executable_name,
&ds_tmp, /* Get output from command, discard*/ &ds_tmp, /* Get output from command, discard*/
"--help", "--help",
"2>&1", "2>&1",
IF_WIN("> NUL", "> /dev/null"), IF_WIN("> NUL", "> /dev/null"),
NULL)) NULL))
die("Can't execute '%s'", tool_path); die("Can't execute '%s'", tool_executable_name);
dynstr_free(&ds_tmp); dynstr_free(&ds_tmp);
...@@ -759,11 +723,20 @@ static const char *load_default_groups[]= ...@@ -759,11 +723,20 @@ static const char *load_default_groups[]=
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
char self_name[FN_REFLEN];
MY_INIT(argv[0]); MY_INIT(argv[0]);
#ifdef __NETWARE__ #ifdef __NETWARE__
setscreenmode(SCR_AUTOCLOSE_ON_EXIT); setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
#endif #endif
#if __WIN__
if (GetModuleFileName(NULL, self_name, FN_REFLEN) == 0)
#endif
{
strncpy(self_name, argv[0], FN_REFLEN);
}
if (init_dynamic_string(&ds_args, "", 512, 256)) if (init_dynamic_string(&ds_args, "", 512, 256))
die("Out of memory"); die("Out of memory");
...@@ -789,10 +762,10 @@ int main(int argc, char **argv) ...@@ -789,10 +762,10 @@ int main(int argc, char **argv)
dynstr_append(&ds_args, " "); dynstr_append(&ds_args, " ");
/* Find mysql */ /* Find mysql */
find_tool(mysql_path, IF_WIN("mysql.exe", "mysql")); find_tool(mysql_path, IF_WIN("mysql.exe", "mysql"), self_name);
/* Find mysqlcheck */ /* Find mysqlcheck */
find_tool(mysqlcheck_path, IF_WIN("mysqlcheck.exe", "mysqlcheck")); find_tool(mysqlcheck_path, IF_WIN("mysqlcheck.exe", "mysqlcheck"), self_name);
/* /*
Read the mysql_upgrade_info file to check if mysql_upgrade Read the mysql_upgrade_info file to check if mysql_upgrade
......
...@@ -343,8 +343,8 @@ case $default_charset in ...@@ -343,8 +343,8 @@ case $default_charset in
default_charset_default_collation="ucs2_general_ci" default_charset_default_collation="ucs2_general_ci"
define(UCSC1, ucs2_general_ci ucs2_bin) define(UCSC1, ucs2_general_ci ucs2_bin)
define(UCSC2, ucs2_czech_ci ucs2_danish_ci) define(UCSC2, ucs2_czech_ci ucs2_danish_ci)
define(UCSC3, ucs2_esperanto_ci ucs2_estonian_ci ucs2_icelandic_ci) define(UCSC3, ucs2_esperanto_ci ucs2_estonian_ci ucs2_hungarian_ci)
define(UCSC4, ucs2_latvian_ci ucs2_lithuanian_ci) define(UCSC4, ucs2_icelandic_ci ucs2_latvian_ci ucs2_lithuanian_ci)
define(UCSC5, ucs2_persian_ci ucs2_polish_ci ucs2_romanian_ci) define(UCSC5, ucs2_persian_ci ucs2_polish_ci ucs2_romanian_ci)
define(UCSC6, ucs2_slovak_ci ucs2_slovenian_ci) define(UCSC6, ucs2_slovak_ci ucs2_slovenian_ci)
define(UCSC7, ucs2_spanish2_ci ucs2_spanish_ci) define(UCSC7, ucs2_spanish2_ci ucs2_spanish_ci)
...@@ -367,8 +367,8 @@ case $default_charset in ...@@ -367,8 +367,8 @@ case $default_charset in
else else
define(UTFC1, utf8_general_ci utf8_bin) define(UTFC1, utf8_general_ci utf8_bin)
define(UTFC2, utf8_czech_ci utf8_danish_ci) define(UTFC2, utf8_czech_ci utf8_danish_ci)
define(UTFC3, utf8_esperanto_ci utf8_estonian_ci utf8_icelandic_ci) define(UTFC3, utf8_esperanto_ci utf8_estonian_ci utf8_hungarian_ci)
define(UTFC4, utf8_latvian_ci utf8_lithuanian_ci) define(UTFC4, utf8_icelandic_ci utf8_latvian_ci utf8_lithuanian_ci)
define(UTFC5, utf8_persian_ci utf8_polish_ci utf8_romanian_ci) define(UTFC5, utf8_persian_ci utf8_polish_ci utf8_romanian_ci)
define(UTFC6, utf8_slovak_ci utf8_slovenian_ci) define(UTFC6, utf8_slovak_ci utf8_slovenian_ci)
define(UTFC7, utf8_spanish2_ci utf8_spanish_ci) define(UTFC7, utf8_spanish2_ci utf8_spanish_ci)
......
# Test of binlogging of INSERT_ID with INSERT DELAYED # ==== Purpose ====
#
# Verify that INSERT DELAYED in mixed or row mode writes events to the
# binlog, and that AUTO_INCREMENT works correctly.
#
# ==== Method ====
#
# Insert both single and multiple rows into an autoincrement column,
# both with specified value and with NULL.
#
# With INSERT DELAYED, the rows do not show up in the table
# immediately, so we must do source include/wait_until_rows_count.inc
# between any two INSERT DELAYED statements. Moreover, if mixed or
# row-based logging is used, there is also a delay between when rows
# show up in the table and when they show up in the binlog. To ensure
# that the rows show up in the binlog, we call FLUSH TABLES, which
# waits until the delayed_insert thread has finished.
#
# We cannot read the binlog after executing INSERT DELAYED statements
# that insert multiple rows, because that is nondeterministic. More
# precisely, rows may be written in batches to the binlog, where each
# batch has one Table_map_log_event and one or more
# Write_rows_log_event. The number of rows included in each batch is
# nondeterministic.
#
# ==== Related bugs ====
#
# BUG#20627: INSERT DELAYED does not honour auto_increment_* variables
# Bug in this test: BUG#38068: binlog_stm_binlog fails sporadically in pushbuild
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
# First, avoid BUG#20627:
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
# Verify that only one INSERT_ID event is binlogged.
# Note, that because of WL#3368 mixed mode binlog records RBR events for the delayed
let $table=t1;
let $rows_inserted=11; # total number of inserted rows in this test
insert delayed into t1 values (207);
let $count=1;
# use this macro instead of sleeps. let $table=t1;
let $count=0;
insert delayed into t1 values (207);
inc $count;
--source include/wait_until_rows_count.inc --source include/wait_until_rows_count.inc
insert delayed into t1 values (null); insert delayed into t1 values (null);
inc $count; inc $count;
--source include/wait_until_rows_count.inc --source include/wait_until_rows_count.inc
...@@ -20,9 +46,10 @@ insert delayed into t1 values (300); ...@@ -20,9 +46,10 @@ insert delayed into t1 values (300);
inc $count; inc $count;
--source include/wait_until_rows_count.inc --source include/wait_until_rows_count.inc
# moving binlog check affront of multi-rows queries which work is indeterministic (extra table_maps) # It is not enough to wait until all rows have been inserted into the
# todo: better check is to substitute SHOW BINLOG with reading from binlog, probably bug#19459 is in # table. FLUSH TABLES ensures that they are in the binlog too. See
# the way # comment above.
FLUSH TABLES;
source include/show_binlog_events.inc; source include/show_binlog_events.inc;
insert delayed into t1 values (null),(null),(null),(null); insert delayed into t1 values (null),(null),(null),(null);
...@@ -33,8 +60,5 @@ insert delayed into t1 values (null),(null),(400),(null); ...@@ -33,8 +60,5 @@ insert delayed into t1 values (null),(null),(400),(null);
inc $count; inc $count; inc $count; inc $count; inc $count; inc $count; inc $count; inc $count;
--source include/wait_until_rows_count.inc --source include/wait_until_rows_count.inc
#check this assertion about $count calculation
--echo $count == $rows_inserted
select * from t1; select * from t1;
drop table t1; drop table t1;
...@@ -309,51 +309,52 @@ sync_slave_with_master; ...@@ -309,51 +309,52 @@ sync_slave_with_master;
# 7. Replicating UTF-8 CHAR(255) to CHAR(255) UTF-8 # 7. Replicating UTF-8 CHAR(255) to CHAR(255) UTF-8
connection master; connection master;
CREATE TABLE t1 (i INT NOT NULL, eval CREATE TABLE t1 (i INT NOT NULL,
c CHAR(16) CHARACTER SET utf8 NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL); j INT NOT NULL) ENGINE = $type ;
CREATE TABLE t2 (i INT NOT NULL, eval CREATE TABLE t2 (i INT NOT NULL,
c CHAR(16) CHARACTER SET utf8 NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL); j INT NOT NULL) ENGINE = $type ;
sync_slave_with_master; sync_slave_with_master;
ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
connection master; connection master;
CREATE TABLE t3 (i INT NOT NULL, eval CREATE TABLE t3 (i INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL); j INT NOT NULL) ENGINE = $type ;
sync_slave_with_master; sync_slave_with_master;
ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
connection master; connection master;
CREATE TABLE t4 (i INT NOT NULL, eval CREATE TABLE t4 (i INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL); j INT NOT NULL) ENGINE = $type ;
CREATE TABLE t5 (i INT NOT NULL, eval CREATE TABLE t5 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL); j INT NOT NULL) ENGINE = $type ;
sync_slave_with_master; sync_slave_with_master;
ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
connection master; connection master;
CREATE TABLE t6 (i INT NOT NULL, eval CREATE TABLE t6 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL); j INT NOT NULL) ENGINE = $type ;
sync_slave_with_master; sync_slave_with_master;
ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
connection master; connection master;
CREATE TABLE t7 (i INT NOT NULL, eval CREATE TABLE t7 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL); j INT NOT NULL) ENGINE = $type ;
--echo [expecting slave to replicate correctly] --echo [expecting slave to replicate correctly]
connection master; connection master;
INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (1, "", 1);
INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
sync_slave_with_master;
let $diff_table_1=master:test.t1; let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1; let $diff_table_2=slave:test.t1;
...@@ -363,6 +364,7 @@ source include/diff_tables.inc; ...@@ -363,6 +364,7 @@ source include/diff_tables.inc;
connection master; connection master;
INSERT INTO t2 VALUES (1, "", 1); INSERT INTO t2 VALUES (1, "", 1);
INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
sync_slave_with_master;
let $diff_table_1=master:test.t2; let $diff_table_1=master:test.t2;
let $diff_table_2=slave:test.t2; let $diff_table_2=slave:test.t2;
...@@ -379,7 +381,11 @@ let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); ...@@ -379,7 +381,11 @@ let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
disable_query_log; disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error; eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log; enable_query_log;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; connection master;
RESET MASTER;
connection slave;
STOP SLAVE;
RESET SLAVE;
START SLAVE; START SLAVE;
source include/wait_for_slave_to_start.inc; source include/wait_for_slave_to_start.inc;
...@@ -387,6 +393,7 @@ source include/wait_for_slave_to_start.inc; ...@@ -387,6 +393,7 @@ source include/wait_for_slave_to_start.inc;
connection master; connection master;
INSERT INTO t4 VALUES (1, "", 1); INSERT INTO t4 VALUES (1, "", 1);
INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2); INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
sync_slave_with_master;
let $diff_table_1=master:test.t4; let $diff_table_1=master:test.t4;
let $diff_table_2=slave:test.t4; let $diff_table_2=slave:test.t4;
...@@ -403,7 +410,11 @@ let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); ...@@ -403,7 +410,11 @@ let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
disable_query_log; disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error; eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log; enable_query_log;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; connection master;
RESET MASTER;
connection slave;
STOP SLAVE;
RESET SLAVE;
START SLAVE; START SLAVE;
source include/wait_for_slave_to_start.inc; source include/wait_for_slave_to_start.inc;
...@@ -418,7 +429,11 @@ let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); ...@@ -418,7 +429,11 @@ let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
disable_query_log; disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error; eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log; enable_query_log;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; connection master;
RESET MASTER;
connection slave;
STOP SLAVE;
RESET SLAVE;
START SLAVE; START SLAVE;
source include/wait_for_slave_to_start.inc; source include/wait_for_slave_to_start.inc;
...@@ -426,6 +441,7 @@ source include/wait_for_slave_to_start.inc; ...@@ -426,6 +441,7 @@ source include/wait_for_slave_to_start.inc;
connection master; connection master;
INSERT INTO t7 VALUES (1, "", 1); INSERT INTO t7 VALUES (1, "", 1);
INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2); INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
sync_slave_with_master;
let $diff_table_1=master:test.t7; let $diff_table_1=master:test.t7;
let $diff_table_2=slave:test.t7; let $diff_table_2=slave:test.t7;
......
...@@ -4,7 +4,7 @@ if (!$binlog_start) ...@@ -4,7 +4,7 @@ if (!$binlog_start)
{ {
let $binlog_start=106; let $binlog_start=106;
} }
--replace_result $binlog_start <binlog_start> --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start <binlog_start>
--replace_column 2 # 4 # 5 # --replace_column 2 # 4 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/ --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/
--eval show binlog events from $binlog_start --eval show binlog events from $binlog_start
...@@ -131,3 +131,49 @@ drop table t1; ...@@ -131,3 +131,49 @@ drop table t1;
select if(0, 18446744073709551610, 18446744073709551610); select if(0, 18446744073709551610, 18446744073709551610);
if(0, 18446744073709551610, 18446744073709551610) if(0, 18446744073709551610, 18446744073709551610)
18446744073709551610 18446744073709551610
CREATE TABLE t1(a DECIMAL(10,3));
SELECT t1.a,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,0)))))))))))))))))))))))))))))) + 1
FROM t1;
a IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((R
DROP TABLE t1;
End of 5.0 tests
drop table if exists t1;
create table t1(a int not null auto_increment primary key) engine=innodb;
insert into t1 set a = -1;
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
SET storage_engine=InnoDB;
...@@ -4398,4 +4398,15 @@ INSERT INTO t1 VALUES (1), (3); ...@@ -4398,4 +4398,15 @@ INSERT INTO t1 VALUES (1), (3);
SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10); SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10);
a b a b
DROP TABLE t1,t2; DROP TABLE t1,t2;
End of 5.0 tests. CREATE TABLE t1(pk int PRIMARY KEY, a int, INDEX idx(a));
INSERT INTO t1 VALUES (1, 10), (3, 30), (2, 20);
CREATE TABLE t2(pk int PRIMARY KEY, a int, b int, INDEX idxa(a));
INSERT INTO t2 VALUES (2, 20, 700), (1, 10, 200), (4, 10, 100);
SELECT * FROM t1
WHERE EXISTS (SELECT DISTINCT a FROM t2 WHERE t1.a < t2.a ORDER BY b);
pk a
1 10
3 30
2 20
DROP TABLE t1,t2;
End of 5.1 tests.
...@@ -18,7 +18,7 @@ load data infile '../../std_data/rpl_loaddata.dat' into table t2 /* will be "kil ...@@ -18,7 +18,7 @@ load data infile '../../std_data/rpl_loaddata.dat' into table t2 /* will be "kil
ERROR 70100: Query execution was interrupted ERROR 70100: Query execution was interrupted
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12 master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */ ;file_id=# master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */ ;file_id=#
select select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) (@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
......
...@@ -1141,10 +1141,10 @@ master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F ...@@ -1141,10 +1141,10 @@ master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `mysql`; COMMIT master-bin.000001 # Query # # use `mysql`; COMMIT
drop table t1,t2,t3,tt1; drop table t1,t2,t3,tt1;
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
insert delayed into t1 values (207); insert delayed into t1 values (207);
insert delayed into t1 values (null); insert delayed into t1 values (null);
insert delayed into t1 values (300); insert delayed into t1 values (300);
FLUSH TABLES;
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key)
...@@ -1188,9 +1188,9 @@ master-bin.000001 # Query # # use `test`; BEGIN ...@@ -1188,9 +1188,9 @@ master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; COMMIT master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; FLUSH TABLES
insert delayed into t1 values (null),(null),(null),(null); insert delayed into t1 values (null),(null),(null),(null);
insert delayed into t1 values (null),(null),(400),(null); insert delayed into t1 values (null),(null),(400),(null);
11 == 11
select * from t1; select * from t1;
a a
207 207
......
...@@ -926,7 +926,7 @@ Log_name Pos Event_type Server_id End_log_pos Info ...@@ -926,7 +926,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12 master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=# master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
......
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
insert delayed into t1 values (207); insert delayed into t1 values (207);
insert delayed into t1 values (null); insert delayed into t1 values (null);
insert delayed into t1 values (300); insert delayed into t1 values (300);
FLUSH TABLES;
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
...@@ -10,9 +10,9 @@ master-bin.000001 # Query # # use `test`; insert delayed into t1 values (207) ...@@ -10,9 +10,9 @@ master-bin.000001 # Query # # use `test`; insert delayed into t1 values (207)
master-bin.000001 # Intvar # # INSERT_ID=208 master-bin.000001 # Intvar # # INSERT_ID=208
master-bin.000001 # Query # # use `test`; insert delayed into t1 values (null) master-bin.000001 # Query # # use `test`; insert delayed into t1 values (null)
master-bin.000001 # Query # # use `test`; insert delayed into t1 values (300) master-bin.000001 # Query # # use `test`; insert delayed into t1 values (300)
master-bin.000001 # Query # # use `test`; FLUSH TABLES
insert delayed into t1 values (null),(null),(null),(null); insert delayed into t1 values (null),(null),(null),(null);
insert delayed into t1 values (null),(null),(400),(null); insert delayed into t1 values (null),(null),(400),(null);
11 == 11
select * from t1; select * from t1;
a a
207 207
......
...@@ -629,10 +629,10 @@ master-bin.000001 # Query # # use `mysql`; UPDATE user SET password=password('An ...@@ -629,10 +629,10 @@ master-bin.000001 # Query # # use `mysql`; UPDATE user SET password=password('An
master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@' master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@'
drop table t1,t2,t3,tt1; drop table t1,t2,t3,tt1;
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
insert delayed into t1 values (207); insert delayed into t1 values (207);
insert delayed into t1 values (null); insert delayed into t1 values (null);
insert delayed into t1 values (300); insert delayed into t1 values (300);
FLUSH TABLES;
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key)
...@@ -660,9 +660,9 @@ master-bin.000001 # Query # # use `test`; BEGIN ...@@ -660,9 +660,9 @@ master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; COMMIT master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; FLUSH TABLES
insert delayed into t1 values (null),(null),(null),(null); insert delayed into t1 values (null),(null),(null),(null);
insert delayed into t1 values (null),(null),(400),(null); insert delayed into t1 values (null),(null),(400),(null);
11 == 11
select * from t1; select * from t1;
a a
207 207
......
...@@ -623,7 +623,7 @@ show binlog events from <binlog_start>; ...@@ -623,7 +623,7 @@ show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12 master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=# master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
master-bin.000001 # Query # # use `test`; ROLLBACK master-bin.000001 # Query # # use `test`; ROLLBACK
...@@ -858,7 +858,7 @@ Log_name Pos Event_type Server_id End_log_pos Info ...@@ -858,7 +858,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12 master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=# master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
......
...@@ -13,12 +13,7 @@ ...@@ -13,12 +13,7 @@
USE test; USE test;
--source suite/funcs_1/include/tb3.inc --source suite/funcs_1/include/tb3.inc
# This test cannot be used for the embedded server because we check here
# privilgeges.
--source include/not_embedded.inc
USE test;
--source suite/funcs_1/include/tb3.inc
--disable_abort_on_error --disable_abort_on_error
......
...@@ -8,8 +8,7 @@ ...@@ -8,8 +8,7 @@
USE test; USE test;
--source suite/funcs_1/include/tb3.inc --source suite/funcs_1/include/tb3.inc
USE test;
--source suite/funcs_1/include/tb3.inc
# General setup for Trigger tests # General setup for Trigger tests
let $message= Testcase: 3.5:; let $message= Testcase: 3.5:;
......
...@@ -13,13 +13,6 @@ eval ...@@ -13,13 +13,6 @@ eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb3.txt' load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3; into table tb3;
USE test;
--source suite/funcs_1/include/tb3.inc
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
--disable_abort_on_error --disable_abort_on_error
......
...@@ -4,6 +4,8 @@ reset master; ...@@ -4,6 +4,8 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
==== Create a big file ====
==== Load our big file into a table ====
create table t2 (id int not null primary key auto_increment); create table t2 (id int not null primary key auto_increment);
select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ; select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ;
@@session.read_buffer_size - @@session.max_allowed_packet > 0 @@session.read_buffer_size - @@session.max_allowed_packet > 0
...@@ -12,15 +14,18 @@ load data infile 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2; ...@@ -12,15 +14,18 @@ load data infile 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2;
select count(*) from t2 /* 5 000 */; select count(*) from t2 /* 5 000 */;
count(*) count(*)
5000 5000
show binlog events in 'master-bin.000002' from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000002 # Query # # use `test`; create table t2 (id int not null primary key auto_increment) master-bin.000001 # Query # # use `test`; create table t2 (id int not null primary key auto_increment)
master-bin.000002 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000002 # Append_block # # ;file_id=#;block_len=# master-bin.000001 # Append_block # # ;file_id=#;block_len=#
master-bin.000002 # Append_block # # ;file_id=#;block_len=# master-bin.000001 # Append_block # # ;file_id=#;block_len=#
master-bin.000002 # Execute_load_query # # use `test`; load data infile 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2 ;file_id=# master-bin.000001 # Execute_load_query # # use `test`; load data infile 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2 ;file_id=#
==== Verify results on slave ====
[on slave]
select count(*) from t2 /* 5 000 */; select count(*) from t2 /* 5 000 */;
count(*) count(*)
5000 5000
drop table t1, t2; ==== Clean up ====
end of the tests [on master]
drop table t2;
...@@ -453,29 +453,29 @@ a b c ...@@ -453,29 +453,29 @@ a b c
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
CREATE TABLE t1 (i INT NOT NULL, CREATE TABLE t1 (i INT NOT NULL,
c CHAR(16) CHARACTER SET utf8 NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL); j INT NOT NULL) ENGINE = 'MYISAM' ;
CREATE TABLE t2 (i INT NOT NULL, CREATE TABLE t2 (i INT NOT NULL,
c CHAR(16) CHARACTER SET utf8 NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL); j INT NOT NULL) ENGINE = 'MYISAM' ;
ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
CREATE TABLE t3 (i INT NOT NULL, CREATE TABLE t3 (i INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL); j INT NOT NULL) ENGINE = 'MYISAM' ;
ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
CREATE TABLE t4 (i INT NOT NULL, CREATE TABLE t4 (i INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL); j INT NOT NULL) ENGINE = 'MYISAM' ;
CREATE TABLE t5 (i INT NOT NULL, CREATE TABLE t5 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL); j INT NOT NULL) ENGINE = 'MYISAM' ;
ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
CREATE TABLE t6 (i INT NOT NULL, CREATE TABLE t6 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL); j INT NOT NULL) ENGINE = 'MYISAM' ;
ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
CREATE TABLE t7 (i INT NOT NULL, CREATE TABLE t7 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL); j INT NOT NULL) ENGINE = 'MYISAM' ;
[expecting slave to replicate correctly] [expecting slave to replicate correctly]
INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (1, "", 1);
INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
...@@ -489,7 +489,9 @@ INSERT INTO t3 VALUES (1, "", 1); ...@@ -489,7 +489,9 @@ INSERT INTO t3 VALUES (1, "", 1);
INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2);
Last_SQL_Error Last_SQL_Error
Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size. Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size.
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; RESET MASTER;
STOP SLAVE;
RESET SLAVE;
START SLAVE; START SLAVE;
[expecting slave to replicate correctly] [expecting slave to replicate correctly]
INSERT INTO t4 VALUES (1, "", 1); INSERT INTO t4 VALUES (1, "", 1);
...@@ -500,14 +502,18 @@ INSERT INTO t5 VALUES (1, "", 1); ...@@ -500,14 +502,18 @@ INSERT INTO t5 VALUES (1, "", 1);
INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
Last_SQL_Error Last_SQL_Error
Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size. Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size.
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; RESET MASTER;
STOP SLAVE;
RESET SLAVE;
START SLAVE; START SLAVE;
[expecting slave to stop] [expecting slave to stop]
INSERT INTO t6 VALUES (1, "", 1); INSERT INTO t6 VALUES (1, "", 1);
INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
Last_SQL_Error Last_SQL_Error
Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size. Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size.
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; RESET MASTER;
STOP SLAVE;
RESET SLAVE;
START SLAVE; START SLAVE;
[expecting slave to replicate correctly] [expecting slave to replicate correctly]
INSERT INTO t7 VALUES (1, "", 1); INSERT INTO t7 VALUES (1, "", 1);
......
...@@ -453,29 +453,29 @@ a b c ...@@ -453,29 +453,29 @@ a b c
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
CREATE TABLE t1 (i INT NOT NULL, CREATE TABLE t1 (i INT NOT NULL,
c CHAR(16) CHARACTER SET utf8 NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL); j INT NOT NULL) ENGINE = 'INNODB' ;
CREATE TABLE t2 (i INT NOT NULL, CREATE TABLE t2 (i INT NOT NULL,
c CHAR(16) CHARACTER SET utf8 NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL); j INT NOT NULL) ENGINE = 'INNODB' ;
ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
CREATE TABLE t3 (i INT NOT NULL, CREATE TABLE t3 (i INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL); j INT NOT NULL) ENGINE = 'INNODB' ;
ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
CREATE TABLE t4 (i INT NOT NULL, CREATE TABLE t4 (i INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL); j INT NOT NULL) ENGINE = 'INNODB' ;
CREATE TABLE t5 (i INT NOT NULL, CREATE TABLE t5 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL); j INT NOT NULL) ENGINE = 'INNODB' ;
ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
CREATE TABLE t6 (i INT NOT NULL, CREATE TABLE t6 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL); j INT NOT NULL) ENGINE = 'INNODB' ;
ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
CREATE TABLE t7 (i INT NOT NULL, CREATE TABLE t7 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL); j INT NOT NULL) ENGINE = 'INNODB' ;
[expecting slave to replicate correctly] [expecting slave to replicate correctly]
INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (1, "", 1);
INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
...@@ -489,7 +489,9 @@ INSERT INTO t3 VALUES (1, "", 1); ...@@ -489,7 +489,9 @@ INSERT INTO t3 VALUES (1, "", 1);
INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2);
Last_SQL_Error Last_SQL_Error
Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size. Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size.
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; RESET MASTER;
STOP SLAVE;
RESET SLAVE;
START SLAVE; START SLAVE;
[expecting slave to replicate correctly] [expecting slave to replicate correctly]
INSERT INTO t4 VALUES (1, "", 1); INSERT INTO t4 VALUES (1, "", 1);
...@@ -500,14 +502,18 @@ INSERT INTO t5 VALUES (1, "", 1); ...@@ -500,14 +502,18 @@ INSERT INTO t5 VALUES (1, "", 1);
INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
Last_SQL_Error Last_SQL_Error
Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size. Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size.
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; RESET MASTER;
STOP SLAVE;
RESET SLAVE;
START SLAVE; START SLAVE;
[expecting slave to stop] [expecting slave to stop]
INSERT INTO t6 VALUES (1, "", 1); INSERT INTO t6 VALUES (1, "", 1);
INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
Last_SQL_Error Last_SQL_Error
Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size. Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size.
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; RESET MASTER;
STOP SLAVE;
RESET SLAVE;
START SLAVE; START SLAVE;
[expecting slave to replicate correctly] [expecting slave to replicate correctly]
INSERT INTO t7 VALUES (1, "", 1); INSERT INTO t7 VALUES (1, "", 1);
......
...@@ -193,7 +193,7 @@ master-bin.000001 # Intvar # # INSERT_ID=1 ...@@ -193,7 +193,7 @@ master-bin.000001 # Intvar # # INSERT_ID=1
master-bin.000001 # Query # # use `test`; insert into t1 values (NULL) master-bin.000001 # Query # # use `test`; insert into t1 values (NULL)
master-bin.000001 # Query # # use `test`; drop table t1 master-bin.000001 # Query # # use `test`; drop table t1
master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=581 master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/words.dat' into table t1 ignore 1 lines ;file_id=# master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/words.dat' into table t1 ignore 1 lines ;file_id=#
master-bin.000001 # Rotate # # master-bin.000002;pos=4 master-bin.000001 # Rotate # # master-bin.000002;pos=4
show binlog events in 'master-bin.000002'; show binlog events in 'master-bin.000002';
......
...@@ -45,7 +45,7 @@ RESET SLAVE; ...@@ -45,7 +45,7 @@ RESET SLAVE;
RESET MASTER; RESET MASTER;
include/start_slave.inc include/start_slave.inc
[on slave] [on slave]
SET @@global.init_slave = 'ant'; SET @@global.init_slave = 'SELECT 1';
[on master] [on master]
CREATE TABLE tstmt (id INT AUTO_INCREMENT PRIMARY KEY, CREATE TABLE tstmt (id INT AUTO_INCREMENT PRIMARY KEY,
truth BOOLEAN, truth BOOLEAN,
...@@ -66,9 +66,9 @@ SET @@global.sync_binlog = 2000000; ...@@ -66,9 +66,9 @@ SET @@global.sync_binlog = 2000000;
INSERT INTO tstmt(num) VALUES (@@global.sync_binlog); INSERT INTO tstmt(num) VALUES (@@global.sync_binlog);
SET @@global.sync_binlog = 3000000; SET @@global.sync_binlog = 3000000;
INSERT INTO tstmt(num) VALUES (@@global.sync_binlog); INSERT INTO tstmt(num) VALUES (@@global.sync_binlog);
SET @@global.init_slave = 'bison'; SET @@global.init_slave = 'SELECT 2';
INSERT INTO tstmt(text) VALUES (@@global.init_slave); INSERT INTO tstmt(text) VALUES (@@global.init_slave);
SET @@global.init_slave = 'cat'; SET @@global.init_slave = 'SELECT 3';
INSERT INTO tstmt(text) VALUES (@@global.init_slave); INSERT INTO tstmt(text) VALUES (@@global.init_slave);
SET @@global.slave_exec_mode = 'IDEMPOTENT'; SET @@global.slave_exec_mode = 'IDEMPOTENT';
INSERT INTO tstmt(text) VALUES (@@global.slave_exec_mode); INSERT INTO tstmt(text) VALUES (@@global.slave_exec_mode);
...@@ -140,9 +140,9 @@ INSERT INTO tproc(num) VALUES (@@global.sync_binlog); ...@@ -140,9 +140,9 @@ INSERT INTO tproc(num) VALUES (@@global.sync_binlog);
SET @@global.sync_binlog = 3000000; SET @@global.sync_binlog = 3000000;
INSERT INTO tproc(num) VALUES (@@global.sync_binlog); INSERT INTO tproc(num) VALUES (@@global.sync_binlog);
# string # string
SET @@global.init_slave = 'bison'; SET @@global.init_slave = 'SELECT 2';
INSERT INTO tproc(text) VALUES (@@global.init_slave); INSERT INTO tproc(text) VALUES (@@global.init_slave);
SET @@global.init_slave = 'cat'; SET @@global.init_slave = 'SELECT 3';
INSERT INTO tproc(text) VALUES (@@global.init_slave); INSERT INTO tproc(text) VALUES (@@global.init_slave);
# enumeration # enumeration
SET @@global.slave_exec_mode = 'IDEMPOTENT'; SET @@global.slave_exec_mode = 'IDEMPOTENT';
...@@ -226,9 +226,9 @@ INSERT INTO tfunc(num) VALUES (@@global.sync_binlog); ...@@ -226,9 +226,9 @@ INSERT INTO tfunc(num) VALUES (@@global.sync_binlog);
SET @@global.sync_binlog = 3000000; SET @@global.sync_binlog = 3000000;
INSERT INTO tfunc(num) VALUES (@@global.sync_binlog); INSERT INTO tfunc(num) VALUES (@@global.sync_binlog);
# string # string
SET @@global.init_slave = 'bison'; SET @@global.init_slave = 'SELECT 2';
INSERT INTO tfunc(text) VALUES (@@global.init_slave); INSERT INTO tfunc(text) VALUES (@@global.init_slave);
SET @@global.init_slave = 'cat'; SET @@global.init_slave = 'SELECT 3';
INSERT INTO tfunc(text) VALUES (@@global.init_slave); INSERT INTO tfunc(text) VALUES (@@global.init_slave);
# enumeration # enumeration
SET @@global.slave_exec_mode = 'IDEMPOTENT'; SET @@global.slave_exec_mode = 'IDEMPOTENT';
...@@ -316,9 +316,9 @@ INSERT INTO ttrig(num) VALUES (@@global.sync_binlog); ...@@ -316,9 +316,9 @@ INSERT INTO ttrig(num) VALUES (@@global.sync_binlog);
SET @@global.sync_binlog = 3000000; SET @@global.sync_binlog = 3000000;
INSERT INTO ttrig(num) VALUES (@@global.sync_binlog); INSERT INTO ttrig(num) VALUES (@@global.sync_binlog);
# string # string
SET @@global.init_slave = 'bison'; SET @@global.init_slave = 'SELECT 2';
INSERT INTO ttrig(text) VALUES (@@global.init_slave); INSERT INTO ttrig(text) VALUES (@@global.init_slave);
SET @@global.init_slave = 'cat'; SET @@global.init_slave = 'SELECT 3';
INSERT INTO ttrig(text) VALUES (@@global.init_slave); INSERT INTO ttrig(text) VALUES (@@global.init_slave);
# enumeration # enumeration
SET @@global.slave_exec_mode = 'IDEMPOTENT'; SET @@global.slave_exec_mode = 'IDEMPOTENT';
...@@ -395,9 +395,9 @@ PREPARE p5 FROM 'SET @@global.sync_binlog = 2000000'; ...@@ -395,9 +395,9 @@ PREPARE p5 FROM 'SET @@global.sync_binlog = 2000000';
PREPARE p6 FROM 'INSERT INTO tprep(num) VALUES (@@global.sync_binlog)'; PREPARE p6 FROM 'INSERT INTO tprep(num) VALUES (@@global.sync_binlog)';
PREPARE p7 FROM 'SET @@global.sync_binlog = 3000000'; PREPARE p7 FROM 'SET @@global.sync_binlog = 3000000';
PREPARE p8 FROM 'INSERT INTO tprep(num) VALUES (@@global.sync_binlog)'; PREPARE p8 FROM 'INSERT INTO tprep(num) VALUES (@@global.sync_binlog)';
PREPARE p9 FROM 'SET @@global.init_slave = \'bison\''; PREPARE p9 FROM 'SET @@global.init_slave = \'SELECT 2\'';
PREPARE p10 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)'; PREPARE p10 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)';
PREPARE p11 FROM 'SET @@global.init_slave = \'cat\''; PREPARE p11 FROM 'SET @@global.init_slave = \'SELECT 3\'';
PREPARE p12 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)'; PREPARE p12 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)';
PREPARE p13 FROM 'SET @@global.slave_exec_mode = \'IDEMPOTENT\''; PREPARE p13 FROM 'SET @@global.slave_exec_mode = \'IDEMPOTENT\'';
PREPARE p14 FROM 'INSERT INTO tprep(text) VALUES (@@global.slave_exec_mode)'; PREPARE p14 FROM 'INSERT INTO tprep(text) VALUES (@@global.slave_exec_mode)';
...@@ -522,8 +522,8 @@ id truth num text ...@@ -522,8 +522,8 @@ id truth num text
2 0 NULL NULL 2 0 NULL NULL
3 NULL 2000000 NULL 3 NULL 2000000 NULL
4 NULL 3000000 NULL 4 NULL 3000000 NULL
5 NULL NULL bison 5 NULL NULL SELECT 2
6 NULL NULL cat 6 NULL NULL SELECT 3
7 NULL NULL IDEMPOTENT 7 NULL NULL IDEMPOTENT
8 NULL NULL STRICT 8 NULL NULL STRICT
9 1 NULL NULL 9 1 NULL NULL
......
...@@ -13,3 +13,4 @@ ...@@ -13,3 +13,4 @@
rpl_redirect : Failure is sporadic and and the test is superfluous (mats) rpl_redirect : Failure is sporadic and and the test is superfluous (mats)
rpl_innodb_bug28430 : Failure on Solaris Bug #36793 rpl_innodb_bug28430 : Failure on Solaris Bug #36793
rpl_temporary : BUG#38269 2008-07-21 Sven valgrind error in pushbuild rpl_temporary : BUG#38269 2008-07-21 Sven valgrind error in pushbuild
rpl_flushlog_loop : BUG#37733 2008-07-23 Sven disabled in 5.1-bugteam. the bug has been fixed in 5.1-rpl: please re-enable when that gets pushed to main
...@@ -19,6 +19,37 @@ source include/wait_for_slave_sql_to_stop.inc; ...@@ -19,6 +19,37 @@ source include/wait_for_slave_sql_to_stop.inc;
# The 4 should not be inserted into the table, since the incident log # The 4 should not be inserted into the table, since the incident log
# event should have stop the slave. # event should have stop the slave.
--echo **** On Slave **** --echo **** On Slave ****
#### BEGIN DEBUG INFO ADDED BY SVEN 2008-07-18 -- SEE BUG#38077 ####
let $tables= query_get_value(SHOW TABLES, Tables_in_test, 1);
if (`SELECT '$tables' != 't1'`)
{
--echo **** TEST CASE BUG! PRINTING DEBUG INFO! ****
--echo **** Dear developer, if you see this in the output of a test
--echo **** case run, please add all the information below as a
--echo **** comment to BUG#38077. If it's a pushbuild failure, please
--echo **** include a link to the push page.
--echo **** Thank you! /Sven
SHOW BINLOG EVENTS;
--echo **** master binlog ****
--error 0,1
--exec $MYSQL_BINLOG --hexdump $MYSQLTEST_VARDIR/log/master-bin.000001
--echo **** slave binlog ****
--error 0,1
--exec $MYSQL_BINLOG --hexdump $MYSQLTEST_VARDIR/log/slave-bin.000001
--echo **** slave status ****
query_vertical SHOW SLAVE STATUS;
--echo **** slave's master status ****
SHOW MASTER STATUS;
--echo **** slave binlog events ****
--echo [on master]
connection master;
--echo **** master status ****
SHOW MASTER STATUS;
--echo **** master binlog events ****
SHOW BINLOG EVENTS;
exit;
}
#### END DEBUG INFO ####
SELECT * FROM t1; SELECT * FROM t1;
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
......
# ==== Purpose ====
# #
# check replication of load data with the server parameters subjected to # check replication of load data with the server parameters subjected to
# read_buffer_size > max_allowed_packet # read_buffer_size > max_allowed_packet
# #
# ==== Implementation ====
#
# Insert many rows into t1, write t1 to file.
# Load the file into t2.
# See that t2 came out as expected on slave.
#
# ==== Related Bugs ====
#
# BUG#30435 loading large LOAD DATA INFILE breaks slave with # BUG#30435 loading large LOAD DATA INFILE breaks slave with
# read_buffer_size set on master # read_buffer_size set on master
# BUG#33413 show binlog events fails if binlog has event size of close # BUG#33413 show binlog events fails if binlog has event size of close
...@@ -9,10 +18,17 @@ ...@@ -9,10 +18,17 @@
source include/have_binlog_format_mixed_or_statement.inc; source include/have_binlog_format_mixed_or_statement.inc;
source include/master-slave.inc; source include/master-slave.inc;
source include/have_innodb.inc;
source include/have_binlog_format_mixed_or_statement.inc;
--echo ==== Create a big file ====
# We turn off binlogging to avoid too much noise in the binlog. t1 is
# just an auxiliary construction anyways, it is not needed on the
# slave.
--disable_query_log --disable_query_log
SET @@sql_log_bin= 0;
let $rows= 5000; let $rows= 5000;
create table t1 (id int not null primary key auto_increment); create table t1 (id int not null primary key auto_increment);
...@@ -22,10 +38,13 @@ while($rows) ...@@ -22,10 +38,13 @@ while($rows)
dec $rows; dec $rows;
} }
eval select * into outfile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' from t1; eval select * into outfile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' from t1;
flush logs;
DROP TABLE t1;
SET @@sql_log_bin= 1;
--enable_query_log --enable_query_log
connection master;
--echo ==== Load our big file into a table ====
create table t2 (id int not null primary key auto_increment); create table t2 (id int not null primary key auto_increment);
select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ; select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ;
...@@ -34,21 +53,21 @@ select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ; ...@@ -34,21 +53,21 @@ select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ;
eval load data infile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2; eval load data infile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2;
select count(*) from t2 /* 5 000 */; select count(*) from t2 /* 5 000 */;
# the binglog will show fragmented Append_block events # the binlog will show fragmented Append_block events
--let $binlog_start=106 source include/show_binlog_events.inc;
--replace_column 2 # 4 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start <binlog_start>
--eval show binlog events in 'master-bin.000002' from $binlog_start
--echo ==== Verify results on slave ====
--echo [on slave]
sync_slave_with_master; sync_slave_with_master;
#connection slave;
select count(*) from t2 /* 5 000 */; select count(*) from t2 /* 5 000 */;
--echo ==== Clean up ====
--echo [on master]
connection master; connection master;
drop table t1, t2; drop table t2;
sync_slave_with_master; sync_slave_with_master;
remove_file $MYSQLTEST_VARDIR/tmp/bug30435_5k.txt; remove_file $MYSQLTEST_VARDIR/tmp/bug30435_5k.txt;
--echo end of the tests
--binlog-format=statement --log-slave-updates
# Requires statement logging # ==== Purpose ====
#
# Verify that Slave_open_temp_tables is increased when a temporary
# table is opened on the slave, and decreased when a temporary table
# is closed on the slave, and that it is preserved during 'DELETE FROM
# table' and 'TRUNCATE table'.
#
# ==== Method ====
#
# Create a temporary table on master, insert rows, and try:
# - delete rows from the table
# - truncate the table
# - drop the table
#
# ==== Related bugs ====
#
# BUG#17137 Running "truncate table" on temporary table leaves the table open on a slave
#
# Bug in this test: BUG#37493: rpl_trunc_temp.test nondeterministic
# Requires statement-based logging since temporary tables are not
# logged in row-based logging
-- source include/have_binlog_format_mixed_or_statement.inc -- source include/have_binlog_format_mixed_or_statement.inc
source include/master-slave.inc; source include/master-slave.inc;
#
# Bug#17137 Running "truncate table" on temporary table
# leaves the table open on a slave
#
create temporary table t1 (n int); create temporary table t1 (n int);
insert into t1 values(1); insert into t1 values(1);
sync_slave_with_master; sync_slave_with_master;
...@@ -28,13 +45,10 @@ show status like 'Slave_open_temp_tables'; ...@@ -28,13 +45,10 @@ show status like 'Slave_open_temp_tables';
# Disconnect the master, temp table on slave should dissapear # Disconnect the master, temp table on slave should dissapear
disconnect master; disconnect master;
connection master1; connection slave;
# Wait until drop of temp tables appers in binlog
# Wait until drop of temp tables appers in slave's binlog
let $wait_binlog_event= DROP; let $wait_binlog_event= DROP;
source include/wait_for_binlog_event.inc; source include/wait_for_binlog_event.inc;
connection slave;
show status like 'Slave_open_temp_tables'; show status like 'Slave_open_temp_tables';
# End of 4.1 tests
# Same test as rpl_truncate_7ndb.test, but with mixed mode # Same test as rpl_truncate_7ndb.test, but with mixed mode
# This is marked with 'big_test' just because the rpl_truncate_7ndb test is # This is marked with 'big_test' just because the rpl_truncate_7ndb test is
# so slow... # so slow...
--source include/have_binlog_format_mixed.inc
--source include/big_test.inc --source include/big_test.inc
--source t/rpl_truncate_7ndb.test --source t/rpl_truncate_7ndb.test
...@@ -117,7 +117,7 @@ source include/reset_master_and_slave.inc; ...@@ -117,7 +117,7 @@ source include/reset_master_and_slave.inc;
# above, but can't because it affects how the slave works. # above, but can't because it affects how the slave works.
--echo [on slave] --echo [on slave]
connection slave; connection slave;
SET @@global.init_slave = 'ant'; SET @@global.init_slave = 'SELECT 1';
--echo [on master] --echo [on master]
...@@ -154,9 +154,9 @@ SET @@global.sync_binlog = 3000000; ...@@ -154,9 +154,9 @@ SET @@global.sync_binlog = 3000000;
INSERT INTO tstmt(num) VALUES (@@global.sync_binlog); INSERT INTO tstmt(num) VALUES (@@global.sync_binlog);
# string # string
SET @@global.init_slave = 'bison'; SET @@global.init_slave = 'SELECT 2';
INSERT INTO tstmt(text) VALUES (@@global.init_slave); INSERT INTO tstmt(text) VALUES (@@global.init_slave);
SET @@global.init_slave = 'cat'; SET @@global.init_slave = 'SELECT 3';
INSERT INTO tstmt(text) VALUES (@@global.init_slave); INSERT INTO tstmt(text) VALUES (@@global.init_slave);
# enumeration # enumeration
...@@ -258,9 +258,9 @@ BEGIN ...@@ -258,9 +258,9 @@ BEGIN
INSERT INTO tproc(num) VALUES (@@global.sync_binlog); INSERT INTO tproc(num) VALUES (@@global.sync_binlog);
# string # string
SET @@global.init_slave = 'bison'; SET @@global.init_slave = 'SELECT 2';
INSERT INTO tproc(text) VALUES (@@global.init_slave); INSERT INTO tproc(text) VALUES (@@global.init_slave);
SET @@global.init_slave = 'cat'; SET @@global.init_slave = 'SELECT 3';
INSERT INTO tproc(text) VALUES (@@global.init_slave); INSERT INTO tproc(text) VALUES (@@global.init_slave);
# enumeration # enumeration
...@@ -367,9 +367,9 @@ BEGIN ...@@ -367,9 +367,9 @@ BEGIN
INSERT INTO tfunc(num) VALUES (@@global.sync_binlog); INSERT INTO tfunc(num) VALUES (@@global.sync_binlog);
# string # string
SET @@global.init_slave = 'bison'; SET @@global.init_slave = 'SELECT 2';
INSERT INTO tfunc(text) VALUES (@@global.init_slave); INSERT INTO tfunc(text) VALUES (@@global.init_slave);
SET @@global.init_slave = 'cat'; SET @@global.init_slave = 'SELECT 3';
INSERT INTO tfunc(text) VALUES (@@global.init_slave); INSERT INTO tfunc(text) VALUES (@@global.init_slave);
# enumeration # enumeration
...@@ -478,9 +478,9 @@ BEGIN ...@@ -478,9 +478,9 @@ BEGIN
INSERT INTO ttrig(num) VALUES (@@global.sync_binlog); INSERT INTO ttrig(num) VALUES (@@global.sync_binlog);
# string # string
SET @@global.init_slave = 'bison'; SET @@global.init_slave = 'SELECT 2';
INSERT INTO ttrig(text) VALUES (@@global.init_slave); INSERT INTO ttrig(text) VALUES (@@global.init_slave);
SET @@global.init_slave = 'cat'; SET @@global.init_slave = 'SELECT 3';
INSERT INTO ttrig(text) VALUES (@@global.init_slave); INSERT INTO ttrig(text) VALUES (@@global.init_slave);
# enumeration # enumeration
...@@ -581,9 +581,9 @@ PREPARE p7 FROM 'SET @@global.sync_binlog = 3000000'; ...@@ -581,9 +581,9 @@ PREPARE p7 FROM 'SET @@global.sync_binlog = 3000000';
PREPARE p8 FROM 'INSERT INTO tprep(num) VALUES (@@global.sync_binlog)'; PREPARE p8 FROM 'INSERT INTO tprep(num) VALUES (@@global.sync_binlog)';
# string # string
PREPARE p9 FROM 'SET @@global.init_slave = \'bison\''; PREPARE p9 FROM 'SET @@global.init_slave = \'SELECT 2\'';
PREPARE p10 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)'; PREPARE p10 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)';
PREPARE p11 FROM 'SET @@global.init_slave = \'cat\''; PREPARE p11 FROM 'SET @@global.init_slave = \'SELECT 3\'';
PREPARE p12 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)'; PREPARE p12 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)';
# enumeration # enumeration
......
...@@ -437,7 +437,7 @@ SELECT COUNT(*) FROM t1 ORDER BY c1,c2; ...@@ -437,7 +437,7 @@ SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
COUNT(*) 0 COUNT(*) 0
set @@global.slave_exec_mode= default; set @@global.slave_exec_mode= default;
Last_SQL_Error Last_SQL_Error
0
SELECT COUNT(*) FROM t1 ORDER BY c1,c2; SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
COUNT(*) 0 COUNT(*) 0
**** Test for BUG#37076 **** **** Test for BUG#37076 ****
...@@ -451,3 +451,72 @@ SELECT * FROM t1; ...@@ -451,3 +451,72 @@ SELECT * FROM t1;
a b c a b c
2005-11-14 01:01:01 2005-11-14 01:01:02 2005-11-14 2005-11-14 01:01:01 2005-11-14 01:01:02 2005-11-14
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
CREATE TABLE t1 (i INT NOT NULL,
c CHAR(16) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'NDB' ;
CREATE TABLE t2 (i INT NOT NULL,
c CHAR(16) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'NDB' ;
ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
CREATE TABLE t3 (i INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'NDB' ;
ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
CREATE TABLE t4 (i INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'NDB' ;
CREATE TABLE t5 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'NDB' ;
ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
CREATE TABLE t6 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'NDB' ;
ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
CREATE TABLE t7 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'NDB' ;
[expecting slave to replicate correctly]
INSERT INTO t1 VALUES (1, "", 1);
INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
Comparing tables master:test.t1 and slave:test.t1
[expecting slave to replicate correctly]
INSERT INTO t2 VALUES (1, "", 1);
INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
Comparing tables master:test.t2 and slave:test.t2
[expecting slave to stop]
INSERT INTO t3 VALUES (1, "", 1);
INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2);
Last_SQL_Error
Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size.
RESET MASTER;
STOP SLAVE;
RESET SLAVE;
START SLAVE;
[expecting slave to replicate correctly]
INSERT INTO t4 VALUES (1, "", 1);
INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
Comparing tables master:test.t4 and slave:test.t4
[expecting slave to stop]
INSERT INTO t5 VALUES (1, "", 1);
INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
Last_SQL_Error
Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size.
RESET MASTER;
STOP SLAVE;
RESET SLAVE;
START SLAVE;
[expecting slave to stop]
INSERT INTO t6 VALUES (1, "", 1);
INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
Last_SQL_Error
Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size.
RESET MASTER;
STOP SLAVE;
RESET SLAVE;
START SLAVE;
[expecting slave to replicate correctly]
INSERT INTO t7 VALUES (1, "", 1);
INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
Comparing tables master:test.t7 and slave:test.t7
drop table t1, t2, t3, t4, t5, t6, t7;
...@@ -12,5 +12,5 @@ ...@@ -12,5 +12,5 @@
rpl_ndb_circular : Bug#33849 COMMIT event missing in cluster circular replication. rpl_ndb_circular : Bug#33849 COMMIT event missing in cluster circular replication.
rpl_ndb_circular_simplex : Bug#33849 COMMIT event missing in cluster circular replication. rpl_ndb_circular_simplex : Bug#33849 COMMIT event missing in cluster circular replication.
rpl_row_basic_7ndb : Bug#38369 rpl_ndb.rpl_row_basic_7ndb fails
rpl_ndb_circular_2ch : Bug#33849 COMMIT event missing in cluster circular replication. # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
...@@ -172,7 +172,7 @@ SELECT COUNT(*), SUM(a), b FROM t1 WHERE c = 3 GROUP BY b ORDER BY b; ...@@ -172,7 +172,7 @@ SELECT COUNT(*), SUM(a), b FROM t1 WHERE c = 3 GROUP BY b ORDER BY b;
--connection master --connection master
DROP TABLE t1; DROP TABLE t1;
--connection slave --connection slave
--disable_warings --disable_warnings
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
--enable_warnings --enable_warnings
--echo --echo
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
# BUG#26395: if crash during autocommit update to transactional table on master, slave fails # BUG#26395: if crash during autocommit update to transactional table on master, slave fails
source include/ndb_master-slave.inc;
source include/have_ndb.inc; source include/have_ndb.inc;
source include/ndb_master-slave.inc;
source include/have_innodb.inc; source include/have_innodb.inc;
CREATE TABLE tmyisam (a int) ENGINE = MYISAM; CREATE TABLE tmyisam (a int) ENGINE = MYISAM;
......
Some of these tests allocate more than 4GB RAM.
So, assure that the machine on which the suite will be executed has more than 4GB RAM.
...@@ -21,9 +21,6 @@ ...@@ -21,9 +21,6 @@
# Reference: # # Reference: #
# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# # # #
# Last Modification: #
# 2008-07-14 hhunger removed values for 64 bit platforms. #
# #
################################################################################ ################################################################################
--source include/load_sysvars.inc --source include/load_sysvars.inc
...@@ -77,9 +74,8 @@ SELECT @@session.query_prealloc_size = 8192; ...@@ -77,9 +74,8 @@ SELECT @@session.query_prealloc_size = 8192;
SET @@global.query_prealloc_size = 8192; SET @@global.query_prealloc_size = 8192;
SELECT @@global.query_prealloc_size ; SELECT @@global.query_prealloc_size ;
# Due to problems with 64 bit machines having less than 6 GB main memory. SET @@global.query_prealloc_size = 4294967295;
#SET @@global.query_prealloc_size = 4294967295; SELECT @@global.query_prealloc_size ;
#SELECT @@global.query_prealloc_size ;
SET @@global.query_prealloc_size = 655354; SET @@global.query_prealloc_size = 655354;
SELECT @@global.query_prealloc_size ; SELECT @@global.query_prealloc_size ;
...@@ -93,9 +89,8 @@ SELECT @@global.query_prealloc_size ; ...@@ -93,9 +89,8 @@ SELECT @@global.query_prealloc_size ;
SET @@session.query_prealloc_size = 8192; SET @@session.query_prealloc_size = 8192;
SELECT @@session.query_prealloc_size ; SELECT @@session.query_prealloc_size ;
# Due to problems with 64 bit machines having less than 6 GB main memory. SET @@session.query_prealloc_size = 4294967295;
#SET @@session.query_prealloc_size = 4294967295; SELECT @@session.query_prealloc_size ;
#SELECT @@session.query_prealloc_size ;
SET @@session.query_prealloc_size = 655345; SET @@session.query_prealloc_size = 655345;
SELECT @@session.query_prealloc_size ; SELECT @@session.query_prealloc_size ;
...@@ -114,9 +109,8 @@ SELECT @@global.query_prealloc_size ; ...@@ -114,9 +109,8 @@ SELECT @@global.query_prealloc_size ;
SET @@global.query_prealloc_size = -1024; SET @@global.query_prealloc_size = -1024;
SELECT @@global.query_prealloc_size ; SELECT @@global.query_prealloc_size ;
# Due to problems with 64 bit machines having less than 6 GB main memory. SET @@global.query_prealloc_size = 429496729533;
#SET @@global.query_prealloc_size = 429496729533; SELECT @@global.query_prealloc_size ;
#SELECT @@global.query_prealloc_size ;
--Error ER_PARSE_ERROR --Error ER_PARSE_ERROR
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment