diff options
Diffstat (limited to 'mysql-test/include')
-rw-r--r-- | mysql-test/include/bug38347.inc | 21 | ||||
-rw-r--r-- | mysql-test/include/default_client.cnf | 19 | ||||
-rw-r--r-- | mysql-test/include/default_my.cnf | 1 | ||||
-rw-r--r-- | mysql-test/include/have_case_insensitive_fs.inc | 4 | ||||
-rw-r--r-- | mysql-test/include/have_community_features.inc | 4 | ||||
-rw-r--r-- | mysql-test/include/have_nodebug.inc | 4 | ||||
-rw-r--r-- | mysql-test/include/have_profiling.inc | 4 | ||||
-rw-r--r-- | mysql-test/include/have_semisync_plugin.inc | 22 | ||||
-rw-r--r-- | mysql-test/include/have_ssl_communication.inc | 4 | ||||
-rw-r--r-- | mysql-test/include/master-slave.inc | 2 | ||||
-rw-r--r-- | mysql-test/include/query_cache_sql_prepare.inc | 37 | ||||
-rw-r--r-- | mysql-test/include/setup_fake_relay_log.inc | 16 | ||||
-rw-r--r-- | mysql-test/include/show_binlog_events.inc | 29 | ||||
-rw-r--r-- | mysql-test/include/show_binlog_events2.inc | 2 | ||||
-rw-r--r-- | mysql-test/include/show_relaylog_events.inc | 35 | ||||
-rw-r--r-- | mysql-test/include/test_fieldsize.inc | 2 | ||||
-rw-r--r-- | mysql-test/include/wait_for_slave_param.inc | 4 | ||||
-rw-r--r-- | mysql-test/include/wait_until_disconnected.inc | 2 |
18 files changed, 199 insertions, 13 deletions
diff --git a/mysql-test/include/bug38347.inc b/mysql-test/include/bug38347.inc new file mode 100644 index 00000000000..ca1dbfa1bd2 --- /dev/null +++ b/mysql-test/include/bug38347.inc @@ -0,0 +1,21 @@ + +--echo +SHOW GRANTS FOR mysqltest_u1@localhost; + +--echo +--echo # connection: con1 (mysqltest_u1@mysqltest_db1) +--connect (con1,localhost,mysqltest_u1,,mysqltest_db1) +--connection con1 + +--echo +SHOW CREATE TABLE t1; + +--echo +--echo # connection: default +--connection default + +--disconnect con1 + +--echo +REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost; +SHOW GRANTS FOR mysqltest_u1@localhost; diff --git a/mysql-test/include/default_client.cnf b/mysql-test/include/default_client.cnf new file mode 100644 index 00000000000..38f0d39127a --- /dev/null +++ b/mysql-test/include/default_client.cnf @@ -0,0 +1,19 @@ +# +# We use default-character-set=latin1 to avoid character set auto-detection +# when running tests - not to depend on the current machine localization. +# + +[mysql] +default-character-set=latin1 + +[mysqlshow] +default-character-set=latin1 + +[mysqlimport] +default-character-set=latin1 + +[mysqlcheck] +default-character-set=latin1 + +[mysql_upgrade] +default-character-set=latin1 diff --git a/mysql-test/include/default_my.cnf b/mysql-test/include/default_my.cnf index d77fee0e200..428c2166947 100644 --- a/mysql-test/include/default_my.cnf +++ b/mysql-test/include/default_my.cnf @@ -1,5 +1,6 @@ # Use default setting for mysqld processes !include default_mysqld.cnf +!include default_client.cnf [mysqld.1] diff --git a/mysql-test/include/have_case_insensitive_fs.inc b/mysql-test/include/have_case_insensitive_fs.inc new file mode 100644 index 00000000000..de4ad73d780 --- /dev/null +++ b/mysql-test/include/have_case_insensitive_fs.inc @@ -0,0 +1,4 @@ +--require r/case_insensitive_fs.require +--disable_query_log +show variables like 'lower_case_file_system'; +--enable_query_log diff --git a/mysql-test/include/have_community_features.inc b/mysql-test/include/have_community_features.inc deleted file mode 100644 index 66697d8dd00..00000000000 --- a/mysql-test/include/have_community_features.inc +++ /dev/null @@ -1,4 +0,0 @@ ---require r/have_community_features.require ---disable_query_log -show variables like 'have_community_features'; ---enable_query_log diff --git a/mysql-test/include/have_nodebug.inc b/mysql-test/include/have_nodebug.inc new file mode 100644 index 00000000000..3a5b073cd2e --- /dev/null +++ b/mysql-test/include/have_nodebug.inc @@ -0,0 +1,4 @@ +-- require r/have_nodebug.require +disable_query_log; +select (version() like '%debug%') as debug; +enable_query_log; diff --git a/mysql-test/include/have_profiling.inc b/mysql-test/include/have_profiling.inc new file mode 100644 index 00000000000..48f6668ff92 --- /dev/null +++ b/mysql-test/include/have_profiling.inc @@ -0,0 +1,4 @@ +--require r/have_profiling.require +--disable_query_log +show variables like 'have_profiling'; +--enable_query_log diff --git a/mysql-test/include/have_semisync_plugin.inc b/mysql-test/include/have_semisync_plugin.inc new file mode 100644 index 00000000000..37c9a744b6a --- /dev/null +++ b/mysql-test/include/have_semisync_plugin.inc @@ -0,0 +1,22 @@ +# +# Check if dynamic loading is supported +# +--require r/have_dynamic_loading.require +disable_query_log; +show variables like 'have_dynamic_loading'; +enable_query_log; + +# +# Check if the variable SEMISYNC_MASTER_PLUGIN is set +# +if (`select LENGTH('$SEMISYNC_MASTER_PLUGIN') = 0`) +{ + skip Need semisync plugins; +} + +# +# Check if --plugin-dir was setup for semisync +# +if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$SEMISYNC_PLUGIN_OPT'`) { + --skip SEMISYNC plugin requires that --plugin-dir is set to the semisync plugin dir (either the .opt file does not contain \$SEMISYNC_PLUGIN_OPT or another plugin is in use) +} diff --git a/mysql-test/include/have_ssl_communication.inc b/mysql-test/include/have_ssl_communication.inc new file mode 100644 index 00000000000..6f2d5587a75 --- /dev/null +++ b/mysql-test/include/have_ssl_communication.inc @@ -0,0 +1,4 @@ +-- require r/have_ssl.require +disable_query_log; +show variables like 'have_ssl'; +enable_query_log; diff --git a/mysql-test/include/master-slave.inc b/mysql-test/include/master-slave.inc index e0eb87f02f7..25e0150dd0a 100644 --- a/mysql-test/include/master-slave.inc +++ b/mysql-test/include/master-slave.inc @@ -8,5 +8,7 @@ connect (slave1,127.0.0.1,root,,test,$SLAVE_MYPORT,); -- source include/master-slave-reset.inc +connection master; +sync_slave_with_master; # Set the default connection to 'master' connection master; diff --git a/mysql-test/include/query_cache_sql_prepare.inc b/mysql-test/include/query_cache_sql_prepare.inc index 1842d5412bb..baa041aa058 100644 --- a/mysql-test/include/query_cache_sql_prepare.inc +++ b/mysql-test/include/query_cache_sql_prepare.inc @@ -1,11 +1,13 @@ ############### include/query_cache_sql_prepare.inc ################ # # This is to see how statements prepared via the PREPARE SQL command -# go into the query cache: if using parameters they cannot; if not -# using parameters they can. +# go into the query cache. # Query cache is abbreviated as "QC" # # Last update: +# 2008-05-26 Kostja +# - Add test coverage for automatic statement reprepare +# # 2007-05-03 ML - Move t/query_cache_sql_prepare.test # to include/query_cache_sql_prepare.inc # - Create two toplevel tests sourcing this routine @@ -490,6 +492,37 @@ use test; --echo --echo ######################################################################## +--echo # +--echo # Bug#27430 Crash in subquery code when in PS and table DDL changed +--echo # after PREPARE +--echo # Check the effect of automatic reprepare on query cache +--echo # +--echo ######################################################################## +--disable_warnings +drop table if exists t1; +--enable_warnings +create table t1 (a varchar(255)); +insert into t1 (a) values ("Pack my box with five dozen liquor jugs."); +flush status; +prepare stmt from "select a from t1"; +execute stmt; +set @@global.query_cache_size=0; +alter table t1 add column b int; +execute stmt; +set @@global.query_cache_size=100000; +execute stmt; +execute stmt; +--echo # +--echo # Sic: ALTER TABLE caused an automatic reprepare +--echo # of the prepared statement. Since the query cache was disabled +--echo # at the time of reprepare, the new prepared statement doesn't +--echo # work with it. +--echo # +show status like 'Qcache_hits'; +show status like 'Qcache_queries_in_cache'; +--echo # Cleanup +deallocate prepare stmt; +drop table t1; ############################################################################### diff --git a/mysql-test/include/setup_fake_relay_log.inc b/mysql-test/include/setup_fake_relay_log.inc index f88806e1079..b11e6afbeca 100644 --- a/mysql-test/include/setup_fake_relay_log.inc +++ b/mysql-test/include/setup_fake_relay_log.inc @@ -69,7 +69,21 @@ let $_fake_relay_log_purge= `SELECT @@global.relay_log_purge`; # Create relay log file. copy_file $fake_relay_log $_fake_relay_log; # Create relay log index. ---exec echo $_fake_filename-fake.000001 > $_fake_relay_index + +# After patch for BUG#12190, the filename used in CHANGE MASTER +# RELAY_LOG_FILE will be automatically added the directory of the +# relay log before comparison, thus we need to added the directory +# part (./ on unix .\ on windows) when faking the relay-log-bin.index. + +if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") = 0`) +{ + eval select './$_fake_filename-fake.000001\n' into dumpfile '$_fake_relay_index'; +} + +if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") != 0`) +{ + eval select '.\\\\$_fake_filename-fake.000001\n' into dumpfile '$_fake_relay_index'; +} # Setup replication from existing relay log. eval CHANGE MASTER TO MASTER_HOST='dummy.localdomain', RELAY_LOG_FILE='$_fake_filename-fake.000001', RELAY_LOG_POS=4; diff --git a/mysql-test/include/show_binlog_events.inc b/mysql-test/include/show_binlog_events.inc index 68f913a16a3..fcdc52eaf14 100644 --- a/mysql-test/include/show_binlog_events.inc +++ b/mysql-test/include/show_binlog_events.inc @@ -1,10 +1,35 @@ # $binlog_start can be set by caller or take a default value +# $binary_log_file the name of the log file show +# $binary_log_limit_row - sets the number of binlog rows to be returned +# $binary_log_limit_offset - sets the offset where to start returning events + +let $show_binlog_events= show binlog events; if (!$binlog_start) { - let $binlog_start=106; + # defaults to chop the first event in the binary log + let $binlog_start=107; } + +if (!`SELECT '$binary_log_file' = ''`) +{ + let $show_binlog_events= $show_binlog_events in '$binary_log_file'; +} +let $show_binlog_events= $show_binlog_events from $binlog_start; + +if ($binary_log_limit_row) +{ + let $limit= limit; + if ($binary_log_limit_offset) + { + let $limit= $limit $binary_log_limit_offset, ; + } + + let $limit= $limit $binary_log_limit_row; + let $show_binlog_events= $show_binlog_events $limit; +} + --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start <binlog_start> --replace_column 2 # 4 # 5 # --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ ---eval show binlog events from $binlog_start +--eval $show_binlog_events diff --git a/mysql-test/include/show_binlog_events2.inc b/mysql-test/include/show_binlog_events2.inc index 5dd272c562d..0e1a889bacc 100644 --- a/mysql-test/include/show_binlog_events2.inc +++ b/mysql-test/include/show_binlog_events2.inc @@ -1,4 +1,4 @@ ---let $binlog_start=106 +--let $binlog_start=107 --replace_result $binlog_start <binlog_start> --replace_column 2 # 5 # --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ diff --git a/mysql-test/include/show_relaylog_events.inc b/mysql-test/include/show_relaylog_events.inc new file mode 100644 index 00000000000..6f63b055d58 --- /dev/null +++ b/mysql-test/include/show_relaylog_events.inc @@ -0,0 +1,35 @@ +# $binlog_start can be set by caller or take a default value +# $binary_log_file the name of the log file show +# $binary_log_limit_row - sets the number of binlog rows to be returned +# $binary_log_limit_offset - sets the offset where to start returning events + +let $show_binlog_events= show relaylog events; + +if (!$binlog_start) +{ + # defaults to chop the first event in the binary log + let $binlog_start=106; +} + +if (!`SELECT '$binary_log_file' = ''`) +{ + let $show_binlog_events= $show_binlog_events in '$binary_log_file'; +} +let $show_binlog_events= $show_binlog_events from $binlog_start; + +if ($binary_log_limit_row) +{ + let $limit= limit; + if ($binary_log_limit_offset) + { + let $limit= $limit $binary_log_limit_offset, ; + } + + let $limit= $limit $binary_log_limit_row; + let $show_binlog_events= $show_binlog_events $limit; +} + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start <binlog_start> +--replace_column 2 # 4 # 5 # +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /Server ver:.*$/SERVER_VERSION, BINLOG_VERSION/ +--eval $show_binlog_events diff --git a/mysql-test/include/test_fieldsize.inc b/mysql-test/include/test_fieldsize.inc index cbe63e26318..606bc63779d 100644 --- a/mysql-test/include/test_fieldsize.inc +++ b/mysql-test/include/test_fieldsize.inc @@ -22,7 +22,7 @@ eval $test_insert; connection slave; START SLAVE; -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # --query_vertical SHOW SLAVE STATUS diff --git a/mysql-test/include/wait_for_slave_param.inc b/mysql-test/include/wait_for_slave_param.inc index 82e57922913..1e690bdfe9c 100644 --- a/mysql-test/include/wait_for_slave_param.inc +++ b/mysql-test/include/wait_for_slave_param.inc @@ -49,6 +49,8 @@ if (!$_slave_timeout_counter) { let $_slave_timeout_counter= 3000; } +# Save resulting counter for later use. +let $slave_tcnt= $_slave_timeout_counter; let $_slave_param_comparison= $slave_param_comparison; if (`SELECT '$_slave_param_comparison' = ''`) @@ -70,7 +72,7 @@ while (`SELECT NOT('$_show_slave_status_value' $_slave_param_comparison '$slave_ # This has to be outside the loop until BUG#41913 has been fixed if (!$_slave_timeout_counter) { - --echo **** ERROR: timeout after $slave_timeout seconds while waiting for slave parameter $slave_param $_slave_param_comparison $slave_param_value **** + --echo **** ERROR: timeout after $slave_tcnt deci-seconds while waiting for slave parameter $slave_param $_slave_param_comparison $slave_param_value **** if (`SELECT '$slave_error_message' != ''`) { --echo Message: $slave_error_message diff --git a/mysql-test/include/wait_until_disconnected.inc b/mysql-test/include/wait_until_disconnected.inc index a4362e52d01..8a989becc18 100644 --- a/mysql-test/include/wait_until_disconnected.inc +++ b/mysql-test/include/wait_until_disconnected.inc @@ -7,7 +7,7 @@ let $counter= 500; let $mysql_errno= 0; while (!$mysql_errno) { - --error 0,1053,2002,2006,2013 + --error 0,1040,1053,2002,2003,2006,2013 show status; dec $counter; |