From 4cc8730d15468e4b88952b4b03182532517a621b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Jun 2005 21:29:37 +0200 Subject: [PATCH 01/13] mtr_process.pl: Added a sleep for 5 seconds when shuting down, work around for strange problem with server restarts mtr_cases.pl: Set default time zone as opt to mysqld mysql-test-run.pl: Enabled --mysqld= to work Put some Windows path names into environment, to be used in --replace_result mysql-test-run.sh: Make shell script tolerant to Windows change in test cases mysql-test/mysql-test-run.sh: Make shell script tolerant to Windows change in test cases mysql-test/mysql-test-run.pl: Enabled --mysqld= to work Put some Windows path names into environment, to be used in --replace_result mysql-test/lib/mtr_cases.pl: Set default time zone as opt to mysqld mysql-test/lib/mtr_process.pl: Added a sleep for 5 seconds when shuting down, work around for strange problem with server restarts --- mysql-test/lib/mtr_cases.pl | 14 ++++++-------- mysql-test/lib/mtr_process.pl | 2 ++ mysql-test/mysql-test-run.pl | 18 +++++++++++++++--- mysql-test/mysql-test-run.sh | 3 ++- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index 878afe95f2c..b4f0080a4e9 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -171,8 +171,8 @@ sub collect_one_test_case($$$$$) { my $slave_sh= "$testdir/$tname-slave.sh"; my $disabled= "$testdir/$tname.disabled"; - $tinfo->{'master_opt'}= []; - $tinfo->{'slave_opt'}= []; + $tinfo->{'master_opt'}= ["--default-time-zone=+3:00"]; + $tinfo->{'slave_opt'}= ["--default-time-zone=+3:00"]; $tinfo->{'slave_mi'}= []; if ( -f $master_opt_file ) @@ -180,9 +180,9 @@ sub collect_one_test_case($$$$$) { $tinfo->{'master_restart'}= 1; # We think so for now # This is a dirty hack from old mysql-test-run, we use the opt file # to flag other things as well, it is not a opt list at all - my $extra_master_opt= mtr_get_opts_from_file($master_opt_file); + $tinfo->{'master_opt'}= mtr_get_opts_from_file($master_opt_file); - foreach my $opt (@$extra_master_opt) + foreach my $opt (@{$tinfo->{'master_opt'}}) { my $value; @@ -191,7 +191,7 @@ sub collect_one_test_case($$$$$) { if ( defined $value ) { $tinfo->{'timezone'}= $value; - $extra_master_opt= []; + $tinfo->{'master_opt'}= []; $tinfo->{'master_restart'}= 0; last; } @@ -206,13 +206,11 @@ sub collect_one_test_case($$$$$) { { $tinfo->{'result_file'}.= $::opt_result_ext; } - $extra_master_opt= []; + $tinfo->{'master_opt'}= []; $tinfo->{'master_restart'}= 0; last; } } - - $tinfo->{'master_opt'}= $extra_master_opt; } if ( -f $slave_opt_file ) diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index 7bca422773c..1eb4f6b7c58 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -669,6 +669,8 @@ sub mtr_mysqladmin_shutdown () { last; # If we got here, we are done } + sleep(5) if $::glob_win32; # FIXME next startup fails if no sleep + return $res; } diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index d4fb37c2f96..17ddebdcb2b 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -204,7 +204,7 @@ our $opt_bench= 0; our $opt_small_bench= 0; our $opt_big_test= 0; # Send --big-test to mysqltest -our $opt_extra_mysqld_opt; # FIXME not handled +our @opt_extra_mysqld_opt; our $opt_compress; our $opt_current_test; @@ -500,7 +500,7 @@ sub command_line_setup () { 'record' => \$opt_record, # ??? - 'mysqld=s' => \$opt_extra_mysqld_opt, + 'mysqld=s' => \@opt_extra_mysqld_opt, # Run test on running server 'extern' => \$opt_extern, @@ -953,13 +953,25 @@ sub environment_setup () { $ENV{'LC_COLLATE'}= "C"; $ENV{'USE_RUNNING_SERVER'}= $glob_use_running_server; $ENV{'MYSQL_TEST_DIR'}= $glob_mysql_test_dir; + $ENV{'MYSQL_TEST_WINDIR'}= $glob_mysql_test_dir; $ENV{'MASTER_MYSOCK'}= $master->[0]->{'path_mysock'}; + $ENV{'MASTER_WINMYSOCK'}= $master->[0]->{'path_mysock'}; $ENV{'MASTER_MYSOCK1'}= $master->[1]->{'path_mysock'}; $ENV{'MASTER_MYPORT'}= $master->[0]->{'path_myport'}; $ENV{'MASTER_MYPORT1'}= $master->[1]->{'path_myport'}; $ENV{'SLAVE_MYPORT'}= $slave->[0]->{'path_myport'}; # $ENV{'MYSQL_TCP_PORT'}= '@MYSQL_TCP_PORT@'; # FIXME $ENV{'MYSQL_TCP_PORT'}= 3306; + + if ( $glob_cygwin_perl ) + { + foreach my $key ('MYSQL_TEST_WINDIR','MASTER_MYSOCK') + { + $ENV{$key}= `cygpath -w $ENV{$key}`; + $ENV{$key} =~ s,\\,\\\\,g; + chomp($ENV{$key}); + } + } } @@ -1852,7 +1864,7 @@ sub mysqld_arguments ($$$$$) { } } - foreach my $arg ( @$extra_opt ) + foreach my $arg ( @opt_extra_mysqld_opt, @$extra_opt ) { mtr_add_arg($args, "%s%s", $prefix, $arg); } diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 3f7e7d22200..7540a76317e 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -170,7 +170,8 @@ cd .. BASEDIR=`pwd` cd $CWD MYSQL_TEST_DIR=$BASEDIR/mysql-test -export MYSQL_TEST_DIR +MYSQL_TEST_WINDIR=$MYSQL_TEST_DIR +export MYSQL_TEST_DIR MYSQL_TEST_WINDIR STD_DATA=$MYSQL_TEST_DIR/std_data hostname=`hostname` # Installed in the mysql privilege table From b78072633dafab2d5fe08e364d4b8378c188fc16 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Jun 2005 14:58:53 +1000 Subject: [PATCH 02/13] BUG#11132 Connections stuck in CLOSE_WAIT In 4.1 (it is different in 5.0), we do not use the mgm connection after fetching the configuration (and if we did, we would have to have calls to check the connection and reconnect if needed - in case the mgm server had restarted) so we can disconnect after first use. This means we won't have connections stuck in CLOSE_WAIT when the mgm server shuts down. ndb/src/common/mgmcommon/ConfigRetriever.cpp: Disconnect from management server after configuration is fetched. --- ndb/src/common/mgmcommon/ConfigRetriever.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ndb/src/common/mgmcommon/ConfigRetriever.cpp b/ndb/src/common/mgmcommon/ConfigRetriever.cpp index fd04ad393eb..648f3b4a52c 100644 --- a/ndb/src/common/mgmcommon/ConfigRetriever.cpp +++ b/ndb/src/common/mgmcommon/ConfigRetriever.cpp @@ -138,7 +138,9 @@ ConfigRetriever::getConfig(NdbMgmHandle m_handle){ setError(CR_ERROR, ndb_mgm_get_latest_error_desc(m_handle)); return 0; } - + + ndb_mgm_disconnect(m_handle); + return conf; } From 9fb9133f2c1f0524ddbb174c27621ac47fe436b2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Jun 2005 22:49:52 +0200 Subject: [PATCH 03/13] cleanup for bug#11167. portability alignment issues. --- sql/sql_select.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2cb650cda2a..41b56ae888c 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8112,9 +8112,9 @@ store_record_in_cache(JOIN_CACHE *cache) end > str && end[-1] == ' ' ; end--) ; length=(uint) (end-str); - memcpy(pos+sizeof(uint), str, length); - *((uint *) pos)= length; - pos+= length+sizeof(uint); + memcpy(pos+2, str, length); + int2store(pos, length); + pos+= length+2; } else { @@ -8177,9 +8177,9 @@ read_cached_record(JOIN_TAB *tab) { if (copy->strip) { - memcpy(copy->str, pos+sizeof(uint), length= *((uint *) pos)); + memcpy(copy->str, pos+2, length= uint2korr(pos)); memset(copy->str+length, ' ', copy->length-length); - pos+= sizeof(uint)+length; + pos+= 2+length; } else { From 2074572171104b30ab6c51cd1e756c001c90b72c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Jun 2005 10:09:05 +0200 Subject: [PATCH 04/13] fix test results - Bug #11328 mysql-test/r/bdb_cache.result: fix test results mysql-test/t/bdb_cache.test: fix test results --- mysql-test/r/bdb_cache.result | 4 +--- mysql-test/t/bdb_cache.test | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/bdb_cache.result b/mysql-test/r/bdb_cache.result index 218fd489c6a..6506ce0412a 100644 --- a/mysql-test/r/bdb_cache.result +++ b/mysql-test/r/bdb_cache.result @@ -12,10 +12,9 @@ show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 0 drop table t1; -commit; set autocommit=1; -begin; create table t1 (a int not null) engine=bdb; +begin; insert into t1 values (1),(2),(3); select * from t1; a @@ -26,7 +25,6 @@ show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 0 drop table t1; -commit; create table t1 (a int not null) engine=bdb; create table t2 (a int not null) engine=bdb; create table t3 (a int not null) engine=bdb; diff --git a/mysql-test/t/bdb_cache.test b/mysql-test/t/bdb_cache.test index 0082c83faff..401456711ac 100644 --- a/mysql-test/t/bdb_cache.test +++ b/mysql-test/t/bdb_cache.test @@ -14,15 +14,13 @@ insert into t1 values (1),(2),(3); select * from t1; show status like "Qcache_queries_in_cache"; drop table t1; -commit; set autocommit=1; -begin; create table t1 (a int not null) engine=bdb; +begin; insert into t1 values (1),(2),(3); select * from t1; show status like "Qcache_queries_in_cache"; drop table t1; -commit; create table t1 (a int not null) engine=bdb; create table t2 (a int not null) engine=bdb; create table t3 (a int not null) engine=bdb; From 17b55ca39b47c578329a61a07d2ffddeb3e91f22 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Jun 2005 13:39:54 +0200 Subject: [PATCH 05/13] for consictency, changed to use memcpy_fixed. --- sql/sql_select.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 41b56ae888c..352227acc68 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8112,9 +8112,9 @@ store_record_in_cache(JOIN_CACHE *cache) end > str && end[-1] == ' ' ; end--) ; length=(uint) (end-str); - memcpy(pos+2, str, length); - int2store(pos, length); - pos+= length+2; + memcpy(pos+sizeof(length), str, length); + memcpy_fixed(pos, &length, sizeof(length)); + pos+= length+sizeof(length); } else { @@ -8177,9 +8177,10 @@ read_cached_record(JOIN_TAB *tab) { if (copy->strip) { - memcpy(copy->str, pos+2, length= uint2korr(pos)); + memcpy_fixed(&length, pos, sizeof(length)); + memcpy(copy->str, pos+sizeof(length), length); memset(copy->str+length, ' ', copy->length-length); - pos+= 2+length; + pos+= sizeof(length)+length; } else { From b0d82705d3b3f69b61038909e15c0d00d38f3150 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Jun 2005 16:56:03 +0200 Subject: [PATCH 06/13] WL#2076: Added if(...) construct to mysqltest Removed SHOW BINLOG EVENTS in test case for ps-protocol and row-based replication client/mysqltest.c: WL#2067: Added if(...) construct to mysqltest mysql-test/include/rpl_stmt_seq.inc: Removed SHOW BINLOG EVENTS in test case for ps-protocol and row-based replication mysql-test/r/rpl_ddl.result: Removed SHOW BINLOG EVENTS in test case for ps-protocol and row-based replication mysql-test/t/rpl_ddl.test: Comment --- client/mysqltest.c | 84 ++-- mysql-test/include/rpl_stmt_seq.inc | 29 +- mysql-test/r/rpl_ddl.result | 585 ---------------------------- mysql-test/t/rpl_ddl.test | 2 + 4 files changed, 81 insertions(+), 619 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index e60d9ecd1c5..131616b6f71 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -153,10 +153,6 @@ static char TMPDIR[FN_REFLEN]; static char delimiter[MAX_DELIMITER]= DEFAULT_DELIMITER; static uint delimiter_length= 1; -static int *cur_block, *block_stack_end; -static int block_stack[BLOCK_STACK_DEPTH]; - -static int block_ok_stack[BLOCK_STACK_DEPTH]; static CHARSET_INFO *charset_info= &my_charset_latin1; /* Default charset */ static const char *charset_name= "latin1"; /* Default character set name */ @@ -210,8 +206,6 @@ MYSQL_RES *last_result=0; PARSER parser; MASTER_POS master_pos; -int *block_ok; /* set to 0 if the current block should not be executed */ -int false_block_depth = 0; /* if set, all results are concated and compared against this file */ const char *result_file = 0; @@ -281,6 +275,7 @@ Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL, Q_START_TIMER, Q_END_TIMER, Q_CHARACTER_SET, Q_DISABLE_PS_PROTOCOL, Q_ENABLE_PS_PROTOCOL, Q_DISABLE_RECONNECT, Q_ENABLE_RECONNECT, +Q_IF, Q_UNKNOWN, /* Unknown command. */ Q_COMMENT, /* Comments, ignored. */ @@ -368,9 +363,20 @@ const char *command_names[]= "enable_ps_protocol", "disable_reconnect", "enable_reconnect", + "if", 0 }; +/* Block stack */ +typedef struct +{ + int line; /* Start line of block */ + my_bool ok; /* Should block be executed */ + enum enum_commands cmd; /* Command owning the block */ +} BLOCK; +static BLOCK block_stack[BLOCK_STACK_DEPTH]; +static BLOCK *cur_block, *block_stack_end; + TYPELIB command_typelib= {array_elements(command_names),"", command_names, 0}; @@ -1723,36 +1729,54 @@ int do_connect(struct st_query* q) int do_done(struct st_query* q) { + /* Dummy statement to eliminate compiler warning */ q->type = Q_END_BLOCK; + + /* Check if empty block stack */ if (cur_block == block_stack) die("Stray '}' - end of block before beginning"); - if (*block_ok--) + + /* Test if inner block has been executed */ + if (cur_block->ok && cur_block->cmd == Q_WHILE) { - parser.current_line = *--cur_block; + /* Pop block from stack, re-execute outer block */ + cur_block--; + parser.current_line = cur_block->line; } else { - ++parser.current_line; - --cur_block; + /* Pop block from stack, goto next line */ + cur_block--; + parser.current_line++; } return 0; } -int do_while(struct st_query* q) + +int do_block(enum enum_commands cmd, struct st_query* q) { char* p=q->first_argument; const char* expr_start, *expr_end; VAR v; + + /* Check stack overflow */ if (cur_block == block_stack_end) die("Nesting too deeply"); - if (!*block_ok) + + /* Set way to find outer block again, increase line counter */ + cur_block->line= parser.current_line++; + + /* If this block is ignored */ + if (!cur_block->ok) { - ++false_block_depth; - *++block_ok = 0; - *cur_block++ = parser.current_line++; + /* Inner block should be ignored too */ + cur_block++; + cur_block->cmd= cmd; + cur_block->ok= FALSE; return 0; } + /* Parse and evaluate test expression */ expr_start = strchr(p, '('); if (!expr_start) die("missing '(' in while"); @@ -1761,14 +1785,12 @@ int do_while(struct st_query* q) die("missing ')' in while"); var_init(&v,0,0,0,0); eval_expr(&v, ++expr_start, &expr_end); - *cur_block++ = parser.current_line++; - if (!v.int_val) - { - *++block_ok = 0; - false_block_depth++; - } - else - *++block_ok = 1; + + /* Define inner block */ + cur_block++; + cur_block->cmd= cmd; + cur_block->ok= (v.int_val ? TRUE : FALSE); + var_free(&v); return 0; } @@ -3404,12 +3426,13 @@ int main(int argc, char **argv) lineno = lineno_stack; my_init_dynamic_array(&q_lines, sizeof(struct st_query*), INIT_Q_LINES, INIT_Q_LINES); + memset(block_stack, 0, sizeof(block_stack)); - block_stack_end = block_stack + BLOCK_STACK_DEPTH; - memset(block_ok_stack, 0, sizeof(block_stack)); - cur_block = block_stack; - block_ok = block_ok_stack; - *block_ok = 1; + block_stack_end= block_stack + BLOCK_STACK_DEPTH; + cur_block= block_stack; + cur_block->ok= TRUE; /* Outer block should always be executed */ + cur_block->cmd= Q_UNKNOWN; + init_dynamic_string(&ds_res, "", 0, 65536); parse_args(argc, argv); if (mysql_server_init(embedded_server_arg_count, @@ -3461,7 +3484,7 @@ int main(int argc, char **argv) int current_line_inc = 1, processed = 0; if (q->type == Q_UNKNOWN || q->type == Q_COMMENT_WITH_COMMAND) get_query_type(q); - if (*block_ok) + if (cur_block->ok) { processed = 1; switch (q->type) { @@ -3657,7 +3680,8 @@ int main(int argc, char **argv) { current_line_inc = 0; switch (q->type) { - case Q_WHILE: do_while(q); break; + case Q_WHILE: do_block(Q_WHILE, q); break; + case Q_IF: do_block(Q_IF, q); break; case Q_END_BLOCK: do_done(q); break; default: current_line_inc = 1; break; } diff --git a/mysql-test/include/rpl_stmt_seq.inc b/mysql-test/include/rpl_stmt_seq.inc index 6f207e66156..d56ee02e33c 100644 --- a/mysql-test/include/rpl_stmt_seq.inc +++ b/mysql-test/include/rpl_stmt_seq.inc @@ -4,6 +4,12 @@ # the $variables is extreme sensitive. # +############################################################### +# Debug options : To debug this test script +############################################################### +let $showbinlog= 0; +let $manipulate= 1; + ######## The typical test sequence # 1. INSERT without commit # check table content of master and slave @@ -52,9 +58,12 @@ let $MAX= `SELECT MAX(f1) FROM t1` ; eval INSERT INTO t1 SET f1= $MAX + 1; # results before DDL(to be tested) SELECT MAX(f1) FROM t1; +if ($show_binlog) +{ --replace_result $VERSION VERSION --replace_column 2 # 5 # eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s'; +} sync_slave_with_master; connection slave; @@ -63,9 +72,12 @@ SELECT '-------- switch to slave --------' as ""; --enable_query_log # results before DDL(to be tested) SELECT MAX(f1) FROM t1; +if ($show_binlog) +{ --replace_result $VERSION VERSION --replace_column 2 # 5 # eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s'; +} ############################################################### # command to be tested @@ -79,9 +91,12 @@ eval $my_stmt; let $my_stmt= ERROR: YOU FORGOT TO FILL IN THE STATEMENT; # results after DDL(to be tested) SELECT MAX(f1) FROM t1; +if ($show_binlog) +{ --replace_result $VERSION VERSION --replace_column 2 # 5 # eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s'; +} sync_slave_with_master; connection slave; @@ -90,9 +105,12 @@ SELECT '-------- switch to slave --------' as ""; --enable_query_log # results after DDL(to be tested) SELECT MAX(f1) FROM t1; +if ($show_binlog) +{ --replace_result $VERSION VERSION --replace_column 2 # 5 # eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s'; +} ############################################################### # ROLLBACK @@ -114,9 +132,12 @@ eval SELECT CONCAT(CONCAT('TEST-INFO: MASTER: The INSERT is ', ' (Failed)')) AS "" FROM mysqltest1.t1; --enable_query_log +if ($show_binlog) +{ --replace_result $VERSION VERSION --replace_column 2 # 5 # eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s'; +} sync_slave_with_master; connection slave; @@ -133,16 +154,17 @@ eval SELECT CONCAT(CONCAT('TEST-INFO: SLAVE: The INSERT is ', ' (Failed)')) AS "" FROM mysqltest1.t1; --enable_query_log +if ($show_binlog) +{ --replace_result $VERSION VERSION --replace_column 2 # 5 # eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s'; +} ############################################################### # Manipulate binlog ############################################################### -#let $manipulate= 0; -let $manipulate= 1; -while ($manipulate) +if ($manipulate) { #### Manipulate the binary logs, # so that the output of SHOW BINLOG EVENTS IN @@ -171,7 +193,6 @@ flush logs; # sleep 1; # eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s'; inc $_log_num_n; -let $manipulate= 0; } connection master; diff --git a/mysql-test/r/rpl_ddl.result b/mysql-test/r/rpl_ddl.result index 9e3f76fe0bb..3737883b694 100644 --- a/mysql-test/r/rpl_ddl.result +++ b/mysql-test/r/rpl_ddl.result @@ -49,152 +49,22 @@ INSERT INTO t1 SET f1= 0 + 1; SELECT MAX(f1) FROM t1; MAX(f1) 1 -SHOW BINLOG EVENTS IN 'master-bin.000001'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000001 # Start 1 # Server ver: VERSION, Binlog ver: 3 -master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest1 -master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest2 -master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest3 -master-bin.000001 # Query 1 # CREATE DATABASE mysqltest1 -master-bin.000001 # Query 1 # CREATE DATABASE mysqltest2 -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; INSERT INTO mysqltest1.t1 SET f1= 0 -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE INDEX my_idx6 ON mysqltest1.t6(f1) -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; INSERT INTO mysqltest1.t7 SET f1= 0 -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT) -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 0 -SHOW BINLOG EVENTS IN 'slave-bin.000001'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000001 # Start 2 # Server ver: VERSION, Binlog ver: 3 -slave-bin.000001 # Query 2 # use `test`; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9 -slave-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest1 -slave-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest2 -slave-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest3 -slave-bin.000001 # Query 1 # CREATE DATABASE mysqltest1 -slave-bin.000001 # Query 1 # CREATE DATABASE mysqltest2 -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; INSERT INTO mysqltest1.t1 SET f1= 0 -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE INDEX my_idx6 ON mysqltest1.t6(f1) -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; INSERT INTO mysqltest1.t7 SET f1= 0 -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT) -------- switch to master ------- COMMIT; SELECT MAX(f1) FROM t1; MAX(f1) 1 -SHOW BINLOG EVENTS IN 'master-bin.000001'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000001 # Start 1 # Server ver: VERSION, Binlog ver: 3 -master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest1 -master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest2 -master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest3 -master-bin.000001 # Query 1 # CREATE DATABASE mysqltest1 -master-bin.000001 # Query 1 # CREATE DATABASE mysqltest2 -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; INSERT INTO mysqltest1.t1 SET f1= 0 -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE INDEX my_idx6 ON mysqltest1.t6(f1) -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; INSERT INTO mysqltest1.t7 SET f1= 0 -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT) -master-bin.000001 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000001 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 0 + 1 -master-bin.000001 # Query 1 # use `mysqltest1`; COMMIT -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 1 -SHOW BINLOG EVENTS IN 'slave-bin.000001'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000001 # Start 2 # Server ver: VERSION, Binlog ver: 3 -slave-bin.000001 # Query 2 # use `test`; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9 -slave-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest1 -slave-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest2 -slave-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest3 -slave-bin.000001 # Query 1 # CREATE DATABASE mysqltest1 -slave-bin.000001 # Query 1 # CREATE DATABASE mysqltest2 -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; INSERT INTO mysqltest1.t1 SET f1= 0 -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE INDEX my_idx6 ON mysqltest1.t6(f1) -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; INSERT INTO mysqltest1.t7 SET f1= 0 -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT) -slave-bin.000001 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 0 + 1 -------- switch to master ------- ROLLBACK; @@ -203,40 +73,6 @@ MAX(f1) 1 TEST-INFO: MASTER: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'master-bin.000001'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000001 # Start 1 # Server ver: VERSION, Binlog ver: 3 -master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest1 -master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest2 -master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest3 -master-bin.000001 # Query 1 # CREATE DATABASE mysqltest1 -master-bin.000001 # Query 1 # CREATE DATABASE mysqltest2 -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; INSERT INTO mysqltest1.t1 SET f1= 0 -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE INDEX my_idx6 ON mysqltest1.t6(f1) -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; INSERT INTO mysqltest1.t7 SET f1= 0 -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE= "InnoDB" -master-bin.000001 # Query 1 # use `test`; CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT) -master-bin.000001 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000001 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 0 + 1 -master-bin.000001 # Query 1 # use `mysqltest1`; COMMIT -------- switch to slave -------- SELECT MAX(f1) FROM t1; @@ -244,39 +80,6 @@ MAX(f1) 1 TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'slave-bin.000001'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000001 # Start 2 # Server ver: VERSION, Binlog ver: 3 -slave-bin.000001 # Query 2 # use `test`; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9 -slave-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest1 -slave-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest2 -slave-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest3 -slave-bin.000001 # Query 1 # CREATE DATABASE mysqltest1 -slave-bin.000001 # Query 1 # CREATE DATABASE mysqltest2 -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; INSERT INTO mysqltest1.t1 SET f1= 0 -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE INDEX my_idx6 ON mysqltest1.t6(f1) -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; INSERT INTO mysqltest1.t7 SET f1= 0 -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE= "InnoDB" -slave-bin.000001 # Query 1 # use `test`; CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT) -slave-bin.000001 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 0 + 1 -------- switch to master ------- flush logs; @@ -293,30 +96,22 @@ INSERT INTO t1 SET f1= 1 + 1; SELECT MAX(f1) FROM t1; MAX(f1) 2 -SHOW BINLOG EVENTS IN 'master-bin.000002'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 1 -SHOW BINLOG EVENTS IN 'slave-bin.000002'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- ROLLBACK; SELECT MAX(f1) FROM t1; MAX(f1) 1 -SHOW BINLOG EVENTS IN 'master-bin.000002'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 1 -SHOW BINLOG EVENTS IN 'slave-bin.000002'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- ROLLBACK; @@ -325,8 +120,6 @@ MAX(f1) 1 TEST-INFO: MASTER: The INSERT is not committed (Succeeded) -SHOW BINLOG EVENTS IN 'master-bin.000002'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; @@ -334,8 +127,6 @@ MAX(f1) 1 TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) -SHOW BINLOG EVENTS IN 'slave-bin.000002'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- flush logs; @@ -352,34 +143,22 @@ INSERT INTO t1 SET f1= 1 + 1; SELECT MAX(f1) FROM t1; MAX(f1) 2 -SHOW BINLOG EVENTS IN 'master-bin.000003'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 1 -SHOW BINLOG EVENTS IN 'slave-bin.000003'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- SET AUTOCOMMIT=1; SELECT MAX(f1) FROM t1; MAX(f1) 2 -SHOW BINLOG EVENTS IN 'master-bin.000003'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000003 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000003 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 1 + 1 -master-bin.000003 # Query 1 # use `mysqltest1`; COMMIT -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 2 -SHOW BINLOG EVENTS IN 'slave-bin.000003'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000003 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 1 + 1 -------- switch to master ------- ROLLBACK; @@ -388,11 +167,6 @@ MAX(f1) 2 TEST-INFO: MASTER: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'master-bin.000003'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000003 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000003 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 1 + 1 -master-bin.000003 # Query 1 # use `mysqltest1`; COMMIT -------- switch to slave -------- SELECT MAX(f1) FROM t1; @@ -400,9 +174,6 @@ MAX(f1) 2 TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'slave-bin.000003'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000003 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 1 + 1 -------- switch to master ------- flush logs; @@ -420,34 +191,22 @@ INSERT INTO t1 SET f1= 2 + 1; SELECT MAX(f1) FROM t1; MAX(f1) 3 -SHOW BINLOG EVENTS IN 'master-bin.000004'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 2 -SHOW BINLOG EVENTS IN 'slave-bin.000004'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- START TRANSACTION; SELECT MAX(f1) FROM t1; MAX(f1) 3 -SHOW BINLOG EVENTS IN 'master-bin.000004'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000004 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000004 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 2 + 1 -master-bin.000004 # Query 1 # use `mysqltest1`; COMMIT -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 3 -SHOW BINLOG EVENTS IN 'slave-bin.000004'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000004 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 2 + 1 -------- switch to master ------- ROLLBACK; @@ -456,11 +215,6 @@ MAX(f1) 3 TEST-INFO: MASTER: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'master-bin.000004'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000004 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000004 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 2 + 1 -master-bin.000004 # Query 1 # use `mysqltest1`; COMMIT -------- switch to slave -------- SELECT MAX(f1) FROM t1; @@ -468,9 +222,6 @@ MAX(f1) 3 TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'slave-bin.000004'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000004 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 2 + 1 -------- switch to master ------- flush logs; @@ -487,34 +238,22 @@ INSERT INTO t1 SET f1= 3 + 1; SELECT MAX(f1) FROM t1; MAX(f1) 4 -SHOW BINLOG EVENTS IN 'master-bin.000005'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 3 -SHOW BINLOG EVENTS IN 'slave-bin.000005'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- BEGIN; SELECT MAX(f1) FROM t1; MAX(f1) 4 -SHOW BINLOG EVENTS IN 'master-bin.000005'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000005 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000005 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 3 + 1 -master-bin.000005 # Query 1 # use `mysqltest1`; COMMIT -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 4 -SHOW BINLOG EVENTS IN 'slave-bin.000005'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000005 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 3 + 1 -------- switch to master ------- ROLLBACK; @@ -523,11 +262,6 @@ MAX(f1) 4 TEST-INFO: MASTER: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'master-bin.000005'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000005 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000005 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 3 + 1 -master-bin.000005 # Query 1 # use `mysqltest1`; COMMIT -------- switch to slave -------- SELECT MAX(f1) FROM t1; @@ -535,9 +269,6 @@ MAX(f1) 4 TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'slave-bin.000005'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000005 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 3 + 1 -------- switch to master ------- flush logs; @@ -554,36 +285,22 @@ INSERT INTO t1 SET f1= 4 + 1; SELECT MAX(f1) FROM t1; MAX(f1) 5 -SHOW BINLOG EVENTS IN 'master-bin.000006'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 4 -SHOW BINLOG EVENTS IN 'slave-bin.000006'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- DROP TABLE mysqltest1.t2; SELECT MAX(f1) FROM t1; MAX(f1) 5 -SHOW BINLOG EVENTS IN 'master-bin.000006'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000006 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000006 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 4 + 1 -master-bin.000006 # Query 1 # use `mysqltest1`; COMMIT -master-bin.000006 # Query 1 # use `mysqltest1`; DROP TABLE mysqltest1.t2 -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 5 -SHOW BINLOG EVENTS IN 'slave-bin.000006'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000006 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 4 + 1 -slave-bin.000006 # Query 1 # use `mysqltest1`; DROP TABLE mysqltest1.t2 -------- switch to master ------- ROLLBACK; @@ -592,12 +309,6 @@ MAX(f1) 5 TEST-INFO: MASTER: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'master-bin.000006'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000006 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000006 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 4 + 1 -master-bin.000006 # Query 1 # use `mysqltest1`; COMMIT -master-bin.000006 # Query 1 # use `mysqltest1`; DROP TABLE mysqltest1.t2 -------- switch to slave -------- SELECT MAX(f1) FROM t1; @@ -605,10 +316,6 @@ MAX(f1) 5 TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'slave-bin.000006'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000006 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 4 + 1 -slave-bin.000006 # Query 1 # use `mysqltest1`; DROP TABLE mysqltest1.t2 -------- switch to master ------- flush logs; @@ -633,30 +340,22 @@ INSERT INTO t1 SET f1= 5 + 1; SELECT MAX(f1) FROM t1; MAX(f1) 6 -SHOW BINLOG EVENTS IN 'master-bin.000007'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 5 -SHOW BINLOG EVENTS IN 'slave-bin.000007'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- DROP TEMPORARY TABLE mysqltest1.t23; SELECT MAX(f1) FROM t1; MAX(f1) 6 -SHOW BINLOG EVENTS IN 'master-bin.000007'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 5 -SHOW BINLOG EVENTS IN 'slave-bin.000007'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- ROLLBACK; @@ -667,12 +366,6 @@ MAX(f1) 5 TEST-INFO: MASTER: The INSERT is not committed (Succeeded) -SHOW BINLOG EVENTS IN 'master-bin.000007'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000007 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000007 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 5 + 1 -master-bin.000007 # Query 1 # use `mysqltest1`; DROP TEMPORARY TABLE mysqltest1.t23 -master-bin.000007 # Query 1 # use `mysqltest1`; ROLLBACK -------- switch to slave -------- SELECT MAX(f1) FROM t1; @@ -680,10 +373,6 @@ MAX(f1) 6 TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'slave-bin.000007'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000007 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 5 + 1 -slave-bin.000007 # Query 1 # use `mysqltest1`; DROP TEMPORARY TABLE mysqltest1.t23 -------- switch to master ------- flush logs; @@ -708,36 +397,22 @@ INSERT INTO t1 SET f1= 5 + 1; SELECT MAX(f1) FROM t1; MAX(f1) 6 -SHOW BINLOG EVENTS IN 'master-bin.000008'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 6 -SHOW BINLOG EVENTS IN 'slave-bin.000008'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- RENAME TABLE mysqltest1.t3 to mysqltest1.t20; SELECT MAX(f1) FROM t1; MAX(f1) 6 -SHOW BINLOG EVENTS IN 'master-bin.000008'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000008 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000008 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 5 + 1 -master-bin.000008 # Query 1 # use `mysqltest1`; COMMIT -master-bin.000008 # Query 1 # use `mysqltest1`; RENAME TABLE mysqltest1.t3 to mysqltest1.t20 -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 6 -SHOW BINLOG EVENTS IN 'slave-bin.000008'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000008 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 5 + 1 -slave-bin.000008 # Query 1 # use `mysqltest1`; RENAME TABLE mysqltest1.t3 to mysqltest1.t20 -------- switch to master ------- ROLLBACK; @@ -746,12 +421,6 @@ MAX(f1) 6 TEST-INFO: MASTER: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'master-bin.000008'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000008 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000008 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 5 + 1 -master-bin.000008 # Query 1 # use `mysqltest1`; COMMIT -master-bin.000008 # Query 1 # use `mysqltest1`; RENAME TABLE mysqltest1.t3 to mysqltest1.t20 -------- switch to slave -------- SELECT MAX(f1) FROM t1; @@ -759,10 +428,6 @@ MAX(f1) 6 TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'slave-bin.000008'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000008 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 5 + 1 -slave-bin.000008 # Query 1 # use `mysqltest1`; RENAME TABLE mysqltest1.t3 to mysqltest1.t20 -------- switch to master ------- flush logs; @@ -789,36 +454,22 @@ INSERT INTO t1 SET f1= 6 + 1; SELECT MAX(f1) FROM t1; MAX(f1) 7 -SHOW BINLOG EVENTS IN 'master-bin.000009'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 6 -SHOW BINLOG EVENTS IN 'slave-bin.000009'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT; SELECT MAX(f1) FROM t1; MAX(f1) 7 -SHOW BINLOG EVENTS IN 'master-bin.000009'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000009 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000009 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 6 + 1 -master-bin.000009 # Query 1 # use `mysqltest1`; COMMIT -master-bin.000009 # Query 1 # use `mysqltest1`; ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 7 -SHOW BINLOG EVENTS IN 'slave-bin.000009'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000009 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 6 + 1 -slave-bin.000009 # Query 1 # use `mysqltest1`; ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT -------- switch to master ------- ROLLBACK; @@ -827,12 +478,6 @@ MAX(f1) 7 TEST-INFO: MASTER: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'master-bin.000009'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000009 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000009 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 6 + 1 -master-bin.000009 # Query 1 # use `mysqltest1`; COMMIT -master-bin.000009 # Query 1 # use `mysqltest1`; ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT -------- switch to slave -------- SELECT MAX(f1) FROM t1; @@ -840,10 +485,6 @@ MAX(f1) 7 TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'slave-bin.000009'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000009 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 6 + 1 -slave-bin.000009 # Query 1 # use `mysqltest1`; ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT -------- switch to master ------- flush logs; @@ -872,36 +513,22 @@ INSERT INTO t1 SET f1= 7 + 1; SELECT MAX(f1) FROM t1; MAX(f1) 8 -SHOW BINLOG EVENTS IN 'master-bin.000010'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 7 -SHOW BINLOG EVENTS IN 'slave-bin.000010'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB"; SELECT MAX(f1) FROM t1; MAX(f1) 8 -SHOW BINLOG EVENTS IN 'master-bin.000010'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000010 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000010 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 7 + 1 -master-bin.000010 # Query 1 # use `mysqltest1`; COMMIT -master-bin.000010 # Query 1 # use `mysqltest1`; CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB" -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 8 -SHOW BINLOG EVENTS IN 'slave-bin.000010'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000010 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 7 + 1 -slave-bin.000010 # Query 1 # use `mysqltest1`; CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB" -------- switch to master ------- ROLLBACK; @@ -910,12 +537,6 @@ MAX(f1) 8 TEST-INFO: MASTER: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'master-bin.000010'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000010 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000010 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 7 + 1 -master-bin.000010 # Query 1 # use `mysqltest1`; COMMIT -master-bin.000010 # Query 1 # use `mysqltest1`; CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB" -------- switch to slave -------- SELECT MAX(f1) FROM t1; @@ -923,10 +544,6 @@ MAX(f1) 8 TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'slave-bin.000010'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000010 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 7 + 1 -slave-bin.000010 # Query 1 # use `mysqltest1`; CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB" -------- switch to master ------- flush logs; @@ -943,30 +560,22 @@ INSERT INTO t1 SET f1= 8 + 1; SELECT MAX(f1) FROM t1; MAX(f1) 9 -SHOW BINLOG EVENTS IN 'master-bin.000011'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 8 -SHOW BINLOG EVENTS IN 'slave-bin.000011'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT); SELECT MAX(f1) FROM t1; MAX(f1) 9 -SHOW BINLOG EVENTS IN 'master-bin.000011'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 8 -SHOW BINLOG EVENTS IN 'slave-bin.000011'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- ROLLBACK; @@ -977,12 +586,6 @@ MAX(f1) 8 TEST-INFO: MASTER: The INSERT is not committed (Succeeded) -SHOW BINLOG EVENTS IN 'master-bin.000011'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000011 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000011 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 8 + 1 -master-bin.000011 # Query 1 # use `mysqltest1`; CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) -master-bin.000011 # Query 1 # use `mysqltest1`; ROLLBACK -------- switch to slave -------- SELECT MAX(f1) FROM t1; @@ -990,10 +593,6 @@ MAX(f1) 9 TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'slave-bin.000011'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000011 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 8 + 1 -slave-bin.000011 # Query 1 # use `mysqltest1`; CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) -------- switch to master ------- flush logs; @@ -1010,36 +609,22 @@ INSERT INTO t1 SET f1= 8 + 1; SELECT MAX(f1) FROM t1; MAX(f1) 9 -SHOW BINLOG EVENTS IN 'master-bin.000012'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 9 -SHOW BINLOG EVENTS IN 'slave-bin.000012'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- TRUNCATE TABLE mysqltest1.t7; SELECT MAX(f1) FROM t1; MAX(f1) 9 -SHOW BINLOG EVENTS IN 'master-bin.000012'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000012 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000012 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 8 + 1 -master-bin.000012 # Query 1 # use `mysqltest1`; COMMIT -master-bin.000012 # Query 1 # use `mysqltest1`; TRUNCATE TABLE mysqltest1.t7 -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 9 -SHOW BINLOG EVENTS IN 'slave-bin.000012'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000012 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 8 + 1 -slave-bin.000012 # Query 1 # use `mysqltest1`; TRUNCATE TABLE mysqltest1.t7 -------- switch to master ------- ROLLBACK; @@ -1048,12 +633,6 @@ MAX(f1) 9 TEST-INFO: MASTER: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'master-bin.000012'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000012 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000012 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 8 + 1 -master-bin.000012 # Query 1 # use `mysqltest1`; COMMIT -master-bin.000012 # Query 1 # use `mysqltest1`; TRUNCATE TABLE mysqltest1.t7 -------- switch to slave -------- SELECT MAX(f1) FROM t1; @@ -1061,10 +640,6 @@ MAX(f1) 9 TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'slave-bin.000012'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000012 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 8 + 1 -slave-bin.000012 # Query 1 # use `mysqltest1`; TRUNCATE TABLE mysqltest1.t7 -------- switch to master ------- flush logs; @@ -1089,34 +664,22 @@ INSERT INTO t1 SET f1= 9 + 1; SELECT MAX(f1) FROM t1; MAX(f1) 10 -SHOW BINLOG EVENTS IN 'master-bin.000013'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 9 -SHOW BINLOG EVENTS IN 'slave-bin.000013'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ; SELECT MAX(f1) FROM t1; MAX(f1) 10 -SHOW BINLOG EVENTS IN 'master-bin.000013'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000013 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000013 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 9 + 1 -master-bin.000013 # Query 1 # use `mysqltest1`; COMMIT -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 10 -SHOW BINLOG EVENTS IN 'slave-bin.000013'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000013 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 9 + 1 -------- switch to master ------- ROLLBACK; @@ -1125,11 +688,6 @@ MAX(f1) 10 TEST-INFO: MASTER: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'master-bin.000013'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000013 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000013 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 9 + 1 -master-bin.000013 # Query 1 # use `mysqltest1`; COMMIT -------- switch to slave -------- SELECT MAX(f1) FROM t1; @@ -1137,9 +695,6 @@ MAX(f1) 10 TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'slave-bin.000013'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000013 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 9 + 1 -------- switch to master ------- flush logs; @@ -1157,30 +712,22 @@ INSERT INTO t1 SET f1= 10 + 1; SELECT MAX(f1) FROM t1; MAX(f1) 11 -SHOW BINLOG EVENTS IN 'master-bin.000014'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 10 -SHOW BINLOG EVENTS IN 'slave-bin.000014'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- UNLOCK TABLES; SELECT MAX(f1) FROM t1; MAX(f1) 11 -SHOW BINLOG EVENTS IN 'master-bin.000014'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 10 -SHOW BINLOG EVENTS IN 'slave-bin.000014'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- ROLLBACK; @@ -1189,8 +736,6 @@ MAX(f1) 10 TEST-INFO: MASTER: The INSERT is not committed (Succeeded) -SHOW BINLOG EVENTS IN 'master-bin.000014'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; @@ -1198,8 +743,6 @@ MAX(f1) 10 TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) -SHOW BINLOG EVENTS IN 'slave-bin.000014'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- flush logs; @@ -1218,30 +761,22 @@ ERROR HY000: Table 't1' was locked with a READ lock and can't be updated SELECT MAX(f1) FROM t1; MAX(f1) 10 -SHOW BINLOG EVENTS IN 'master-bin.000015'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 10 -SHOW BINLOG EVENTS IN 'slave-bin.000015'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- UNLOCK TABLES; SELECT MAX(f1) FROM t1; MAX(f1) 10 -SHOW BINLOG EVENTS IN 'master-bin.000015'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 10 -SHOW BINLOG EVENTS IN 'slave-bin.000015'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- ROLLBACK; @@ -1250,8 +785,6 @@ MAX(f1) 10 TEST-INFO: MASTER: The INSERT is not committed (Succeeded) -SHOW BINLOG EVENTS IN 'master-bin.000015'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; @@ -1259,8 +792,6 @@ MAX(f1) 10 TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) -SHOW BINLOG EVENTS IN 'slave-bin.000015'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- flush logs; @@ -1278,34 +809,22 @@ INSERT INTO t1 SET f1= 10 + 1; SELECT MAX(f1) FROM t1; MAX(f1) 11 -SHOW BINLOG EVENTS IN 'master-bin.000016'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 10 -SHOW BINLOG EVENTS IN 'slave-bin.000016'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- UNLOCK TABLES; SELECT MAX(f1) FROM t1; MAX(f1) 11 -SHOW BINLOG EVENTS IN 'master-bin.000016'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000016 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000016 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 10 + 1 -master-bin.000016 # Query 1 # use `mysqltest1`; COMMIT -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 11 -SHOW BINLOG EVENTS IN 'slave-bin.000016'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000016 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 10 + 1 -------- switch to master ------- ROLLBACK; @@ -1314,11 +833,6 @@ MAX(f1) 11 TEST-INFO: MASTER: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'master-bin.000016'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000016 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000016 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 10 + 1 -master-bin.000016 # Query 1 # use `mysqltest1`; COMMIT -------- switch to slave -------- SELECT MAX(f1) FROM t1; @@ -1326,9 +840,6 @@ MAX(f1) 11 TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'slave-bin.000016'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000016 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 10 + 1 -------- switch to master ------- flush logs; @@ -1345,36 +856,22 @@ INSERT INTO t1 SET f1= 11 + 1; SELECT MAX(f1) FROM t1; MAX(f1) 12 -SHOW BINLOG EVENTS IN 'master-bin.000017'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 11 -SHOW BINLOG EVENTS IN 'slave-bin.000017'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- DROP INDEX my_idx6 ON mysqltest1.t6; SELECT MAX(f1) FROM t1; MAX(f1) 12 -SHOW BINLOG EVENTS IN 'master-bin.000017'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000017 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000017 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 11 + 1 -master-bin.000017 # Query 1 # use `mysqltest1`; COMMIT -master-bin.000017 # Query 1 # use `mysqltest1`; DROP INDEX my_idx6 ON mysqltest1.t6 -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 12 -SHOW BINLOG EVENTS IN 'slave-bin.000017'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000017 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 11 + 1 -slave-bin.000017 # Query 1 # use `mysqltest1`; DROP INDEX my_idx6 ON mysqltest1.t6 -------- switch to master ------- ROLLBACK; @@ -1383,12 +880,6 @@ MAX(f1) 12 TEST-INFO: MASTER: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'master-bin.000017'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000017 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000017 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 11 + 1 -master-bin.000017 # Query 1 # use `mysqltest1`; COMMIT -master-bin.000017 # Query 1 # use `mysqltest1`; DROP INDEX my_idx6 ON mysqltest1.t6 -------- switch to slave -------- SELECT MAX(f1) FROM t1; @@ -1396,10 +887,6 @@ MAX(f1) 12 TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'slave-bin.000017'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000017 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 11 + 1 -slave-bin.000017 # Query 1 # use `mysqltest1`; DROP INDEX my_idx6 ON mysqltest1.t6 -------- switch to master ------- flush logs; @@ -1424,36 +911,22 @@ INSERT INTO t1 SET f1= 12 + 1; SELECT MAX(f1) FROM t1; MAX(f1) 13 -SHOW BINLOG EVENTS IN 'master-bin.000018'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 12 -SHOW BINLOG EVENTS IN 'slave-bin.000018'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- CREATE INDEX my_idx5 ON mysqltest1.t5(f1); SELECT MAX(f1) FROM t1; MAX(f1) 13 -SHOW BINLOG EVENTS IN 'master-bin.000018'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000018 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000018 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 12 + 1 -master-bin.000018 # Query 1 # use `mysqltest1`; COMMIT -master-bin.000018 # Query 1 # use `mysqltest1`; CREATE INDEX my_idx5 ON mysqltest1.t5(f1) -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 13 -SHOW BINLOG EVENTS IN 'slave-bin.000018'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000018 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 12 + 1 -slave-bin.000018 # Query 1 # use `mysqltest1`; CREATE INDEX my_idx5 ON mysqltest1.t5(f1) -------- switch to master ------- ROLLBACK; @@ -1462,12 +935,6 @@ MAX(f1) 13 TEST-INFO: MASTER: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'master-bin.000018'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000018 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000018 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 12 + 1 -master-bin.000018 # Query 1 # use `mysqltest1`; COMMIT -master-bin.000018 # Query 1 # use `mysqltest1`; CREATE INDEX my_idx5 ON mysqltest1.t5(f1) -------- switch to slave -------- SELECT MAX(f1) FROM t1; @@ -1475,10 +942,6 @@ MAX(f1) 13 TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'slave-bin.000018'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000018 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 12 + 1 -slave-bin.000018 # Query 1 # use `mysqltest1`; CREATE INDEX my_idx5 ON mysqltest1.t5(f1) -------- switch to master ------- flush logs; @@ -1505,36 +968,22 @@ INSERT INTO t1 SET f1= 13 + 1; SELECT MAX(f1) FROM t1; MAX(f1) 14 -SHOW BINLOG EVENTS IN 'master-bin.000019'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 13 -SHOW BINLOG EVENTS IN 'slave-bin.000019'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- DROP DATABASE mysqltest2; SELECT MAX(f1) FROM t1; MAX(f1) 14 -SHOW BINLOG EVENTS IN 'master-bin.000019'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000019 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000019 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 13 + 1 -master-bin.000019 # Query 1 # use `mysqltest1`; COMMIT -master-bin.000019 # Query 1 # DROP DATABASE mysqltest2 -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 14 -SHOW BINLOG EVENTS IN 'slave-bin.000019'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000019 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 13 + 1 -slave-bin.000019 # Query 1 # DROP DATABASE mysqltest2 -------- switch to master ------- ROLLBACK; @@ -1543,12 +992,6 @@ MAX(f1) 14 TEST-INFO: MASTER: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'master-bin.000019'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000019 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000019 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 13 + 1 -master-bin.000019 # Query 1 # use `mysqltest1`; COMMIT -master-bin.000019 # Query 1 # DROP DATABASE mysqltest2 -------- switch to slave -------- SELECT MAX(f1) FROM t1; @@ -1556,10 +999,6 @@ MAX(f1) 14 TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'slave-bin.000019'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000019 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 13 + 1 -slave-bin.000019 # Query 1 # DROP DATABASE mysqltest2 -------- switch to master ------- flush logs; @@ -1584,36 +1023,22 @@ INSERT INTO t1 SET f1= 14 + 1; SELECT MAX(f1) FROM t1; MAX(f1) 15 -SHOW BINLOG EVENTS IN 'master-bin.000020'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 14 -SHOW BINLOG EVENTS IN 'slave-bin.000020'; -Log_name Pos Event_type Server_id Orig_log_pos Info -------- switch to master ------- CREATE DATABASE mysqltest3; SELECT MAX(f1) FROM t1; MAX(f1) 15 -SHOW BINLOG EVENTS IN 'master-bin.000020'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000020 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000020 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 14 + 1 -master-bin.000020 # Query 1 # use `mysqltest1`; COMMIT -master-bin.000020 # Query 1 # CREATE DATABASE mysqltest3 -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) 15 -SHOW BINLOG EVENTS IN 'slave-bin.000020'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000020 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 14 + 1 -slave-bin.000020 # Query 1 # CREATE DATABASE mysqltest3 -------- switch to master ------- ROLLBACK; @@ -1622,12 +1047,6 @@ MAX(f1) 15 TEST-INFO: MASTER: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'master-bin.000020'; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000020 # Query 1 # use `mysqltest1`; BEGIN -master-bin.000020 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 14 + 1 -master-bin.000020 # Query 1 # use `mysqltest1`; COMMIT -master-bin.000020 # Query 1 # CREATE DATABASE mysqltest3 -------- switch to slave -------- SELECT MAX(f1) FROM t1; @@ -1635,10 +1054,6 @@ MAX(f1) 15 TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -SHOW BINLOG EVENTS IN 'slave-bin.000020'; -Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.000020 # Query 1 # use `mysqltest1`; INSERT INTO t1 SET f1= 14 + 1 -slave-bin.000020 # Query 1 # CREATE DATABASE mysqltest3 -------- switch to master ------- flush logs; diff --git a/mysql-test/t/rpl_ddl.test b/mysql-test/t/rpl_ddl.test index d9b09d397b5..301a55b5493 100644 --- a/mysql-test/t/rpl_ddl.test +++ b/mysql-test/t/rpl_ddl.test @@ -253,6 +253,8 @@ let $my_slave_commit= false; --source include/rpl_stmt_seq.inc # With prior read locking +# Note that this test generate an error since the rpl_stmt_seq.inc +# tries to insert into t1. LOCK TABLES mysqltest1.t1 READ; let $my_stmt= UNLOCK TABLES; let $my_master_commit= false; From 51cd70da3dced6800ccf31a6c8e63040b73dbc84 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Jun 2005 23:05:38 +0400 Subject: [PATCH 07/13] A fix for Bug#9141 "4.1 does not log into slow log ALTER, OPTIMIZE and ANALYZE statements". In 4.1 we disabled logging of slow admin statements. The fix adds an option to enable it back. No test case (slow log is not tested in the test suite), but tested manually. + post-review fixes (word police mainly). sql/mysql_priv.h: - declaration for a new option sql/mysqld.cc: Add server option '--log-slow-admin-statements' to log slow optimize/alter/etc statements to the slow log if it's enabled. Add warnings that this option works only if the slow log is open. sql/sql_class.h: Rename 'thd->slow_command' to thd->enable_slow_log (negates the meaning of this variable, and so resolves the need to negate value opt_log_slow_admin_statements when setting it). sql/sql_parse.cc: Implement optional logging of administrative statements in the slow log. --- sql/mysql_priv.h | 1 + sql/mysqld.cc | 19 ++++++++++++++++--- sql/sql_class.h | 2 +- sql/sql_parse.cc | 33 ++++++++++++++++++--------------- 4 files changed, 36 insertions(+), 19 deletions(-) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 0d058190a46..e9e8b52270c 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -918,6 +918,7 @@ extern my_bool opt_slave_compressed_protocol, use_temp_pool; extern my_bool opt_readonly, lower_case_file_system; extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs; extern my_bool opt_secure_auth; +extern my_bool opt_log_slow_admin_statements; extern uint opt_crash_binlog_innodb; extern char *shared_memory_base_name, *mysqld_unix_port; extern bool opt_enable_shared_memory; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 67a80c4ca20..951de53724f 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -294,6 +294,7 @@ my_bool opt_sync_bdb_logs, opt_sync_frm, opt_allow_suspicious_udfs; my_bool opt_secure_auth= 0; my_bool opt_short_log_format= 0; my_bool opt_log_queries_not_using_indexes= 0; +my_bool opt_log_slow_admin_statements= 0; my_bool lower_case_file_system= 0; my_bool opt_innodb_safe_binlog= 0; volatile bool mqh_used = 0; @@ -4196,7 +4197,8 @@ enum options_mysqld OPT_TIME_FORMAT, OPT_DATETIME_FORMAT, OPT_LOG_QUERIES_NOT_USING_INDEXES, - OPT_DEFAULT_TIME_ZONE + OPT_DEFAULT_TIME_ZONE, + OPT_LOG_SLOW_ADMIN_STATEMENTS }; @@ -4456,7 +4458,7 @@ Disable with --skip-isam.", "Log some extra information to update log. Please note that this option is deprecated; see --log-short-format option.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"log-queries-not-using-indexes", OPT_LOG_QUERIES_NOT_USING_INDEXES, - "Log queries that are executed without benefit of any index.", + "Log queries that are executed without benefit of any index to the slow log if it is open.", (gptr*) &opt_log_queries_not_using_indexes, (gptr*) &opt_log_queries_not_using_indexes, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"log-short-format", OPT_SHORT_LOG_FORMAT, @@ -4467,8 +4469,13 @@ Disable with --skip-isam.", "Tells the slave to log the updates from the slave thread to the binary log. You will need to turn it on if you plan to daisy-chain the slaves.", (gptr*) &opt_log_slave_updates, (gptr*) &opt_log_slave_updates, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"log-slow-admin-statements", OPT_LOG_SLOW_ADMIN_STATEMENTS, + "Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open.", + (gptr*) &opt_log_slow_admin_statements, + (gptr*) &opt_log_slow_admin_statements, + 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"log-slow-queries", OPT_SLOW_QUERY_LOG, - "Log slow queries to this log file. Defaults logging to hostname-slow.log file.", + "Log slow queries to this log file. Defaults logging to hostname-slow.log file. Must be enabled to activate other slow log options.", (gptr*) &opt_slow_logname, (gptr*) &opt_slow_logname, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"log-update", OPT_UPDATE_LOG, @@ -6084,6 +6091,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case (int) OPT_SLOW_QUERY_LOG: opt_slow_log=1; break; + case (int) OPT_LOG_SLOW_ADMIN_STATEMENTS: + opt_log_slow_admin_statements= 1; + break; case (int) OPT_SKIP_NEW: opt_specialflag|= SPECIAL_NO_NEW_FUNC; delay_key_write_options= (uint) DELAY_KEY_WRITE_NONE; @@ -6443,6 +6453,9 @@ static void get_options(int argc,char **argv) if (opt_bdb) sql_print_warning("this binary does not contain BDB storage engine"); #endif + if ((opt_log_slow_admin_statements || opt_log_queries_not_using_indexes) && + !opt_slow_log) + sql_print_warning("options --log-slow-admin-statements and --log-queries-not-using-indexes have no effect if --log-slow-queries is not set"); /* Check that the default storage engine is actually available. diff --git a/sql/sql_class.h b/sql/sql_class.h index fbd60373498..b6bf0dcdc45 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -916,7 +916,7 @@ public: bool query_error, bootstrap, cleanup_done; bool tmp_table_used; bool charset_is_system_charset, charset_is_collation_connection; - bool slow_command; + bool enable_slow_log; /* enable slow log for current statement */ my_bool volatile killed; /* diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index cd84c66cbba..4e714e70c5f 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1342,10 +1342,10 @@ bool dispatch_command(enum enum_server_command command, THD *thd, thd->command=command; /* - Commands which will always take a long time should be marked with - this so that they will not get logged to the slow query log + Commands which always take a long time are logged into + the slow log only if opt_log_slow_admin_statements is set. */ - thd->slow_command=FALSE; + thd->enable_slow_log= TRUE; thd->set_time(); VOID(pthread_mutex_lock(&LOCK_thread_count)); thd->query_id=query_id; @@ -1383,7 +1383,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, uint tbl_len= *(uchar*) (packet + db_len + 1); statistic_increment(com_other, &LOCK_status); - thd->slow_command= TRUE; + thd->enable_slow_log= opt_log_slow_admin_statements; db= thd->alloc(db_len + tbl_len + 2); tbl_name= strmake(db, packet + 1, db_len)+1; strmake(tbl_name, packet + db_len + 2, tbl_len); @@ -1658,7 +1658,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, uint32 slave_server_id; statistic_increment(com_other,&LOCK_status); - thd->slow_command = TRUE; + thd->enable_slow_log= opt_log_slow_admin_statements; if (check_global_access(thd, REPL_SLAVE_ACL)) break; @@ -1848,8 +1848,11 @@ static void log_slow_query(THD *thd) time_t start_of_query=thd->start_time; thd->end_time(); // Set start time - /* If not reading from backup and if the query took too long */ - if (!thd->slow_command && !thd->user_time) // do not log 'slow_command' queries + /* + Do not log administrative statements unless the appropriate option is + set; do not log into slow log if reading from backup. + */ + if (thd->enable_slow_log && !thd->user_time) { thd->proc_info="logging slow query"; @@ -2292,7 +2295,7 @@ mysql_execute_command(THD *thd) check_table_access(thd,SELECT_ACL, tables,0) || check_global_access(thd, FILE_ACL)) goto error; /* purecov: inspected */ - thd->slow_command=TRUE; + thd->enable_slow_log= opt_log_slow_admin_statements; res = mysql_backup_table(thd, tables); break; @@ -2303,7 +2306,7 @@ mysql_execute_command(THD *thd) check_table_access(thd, INSERT_ACL, tables,0) || check_global_access(thd, FILE_ACL)) goto error; /* purecov: inspected */ - thd->slow_command=TRUE; + thd->enable_slow_log= opt_log_slow_admin_statements; res = mysql_restore_table(thd, tables); break; } @@ -2538,7 +2541,7 @@ unsent_create_error: case SQLCOM_CREATE_INDEX: if (check_one_table_access(thd, INDEX_ACL, tables)) goto error; /* purecov: inspected */ - thd->slow_command=TRUE; + thd->enable_slow_log= opt_log_slow_admin_statements; if (end_active_trans(thd)) res= -1; else @@ -2624,7 +2627,7 @@ unsent_create_error: res= -1; else { - thd->slow_command=TRUE; + thd->enable_slow_log= opt_log_slow_admin_statements; res= mysql_alter_table(thd, select_lex->db, lex->name, &lex->create_info, tables, lex->create_list, @@ -2716,7 +2719,7 @@ unsent_create_error: if (check_db_used(thd,tables) || check_table_access(thd,SELECT_ACL | INSERT_ACL, tables,0)) goto error; /* purecov: inspected */ - thd->slow_command=TRUE; + thd->enable_slow_log= opt_log_slow_admin_statements; res = mysql_repair_table(thd, tables, &lex->check_opt); /* ! we write after unlocking the table */ if (!res && !lex->no_write_to_binlog) @@ -2736,7 +2739,7 @@ unsent_create_error: if (check_db_used(thd,tables) || check_table_access(thd, SELECT_ACL | EXTRA_ACL , tables,0)) goto error; /* purecov: inspected */ - thd->slow_command=TRUE; + thd->enable_slow_log= opt_log_slow_admin_statements; res = mysql_check_table(thd, tables, &lex->check_opt); break; } @@ -2745,7 +2748,7 @@ unsent_create_error: if (check_db_used(thd,tables) || check_table_access(thd,SELECT_ACL | INSERT_ACL, tables,0)) goto error; /* purecov: inspected */ - thd->slow_command=TRUE; + thd->enable_slow_log= opt_log_slow_admin_statements; res = mysql_analyze_table(thd, tables, &lex->check_opt); /* ! we write after unlocking the table */ if (!res && !lex->no_write_to_binlog) @@ -2766,7 +2769,7 @@ unsent_create_error: if (check_db_used(thd,tables) || check_table_access(thd,SELECT_ACL | INSERT_ACL, tables,0)) goto error; /* purecov: inspected */ - thd->slow_command=TRUE; + thd->enable_slow_log= opt_log_slow_admin_statements; res= (specialflag & (SPECIAL_SAFE_MODE | SPECIAL_NO_NEW_FUNC)) ? mysql_recreate_table(thd, tables, 1) : mysql_optimize_table(thd, tables, &lex->check_opt); From c0484a301f1dfdac6b63b25cf0e4697a2ad9d05c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Jun 2005 00:11:48 +0400 Subject: [PATCH 08/13] Fix Bug#9334 "PS API queries in log file" and Bug#8367 "low log doesn't gives complete information about prepared statements" Implement status variables for prepared statements commands (a port of the patch by Andrey Hristov). See details in comments to the changed files. No test case as there is no way to test slow log/general log in mysqltest. mysql-test/r/ps_grant.result: Now execute is logged with tag 'Execute' (changed result file). sql/mysql_priv.h: - remove obsolete macro. - add declarations for new status variables. - export function log_slow_statement, which now is used in sql_prepare.cc sql/mysqld.cc: Add status variables for prepared statements API: now we record mysql_stmt_close, mysql_stmt_reset, mysql_stmt_prepare, mysql_stmt_execute mysql_stmt_send_long_data, PREPARE, EXECUTE, DEALLOCATE. sql/sql_parse.cc: - account DEALLOCATE prepare as a Com_stmt_close command (close of a prepared statement). sql/sql_prepare.cc: - fix a bug in SQL syntax for prepared statements + logging: if we use --log and EXECUTE stmt USING @no_such_variable;, the server crashed because the old code assumed that the variable returned by get_var_with_binlog is never NULL. - account statistics for mysql_stmt_{prepare,execute,close,reset,send_long_data} in Com_stmt_{prepare,execute,close,reset,send_long_data} correspondingly. - log slow statements into the slow log early, when thd->query points to a valid (with expanded placeholder values) query. The previous version was logging it in sql_parse, when thd->query is empty. Prevent the server from logging the statement twice by setting thd->enable_slow_log= FALSE. - now in case of EXECUTE stmt in SQL syntax for prepared statements the general log gets two queries, e.g. Query EXECUTE stmt USING @a, @b, @c Execute INSERT INTO t1 VALUES (1, 2, 3) This makes the behavior consistent with PREPARE command, which also logs the statement twice. --- mysql-test/r/ps_grant.result | 2 +- sql/mysql_priv.h | 5 ++- sql/mysqld.cc | 7 ++++ sql/sql_parse.cc | 9 +++-- sql/sql_prepare.cc | 71 +++++++++++++++++++++++++----------- 5 files changed, 65 insertions(+), 29 deletions(-) diff --git a/mysql-test/r/ps_grant.result b/mysql-test/r/ps_grant.result index 0787f30c643..249fb2fe40f 100644 --- a/mysql-test/r/ps_grant.result +++ b/mysql-test/r/ps_grant.result @@ -78,4 +78,4 @@ drop database mysqltest; prepare stmt4 from ' show full processlist '; execute stmt4; Id User Host db Command Time State Info -number root localhost test Query time NULL show full processlist +number root localhost test Execute time NULL show full processlist diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index e9e8b52270c..2bcaa1ecc2d 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -424,8 +424,6 @@ struct Query_cache_query_flags #define query_cache_invalidate_by_MyISAM_filename_ref NULL #endif /*HAVE_QUERY_CACHE*/ -#define prepare_execute(A) ((A)->command == COM_EXECUTE) - int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create, bool silent); int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create); int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent); @@ -462,6 +460,7 @@ void mysql_execute_command(THD *thd); bool do_command(THD *thd); bool dispatch_command(enum enum_server_command command, THD *thd, char* packet, uint packet_length); +void log_slow_statement(THD *thd); bool check_dup(const char *db, const char *name, TABLE_LIST *tables); bool table_cache_init(void); @@ -899,6 +898,8 @@ extern ulong binlog_cache_size, max_binlog_cache_size, open_files_limit; extern ulong max_binlog_size, max_relay_log_size; extern ulong rpl_recovery_rank, thread_cache_size; extern ulong com_stat[(uint) SQLCOM_END], com_other, back_log; +extern ulong com_stmt_prepare, com_stmt_execute, com_stmt_send_long_data; +extern ulong com_stmt_reset, com_stmt_close; extern ulong specialflag, current_pid; extern ulong expire_logs_days, sync_binlog_period, sync_binlog_counter; extern my_bool relay_log_purge, opt_innodb_safe_binlog; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 951de53724f..ec05ea2b8ce 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -316,6 +316,8 @@ ulong slave_net_timeout, slave_trans_retries; ulong thread_cache_size=0, binlog_cache_size=0, max_binlog_cache_size=0; ulong query_cache_size=0; ulong com_stat[(uint) SQLCOM_END], com_other; +ulong com_stmt_prepare, com_stmt_execute, com_stmt_send_long_data; +ulong com_stmt_close, com_stmt_reset; ulong bytes_sent, bytes_received, net_big_packet_count; ulong refresh_version, flush_version; /* Increments on each reload */ ulong query_id, long_query_count; @@ -5474,6 +5476,11 @@ struct show_var_st status_vars[]= { {"Com_show_warnings", (char*) (com_stat+(uint) SQLCOM_SHOW_WARNS),SHOW_LONG}, {"Com_slave_start", (char*) (com_stat+(uint) SQLCOM_SLAVE_START),SHOW_LONG}, {"Com_slave_stop", (char*) (com_stat+(uint) SQLCOM_SLAVE_STOP),SHOW_LONG}, + {"Com_stmt_prepare", (char*) &com_stmt_prepare, SHOW_LONG}, + {"Com_stmt_execute", (char*) &com_stmt_execute, SHOW_LONG}, + {"Com_stmt_send_long_data", (char*) &com_stmt_send_long_data, SHOW_LONG}, + {"Com_stmt_reset", (char*) &com_stmt_reset, SHOW_LONG}, + {"Com_stmt_close", (char*) &com_stmt_close, SHOW_LONG}, {"Com_truncate", (char*) (com_stat+(uint) SQLCOM_TRUNCATE),SHOW_LONG}, {"Com_unlock_tables", (char*) (com_stat+(uint) SQLCOM_UNLOCK_TABLES),SHOW_LONG}, {"Com_update", (char*) (com_stat+(uint) SQLCOM_UPDATE),SHOW_LONG}, diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 4e714e70c5f..c107203b548 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -59,7 +59,6 @@ static void remove_escape(char *name); static void refresh_status(void); static bool append_file_to_dir(THD *thd, const char **filename_ptr, const char *table_name); -static void log_slow_query(THD *thd); const char *any_db="*any*"; // Special symbol for check_access @@ -1515,7 +1514,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, #endif ulong length= (ulong)(packet_end-packet); - log_slow_query(thd); + log_slow_statement(thd); /* Remove garbage at start of query */ while (my_isspace(thd->charset(), *packet) && length > 0) @@ -1827,7 +1826,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, if (thd->is_fatal_error) send_error(thd,0); // End of memory ? - log_slow_query(thd); + log_slow_statement(thd); thd->proc_info="cleaning up"; VOID(pthread_mutex_lock(&LOCK_thread_count)); // For process list @@ -1843,7 +1842,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, } -static void log_slow_query(THD *thd) +void log_slow_statement(THD *thd) { time_t start_of_query=thd->start_time; thd->end_time(); // Set start time @@ -2193,6 +2192,8 @@ mysql_execute_command(THD *thd) DBUG_PRINT("info", ("DEALLOCATE PREPARE: %.*s\n", lex->prepared_stmt_name.length, lex->prepared_stmt_name.str)); + /* We account deallocate in the same manner as mysql_stmt_close */ + statistic_increment(com_stmt_close, &LOCK_status); if ((stmt= thd->stmt_map.find_by_name(&lex->prepared_stmt_name))) { thd->stmt_map.erase(stmt); diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index b57f88ac172..1f5bb04c802 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -820,7 +820,8 @@ static bool insert_params_from_vars_with_log(Prepared_statement *stmt, DBUG_ENTER("insert_params_from_vars"); List_iterator var_it(varnames); - String str; + String buf; + const String *val; uint32 length= 0; if (query->copy(stmt->query, stmt->query_length, default_charset_info)) DBUG_RETURN(1); @@ -831,32 +832,35 @@ static bool insert_params_from_vars_with_log(Prepared_statement *stmt, varname= var_it++; if (get_var_with_binlog(stmt->thd, *varname, &entry)) DBUG_RETURN(1); - DBUG_ASSERT(entry); if (param->set_from_user_var(stmt->thd, entry)) DBUG_RETURN(1); /* Insert @'escaped-varname' instead of parameter in the query */ - char *buf, *ptr; - str.length(0); - if (str.reserve(entry->name.length*2+3)) - DBUG_RETURN(1); + if (entry) + { + char *begin, *ptr; + buf.length(0); + if (buf.reserve(entry->name.length*2+3)) + DBUG_RETURN(1); - buf= str.c_ptr_quick(); - ptr= buf; - *ptr++= '@'; - *ptr++= '\''; - ptr+= - escape_string_for_mysql(&my_charset_utf8_general_ci, - ptr, entry->name.str, entry->name.length); - *ptr++= '\''; - str.length(ptr - buf); + begin= ptr= buf.c_ptr_quick(); + *ptr++= '@'; + *ptr++= '\''; + ptr+= escape_string_for_mysql(&my_charset_utf8_general_ci, + ptr, entry->name.str, entry->name.length); + *ptr++= '\''; + buf.length(ptr - begin); + val= &buf; + } + else + val= &my_null_string; if (param->convert_str_value(stmt->thd)) DBUG_RETURN(1); /* out of memory */ - if (query->replace(param->pos_in_query+length, 1, str)) + if (query->replace(param->pos_in_query+length, 1, *val)) DBUG_RETURN(1); - length+= str.length()-1; + length+= val->length()-1; } DBUG_RETURN(0); } @@ -1558,6 +1562,13 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length, DBUG_PRINT("prep_query", ("%s", packet)); + /* + If this is an SQLCOM_PREPARE, we also increase Com_prepare_sql. + However, it seems handy if com_stmt_prepare is increased always, + no matter what kind of prepare is processed. + */ + statistic_increment(com_stmt_prepare, &LOCK_status); + if (stmt == 0) { send_error(thd, ER_OUT_OF_RESOURCES); @@ -1596,7 +1607,7 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length, DBUG_RETURN(1); } - mysql_log.write(thd, COM_PREPARE, "[%lu] %s", stmt->id, packet); + mysql_log.write(thd, thd->command, "[%lu] %s", stmt->id, packet); thd->current_arena= stmt; mysql_init_query(thd, (uchar *) thd->query, thd->query_length); @@ -1763,6 +1774,7 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length) packet+= 9; /* stmt_id + 5 bytes of flags */ + statistic_increment(com_stmt_execute, &LOCK_status); if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_execute", SEND_ERROR))) DBUG_VOID_RETURN; @@ -1796,9 +1808,6 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length) if (stmt->param_count && stmt->set_params_data(stmt, &expanded_query)) goto set_params_data_err; #endif - mysql_log.write(thd, COM_EXECUTE, "[%lu] %s", stmt->id, - expanded_query.length() ? expanded_query.c_ptr() : - stmt->query); thd->protocol= &thd->protocol_prep; // Switch to binary protocol execute_stmt(thd, stmt, &expanded_query, TRUE); thd->protocol= &thd->protocol_simple; // Use normal protocol @@ -1827,6 +1836,8 @@ void mysql_sql_stmt_execute(THD *thd, LEX_STRING *stmt_name) String expanded_query; DBUG_ENTER("mysql_sql_stmt_execute"); + /* See comment for statistics_increment in mysql_stmt_prepare */ + statistic_increment(com_stmt_execute, &LOCK_status); if (!(stmt= (Prepared_statement*)thd->stmt_map.find_by_name(stmt_name))) { my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), stmt_name->length, @@ -1853,6 +1864,7 @@ void mysql_sql_stmt_execute(THD *thd, LEX_STRING *stmt_name) my_error(ER_WRONG_ARGUMENTS, MYF(0), "EXECUTE"); send_error(thd); } + thd->command= COM_EXECUTE; /* For nice messages in general log */ execute_stmt(thd, stmt, &expanded_query, FALSE); DBUG_VOID_RETURN; } @@ -1887,6 +1899,7 @@ static void execute_stmt(THD *thd, Prepared_statement *stmt, my_error(ER_OUTOFMEMORY, 0, expanded_query->length()); DBUG_VOID_RETURN; } + mysql_log.write(thd, thd->command, "[%lu] %s", stmt->id, thd->query); /* At first execution of prepared statement we will perform logical transformations of the query tree (i.e. negations elimination). @@ -1900,6 +1913,14 @@ static void execute_stmt(THD *thd, Prepared_statement *stmt, thd->lex->unit.cleanup(); if (!(specialflag & SPECIAL_NO_PRIOR)) my_pthread_setprio(pthread_self(), WAIT_PRIOR); + /* + 'start_time' is set in dispatch_command, but THD::query will + be freed when we return from this function. So let's log the slow + query here. + */ + log_slow_statement(thd); + /* Prevent from second logging in the end of dispatch_command */ + thd->enable_slow_log= FALSE; /* Free Items that were created during this execution of the PS. */ free_items(thd->free_list); @@ -1941,6 +1962,7 @@ void mysql_stmt_reset(THD *thd, char *packet) DBUG_ENTER("mysql_stmt_reset"); + statistic_increment(com_stmt_reset, &LOCK_status); if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_reset", SEND_ERROR))) DBUG_VOID_RETURN; @@ -1973,6 +1995,7 @@ void mysql_stmt_free(THD *thd, char *packet) DBUG_ENTER("mysql_stmt_free"); + statistic_increment(com_stmt_close, &LOCK_status); if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_close", DONT_SEND_ERROR))) DBUG_VOID_RETURN; @@ -2012,6 +2035,7 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length) DBUG_ENTER("mysql_stmt_get_longdata"); + statistic_increment(com_stmt_send_long_data, &LOCK_status); #ifndef EMBEDDED_LIBRARY /* Minimal size of long data packet is 6 bytes */ if ((ulong) (packet_end - packet) < MYSQL_LONG_DATA_HEADER) @@ -2068,10 +2092,12 @@ Prepared_statement::Prepared_statement(THD *thd_arg) *last_error= '\0'; } + void Prepared_statement::setup_set_params() { /* Setup binary logging */ - if (mysql_bin_log.is_open() && is_update_query(lex->sql_command)) + if (mysql_bin_log.is_open() && is_update_query(lex->sql_command) || + mysql_log.is_open() || mysql_slow_log.is_open()) { set_params_from_vars= insert_params_from_vars_with_log; #ifndef EMBEDDED_LIBRARY @@ -2091,6 +2117,7 @@ void Prepared_statement::setup_set_params() } } + Prepared_statement::~Prepared_statement() { free_items(free_list); From 6de6d3ad5cc34a53735b0b12ca80846d50537f62 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Jun 2005 12:36:09 +0200 Subject: [PATCH 09/13] sql_select.cc: fixed 64bit bug in lenght store/retrive in cache sql/sql_select.cc: fixed 64bit bug in lenght store/retrive in cache --- sql/sql_select.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 352227acc68..afb221b03ba 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -28,6 +28,8 @@ #include #include +typedef uint32 cache_rec_length_type; + const char *join_type_str[]={ "UNKNOWN","system","const","eq_ref","ref", "MAYBE_REF","ALL","range","index","fulltext", "ref_or_null","unique_subquery","index_subquery" @@ -8067,7 +8069,7 @@ used_blob_length(CACHE_FIELD **ptr) static bool store_record_in_cache(JOIN_CACHE *cache) { - ulong length; + cache_rec_length_type length; uchar *pos; CACHE_FIELD *copy,*end_field; bool last_record; @@ -8148,7 +8150,7 @@ static void read_cached_record(JOIN_TAB *tab) { uchar *pos; - uint length; + cache_rec_length_type length; bool last_record; CACHE_FIELD *copy,*end_field; From 3e4082cd8ebea22b47bf14e3392f822c6499e0d9 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Jun 2005 18:14:28 +0200 Subject: [PATCH 10/13] BSD make compatibility. bug#9828 --- mysql-test/Makefile.am | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 0480c83296e..0c27edb02e7 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -82,9 +82,16 @@ install-data-local: $(INSTALL_DATA) $(srcdir)/lib/init_db.sql $(DESTDIR)$(testdir)/lib $(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib -std_data/%.pem: +std_data/client-key.pem: + @CP@ $(top_srcdir)/SSL/$(@F) $(srcdir)/std_data +std_data/client-cert.pem: + @CP@ $(top_srcdir)/SSL/$(@F) $(srcdir)/std_data +std_data/cacert.pem: + @CP@ $(top_srcdir)/SSL/$(@F) $(srcdir)/std_data +std_data/server-cert.pem: + @CP@ $(top_srcdir)/SSL/$(@F) $(srcdir)/std_data +std_data/server-key.pem: @CP@ $(top_srcdir)/SSL/$(@F) $(srcdir)/std_data - SUFFIXES = .sh From f35c177a2a754c0b09b01c59d1d958f124382c19 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 19 Jun 2005 20:06:27 +0200 Subject: [PATCH 11/13] mysql-test-run.pl: Added dummy --manager-port flag, for backward compatibility Back port from 5.0, correction of paths to SSL pem files mtr_cases.pl: Removed hard coded exclude list for embedded server mysql-test-run.pl: Set environment variable MYSQL_SHOW, to be used in test cases mysql-test/lib/mtr_cases.pl: Removed hard coded exclude list for embedded server mysql-test/mysql-test-run.pl: Added dummy --manager-port flag, for backward compatibility Back port from 5.0, correction of paths to SSL pem files --- mysql-test/lib/mtr_cases.pl | 10 ------ mysql-test/mysql-test-run.pl | 66 ++++++++++++++++++------------------ 2 files changed, 33 insertions(+), 43 deletions(-) diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index b4f0080a4e9..c07f10c3bf7 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -126,16 +126,6 @@ sub collect_one_test_case($$$$$) { return; } - # FIXME temporary solution, we have a hard coded list of test cases to - # skip if we are using the embedded server - - if ( $::glob_use_embedded_server and - mtr_match_any_exact($tname,\@::skip_if_embedded_server) ) - { - $tinfo->{'skip'}= 1; - return; - } - # ---------------------------------------------------------------------- # Collect information about test case # ---------------------------------------------------------------------- diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 17ddebdcb2b..3f7ba38d83d 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -100,31 +100,6 @@ require "lib/mtr_misc.pl"; $Devel::Trace::TRACE= 1; -my @skip_if_embedded_server= - ( - "alter_table", - "bdb-deadlock", - "connect", - "flush_block_commit", - "grant2", - "grant_cache", - "grant", - "init_connect", - "innodb-deadlock", - "innodb-lock", - "mix_innodb_myisam_binlog", - "mysqlbinlog2", - "mysqlbinlog", - "mysqldump", - "mysql_protocols", - "ps_1general", - "rename", - "show_check", - "system_mysql_db_fix", - "user_var", - "variables", - ); - # Used by gcov our @mysqld_src_dirs= ( @@ -196,6 +171,7 @@ our $exe_mysqlbinlog; our $exe_mysql_client_test; our $exe_mysqld; our $exe_mysqldump; # Called from test case +our $exe_mysqlshow; # Called from test case our $exe_mysql_fix_system_tables; our $exe_mysqltest; our $exe_slave_mysqld; @@ -241,6 +217,7 @@ our $opt_ndbcluster_port; our $opt_ndbconnectstring; our $opt_no_manager; # Does nothing now, we never use manager +our $opt_manager_port; # Does nothing now, we never use manager our $opt_old_master; @@ -495,6 +472,7 @@ sub command_line_setup () { 'master_port=i' => \$opt_master_myport, 'slave_port=i' => \$opt_slave_myport, 'ndbcluster_port=i' => \$opt_ndbcluster_port, + 'manager-port' => \$opt_manager_port, # Test case authoring 'record' => \$opt_record, @@ -823,6 +801,14 @@ sub executable_setup () { { $exe_mysqldump= "$glob_basedir/client/mysqldump"; } + if ( -f "$glob_basedir/client/.libs/mysqlshow" ) + { + $exe_mysqlshow= "$glob_basedir/client/.libs/mysqlshow"; + } + else + { + $exe_mysqlshow= "$glob_basedir/client/mysqlshow"; + } if ( -f "$glob_basedir/client/.libs/mysqlbinlog" ) { $exe_mysqlbinlog= "$glob_basedir/client/.libs/mysqlbinlog"; @@ -850,6 +836,7 @@ sub executable_setup () { $path_client_bindir= "$glob_basedir/bin"; $exe_mysqltest= "$path_client_bindir/mysqltest"; $exe_mysqldump= "$path_client_bindir/mysqldump"; + $exe_mysqlshow= "$path_client_bindir/mysqlshow"; $exe_mysqlbinlog= "$path_client_bindir/mysqlbinlog"; $exe_mysqladmin= "$path_client_bindir/mysqladmin"; $exe_mysql= "$path_client_bindir/mysql"; @@ -1821,11 +1808,12 @@ sub mysqld_arguments ($$$$$) { if ( $opt_with_openssl ) { - mtr_add_arg($args, "%s--ssl-ca=%s/SSL/cacert.pem", $prefix, $glob_basedir); - mtr_add_arg($args, "%s--ssl-cert=%s/SSL/server-cert.pem", $prefix, - $glob_basedir); - mtr_add_arg($args, "%s--ssl-key=%s/SSL/server-key.pem", $prefix, - $glob_basedir); + mtr_add_arg($args, "%s--ssl-ca=%s/std_data/cacert.pem", $prefix, + $glob_mysql_test_dir); + mtr_add_arg($args, "%s--ssl-cert=%s/std_data/server-cert.pem", $prefix, + $glob_mysql_test_dir); + mtr_add_arg($args, "%s--ssl-key=%s/std_data/server-key.pem", $prefix, + $glob_mysql_test_dir); } if ( $opt_warnings ) @@ -2058,6 +2046,14 @@ sub run_mysqltest ($$) { " --debug=d:t:A,$opt_vardir/log/mysqldump.trace"; } + my $cmdline_mysqlshow= "$exe_mysqlshow -uroot " . + "--socket=$master->[0]->{'path_mysock'} --password="; + if ( $opt_debug ) + { + $cmdline_mysqlshow .= + " --debug=d:t:A,$opt_vardir/log/mysqlshow.trace"; + } + my $cmdline_mysqlbinlog= "$exe_mysqlbinlog --no-defaults --local-load=$opt_tmpdir"; @@ -2090,6 +2086,7 @@ sub run_mysqltest ($$) { $ENV{'MYSQL'}= $cmdline_mysql; $ENV{'MYSQL_DUMP'}= $cmdline_mysqldump; + $ENV{'MYSQL_SHOW'}= $cmdline_mysqlshow; $ENV{'MYSQL_BINLOG'}= $cmdline_mysqlbinlog; $ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables; $ENV{'MYSQL_CLIENT_TEST'}= $cmdline_mysql_client_test; @@ -2163,9 +2160,12 @@ sub run_mysqltest ($$) { if ( $opt_with_openssl ) { - mtr_add_arg($args, "--ssl-ca=%s/SSL/cacert.pem", $glob_basedir); - mtr_add_arg($args, "--ssl-cert=%s/SSL/client-cert.pem", $glob_basedir); - mtr_add_arg($args, "--ssl-key=%s/SSL/client-key.pem", $glob_basedir); + mtr_add_arg($args, "--ssl-ca=%s/std_data/cacert.pem", + $glob_mysql_test_dir); + mtr_add_arg($args, "--ssl-cert=%s/std_data/client-cert.pem", + $glob_mysql_test_dir); + mtr_add_arg($args, "--ssl-key=%s/std_data/client-key.pem", + $glob_mysql_test_dir); } mtr_add_arg($args, "-R"); From 8d87d9bf290c534692072b6ef3795a7d67ce6340 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 20 Jun 2005 15:18:53 +1000 Subject: [PATCH 12/13] BUG#11377 Building cluster in 4.1 BK tree fails with GCC4.0 ndb/src/kernel/SimBlockList.cpp: GCC 4.0 build fix --- ndb/src/kernel/SimBlockList.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ndb/src/kernel/SimBlockList.cpp b/ndb/src/kernel/SimBlockList.cpp index 75a52ae0c4b..bf3958cf137 100644 --- a/ndb/src/kernel/SimBlockList.cpp +++ b/ndb/src/kernel/SimBlockList.cpp @@ -39,7 +39,6 @@ #else enum SIMBLOCKLIST_DUMMY { A_VALUE = 0 }; -static void * operator new (size_t sz, SIMBLOCKLIST_DUMMY dummy){ char * tmp = (char *)malloc(sz); From 1bc23847bf245a808ccd6f22633ae03685a8e771 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 20 Jun 2005 07:53:53 +0200 Subject: [PATCH 13/13] ha_ndbcluster.cc: remove typecheck in ndb handler not needed sql/ha_ndbcluster.cc: remove typecheck in ndb handler not needed --- sql/ha_ndbcluster.cc | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index a0080af1dfb..5ceab51fbe1 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -464,13 +464,12 @@ bool ha_ndbcluster::get_error_message(int error, } +#ifndef DBUG_OFF /* Check if type is supported by NDB. - TODO Use this once in open(), not in every operation - */ -static inline bool ndb_supported_type(enum_field_types type) +static bool ndb_supported_type(enum_field_types type) { switch (type) { case MYSQL_TYPE_DECIMAL: @@ -502,6 +501,7 @@ static inline bool ndb_supported_type(enum_field_types type) } return FALSE; } +#endif /* !DBUG_OFF */ /* @@ -531,15 +531,10 @@ int ha_ndbcluster::set_ndb_key(NdbOperation *ndb_op, Field *field, pack_len)); DBUG_DUMP("key", (char*)field_ptr, pack_len); - if (ndb_supported_type(field->type())) - { - if (! (field->flags & BLOB_FLAG)) - // Common implementation for most field types - DBUG_RETURN(ndb_op->equal(fieldnr, (char*) field_ptr, pack_len) != 0); - } - // Unhandled field types - DBUG_PRINT("error", ("Field type %d not supported", field->type())); - DBUG_RETURN(2); + DBUG_ASSERT(ndb_supported_type(field->type())); + DBUG_ASSERT(! (field->flags & BLOB_FLAG)); + // Common implementation for most field types + DBUG_RETURN(ndb_op->equal(fieldnr, (char*) field_ptr, pack_len) != 0); } @@ -558,7 +553,7 @@ int ha_ndbcluster::set_ndb_value(NdbOperation *ndb_op, Field *field, pack_len, field->is_null()?"Y":"N")); DBUG_DUMP("value", (char*) field_ptr, pack_len); - if (ndb_supported_type(field->type())) + DBUG_ASSERT(ndb_supported_type(field->type())); { // ndb currently does not support size 0 const byte *empty_field= ""; @@ -607,9 +602,6 @@ int ha_ndbcluster::set_ndb_value(NdbOperation *ndb_op, Field *field, } DBUG_RETURN(1); } - // Unhandled field types - DBUG_PRINT("error", ("Field type %d not supported", field->type())); - DBUG_RETURN(2); } @@ -704,9 +696,8 @@ int ha_ndbcluster::get_ndb_value(NdbOperation *ndb_op, Field *field, if (field != NULL) { - DBUG_ASSERT(buf); - if (ndb_supported_type(field->type())) - { + DBUG_ASSERT(buf); + DBUG_ASSERT(ndb_supported_type(field->type())); DBUG_ASSERT(field->ptr != NULL); if (! (field->flags & BLOB_FLAG)) { @@ -730,10 +721,6 @@ int ha_ndbcluster::get_ndb_value(NdbOperation *ndb_op, Field *field, DBUG_RETURN(ndb_blob->setActiveHook(g_get_ndb_blobs_value, arg) != 0); } DBUG_RETURN(1); - } - // Unhandled field types - DBUG_PRINT("error", ("Field type %d not supported", field->type())); - DBUG_RETURN(2); } // Used for hidden key only