From b1dafe5efec012a5c18f7e96b4e68aba8340bd2e Mon Sep 17 00:00:00 2001 From: "skozlov/ksm@mysql.com/virtop.(none)" <> Date: Fri, 4 Apr 2008 01:16:55 +0400 Subject: [PATCH 01/16] Bug#32653. Added --log-slave-updates because test requires it. The events based on LOAD DATA INFILE masked by --replace_regex instead restarting of slave. Added waiting start and stop of slave after START|STOP SLAVE statements. --- mysql-test/r/rpl_log.result | 15 +++++++-------- mysql-test/t/disabled.def | 1 - mysql-test/t/rpl_log-slave.opt | 2 +- mysql-test/t/rpl_log.test | 19 ++++++++----------- 4 files changed, 16 insertions(+), 21 deletions(-) diff --git a/mysql-test/r/rpl_log.result b/mysql-test/r/rpl_log.result index 6ee0eb283b5..ae3fe107038 100644 --- a/mysql-test/r/rpl_log.result +++ b/mysql-test/r/rpl_log.result @@ -7,7 +7,7 @@ start slave; stop slave; reset master; reset slave; -reset master; +start slave; create table t1(n int not null auto_increment primary key); insert into t1 values (NULL); drop table t1; @@ -25,8 +25,8 @@ master-bin.000001 219 Intvar 1 247 INSERT_ID=1 master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL) master-bin.000001 338 Query 1 414 use `test`; drop table t1 master-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null) -master-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581 -master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1 +master-bin.000001 517 Begin_load_query 1 1121 ;file_id=#;block_len=# +master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile 'words.dat' into table t1 ignore 1 lines ;file_id=# master-bin.000001 1269 Query 1 1345 use `test`; drop table t1 show binlog events from 98 limit 1; Log_name Pos Event_type Server_id End_log_pos Info @@ -41,7 +41,6 @@ master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL) flush logs; create table t5 (a int); drop table t5; -start slave; flush logs; stop slave; create table t1 (n int); @@ -55,8 +54,8 @@ master-bin.000001 219 Intvar 1 247 INSERT_ID=1 master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL) master-bin.000001 338 Query 1 414 use `test`; drop table t1 master-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null) -master-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581 -master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1 +master-bin.000001 517 Begin_load_query 1 1121 ;file_id=#;block_len=# +master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile 'words.dat' into table t1 ignore 1 lines ;file_id=# master-bin.000001 1269 Query 1 1345 use `test`; drop table t1 master-bin.000001 1345 Rotate 1 1389 master-bin.000002;pos=4 show binlog events in 'master-bin.000002'; @@ -84,8 +83,8 @@ slave-bin.000001 219 Intvar 1 247 INSERT_ID=1 slave-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL) slave-bin.000001 338 Query 1 414 use `test`; drop table t1 slave-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null) -slave-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581 -slave-bin.000001 1121 Execute_load_query 1 1271 use `test`; load data INFILE '../tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1 +slave-bin.000001 517 Begin_load_query 1 1121 ;file_id=#;block_len=# +slave-bin.000001 1121 Execute_load_query 1 1271 use `test`; load data INFILE 'words.dat' INTO table t1 ignore 1 lines ;file_id=# slave-bin.000001 1271 Query 1 1347 use `test`; drop table t1 slave-bin.000001 1347 Query 1 1433 use `test`; create table t5 (a int) slave-bin.000001 1433 Query 1 1509 use `test`; drop table t5 diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 297b6e70f39..591e9d71721 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -17,7 +17,6 @@ im_options_set : Bug#20294: Instance manager tests fail randomly im_options_unset : Bug#20294: Instance manager tests fail randomly im_utils : Bug#20294: Instance manager tests fail randomly grant_cache : Bug#32651: grant_cache.test fails -rpl_log : Bug#32653: rpl_log.test fails randomly rpl_view : Bug#32654: rpl_view.test fails randomly ndb_backup_print : Bug#32357: ndb_backup_print test fails sometimes in pushbuild rpl_log_pos : Bug#8693 Test 'rpl_log_pos' fails sometimes diff --git a/mysql-test/t/rpl_log-slave.opt b/mysql-test/t/rpl_log-slave.opt index 8b137891791..203fc2287ec 100644 --- a/mysql-test/t/rpl_log-slave.opt +++ b/mysql-test/t/rpl_log-slave.opt @@ -1 +1 @@ - +--log-slave-updates diff --git a/mysql-test/t/rpl_log.test b/mysql-test/t/rpl_log.test index 578a39efd6e..52c4a3e0606 100644 --- a/mysql-test/t/rpl_log.test +++ b/mysql-test/t/rpl_log.test @@ -13,22 +13,15 @@ save_master_pos; connection slave; sync_with_master; stop slave; +--source include/wait_for_slave_to_stop.inc reset master; reset slave; -# We are going to read the slave's binlog which contains file_id (for some LOAD -# DATA INFILE); to make it repeatable (not influenced by other tests), we need -# to stop and start the slave, to be sure file_id will start from 1. -# This can be done with 'server_stop slave', but -# this would require the manager, so most of the time the test will be skipped -# :( -# To workaround this, I (Guilhem) add a (empty) rpl_log-slave.opt (because when -# mysql-test-run finds such a file it restarts the slave before doing the -# test). That's not very elegant but I could find no better way, sorry. +start slave; +--source include/wait_for_slave_to_start.inc let $VERSION=`select version()`; connection master; -reset master; create table t1(n int not null auto_increment primary key); insert into t1 values (NULL); drop table t1; @@ -37,6 +30,7 @@ load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines; select count(*) from t1; drop table t1; --replace_result $VERSION VERSION +--replace_regex /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /infile '.+'/infile 'words.dat'/ show binlog events; show binlog events from 98 limit 1; show binlog events from 98 limit 2; @@ -69,10 +63,10 @@ connection slave; # Note that the above 'slave start' will cause a 3rd rotate event (a fake one) # to go into the relay log (the master always sends a fake one when replication # starts). -start slave; sync_with_master; flush logs; stop slave; +--source include/wait_for_slave_to_stop.inc connection master; # Create some entries for second log @@ -81,6 +75,7 @@ create table t1 (n int); insert into t1 values (1); drop table t1; --replace_result $VERSION VERSION +--replace_regex /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /infile '.+'/infile 'words.dat'/ show binlog events; --replace_result $VERSION VERSION show binlog events in 'master-bin.000002'; @@ -88,9 +83,11 @@ show binary logs; save_master_pos; connection slave; start slave; +--source include/wait_for_slave_to_start.inc sync_with_master; show binary logs; --replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION +--replace_regex /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /INFILE '.+'/INFILE 'words.dat'/ show binlog events in 'slave-bin.000001' from 4; --replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION show binlog events in 'slave-bin.000002' from 4; From a8b2853fa38cac33d574b281516788430b3d5929 Mon Sep 17 00:00:00 2001 From: "skozlov/ksm@mysql.com/virtop.(none)" <> Date: Sun, 6 Apr 2008 22:24:29 +0400 Subject: [PATCH 02/16] Bug#32654. The reason of bug is incorrect clean up during restarting of mysqld under Windows platform (seems some files were in-use). Mtr restarts servers because an option file exist for slave. The option file for slave forces to skip test.foo table for replication. But really test case does not invlved test.foo table at all. So option file can be removed and mtr will not restart servers for test case. --- mysql-test/t/disabled.def | 1 - mysql-test/t/rpl_view-slave.opt | 1 - 2 files changed, 2 deletions(-) delete mode 100644 mysql-test/t/rpl_view-slave.opt diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 297b6e70f39..2285f966a6d 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -18,7 +18,6 @@ im_options_unset : Bug#20294: Instance manager tests fail randomly im_utils : Bug#20294: Instance manager tests fail randomly grant_cache : Bug#32651: grant_cache.test fails rpl_log : Bug#32653: rpl_log.test fails randomly -rpl_view : Bug#32654: rpl_view.test fails randomly ndb_backup_print : Bug#32357: ndb_backup_print test fails sometimes in pushbuild rpl_log_pos : Bug#8693 Test 'rpl_log_pos' fails sometimes kill : Bug#29149 Test "kill" fails on Windows diff --git a/mysql-test/t/rpl_view-slave.opt b/mysql-test/t/rpl_view-slave.opt deleted file mode 100644 index 79b3bf6174b..00000000000 --- a/mysql-test/t/rpl_view-slave.opt +++ /dev/null @@ -1 +0,0 @@ ---replicate-ignore-table=test.foo From 2c024c86e40cec10ad6ab192fca57a3ae7670324 Mon Sep 17 00:00:00 2001 From: "iggy@slim." <> Date: Mon, 7 Apr 2008 01:32:59 -0400 Subject: [PATCH 03/16] Changes for Visual Studio 9 --- CMakeLists.txt | 14 ++++++-------- zlib/zutil.h | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 37956204faa..d4697efef93 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,18 +82,18 @@ SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DDBUG_OFF") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805") -IF(CMAKE_GENERATOR MATCHES "Visual Studio 8") +# Disable warnings in Visual Studio 8 and above +IF(MSVC AND MSVC_VERSION GREATER 1399) SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996") SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996") SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /wd4996") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996") SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996") SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /wd4996") -ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8") - -IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR - CMAKE_GENERATOR MATCHES "Visual Studio 8") +ENDIF(MSVC AND MSVC_VERSION GREATER 1399) +# Settings for Visual Studio 7 and above. +IF(MSVC AND MSVC_VERSION GREATER 1299) # replace /MDd with /MTd STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}) STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO}) @@ -123,9 +123,7 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR IF(NOT tmp_manifest) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO") ENDIF(NOT tmp_manifest) - -ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR - CMAKE_GENERATOR MATCHES "Visual Studio 8") +ENDIF(MSVC AND MSVC_VERSION GREATER 1299) ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE") diff --git a/zlib/zutil.h b/zlib/zutil.h index b7d5eff81b6..4482957d6ac 100644 --- a/zlib/zutil.h +++ b/zlib/zutil.h @@ -194,7 +194,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # ifdef __TURBOC__ # define NO_vsnprintf # endif -# ifdef WIN32 +# if defined(WIN32) && (!defined(_MSC_VER) || _MSC_VER < 1500) /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ # if !defined(vsnprintf) && !defined(NO_vsnprintf) # define vsnprintf _vsnprintf From 454e94ea27a1c0d67a90759cdd21f7693de03809 Mon Sep 17 00:00:00 2001 From: "iggy@amd64.(none)" <> Date: Mon, 7 Apr 2008 18:40:37 -0400 Subject: [PATCH 04/16] Work around for older version of cmake. --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d4697efef93..ae069498da1 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,17 +83,17 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805") # Disable warnings in Visual Studio 8 and above -IF(MSVC AND MSVC_VERSION GREATER 1399) +IF(MSVC AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996") SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996") SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /wd4996") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996") SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996") SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /wd4996") -ENDIF(MSVC AND MSVC_VERSION GREATER 1399) +ENDIF(MSVC AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7") # Settings for Visual Studio 7 and above. -IF(MSVC AND MSVC_VERSION GREATER 1299) +IF(MSVC) # replace /MDd with /MTd STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}) STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO}) @@ -123,7 +123,7 @@ IF(MSVC AND MSVC_VERSION GREATER 1299) IF(NOT tmp_manifest) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO") ENDIF(NOT tmp_manifest) -ENDIF(MSVC AND MSVC_VERSION GREATER 1299) +ENDIF(MSVC) ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE") From ece678c5a26bc675780a7c02d8221610eee315e8 Mon Sep 17 00:00:00 2001 From: Matthias Leich Date: Thu, 21 Aug 2008 16:38:49 +0200 Subject: [PATCH 05/16] Fix for Bug#38270 Test "processlist_priv_ps" fails on varying "processlist" output Details of the fix: - wrong command and state in processlist -> insert poll routine - unexpected additional session -> abort if unexpected session found --- .../funcs_1/datadict/processlist_priv.inc | 41 +++++++++++++++---- .../funcs_1/r/processlist_priv_no_prot.result | 4 +- .../funcs_1/r/processlist_priv_ps.result | 4 +- 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/mysql-test/suite/funcs_1/datadict/processlist_priv.inc b/mysql-test/suite/funcs_1/datadict/processlist_priv.inc index 66c43c750fd..d8e1b398bfc 100644 --- a/mysql-test/suite/funcs_1/datadict/processlist_priv.inc +++ b/mysql-test/suite/funcs_1/datadict/processlist_priv.inc @@ -16,7 +16,7 @@ # That means our SHOW PROCESSLIST can come too early. # # Solution: # # Close the connections at the end of the test. # -# Example2: # +# Example2 (2008-08-14 again observed): # # 1. connection X: SHOW PROCESSLIST/GRANT ... etc. # # 2. Switch to connection Y # # 3. SHOW PROCESSLIST might present a record like # @@ -53,9 +53,11 @@ # WL#3982 Test information_schema.processlist # # # # Last update: # -# 2008-04-14 pcrews replace HOST to account for Windows' use of # -# localhost (host: causing diffs on Windows # -# test runs # +# 2008-08-14 mleich Bug#38270 Test "processlist_priv_ps" fails on # +# varying "processlist" output # +# - Replace one sleep by a poll routines # +# - Remove or disable superfluous sleeps # +# # ######################################################################## # The following variables are used in "datadict_priv.inc" and here. @@ -87,15 +89,28 @@ USE information_schema; --echo 1 Prepare test. --echo connection default (user=root) --echo #################################################################################### +if (`SELECT COUNT(*) <> 1 FROM processlist`) +{ + --echo This test expects one connection to the server. + --echo Expectation: USER HOST DB COMMAND STATE INFO + --echo Expectation: root localhost information_schema Query executing SELECT USER,HOST,DB,COMMAND,STATE,INFO FROM processlist ORDER BY ID + --echo But we found in the moment: + SELECT USER,HOST,DB,COMMAND,STATE,INFO FROM processlist ORDER BY ID; + --echo Maybe + --echo - the base configuration (no of parallel auxiliary sessions) of the server has changed + --echo - a parallel test intended for another server accidently connected to our current one + --echo We cannot proceed in this situation. Abort + exit; +} --echo #################################################################################### --echo 1.1 Create two user --echo #################################################################################### # access to info tables as normal user ---disable_abort_on_error +--error 0, ER_CANNOT_USER DROP USER ddicttestuser1@'localhost'; +--error 0, ER_CANNOT_USER DROP USER ddicttestuser2@'localhost'; ---enable_abort_on_error CREATE USER ddicttestuser1@'localhost'; CREATE USER ddicttestuser2@'localhost'; SET PASSWORD FOR ddicttestuser1@'localhost' = PASSWORD('ddictpass'); @@ -112,6 +127,14 @@ connect (con100,localhost,ddicttestuser1,ddictpass,information_schema); --echo SHOW/SELECT shows all processes/threads. --echo #################################################################################### connection default; +# Avoid Bug#38270 Test "processlist_priv_ps" fails on varying "processlist" output +# This subtest expects that the connection con100 is in state 'Sleep'. +# Poll till the connection con100 is in state COMMAND = 'Sleep'. +let $wait_timeout= 10; +let $wait_condition= +SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST +WHERE DB = 'information_schema' AND COMMAND = 'Sleep' AND USER = 'ddicttestuser1'; +--source include/wait_condition.inc eval SHOW CREATE TABLE $table; --replace_column 1 ID 3 HOST_NAME 6 TIME eval SHOW $table; @@ -120,7 +143,6 @@ eval SELECT * FROM $table $select_where ORDER BY id; --replace_column 1 ID 3 HOST_NAME 6 TIME eval SELECT $columns FROM $table $select_where ORDER BY id; --source suite/funcs_1/datadict/datadict_priv.inc ---real_sleep 0.3 --echo #################################################################################### @@ -128,6 +150,9 @@ eval SELECT $columns FROM $table $select_where ORDER BY id; connection con100; --echo SHOW/SELECT shows only the processes (1) of the user. --echo #################################################################################### +# No need for poll routine here. +# The current state of the default session might depend on load of testing box +# but "ddicttestuser1" must not see anything of the root session. eval SHOW CREATE TABLE $table; --replace_column 1 ID 3 HOST_NAME 6 TIME eval SHOW $table; @@ -219,7 +244,7 @@ SELECT * FROM information_schema.processlist; --echo #################################################################################### ---echo 7 Revoke PROCESS privilege from anonymous user + disconnect ddicttestuser1 +--echo 7 Revoke PROCESS privilege from anonymous user --echo connection default (user=root) --echo #################################################################################### connection default; diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result index e24dae61f17..d862b7424e0 100644 --- a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result +++ b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result @@ -7,9 +7,7 @@ connection default (user=root) 1.1 Create two user #################################################################################### DROP USER ddicttestuser1@'localhost'; -ERROR HY000: Operation DROP USER failed for 'ddicttestuser1'@'localhost' DROP USER ddicttestuser2@'localhost'; -ERROR HY000: Operation DROP USER failed for 'ddicttestuser2'@'localhost' CREATE USER ddicttestuser1@'localhost'; CREATE USER ddicttestuser2@'localhost'; SET PASSWORD FOR ddicttestuser1@'localhost' = PASSWORD('ddictpass'); @@ -240,7 +238,7 @@ ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FRO ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL #################################################################################### -7 Revoke PROCESS privilege from anonymous user + disconnect ddicttestuser1 +7 Revoke PROCESS privilege from anonymous user connection default (user=root) #################################################################################### REVOKE PROCESS ON *.* FROM ''@'localhost'; diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result index 8ec9fad75e1..56230a0f806 100644 --- a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result +++ b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result @@ -7,9 +7,7 @@ connection default (user=root) 1.1 Create two user #################################################################################### DROP USER ddicttestuser1@'localhost'; -ERROR HY000: Operation DROP USER failed for 'ddicttestuser1'@'localhost' DROP USER ddicttestuser2@'localhost'; -ERROR HY000: Operation DROP USER failed for 'ddicttestuser2'@'localhost' CREATE USER ddicttestuser1@'localhost'; CREATE USER ddicttestuser2@'localhost'; SET PASSWORD FOR ddicttestuser1@'localhost' = PASSWORD('ddictpass'); @@ -240,7 +238,7 @@ ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * F ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL #################################################################################### -7 Revoke PROCESS privilege from anonymous user + disconnect ddicttestuser1 +7 Revoke PROCESS privilege from anonymous user connection default (user=root) #################################################################################### REVOKE PROCESS ON *.* FROM ''@'localhost'; From 82aa8e2129a34cc41d231ef7e50d2b87d8227e09 Mon Sep 17 00:00:00 2001 From: Matthias Leich Date: Fri, 22 Aug 2008 19:49:51 +0200 Subject: [PATCH 06/16] Fix for Bug#26687 rpl_ddl test fails if run with --innodb option Details: - The current test + the expected results do only fit if the slave uses MyISAM for mysqltest1.t1. Therefore skip the test if we do not meet these conditions. - The solution for 5.1 will look quite different because "ps_ddl" is already much improved in MySQL 5.1. --- mysql-test/t/rpl_ddl.test | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mysql-test/t/rpl_ddl.test b/mysql-test/t/rpl_ddl.test index d2a41a305b6..23841ee3491 100644 --- a/mysql-test/t/rpl_ddl.test +++ b/mysql-test/t/rpl_ddl.test @@ -55,6 +55,18 @@ DROP DATABASE IF EXISTS mysqltest3; CREATE DATABASE mysqltest1; CREATE DATABASE mysqltest2; CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE= "InnoDB"; +# Prevent Bug#26687 rpl_ddl test fails if run with --innodb option +# The current testscripts + the expected result need that the slave uses MyISAM +# for the table mysqltest.t1. +sync_slave_with_master; +connection slave; +if (`SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES + WHERE TABLE_SCHEMA = 'mysqltest1' AND TABLE_NAME = 't1' + AND ENGINE <> 'MyISAM'`) +{ + skip This test needs on slave side: InnoDB disabled, default engine: MyISAM; +} +connection master; INSERT INTO mysqltest1.t1 SET f1= 0; CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE= "InnoDB"; CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE= "InnoDB"; From 2319c5cf0c87fe653f4140e4dd1ed572d4cc8382 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Thu, 28 Aug 2008 16:59:22 +0200 Subject: [PATCH 07/16] Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY. post push patch when building with valgrind, it does not compile in realpath, so this test fails when using a valgrind build NOTE: building with valgrind is not the same as useing the --valgrind option with mysql-test-run --- mysql-test/t/partition_not_windows.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/t/partition_not_windows.test b/mysql-test/t/partition_not_windows.test index d7108d5af98..4814828c9b9 100644 --- a/mysql-test/t/partition_not_windows.test +++ b/mysql-test/t/partition_not_windows.test @@ -3,6 +3,8 @@ --source include/have_partition.inc # DATA DIRECTORY/INDEX DIRECTORY require symbolic link support --source include/have_symlink.inc +# realpath is not compiled in when building with valgrind +--source include/not_valgrind.inc # The test for Bug 20770 is disabled on Windows due to BUG#19107; it # should be moved into partition.test once the bug has been resolved. From cac06c5ea7ed8b51d633690102709d1e46349139 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Thu, 28 Aug 2008 18:15:54 +0300 Subject: [PATCH 08/16] On behalf of Jasonh: fix for a failing test case of bug 37051 --- mysql-test/include/wait_for_slave_sql_error_and_skip.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mysql-test/include/wait_for_slave_sql_error_and_skip.inc b/mysql-test/include/wait_for_slave_sql_error_and_skip.inc index ef17ffed12f..4b4776d2923 100644 --- a/mysql-test/include/wait_for_slave_sql_error_and_skip.inc +++ b/mysql-test/include/wait_for_slave_sql_error_and_skip.inc @@ -17,6 +17,9 @@ if ($show_sql_error) echo Last_SQL_Error = $error; } +# wait for SQL thread to stop after the error +source include/wait_for_slave_sql_to_stop.inc; + # skip the erroneous statement set global sql_slave_skip_counter=1; start slave; From 44b82b3ecabd044ddadba885349edf16c6686263 Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Fri, 29 Aug 2008 17:20:08 +0300 Subject: [PATCH 09/16] Bug #38798 Assertion mysql_bin_log.is_open() failed in binlog_trans_log_savepos() The assert is about binlogging must have been activated, but it was not actually according to the reported how-to-repeat instuctions. Analysis revealed that binlog_start_trans_and_stmt() was called without prior testing if binlogging is ON. Fixed with avoing entering binlog_start_trans_and_stmt() if binlog is not activated. --- mysql-test/r/skip_log_bin.result | 6 ++++++ mysql-test/t/skip_log_bin-master.opt | 1 + mysql-test/t/skip_log_bin.test | 25 +++++++++++++++++++++++++ sql/sql_insert.cc | 12 +++++++----- 4 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 mysql-test/r/skip_log_bin.result create mode 100644 mysql-test/t/skip_log_bin-master.opt create mode 100644 mysql-test/t/skip_log_bin.test diff --git a/mysql-test/r/skip_log_bin.result b/mysql-test/r/skip_log_bin.result new file mode 100644 index 00000000000..2fdd88ff526 --- /dev/null +++ b/mysql-test/r/skip_log_bin.result @@ -0,0 +1,6 @@ +DROP TABLE IF EXISTS t1, t2; +set @@session.binlog_format=row; +create table t1 (a int); +insert into t1 values (1); +create table t2 select * from t1; +drop table t1, t2; diff --git a/mysql-test/t/skip_log_bin-master.opt b/mysql-test/t/skip_log_bin-master.opt new file mode 100644 index 00000000000..9ebccecc95e --- /dev/null +++ b/mysql-test/t/skip_log_bin-master.opt @@ -0,0 +1 @@ +--loose-skip-log-bin diff --git a/mysql-test/t/skip_log_bin.test b/mysql-test/t/skip_log_bin.test new file mode 100644 index 00000000000..6175b2cf7d3 --- /dev/null +++ b/mysql-test/t/skip_log_bin.test @@ -0,0 +1,25 @@ +# +# binlog_off.test purpose is to verify that the --skip-log-bin flag +# works correctly +# + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +# +# Bug #38798 Assertion mysql_bin_log.is_open() failed in +# binlog_trans_log_savepos() +# Testing that there is no crash. +# Before BUG#38798, the code for CREATE...SELECT called an internal function to +# binlog the statement, even with --skip-log-bin. This caused an assertion +# to be thrown since the binlog was not open. + +set @@session.binlog_format=row; + +create table t1 (a int); +insert into t1 values (1); +create table t2 select * from t1; + +# clean-up +drop table t1, t2; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 9e3c591ae2a..7d66ab487f4 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -3523,7 +3523,8 @@ select_create::prepare(List &values, SELECT_LEX_UNIT *u) temporary table, we need to start a statement transaction. */ if ((thd->lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) == 0 && - thd->current_stmt_binlog_row_based) + thd->current_stmt_binlog_row_based && + mysql_bin_log.is_open()) { thd->binlog_start_trans_and_stmt(); } @@ -3619,10 +3620,11 @@ select_create::binlog_show_create_table(TABLE **tables, uint count) result= store_create_info(thd, &tmp_table_list, &query, create_info); DBUG_ASSERT(result == 0); /* store_create_info() always return 0 */ - thd->binlog_query(THD::STMT_QUERY_TYPE, - query.ptr(), query.length(), - /* is_trans */ TRUE, - /* suppress_use */ FALSE); + if (mysql_bin_log.is_open()) + thd->binlog_query(THD::STMT_QUERY_TYPE, + query.ptr(), query.length(), + /* is_trans */ TRUE, + /* suppress_use */ FALSE); } void select_create::store_values(List &values) From 76cf340947d17d66a02383b37857c76bd07141b0 Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Mon, 1 Sep 2008 11:27:41 +0200 Subject: [PATCH 10/16] Post-merge fixes to update result files. --- mysql-test/suite/rpl/r/rpl_row_log.result | 3 +-- mysql-test/suite/rpl/r/rpl_row_log_innodb.result | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_row_log.result b/mysql-test/suite/rpl/r/rpl_row_log.result index af46d6af9c1..c0d70bb0cdd 100644 --- a/mysql-test/suite/rpl/r/rpl_row_log.result +++ b/mysql-test/suite/rpl/r/rpl_row_log.result @@ -7,7 +7,7 @@ start slave; stop slave; reset master; reset slave; -reset master; +start slave; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM; insert into t1 values (NULL); drop table t1; @@ -113,7 +113,6 @@ Aberdeen Abernathy aberrant aberration -start slave; let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ; diff --git a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result index dc0f9545bc4..790038799c0 100644 --- a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result @@ -7,7 +7,7 @@ start slave; stop slave; reset master; reset slave; -reset master; +start slave; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB; insert into t1 values (NULL); drop table t1; @@ -113,7 +113,6 @@ Aberdeen Abernathy aberrant aberration -start slave; let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ; From 6445c2deae69df41dbe6615d1df081eb67101e1d Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 1 Sep 2008 20:04:17 +0200 Subject: [PATCH 11/16] Bug#37226 Explicit call of my_thread_init() on Windows for every new thread. Bug#33031 app linked to libmysql.lib crash if run as service in vista under localsystem There are some problems using DllMain hook functions on Windows that automatically do global and per-thread initialization for libmysqld.dll 1)per-thread initialization(DLL_THREAD_ATTACH) MySQL internally counts number of active threads that and causes a delay in in my_end() if not all threads are exited. But,there are threads that can be started either by Windows internally (often in TCP/IP scenarios) or by user himself - those threads are not necessarily using libmysql.dll functionality, but nonetheless the contribute to the count of open threads. 2)process-initialization (DLL_PROCESS_ATTACH) my_init() calls WSAStartup that itself loads DLLs and can lead to a deadlock in Windows loader. Fix is to remove dll initialization code from libmysql.dll in general case. I still leave an environment variable LIBMYSQL_DLLINIT, which if set to any value will cause the old behavior (DLL init hooks will be called). This env.variable exists only to prevent breakage of existing Windows-only applications that don't do mysql_thread_init() and work ok today. Use of LIBMYSQL_DLLINIT is discouraged and it will be removed in 6.0 --- libmysql/dll.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libmysql/dll.c b/libmysql/dll.c index 7aa3b5bf96f..8fcf41c792c 100644 --- a/libmysql/dll.c +++ b/libmysql/dll.c @@ -89,9 +89,20 @@ BOOL APIENTRY LibMain(HANDLE hInst,DWORD ul_reason_being_called, UNREFERENCED_PARAMETER(lpReserved); } /* LibMain */ + +static BOOL do_libmain; int __stdcall DllMain(HANDLE hInst,DWORD ul_reason_being_called,LPVOID lpReserved) { - return LibMain(hInst,ul_reason_being_called,lpReserved); + /* + Unless environment variable LIBMYSQL_DLLINIT is set, do nothing. + The environment variable is checked once, during the first call to DllMain() + (in DLL_PROCESS_ATTACH hook). + */ + if (ul_reason_being_called == DLL_PROCESS_ATTACH) + do_libmain = (getenv("LIBMYSQL_DLLINIT") != NULL); + if (do_libmain) + return LibMain(hInst,ul_reason_being_called,lpReserved); + return TRUE; } #elif defined(WINDOWS) From 7e8c13745e0242807989df98e5ad1dcb81df827e Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Mon, 1 Sep 2008 17:11:42 -0300 Subject: [PATCH 12/16] Restore tree name after merge from main. --- .bzr-mysql/default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bzr-mysql/default.conf b/.bzr-mysql/default.conf index f79c1cd6319..e613cefc614 100644 --- a/.bzr-mysql/default.conf +++ b/.bzr-mysql/default.conf @@ -1,4 +1,4 @@ [MYSQL] post_commit_to = "commits@lists.mysql.com" post_push_to = "commits@lists.mysql.com" -tree_name = "mysql-5.0" +tree_name = "mysql-5.1-bugteam" From 36266fc085da03b71a638885a24ce8c155439799 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 1 Sep 2008 17:27:14 -0400 Subject: [PATCH 13/16] Fix "make dist" error - remove Visual Studio project files from distribution --- extra/yassl/Makefile.am | 3 +-- extra/yassl/taocrypt/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/extra/yassl/Makefile.am b/extra/yassl/Makefile.am index 1c0e13c511a..ddd57d60a99 100644 --- a/extra/yassl/Makefile.am +++ b/extra/yassl/Makefile.am @@ -1,6 +1,5 @@ SUBDIRS = taocrypt src testsuite -EXTRA_DIST = yassl.dsp yassl.dsw yassl.vcproj \ - CMakeLists.txt +EXTRA_DIST = CMakeLists.txt # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/extra/yassl/taocrypt/Makefile.am b/extra/yassl/taocrypt/Makefile.am index ac56cfdcf09..11fea2064f0 100644 --- a/extra/yassl/taocrypt/Makefile.am +++ b/extra/yassl/taocrypt/Makefile.am @@ -1,5 +1,5 @@ SUBDIRS = src test benchmark -EXTRA_DIST = taocrypt.dsw taocrypt.dsp taocrypt.vcproj CMakeLists.txt $(wildcard mySTL/*.hpp) +EXTRA_DIST = CMakeLists.txt $(wildcard mySTL/*.hpp) # Don't update the files from bitkeeper %::SCCS/s.% From b2a49edd4effb13a1a9c7db2812652cf00609aef Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 1 Sep 2008 17:46:37 -0400 Subject: [PATCH 14/16] Bug#37226 Explicit call of my_thread_init() on Windows for every new thread. Bug#33031 app linked to libmysql.lib crash if run as service in vista under localsystem There are some problems using DllMain hook functions on Windows that automatically do global and per-thread initialization for libmysqld.dll 1)per-thread initialization(DLL_THREAD_ATTACH) MySQL internally counts number of active threads that and causes a delay in in my_end() if not all threads are exited. But,there are threads that can be started either by Windows internally (often in TCP/IP scenarios) or by user himself - those threads are not necessarily using libmysql.dll functionality, but nonetheless the contribute to the count of open threads. 2)process-initialization (DLL_PROCESS_ATTACH) my_init() calls WSAStartup that itself loads DLLs and can lead to a deadlock in Windows loader. Fix is to remove dll initialization code from libmysql.dll in general case. I still leave an environment variable LIBMYSQL_DLLINIT, which if set to any value will cause the old behavior (DLL init hooks will be called). This env.variable exists only to prevent breakage of existing Windows-only applications that don't do mysql_thread_init() and work ok today. Use of LIBMYSQL_DLLINIT is discouraged and it will be removed in 6.0 --- libmysql/dll.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libmysql/dll.c b/libmysql/dll.c index b0e4b9cab3b..7bea5f880c5 100644 --- a/libmysql/dll.c +++ b/libmysql/dll.c @@ -89,9 +89,20 @@ BOOL APIENTRY LibMain(HANDLE hInst,DWORD ul_reason_being_called, UNREFERENCED_PARAMETER(lpReserved); } /* LibMain */ + +static BOOL do_libmain; int __stdcall DllMain(HANDLE hInst,DWORD ul_reason_being_called,LPVOID lpReserved) { - return LibMain(hInst,ul_reason_being_called,lpReserved); + /* + Unless environment variable LIBMYSQL_DLLINIT is set, do nothing. + The environment variable is checked once, during the first call to DllMain() + (in DLL_PROCESS_ATTACH hook). + */ + if (ul_reason_being_called == DLL_PROCESS_ATTACH) + do_libmain = (getenv("LIBMYSQL_DLLINIT") != NULL); + if (do_libmain) + return LibMain(hInst,ul_reason_being_called,lpReserved); + return TRUE; } #elif defined(WINDOWS) From 447fa91d8367e5044741edd7002838968b4bec72 Mon Sep 17 00:00:00 2001 From: Magnus Svensson Date: Tue, 2 Sep 2008 10:53:30 +0200 Subject: [PATCH 15/16] Bug#31315 mysql_install_db fails if a default table type of NDB is set in my.cnf - Use myisam as default storage engine when running mysqld in --bootstrap mode --- scripts/mysql_install_db.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 4e5ca7305f8..5a2409eeb6f 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -339,6 +339,7 @@ mysqld_bootstrap="${MYSQLD_BOOTSTRAP-$mysqld}" mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \ --basedir=$basedir --datadir=$ldata --log-warnings=0 --loose-skip-innodb \ --loose-skip-ndbcluster $args --max_allowed_packet=8M \ + --default-storage-engine=myisam \ --net_buffer_length=16K" # Create the system and help tables by passing them to "mysqld --bootstrap" From 620a5faaf2d749031784c3226451781c7cb157ac Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Wed, 3 Sep 2008 12:27:01 +0200 Subject: [PATCH 16/16] Updating result files for rpl_ndb test suite. --- mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result index 3bf5ea108ae..18558c57140 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result @@ -7,7 +7,7 @@ start slave; stop slave; reset master; reset slave; -reset master; +start slave; create table t1(n int not null auto_increment primary key)ENGINE=NDB; insert into t1 values (NULL); drop table t1; @@ -117,7 +117,6 @@ Aberdeen Abernathy aberrant aberration -start slave; let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;