diff options
author | unknown <mleich@three.local.lan> | 2007-07-13 18:32:22 +0200 |
---|---|---|
committer | unknown <mleich@three.local.lan> | 2007-07-13 18:32:22 +0200 |
commit | 3a979065e90b8938f88307fa4dbd762b8d786e0b (patch) | |
tree | d14b80db914beff78a30b3073aaea19e5409d2c0 /mysql-test/suite/stress | |
parent | 4922166ed1739d067719200f6542e09f4cc48c1f (diff) | |
download | mariadb-git-3a979065e90b8938f88307fa4dbd762b8d786e0b.tar.gz |
Additional tests checking for symptoms observed within
Bug28309 First insert violates unique constraint - was "memory" table empty ?
---
Add missing phony targets
Makefile.am:
Add execution of the ddl stress tests.
(modified) test-bt: Short running variant added
(new) test-ext-stress: Longer running variant
(modified) test-ext: test-ext-stress added
(modified) test-fast: Short running variant with MyISAM only added
---
Declare test-ext-jp and test-ext-stress to PHONY make targets.
mysql-test/suite/stress/include/ddl.cln:
Script for cleanup at execution end
mysql-test/suite/stress/include/ddl.pre:
Script for general preparations at execution start
mysql-test/suite/stress/include/ddl1.inc:
ddl stress script
mysql-test/suite/stress/include/ddl2.inc:
ddl stress script
mysql-test/suite/stress/include/ddl3.inc:
ddl stress script
mysql-test/suite/stress/include/ddl4.inc:
ddl stress script
mysql-test/suite/stress/include/ddl5.inc:
ddl stress script
mysql-test/suite/stress/include/ddl6.inc:
ddl stress script
mysql-test/suite/stress/include/ddl7.inc:
ddl stress script
mysql-test/suite/stress/include/ddl8.inc:
ddl stress script
mysql-test/suite/stress/r/ddl_archive.result:
File with expected results
mysql-test/suite/stress/r/ddl_csv.result:
File with expected results
mysql-test/suite/stress/r/ddl_innodb.result:
File with expected results
mysql-test/suite/stress/r/ddl_memory.result:
File with expected results
mysql-test/suite/stress/r/ddl_myisam.result:
File with expected results
mysql-test/suite/stress/r/ddl_ndb.result:
File with expected results
mysql-test/suite/stress/t/ddl_archive.test:
Storage engine specific toplevel testscript
mysql-test/suite/stress/t/ddl_csv.test:
Storage engine specific toplevel testscript
mysql-test/suite/stress/t/ddl_innodb.test:
Storage engine specific toplevel testscript
mysql-test/suite/stress/t/ddl_memory.test:
Storage engine specific toplevel testscript
mysql-test/suite/stress/t/ddl_myisam.test:
Storage engine specific toplevel testscript
mysql-test/suite/stress/t/ddl_ndb.test:
Storage engine specific toplevel testscript
Diffstat (limited to 'mysql-test/suite/stress')
22 files changed, 3617 insertions, 0 deletions
diff --git a/mysql-test/suite/stress/include/ddl.cln b/mysql-test/suite/stress/include/ddl.cln new file mode 100644 index 00000000000..7d021a8c912 --- /dev/null +++ b/mysql-test/suite/stress/include/ddl.cln @@ -0,0 +1,4 @@ +######## include/ddl.cln ######## +disconnect con2; +DEALLOCATE PREPARE stmt_start; +DEALLOCATE PREPARE stmt_break; diff --git a/mysql-test/suite/stress/include/ddl.pre b/mysql-test/suite/stress/include/ddl.pre new file mode 100644 index 00000000000..52de4a3665b --- /dev/null +++ b/mysql-test/suite/stress/include/ddl.pre @@ -0,0 +1,21 @@ +######## include/ddl.pre ######## +# The variable +# $runtime -- rough intended runtime per subtest variant +# must be set within the routine sourcing this script. +# +# Please look for more details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-11 mleich +# +SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start"; +--replace_result $runtime <intended_runtime> +eval SET @runtime = $runtime; +eval PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1"; +connect (con2,localhost,root,,); +connection default; + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings diff --git a/mysql-test/suite/stress/include/ddl1.inc b/mysql-test/suite/stress/include/ddl1.inc new file mode 100644 index 00000000000..96adadc5af5 --- /dev/null +++ b/mysql-test/suite/stress/include/ddl1.inc @@ -0,0 +1,277 @@ +######## include/ddl1.inc ###### +# +# Purpose of include/ddl1.inc - include/ddl8.inc: +# +# Stress storage engines with rapid CREATE/DROP TABLE/INDEX +# and following SELECT/INSERT/SHOW etc. +# +# The variables +# $loop_size -- number of rounds till we look at the clock again +# $runtime -- rough intended runtime per subtest variant +# Real runtime without server restarts and comparison is: +# - >= $runtime +# - > runtime needed for $loop_size execution loops +# $engine_type -- storage engine to be used in CREATE TABLE +# must be set within the routine sourcing this script. +# +# Other stuff which must already exist: +# - connection con2 +# - stmt_start and stmt_break prepared by the default connection +# +# Attention: +# The test does suppress the writing of most statements, server error +# messages and result sets. +# This is needed because their number is usual not deterministic. +# The test is partially self checking. That means is prints some +# helpful hints into the protocol and aborts if something is wrong. +# +# Creation of this test: +# 2007-07-04 mleich +# +############################################################################ +# +# Some details: +# +# 1. Base question of the test: +# There was just a create or drop of some object (TABLE/INDEX). +# +# Could it happen that the next statement referring to this +# object gets a somehow wrong server response (result set, +# error message, warning) because the creation or removal of +# the object is in an incomplete state? +# +# Thinkable reasons for incomplete state of creation or removal: +# The server performs the creation or removal +# - all time incomplete. +# Example: +# Bug#28309 First insert violates unique constraint +# - was "memory" table empty ? +# - asynchronous +# In that case the next statement has probably to wait till +# completion. +# +# 2. Why do we use in some scripts "--error 0,<expected error>" followed +# a check of $mysql_errno? +# +# System reactions when running with "--error 0,<expected error>": +# - RC=0 --> no error message +# - RC=<expected error> --> no error message +# - RC not in (0,<expected error>) --> error message + abort of script +# execution +# +# Requirements and tricky solution for statements which are expected +# to fail: +# 1. RC=<expected error> +# - no abort of script execution +# --> add "--error <expected error>" +# - no error message into the protocol, because the number of +# executions is NOT deterministic +# --> use "--error 0,<expected error>" +# 2. RC=0 = failure +# - abort of script execution +# "--error 0,<expected error>" prevents the automatic abort of +# execution. Therefore we do not need to code the abort. +# --> Check $mysql_errno and do an explicit abort if $mysql_errno = 0. +# 3. RC not in (0,<expected error>) +# - abort of script execution +# "--error 0,<expected error>" causes an automatic abort. +# +# 3. We do not check the correctness of the SHOW CREATE TABLE output +# in detail. This must be done within other tests. +# We only check here that +# - same CREATE TABLE/INDEX statements lead to the same +# - different CREATE TABLE/INDEX statements lead to different +# SHOW CREATE TABLE output +# (Applies to ddl4.inc. and ddl8.inc.) +# +# 4. It could be assumed that running this test with +# - PS-PROTOCOL +# There are already subtests using prepared statements contained. +# - SP/CURSOR/VIEW-PROTOCOL +# These protocol variants transform SELECTs to hopefully much +# stressing statement sequencies using SP/CURSOR/VIEW. +# The SELECTs within include/ddl*.inc are very simple. +# does not increase the coverage. +# Therefore we skip runs with these protocols. +# +# 5. The test consumes significant runtime when running on a non RAM +# based filesystem (run without "--mem"). +# Therefore we adjust $runtime and $loop_size depending on "--big-test" +# option. +# $runtime and $loop_size do not influence the expected results. +# Rough runtime in seconds reported by mysql-test-run.pl: +# (engine_type = MEMORY) +# option set -> $runtime $loop_size real runtime in seconds +# 1 20 68 +# --mem 1 20 32 +# --big-test 5 100 200 +# --mem --big-test 5 100 400 +# I assume that runs with slow filesystems are as much valuable +# as runs with extreme fast filesystems. +# +# 6. Hints for analysis of test failures: +# 1. Look into the protocol and check in which ddl*.inc +# script the difference to the expected result occured. +# 2. Comment the sourcing of all other ddl*.inc scripts +# out. +# 3. Edit the ddl*.inc script where the error occured and +# remove all +# - "--disable_query_log", "--disable_result_log" +# - successful passed subtests. +# 4. Alternative: +# Have a look into VARDIR/master-data/mysql/general_log.CSV +# and construct a new testcase from that. +# 5. If the problem is not deterministic, please try the following +# - increase $runtime (important), $loop_size (most probably +# less important) within the "t/ddl_<engine>.test" and +# maybe the "--testcase-timeout" assigned to mysqltest-run.pl +# - vary the I/O performance of the testing machine by using +# a RAM or disk based filesystem for VARDIR +# + + +#---------------------------------------------------------------------- +# Settings for Subtest 1 variants +# Scenario: CREATE with UNIQUE KEY/INSERT/DROP TABLE like in Bug#28309 +let $create_table= CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = $engine_type; +let $insert_into= INSERT INTO t1 VALUES (1,1), (2,2), (3,3); +let $drop_table= DROP TABLE t1; +#---------------------------------------------------------------------- + +# +--echo # Subtest 1A (one connection, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # default: $insert_into +--echo # default: $drop_table +--disable_query_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_table; + eval $insert_into; + eval $drop_table; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_query_log +# +--echo # Subtest 1B (one connection, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # default: $insert_into +--echo # default: $drop_table +--disable_query_log +connection default; +eval PREPARE create_table FROM "$create_table"; +EXECUTE create_table; +eval PREPARE insert_into FROM "$insert_into"; +eval PREPARE drop_table FROM "$drop_table"; +EXECUTE drop_table; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_table; + EXECUTE insert_into; + EXECUTE drop_table; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_table; +DEALLOCATE PREPARE insert_into; +DEALLOCATE PREPARE drop_table; +--enable_query_log +# +--echo # Subtest 1C (two connections, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # con2: $insert_into +--echo # con2: $drop_table +--disable_query_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_table; + connection con2; + eval $insert_into; + eval $drop_table; + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_query_log +# +--echo # Subtest 1D (two connections, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # con2: $insert_into +--echo # con2: $drop_table +--disable_query_log +connection default; +eval PREPARE create_table FROM "$create_table"; +EXECUTE create_table; +connection con2; +eval PREPARE insert_into FROM "$insert_into"; +eval PREPARE drop_table FROM "$drop_table"; +EXECUTE drop_table; +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_table; + connection con2; + EXECUTE insert_into; + EXECUTE drop_table; + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_table; +connection con2; +DEALLOCATE PREPARE insert_into; +DEALLOCATE PREPARE drop_table; +connection default; +--enable_query_log diff --git a/mysql-test/suite/stress/include/ddl2.inc b/mysql-test/suite/stress/include/ddl2.inc new file mode 100644 index 00000000000..dd2ec0fd804 --- /dev/null +++ b/mysql-test/suite/stress/include/ddl2.inc @@ -0,0 +1,259 @@ +######## include/ddl2.inc ###### +# +# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX +# and following SELECT/INSERT/SHOW etc. +# Subtest 2 variants (2A - 2D) +# +# The variables +# $loop_size -- number of rounds till we look at the clock again +# $runtime -- rough intended runtime per subtest variant +# $engine_type -- storage engine to be used in CREATE TABLE +# must be set within the routine sourcing this script. +# +# Other stuff which must already exist: +# - connection con2 +# - stmt_start and stmt_break prepared by the default connection +# +# Please look for more details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + + +#---------------------------------------------------------------------- +# Settings for Subtest 2 variants +# Scenario: CREATE TABLE AS SELECT/SELECT/DROP/SELECT(F) +let $create_table= CREATE TABLE t1 ENGINE = $engine_type AS SELECT 1 AS f1; +let $select_record= SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1; +let $drop_table= DROP TABLE t1; +#---------------------------------------------------------------------- + +# +--echo # Subtest 2A (one connection, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # default: $select_record +--echo # default: $drop_table +--echo # default: $select_record (expect to get ER_NO_SUCH_TABLE) +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_table; + if (`$select_record`) + { + --enable_result_log + --enable_query_log + --echo # Error: Unexpected content within t1. + --echo # Expected: 0 + --echo # Got: + eval $select_record; + SELECT * FROM t1; + --echo # abort + exit; + } + eval $drop_table; + --error 0,ER_NO_SUCH_TABLE + eval $select_record; + if (!$mysql_errno) + { + --echo # Error: SELECT was successful though we expected ER_NO_SUCH_TABLE + --echo # abort + exit; + } + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 2B (one connection, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # default: $select_record +--echo # default: $drop_table +--echo # default: $select_record (expect to get ER_NO_SUCH_TABLE) +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_table FROM "$create_table"; +EXECUTE create_table; +eval PREPARE select_record FROM "$select_record"; +eval PREPARE drop_table FROM "$drop_table"; +EXECUTE drop_table; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_table; + if (`EXECUTE select_record`) + { + --enable_result_log + --enable_query_log + --echo # Error: Unexpected content within t1. + --echo # Expected: 0 + --echo # Got: + EXECUTE select_record; + SELECT * FROM t1; + --echo # abort + exit; + } + EXECUTE drop_table; + --error 0,ER_NO_SUCH_TABLE + EXECUTE select_record; + if (!$mysql_errno) + { + --echo # Error: SELECT was successful though we expected ER_NO_SUCH_TABLE + --echo # abort + exit; + } + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_table; +DEALLOCATE PREPARE select_record; +DEALLOCATE PREPARE drop_table; +--enable_result_log +--enable_query_log +# +--echo # Subtest 2C (two connections, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # con2: $select_record +--echo # default: $drop_table +--echo # con2: $select_record (expect to get ER_NO_SUCH_TABLE) +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_table; + connection con2; + if (`$select_record`) + { + --enable_result_log + --enable_query_log + --echo # Error: Unexpected content within t1. + --echo # Expected: 0 + --echo # Got: + eval $select_record; + SELECT * FROM t1; + --echo # abort + exit; + } + connection default; + eval $drop_table; + connection con2; + --error 0,ER_NO_SUCH_TABLE + eval $select_record; + if (!$mysql_errno) + { + --echo # Error: SELECT was successful though we expected ER_NO_SUCH_TABLE + --echo # abort + exit; + } + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 2D (two connections, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # con2: $select_record +--echo # default: $drop_table +--echo # con2: $select_record (expect to get ER_NO_SUCH_TABLE) +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_table FROM "$create_table"; +eval PREPARE drop_table FROM "$drop_table"; +EXECUTE create_table; +connection con2; +eval PREPARE select_record FROM "$select_record"; +connection default; +EXECUTE drop_table; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_table; + connection con2; + if (`EXECUTE select_record`) + { + --enable_result_log + --enable_query_log + --echo # Error: Unexpected content within t1. + --echo # Expected: 0 + --echo # Got: + EXECUTE select_record; + SELECT * FROM t1; + --echo # abort + exit; + } + connection default; + EXECUTE drop_table; + connection con2; + --error 0,ER_NO_SUCH_TABLE + EXECUTE select_record; + if (!$mysql_errno) + { + --echo # Error: SELECT was successful though we expected ER_NO_SUCH_TABLE + --echo # abort + exit; + } + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_table; +DEALLOCATE PREPARE drop_table; +connection con2; +DEALLOCATE PREPARE select_record; +connection default; +--enable_result_log +--enable_query_log diff --git a/mysql-test/suite/stress/include/ddl3.inc b/mysql-test/suite/stress/include/ddl3.inc new file mode 100644 index 00000000000..aacf09f9428 --- /dev/null +++ b/mysql-test/suite/stress/include/ddl3.inc @@ -0,0 +1,242 @@ +######## include/ddl3.inc ###### +# +# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX +# and following SELECT/INSERT/SHOW etc. +# Subtest 3 variants (3A - 3D) +# +# The variables +# $loop_size -- number of rounds till we look at the clock again +# $runtime -- rough intended runtime per subtest variant +# $engine_type -- storage engine to be used in CREATE TABLE +# must be set within the routine sourcing this script. +# +# Other stuff which must already exist: +# - connection con2 +# - stmt_start and stmt_break prepared by the default connection +# +# Please look for more details within include/ddl2.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + + +#---------------------------------------------------------------------- +# Settings for Subtest 3 variants +# Scenario: CREATE TABLE/CREATE TABLE(F)/DROP TABLE/DROP TABLE(F) +let $create_table= CREATE TABLE t1 (f1 BIGINT) ENGINE=$engine_type; +let $drop_table= DROP TABLE t1; +#---------------------------------------------------------------------- + +# +--echo # Subtest 3A (one connection, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # default: $create_table (expect to get ER_TABLE_EXISTS_ERROR) +--echo # default: $drop_table +--echo # default: $drop_table (expect to get ER_BAD_TABLE_ERROR) +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_table; + --error 0,ER_TABLE_EXISTS_ERROR + eval $create_table; + if (!$mysql_errno) + { + --echo # Error: CREATE TABLE was successful though we expected ER_TABLE_EXISTS_ERROR + --echo # abort + exit; + } + eval $drop_table; + --error 0,ER_BAD_TABLE_ERROR + eval $drop_table; + if (!$mysql_errno) + { + --echo # Error: DROP TABLE was successful though we expected ER_BAD_TABLE_ERROR) + --echo # abort + exit; + } + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 3B (one connection, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # default: $create_table (expect to get ER_TABLE_EXISTS_ERROR) +--echo # default: $drop_table +--echo # default: $drop_table (expect to get ER_BAD_TABLE_ERROR) +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_table FROM "$create_table"; +EXECUTE create_table; +eval PREPARE drop_table FROM "$drop_table"; +EXECUTE drop_table; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_table; + --error 0,ER_TABLE_EXISTS_ERROR + EXECUTE create_table; + if (!$mysql_errno) + { + --echo # Error: CREATE TABLE was successful though we expected ER_TABLE_EXISTS_ERROR + --echo # abort + exit; + } + EXECUTE drop_table; + --error 0,ER_BAD_TABLE_ERROR + EXECUTE drop_table; + if (!$mysql_errno) + { + --echo # Error: DROP TABLE was successful though we expected ER_BAD_TABLE_ERROR) + --echo # abort + exit; + } + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_table; +DEALLOCATE PREPARE drop_table; +--enable_result_log +--enable_query_log +# +--echo # Subtest 3C (two connections, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # con2: $create_table (expect to get ER_TABLE_EXISTS_ERROR) +--echo # default: $drop_table +--echo # con2: $drop_table (expect to get ER_BAD_TABLE_ERROR) +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_table; + connection con2; + --error 0,ER_TABLE_EXISTS_ERROR + eval $create_table; + if (!$mysql_errno) + { + --echo # Error: CREATE TABLE was successful though we expected ER_TABLE_EXISTS_ERROR + --echo # abort + exit; + } + connection default; + eval $drop_table; + connection con2; + --error 0,ER_BAD_TABLE_ERROR + eval $drop_table; + if (!$mysql_errno) + { + --echo # Error: DROP TABLE was successful though we expected ER_BAD_TABLE_ERROR) + --echo # abort + exit; + } + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 3D (two connections, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # con2: $create_table (expect to get ER_TABLE_EXISTS_ERROR) +--echo # default: $drop_table +--echo # con2: $drop_table (expect to get ER_BAD_TABLE_ERROR) +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_table FROM "$create_table"; +eval PREPARE drop_table FROM "$drop_table"; +EXECUTE create_table; +connection con2; +eval PREPARE create_table FROM "$create_table"; +eval PREPARE drop_table FROM "$drop_table"; +EXECUTE drop_table; +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_table; + connection con2; + --error 0,ER_TABLE_EXISTS_ERROR + EXECUTE create_table; + if (!$mysql_errno) + { + --echo # Error: CREATE TABLE was successful though we expected ER_TABLE_EXISTS_ERROR + --echo # abort + exit; + } + connection default; + EXECUTE drop_table; + connection con2; + --error 0,ER_BAD_TABLE_ERROR + EXECUTE drop_table; + if (!$mysql_errno) + { + --echo # Error: DROP TABLE was successful though we expected ER_BAD_TABLE_ERROR) + --echo # abort + exit; + } + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_table; +DEALLOCATE PREPARE drop_table; +connection con2; +DEALLOCATE PREPARE create_table; +DEALLOCATE PREPARE drop_table; +connection default; +--enable_result_log +--enable_query_log diff --git a/mysql-test/suite/stress/include/ddl4.inc b/mysql-test/suite/stress/include/ddl4.inc new file mode 100644 index 00000000000..10452a453a5 --- /dev/null +++ b/mysql-test/suite/stress/include/ddl4.inc @@ -0,0 +1,339 @@ +######## include/ddl4.inc ###### +# +# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX +# and following SELECT/INSERT/SHOW etc. +# Subtest 4 variants (4A - 4D) +# +# The variables +# $loop_size -- number of rounds till we look at the clock again +# $runtime -- rough intended runtime per subtest variant +# $engine_type -- storage engine to be used in CREATE TABLE +# must be set within the routine sourcing this script. +# +# Other stuff which must already exist: +# - connection con2 +# - stmt_start and stmt_break prepared by the default connection +# +# Please look for more details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + + +#---------------------------------------------------------------------- +# Settings for Subtest 4 variants +# Scenario: CREATE TABLE variant1/SHOW/DROP TABLE/SHOW(F)/ +# CREATE TABLE variant2/SHOW/DROP TABLE +let $create_table1= CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=$engine_type; +let $create_table2= CREATE TABLE t1 (f1 BIGINT) ENGINE=$engine_type; +let $show_table= SHOW CREATE TABLE t1; +let $drop_table= DROP TABLE t1; +# +eval $create_table1; +let $cr_value1= INITIALIZED; +let $cr_value1= query_get_value($show_table, Create Table, 1); +eval $drop_table; +eval $create_table2; +let $cr_value2= INITIALIZED; +let $cr_value2= query_get_value($show_table, Create Table, 1); +eval $drop_table; +if (`SELECT '$cr_value1' = '$cr_value2'`) +{ + --echo # Error during generation of prerequisites. + --echo # cr_value1 equals cr_value2 + --echo # cr_value1: $cr_value1 + --echo # cr_value2: $cr_value2 + --echo # abort + exit; +} +#---------------------------------------------------------------------- + +# +--echo # Subtest 4A (one connection, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table1 +--echo # default: $show_table +--echo # default: $drop_table +--echo # default: $show_table (expect to get ER_NO_SUCH_TABLE) +--echo # default: $create_table2 +--echo # default: $show_table +--echo # default: $drop_table +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_table1; + let $value= INITIALIZED; + let $value= query_get_value($show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value1'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value1 + --echo # abort + exit; + } + eval $drop_table; + --error 0,ER_NO_SUCH_TABLE + eval $show_table; + if (!$mysql_errno) + { + --echo # Error: SHOW CREATE TABLE was successful though we expected ER_NO_SUCH_TABLE) + --echo # abort + exit; + } + eval $create_table2; + let $value= INITIALIZED; + let $value= query_get_value($show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value2'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value2 + --echo # abort + exit; + } + eval $drop_table; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 4B (one connection, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table1 +--echo # default: $show_table +--echo # default: $drop_table +--echo # default: $show_table (expect to get ER_NO_SUCH_TABLE) +--echo # default: $create_table2 +--echo # default: $show_table +--echo # default: $drop_table +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_table1 FROM "$create_table1"; +eval PREPARE create_table2 FROM "$create_table2"; +EXECUTE create_table1; +eval PREPARE show_table FROM "$show_table"; +eval PREPARE drop_table FROM "$drop_table"; +EXECUTE drop_table; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_table1; + let $value= INITIALIZED; + let $value= query_get_value(EXECUTE show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value1'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value1 + --echo # abort + exit; + } + EXECUTE drop_table; + --error 0,ER_NO_SUCH_TABLE + EXECUTE show_table; + if (!$mysql_errno) + { + --echo # Error: SHOW CREATE TABLE was successful though we expected ER_NO_SUCH_TABLE) + --echo # abort + exit; + } + EXECUTE create_table2; + let $value= INITIALIZED; + let $value= query_get_value(EXECUTE show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value2'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value2 + --echo # abort + exit; + } + EXECUTE drop_table; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_table1; +DEALLOCATE PREPARE create_table2; +DEALLOCATE PREPARE show_table; +DEALLOCATE PREPARE drop_table; +--enable_result_log +--enable_query_log +# +--echo # Subtest 4C (two connections, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table1 +--echo # con2: $show_table +--echo # default: $drop_table +--echo # con2: $show_table (expect to get ER_NO_SUCH_TABLE) +--echo # default: $create_table2 +--echo # con2: $show_table +--echo # default: $drop_table +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_table1; + connection con2; + let $value= INITIALIZED; + let $value= query_get_value($show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value1'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value1 + --echo # abort + exit; + } + connection default; + eval $drop_table; + connection con2; + --error 0,ER_NO_SUCH_TABLE + eval $show_table; + if (!$mysql_errno) + { + --echo # Error: SHOW CREATE TABLE was successful though we expected ER_NO_SUCH_TABLE) + --echo # abort + exit; + } + connection default; + eval $create_table2; + connection con2; + let $value= INITIALIZED; + let $value= query_get_value($show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value2'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value2 + --echo # abort + exit; + } + connection default; + eval $drop_table; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 4D (two connections, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table1 +--echo # con2: $show_table +--echo # default: $drop_table +--echo # con2: $show_table (expect to get ER_NO_SUCH_TABLE) +--echo # default: $create_table2 +--echo # con2: $show_table +--echo # default: $drop_table +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_table1 FROM "$create_table1"; +eval PREPARE create_table2 FROM "$create_table2"; +eval PREPARE drop_table FROM "$drop_table"; +EXECUTE create_table1; +connection con2; +eval PREPARE show_table FROM "$show_table"; +connection default; +EXECUTE drop_table; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_table1; + connection con2; + let $value= INITIALIZED; + let $value= query_get_value(EXECUTE show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value1'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value1 + --echo # abort + exit; + } + connection default; + EXECUTE drop_table; + connection con2; + --error 0,ER_NO_SUCH_TABLE + EXECUTE show_table; + if (!$mysql_errno) + { + --echo # Error: SHOW CREATE TABLE was successful though we expected ER_NO_SUCH_TABLE) + --echo # abort + exit; + } + connection default; + EXECUTE create_table2; + connection con2; + let $value= INITIALIZED; + let $value= query_get_value(EXECUTE show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value2'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value2 + --echo # abort + exit; + } + connection default; + EXECUTE drop_table; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_table1; +DEALLOCATE PREPARE create_table2; +DEALLOCATE PREPARE drop_table; +connection con2; +DEALLOCATE PREPARE show_table; +connection default; +--enable_result_log +--enable_query_log diff --git a/mysql-test/suite/stress/include/ddl5.inc b/mysql-test/suite/stress/include/ddl5.inc new file mode 100644 index 00000000000..5a6c2fa0e96 --- /dev/null +++ b/mysql-test/suite/stress/include/ddl5.inc @@ -0,0 +1,227 @@ +######## include/ddl5.inc ###### +# +# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX +# and following SELECT/INSERT/SHOW etc. +# Subtest 5 variants (5A - 5D) +# +# The variables +# $loop_size -- number of rounds till we look at the clock again +# $runtime -- rough intended runtime per subtest variant +# $engine_type -- storage engine to be used in CREATE TABLE +# must be set within the routine sourcing this script. +# +# Other stuff which must already exist: +# - connection con2 +# - stmt_start and stmt_break prepared by the default connection +# +# Please look for more details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + +#---------------------------------------------------------------------- +# Settings for Subtest 5 variants +# Scenario: CREATE TABLE with AUTOINC/INSERT/SELECT/DROP TABLE +let $create_table= CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = $engine_type; +let $insert_into= INSERT INTO t1 SET f2 = 9; +let $select_record= SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9; +let $drop_table= DROP TABLE t1; +#---------------------------------------------------------------------- + +# +--echo # Subtest 5A (one connection, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # default: $insert_into +--echo # default: $select_record +--echo # default: $drop_table +--disable_query_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_table; + eval $insert_into; + if (`$select_record`) + { + --enable_result_log + --enable_query_log + --echo # Error: Unexpected content within t1. + --echo # Expected: 0 + --echo # Got: + eval $select_record; + SELECT * FROM t1; + --echo # abort + exit; + } + eval $drop_table; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_query_log +# +--echo # Subtest 5B (one connection, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # default: $insert_into +--echo # default: $select_record +--echo # default: $drop_table +--disable_query_log +connection default; +eval PREPARE create_table FROM "$create_table"; +EXECUTE create_table; +eval PREPARE insert_into FROM "$insert_into"; +eval PREPARE select_record FROM "$select_record"; +eval PREPARE drop_table FROM "$drop_table"; +EXECUTE drop_table; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_table; + EXECUTE insert_into; + if (`EXECUTE select_record`) + { + --enable_result_log + --enable_query_log + --echo # Error: Unexpected content within t1. + --echo # Expected: 0 + --echo # Got: + EXECUTE select_record; + SELECT * FROM t1; + --echo # abort + exit; + } + EXECUTE drop_table; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_table; +DEALLOCATE PREPARE insert_into; +DEALLOCATE PREPARE select_record; +DEALLOCATE PREPARE drop_table; +--enable_query_log +# +--echo # Subtest 5C (two connections, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # con2: $insert_into +--echo # default: $select_record +--echo # con2: $drop_table +--disable_query_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_table; + connection con2; + eval $insert_into; + connection default; + if (`$select_record`) + { + --enable_result_log + --enable_query_log + --echo # Error: Unexpected content within t1. + --echo # Expected: 0 + --echo # Got: + eval $select_record; + SELECT * FROM t1; + --echo # abort + exit; + } + connection con2; + eval $drop_table; + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_query_log +# +--echo # Subtest 5D (two connections, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # con2: $insert_into +--echo # default: $select_record +--echo # con2: $drop_table +--disable_query_log +connection default; +eval PREPARE create_table FROM "$create_table"; +EXECUTE create_table; +eval PREPARE select_record FROM "$select_record"; +connection con2; +eval PREPARE insert_into FROM "$insert_into"; +eval PREPARE drop_table FROM "$drop_table"; +EXECUTE drop_table; +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_table; + connection con2; + EXECUTE insert_into; + connection default; + if (`EXECUTE select_record`) + { + --enable_result_log + --enable_query_log + --echo # Error: Unexpected content within t1. + --echo # Expected: 0 + --echo # Got: + EXECUTE select_record; + SELECT * FROM t1; + --echo # abort + exit; + } + connection con2; + EXECUTE drop_table; + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_table; +DEALLOCATE PREPARE select_record; +connection con2; +DEALLOCATE PREPARE insert_into; +DEALLOCATE PREPARE drop_table; +connection default; +--enable_query_log diff --git a/mysql-test/suite/stress/include/ddl6.inc b/mysql-test/suite/stress/include/ddl6.inc new file mode 100644 index 00000000000..7bbfe300eaa --- /dev/null +++ b/mysql-test/suite/stress/include/ddl6.inc @@ -0,0 +1,266 @@ +######## include/ddl6.inc ###### +# +# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX +# and following SELECT/INSERT/SHOW etc. +# Subtest 6 variants (6A - 6D) +# +# The variables +# $loop_size -- number of rounds till we look at the clock again +# $runtime -- rough intended runtime per subtest variant +# $engine_type -- storage engine to be used in CREATE TABLE +# must be set within the routine sourcing this script. +# +# Other stuff which must already exist: +# - connection con2 +# - stmt_start and stmt_break prepared by the default connection +# +# Please look for more details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + + +#---------------------------------------------------------------------- +# Settings for Subtest 6 variants +# Scenario: CREATE INDEX/CREATE INDEX(F)/DROP INDEX/DROP INDEX(F) +let $create_index= CREATE INDEX IDX1 ON t1 (f2); +let $drop_index= DROP INDEX IDX1 ON t1; +eval CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=$engine_type; +#---------------------------------------------------------------------- + + +# +--echo # Subtest 6A (one connection, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index +--echo # default: $create_index (expect to get ER_DUP_KEYNAME) +--echo # default: $drop_index +--echo # default: $drop_index (expect to get ER_CANT_DROP_FIELD_OR_KEY) +--echo # default: $create_index +--echo # default: $drop_index +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_index; + --error 0,ER_DUP_KEYNAME + eval $create_index; + if (!$mysql_errno) + { + --echo # Error: CREATE INDEX was successful though we expected ER_DUP_KEYNAME + --echo # abort + exit; + } + eval $drop_index; + --error 0,ER_CANT_DROP_FIELD_OR_KEY + eval $drop_index; + if (!$mysql_errno) + { + --echo # Error: DROP INDEX was successful though we expected ER_CANT_DROP_FIELD_OR_KEY + --echo # abort + exit; + } + eval $create_index; + eval $drop_index; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 6B (one connection, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index +--echo # default: $create_index (expect to get ER_DUP_KEYNAME) +--echo # default: $drop_index +--echo # default: $drop_index (expect to get ER_CANT_DROP_FIELD_OR_KEY) +--echo # default: $create_index +--echo # default: $drop_index +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_index FROM "$create_index"; +EXECUTE create_index; +eval PREPARE drop_index FROM "$drop_index"; +EXECUTE drop_index; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_index; + --error 0,ER_DUP_KEYNAME + EXECUTE create_index; + if (!$mysql_errno) + { + --echo # Error: CREATE INDEX was successful though we expected ER_DUP_KEYNAME + --echo # abort + exit; + } + EXECUTE drop_index; + --error 0,ER_CANT_DROP_FIELD_OR_KEY + EXECUTE drop_index; + if (!$mysql_errno) + { + --echo # Error: DROP INDEX was successful though we expected ER_CANT_DROP_FIELD_OR_KEY + --echo # abort + exit; + } + EXECUTE create_index; + EXECUTE drop_index; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_index; +DEALLOCATE PREPARE drop_index; +--enable_result_log +--enable_query_log +# +--echo # Subtest 6C (two connections, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index +--echo # con2: $create_index (expect to get ER_DUP_KEYNAME) +--echo # default: $drop_index +--echo # con2: $drop_index (expect to get ER_CANT_DROP_FIELD_OR_KEY) +--echo # default: $create_index +--echo # con2: $drop_index +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_index; + connection con2; + --error 0,ER_DUP_KEYNAME + eval $create_index; + if (!$mysql_errno) + { + --echo # Error: CREATE INDEX was successful though we expected ER_DUP_KEYNAME + --echo # abort + exit; + } + connection default; + eval $drop_index; + connection con2; + --error 0,ER_CANT_DROP_FIELD_OR_KEY + eval $drop_index; + if (!$mysql_errno) + { + --echo # Error: DROP INDEX was successful though we expected ER_CANT_DROP_FIELD_OR_KEY + --echo # abort + exit; + } + connection default; + eval $create_index; + connection con2; + eval $drop_index; + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 6D (two connections, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index +--echo # con2: $create_index (expect to get ER_DUP_KEYNAME) +--echo # default: $drop_index +--echo # con2: $drop_index (expect to get ER_CANT_DROP_FIELD_OR_KEY) +--echo # default: $create_index +--echo # con2: $drop_index +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_index FROM "$create_index"; +eval PREPARE drop_index FROM "$drop_index"; +EXECUTE create_index; +connection con2; +eval PREPARE create_index FROM "$create_index"; +eval PREPARE drop_index FROM "$drop_index"; +EXECUTE drop_index; +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_index; + connection con2; + --error 0,ER_DUP_KEYNAME + EXECUTE create_index; + if (!$mysql_errno) + { + --echo # Error: CREATE INDEX was successful though we expected ER_DUP_KEYNAME + --echo # abort + exit; + } + connection default; + EXECUTE drop_index; + connection con2; + --error 0,ER_CANT_DROP_FIELD_OR_KEY + EXECUTE drop_index; + if (!$mysql_errno) + { + --echo # Error: DROP INDEX was successful though we expected ER_CANT_DROP_FIELD_OR_KEY + --echo # abort + exit; + } + connection default; + EXECUTE create_index; + connection con2; + EXECUTE drop_index; + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_index; +DEALLOCATE PREPARE drop_index; +connection con2; +DEALLOCATE PREPARE create_index; +DEALLOCATE PREPARE drop_index; +connection default; +--enable_result_log +--enable_query_log + +DROP TABLE t1; diff --git a/mysql-test/suite/stress/include/ddl7.inc b/mysql-test/suite/stress/include/ddl7.inc new file mode 100644 index 00000000000..76ba8066c66 --- /dev/null +++ b/mysql-test/suite/stress/include/ddl7.inc @@ -0,0 +1,274 @@ +######## include/ddl7.inc ###### +# +# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX +# and following SELECT/INSERT/SHOW etc. +# Subtest 7 variants (7A - 7D) +# +# The variables +# $loop_size -- number of rounds till we look at the clock again +# $runtime -- rough intended runtime per subtest variant +# $engine_type -- storage engine to be used in CREATE TABLE +# must be set within the routine sourcing this script. +# +# Other stuff which must already exist: +# - connection con2 +# - stmt_start and stmt_break prepared by the default connection +# +# Please look for more details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + + +#---------------------------------------------------------------------- +# Settings for Subtest 7 variants +# Scenario: CREATE INDEX/INSERT(F)/DROP INDEX/INSERT/CREATE INDEX(F)/DELETE +let $create_index= CREATE UNIQUE INDEX IDX1 ON t1 (f2); +let $insert_record= INSERT INTO t1 VALUES(1,1); +let $drop_index= DROP INDEX IDX1 ON t1; +let $delete_record= DELETE FROM t1 WHERE f1 = 1; +eval CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, PRIMARY KEY(f1)) ENGINE=$engine_type; +INSERT INTO t1 VALUES(0,1); +#---------------------------------------------------------------------- + +# +--echo # Subtest 7A (one connection, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index +--echo # default: $insert_record (expect to get ER_DUP_ENTRY) +--echo # default: $drop_index +--echo # default: $insert_record +--echo # default: $create_index (expect to get ER_DUP_ENTRY) +--echo # default: $delete_record +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +let $counter= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_index; + --error 0,ER_DUP_ENTRY + eval $insert_record; + if (!$mysql_errno) + { + --echo # Error: INSERT was successful though we expected ER_DUP_ENTRY + --echo # abort + exit; + } + eval $drop_index; + eval $insert_record; + # NDB: ER_DUP_UNIQUE, others: ER_DUP_ENTRY + --error 0,ER_DUP_ENTRY,ER_DUP_UNIQUE + eval $create_index; + if (!$mysql_errno) + { + --echo # Error: CREATE INDEX was successful though we expected ER_DUP_ENTRY + --echo # Error: or ER_DUP_UNIQUE (NDB only) + --echo # abort + exit; + } + eval $delete_record; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 7B (one connection, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index +--echo # default: $insert_record (expect to get ER_DUP_ENTRY) +--echo # default: $drop_index +--echo # default: $insert_record +--echo # default: $create_index (expect to get ER_DUP_ENTRY) +--echo # default: $delete_record +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_index FROM "$create_index"; +eval PREPARE insert_record FROM "$insert_record"; +eval PREPARE delete_record FROM "$delete_record"; +eval PREPARE drop_index FROM "$drop_index"; +let $run= 1; +let $counter= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_index; + --error 0,ER_DUP_ENTRY + EXECUTE insert_record; + if (!$mysql_errno) + { + --echo # Error: INSERT was successful though we expected ER_DUP_ENTRY + --echo # abort + exit; + } + EXECUTE drop_index; + EXECUTE insert_record; + --error 0,ER_DUP_ENTRY + EXECUTE create_index; + if (!$mysql_errno) + { + --echo # Error: CREATE INDEX was successful though we expected ER_DUP_ENTRY + --echo # abort + exit; + } + EXECUTE delete_record; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_index; +DEALLOCATE PREPARE insert_record; +DEALLOCATE PREPARE delete_record; +DEALLOCATE PREPARE drop_index; +--enable_result_log +--enable_query_log +# +--echo # Subtest 7C (two connections, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index +--echo # default: $insert_record (expect to get ER_DUP_ENTRY) +--echo # con2: $drop_index +--echo # default: $insert_record +--echo # con2: $create_index (expect to get ER_DUP_ENTRY) +--echo # con2: $delete_record +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +let $counter= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_index; + --error 0,ER_DUP_ENTRY + eval $insert_record; + if (!$mysql_errno) + { + --echo # Error: INSERT was successful though we expected ER_DUP_ENTRY + --echo # abort + exit; + } + connection con2; + eval $drop_index; + connection default; + eval $insert_record; + connection con2; + --error 0,ER_DUP_ENTRY + eval $create_index; + if (!$mysql_errno) + { + --echo # Error: CREATE INDEX was successful though we expected ER_DUP_ENTRY + --echo # abort + exit; + } + eval $delete_record; + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 7D (two connections, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index +--echo # default: $insert_record (expect to get ER_DUP_ENTRY) +--echo # con2: $drop_index +--echo # default: $insert_record +--echo # con2: $create_index (expect to get ER_DUP_ENTRY) +--echo # con2: $delete_record +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_index FROM "$create_index"; +eval PREPARE insert_record FROM "$insert_record"; +EXECUTE create_index; +connection con2; +eval PREPARE create_index FROM "$create_index"; +eval PREPARE drop_index FROM "$drop_index"; +eval PREPARE delete_record FROM "$delete_record"; +EXECUTE drop_index; +connection default; +let $run= 1; +let $counter= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_index; + --error 0,ER_DUP_ENTRY + EXECUTE insert_record; + if (!$mysql_errno) + { + --echo # Error: INSERT was successful though we expected ER_DUP_ENTRY + --echo # abort + exit; + } + connection con2; + EXECUTE drop_index; + connection default; + EXECUTE insert_record; + connection con2; + --error 0,ER_DUP_ENTRY + EXECUTE create_index; + if (!$mysql_errno) + { + --echo # Error: CREATE INDEX was successful though we expected ER_DUP_ENTRY + --echo # abort + exit; + } + EXECUTE delete_record; + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_index; +DEALLOCATE PREPARE insert_record; +connection con2; +DEALLOCATE PREPARE create_index; +DEALLOCATE PREPARE drop_index; +DEALLOCATE PREPARE delete_record; +connection default; +--enable_result_log +--enable_query_log + +DROP TABLE t1; diff --git a/mysql-test/suite/stress/include/ddl8.inc b/mysql-test/suite/stress/include/ddl8.inc new file mode 100644 index 00000000000..85a70770a56 --- /dev/null +++ b/mysql-test/suite/stress/include/ddl8.inc @@ -0,0 +1,302 @@ +######## include/ddl8.inc ###### +# +# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX +# and following SELECT/INSERT/SHOW etc. +# Subtest 8 variants (8A - 8D) +# +# The variables +# $loop_size -- number of rounds till we look at the clock again +# $runtime -- rough intended runtime per subtest variant +# $engine_type -- storage engine to be used in CREATE TABLE +# must be set within the routine sourcing this script. +# +# Other stuff which must already exist: +# - connection con2 +# - stmt_start and stmt_break prepared by the default connection +# +# Please look for more details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + + +#---------------------------------------------------------------------- +# Settings for Subtest 8 variants +# Scenario: CREATE INDEX variant1/SHOW/DROP INDEX/ +# CREATE INDEX variant2/SHOW/DROP INDEX +let $create_index1= CREATE INDEX IDX ON t1 (f2); +let $create_index2= CREATE UNIQUE INDEX IDX ON t1 (f2); +let $show_table= SHOW CREATE TABLE t1; +let $drop_index= DROP INDEX IDX ON t1; +eval CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=$engine_type; +INSERT INTO t1 VALUES(1,1); +eval $create_index1; +let $cr_value1= INITIALIZED; +let $cr_value1= query_get_value($show_table, Create Table, 1); +eval $drop_index; +eval $create_index2; +let $cr_value2= INITIALIZED; +let $cr_value2= query_get_value($show_table, Create Table, 1); +eval $drop_index; +if (`SELECT '$cr_value1' = '$cr_value2'`) +{ + --echo # Error during generation of prerequisites. + --echo # cr_value1 equals cr_value2 + --echo # cr_value1: $cr_value1 + --echo # cr_value2: $cr_value2 + --echo # abort + exit; +} +#---------------------------------------------------------------------- + +# +--echo # Subtest 8A (one connection, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index1 +--echo # default: $show_table +--echo # default: $drop_index +--echo # default: $create_index2 +--echo # default: $show_table +--echo # default: $drop_index +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_index1; + let $value= INITIALIZED; + let $value= query_get_value($show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value1'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value1 + --echo # abort + exit; + } + eval $drop_index; + eval $create_index2; + let $value= INITIALIZED; + let $value= query_get_value($show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value2'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value2 + --echo # abort + exit; + } + eval $drop_index; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 8B (one connection, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index1 +--echo # default: $show_table +--echo # default: $drop_index +--echo # default: $create_index2 +--echo # default: $show_table +--echo # default: $drop_index +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_index1 FROM "$create_index1"; +eval PREPARE create_index2 FROM "$create_index2"; +EXECUTE create_index1; +eval PREPARE show_table FROM "$show_table"; +eval PREPARE drop_index FROM "$drop_index"; +EXECUTE drop_index; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_index1; + let $value= INITIALIZED; + let $value= query_get_value(EXECUTE show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value1'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value1 + --echo # abort + exit; + } + EXECUTE drop_index; + EXECUTE create_index2; + let $value= INITIALIZED; + let $value= query_get_value(EXECUTE show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value2'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value2 + --echo # abort + exit; + } + EXECUTE drop_index; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_index1; +DEALLOCATE PREPARE create_index2; +DEALLOCATE PREPARE show_table; +DEALLOCATE PREPARE drop_index; +--enable_result_log +--enable_query_log +# +--echo # Subtest 8C (two connections, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index1 +--echo # con2: $show_table +--echo # default: $drop_index +--echo # default: $create_index2 +--echo # con2: $show_table +--echo # default: $drop_index +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_index1; + connection con2; + let $value= INITIALIZED; + let $value= query_get_value($show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value1'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value1 + --echo # abort + exit; + } + connection default; + eval $drop_index; + eval $create_index2; + connection con2; + let $value= INITIALIZED; + let $value= query_get_value($show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value2'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value2 + --echo # abort + exit; + } + connection default; + eval $drop_index; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 8D (two connections, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index1 +--echo # con2: $show_table +--echo # default: $drop_index +--echo # default: $create_index2 +--echo # con2: $show_table +--echo # default: $drop_index +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_index1 FROM "$create_index1"; +eval PREPARE create_index2 FROM "$create_index2"; +eval PREPARE drop_index FROM "$drop_index"; +EXECUTE create_index1; +connection con2; +eval PREPARE show_table FROM "$show_table"; +connection default; +EXECUTE drop_index; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_index1; + connection con2; + let $value= INITIALIZED; + let $value= query_get_value(EXECUTE show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value1'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value1 + --echo # abort + exit; + } + connection default; + EXECUTE drop_index; + EXECUTE create_index2; + connection con2; + let $value= INITIALIZED; + let $value= query_get_value(EXECUTE show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value2'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value2 + --echo # abort + exit; + } + connection default; + EXECUTE drop_index; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_index1; +DEALLOCATE PREPARE create_index2; +DEALLOCATE PREPARE drop_index; +connection con2; +DEALLOCATE PREPARE show_table; +connection default; +--enable_result_log +--enable_query_log + +DROP TABLE t1; diff --git a/mysql-test/suite/stress/r/ddl_archive.result b/mysql-test/suite/stress/r/ddl_archive.result new file mode 100644 index 00000000000..47c64a6af94 --- /dev/null +++ b/mysql-test/suite/stress/r/ddl_archive.result @@ -0,0 +1,79 @@ +SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start"; +SET @runtime = <intended_runtime>; +PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1"; +DROP TABLE IF EXISTS t1; +# Subtest 2A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = ARCHIVE AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = ARCHIVE AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = ARCHIVE AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = ARCHIVE AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 3A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 5A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = ARCHIVE +# default: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# default: DROP TABLE t1 +# Subtest 5B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = ARCHIVE +# default: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# default: DROP TABLE t1 +# Subtest 5C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = ARCHIVE +# con2: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# con2: DROP TABLE t1 +# Subtest 5D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = ARCHIVE +# con2: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# con2: DROP TABLE t1 +DEALLOCATE PREPARE stmt_start; +DEALLOCATE PREPARE stmt_break; diff --git a/mysql-test/suite/stress/r/ddl_csv.result b/mysql-test/suite/stress/r/ddl_csv.result new file mode 100644 index 00000000000..3dfa0c8fd15 --- /dev/null +++ b/mysql-test/suite/stress/r/ddl_csv.result @@ -0,0 +1,55 @@ +SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start"; +SET @runtime = <intended_runtime>; +PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1"; +DROP TABLE IF EXISTS t1; +# Subtest 2A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = CSV AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = CSV AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = CSV AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = CSV AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 3A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +DEALLOCATE PREPARE stmt_start; +DEALLOCATE PREPARE stmt_break; diff --git a/mysql-test/suite/stress/r/ddl_innodb.result b/mysql-test/suite/stress/r/ddl_innodb.result new file mode 100644 index 00000000000..6417d3e1c5c --- /dev/null +++ b/mysql-test/suite/stress/r/ddl_innodb.result @@ -0,0 +1,251 @@ +SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start"; +SET @runtime = <intended_runtime>; +PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1"; +DROP TABLE IF EXISTS t1; +# Subtest 1A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = InnoDB +# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# default: DROP TABLE t1 +# Subtest 1B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = InnoDB +# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# default: DROP TABLE t1 +# Subtest 1C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = InnoDB +# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# con2: DROP TABLE t1 +# Subtest 1D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = InnoDB +# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# con2: DROP TABLE t1 +# Subtest 2A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = InnoDB AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = InnoDB AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = InnoDB AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = InnoDB AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 3A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=InnoDB; +DROP TABLE t1; +CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB; +DROP TABLE t1; +# Subtest 4A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=InnoDB +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=InnoDB +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=InnoDB +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=InnoDB +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 5A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = InnoDB +# default: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# default: DROP TABLE t1 +# Subtest 5B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = InnoDB +# default: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# default: DROP TABLE t1 +# Subtest 5C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = InnoDB +# con2: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# con2: DROP TABLE t1 +# Subtest 5D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = InnoDB +# con2: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# con2: DROP TABLE t1 +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=InnoDB; +# Subtest 6A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: DROP INDEX IDX1 ON t1 +# Subtest 6B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: DROP INDEX IDX1 ON t1 +# Subtest 6C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: DROP INDEX IDX1 ON t1 +# Subtest 6D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: DROP INDEX IDX1 ON t1 +DROP TABLE t1; +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, PRIMARY KEY(f1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(0,1); +# Subtest 7A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# default: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# default: DELETE FROM t1 WHERE f1 = 1 +# Subtest 7B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# default: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# default: DELETE FROM t1 WHERE f1 = 1 +# Subtest 7C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# con2: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# con2: DELETE FROM t1 WHERE f1 = 1 +# Subtest 7D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# con2: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# con2: DELETE FROM t1 WHERE f1 = 1 +DROP TABLE t1; +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(1,1); +CREATE INDEX IDX ON t1 (f2); +DROP INDEX IDX ON t1; +CREATE UNIQUE INDEX IDX ON t1 (f2); +DROP INDEX IDX ON t1; +# Subtest 8A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +DROP TABLE t1; +DEALLOCATE PREPARE stmt_start; +DEALLOCATE PREPARE stmt_break; diff --git a/mysql-test/suite/stress/r/ddl_memory.result b/mysql-test/suite/stress/r/ddl_memory.result new file mode 100644 index 00000000000..1700fbc2745 --- /dev/null +++ b/mysql-test/suite/stress/r/ddl_memory.result @@ -0,0 +1,251 @@ +SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start"; +SET @runtime = <intended_runtime>; +PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1"; +DROP TABLE IF EXISTS t1; +# Subtest 1A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = MEMORY +# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# default: DROP TABLE t1 +# Subtest 1B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = MEMORY +# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# default: DROP TABLE t1 +# Subtest 1C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = MEMORY +# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# con2: DROP TABLE t1 +# Subtest 1D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = MEMORY +# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# con2: DROP TABLE t1 +# Subtest 2A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = MEMORY AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = MEMORY AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = MEMORY AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = MEMORY AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 3A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MEMORY; +DROP TABLE t1; +CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY; +DROP TABLE t1; +# Subtest 4A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MEMORY +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MEMORY +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MEMORY +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MEMORY +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 5A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MEMORY +# default: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# default: DROP TABLE t1 +# Subtest 5B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MEMORY +# default: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# default: DROP TABLE t1 +# Subtest 5C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MEMORY +# con2: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# con2: DROP TABLE t1 +# Subtest 5D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MEMORY +# con2: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# con2: DROP TABLE t1 +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=MEMORY; +# Subtest 6A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: DROP INDEX IDX1 ON t1 +# Subtest 6B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: DROP INDEX IDX1 ON t1 +# Subtest 6C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: DROP INDEX IDX1 ON t1 +# Subtest 6D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: DROP INDEX IDX1 ON t1 +DROP TABLE t1; +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, PRIMARY KEY(f1)) ENGINE=MEMORY; +INSERT INTO t1 VALUES(0,1); +# Subtest 7A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# default: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# default: DELETE FROM t1 WHERE f1 = 1 +# Subtest 7B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# default: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# default: DELETE FROM t1 WHERE f1 = 1 +# Subtest 7C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# con2: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# con2: DELETE FROM t1 WHERE f1 = 1 +# Subtest 7D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# con2: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# con2: DELETE FROM t1 WHERE f1 = 1 +DROP TABLE t1; +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=MEMORY; +INSERT INTO t1 VALUES(1,1); +CREATE INDEX IDX ON t1 (f2); +DROP INDEX IDX ON t1; +CREATE UNIQUE INDEX IDX ON t1 (f2); +DROP INDEX IDX ON t1; +# Subtest 8A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +DROP TABLE t1; +DEALLOCATE PREPARE stmt_start; +DEALLOCATE PREPARE stmt_break; diff --git a/mysql-test/suite/stress/r/ddl_myisam.result b/mysql-test/suite/stress/r/ddl_myisam.result new file mode 100644 index 00000000000..82be55b8371 --- /dev/null +++ b/mysql-test/suite/stress/r/ddl_myisam.result @@ -0,0 +1,251 @@ +SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start"; +SET @runtime = <intended_runtime>; +PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1"; +DROP TABLE IF EXISTS t1; +# Subtest 1A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = MyISAM +# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# default: DROP TABLE t1 +# Subtest 1B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = MyISAM +# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# default: DROP TABLE t1 +# Subtest 1C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = MyISAM +# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# con2: DROP TABLE t1 +# Subtest 1D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = MyISAM +# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# con2: DROP TABLE t1 +# Subtest 2A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = MyISAM AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = MyISAM AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = MyISAM AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = MyISAM AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 3A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM; +DROP TABLE t1; +CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM; +DROP TABLE t1; +# Subtest 4A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 5A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MyISAM +# default: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# default: DROP TABLE t1 +# Subtest 5B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MyISAM +# default: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# default: DROP TABLE t1 +# Subtest 5C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MyISAM +# con2: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# con2: DROP TABLE t1 +# Subtest 5D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MyISAM +# con2: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# con2: DROP TABLE t1 +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=MyISAM; +# Subtest 6A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: DROP INDEX IDX1 ON t1 +# Subtest 6B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: DROP INDEX IDX1 ON t1 +# Subtest 6C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: DROP INDEX IDX1 ON t1 +# Subtest 6D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: DROP INDEX IDX1 ON t1 +DROP TABLE t1; +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, PRIMARY KEY(f1)) ENGINE=MyISAM; +INSERT INTO t1 VALUES(0,1); +# Subtest 7A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# default: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# default: DELETE FROM t1 WHERE f1 = 1 +# Subtest 7B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# default: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# default: DELETE FROM t1 WHERE f1 = 1 +# Subtest 7C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# con2: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# con2: DELETE FROM t1 WHERE f1 = 1 +# Subtest 7D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# con2: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# con2: DELETE FROM t1 WHERE f1 = 1 +DROP TABLE t1; +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=MyISAM; +INSERT INTO t1 VALUES(1,1); +CREATE INDEX IDX ON t1 (f2); +DROP INDEX IDX ON t1; +CREATE UNIQUE INDEX IDX ON t1 (f2); +DROP INDEX IDX ON t1; +# Subtest 8A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +DROP TABLE t1; +DEALLOCATE PREPARE stmt_start; +DEALLOCATE PREPARE stmt_break; diff --git a/mysql-test/suite/stress/r/ddl_ndb.result b/mysql-test/suite/stress/r/ddl_ndb.result new file mode 100644 index 00000000000..39146e65fb0 --- /dev/null +++ b/mysql-test/suite/stress/r/ddl_ndb.result @@ -0,0 +1,216 @@ +SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start"; +SET @runtime = <intended_runtime>; +PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1"; +DROP TABLE IF EXISTS t1; +# Subtest 1A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = NDB +# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# default: DROP TABLE t1 +# Subtest 1B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = NDB +# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# default: DROP TABLE t1 +# Subtest 1C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = NDB +# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# con2: DROP TABLE t1 +# Subtest 1D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = NDB +# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# con2: DROP TABLE t1 +# Subtest 2A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = NDB AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = NDB AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = NDB AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = NDB AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 3A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB; +DROP TABLE t1; +CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB; +DROP TABLE t1; +# Subtest 4A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 5A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB +# default: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# default: DROP TABLE t1 +# Subtest 5B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB +# default: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# default: DROP TABLE t1 +# Subtest 5C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB +# con2: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# con2: DROP TABLE t1 +# Subtest 5D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB +# con2: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# con2: DROP TABLE t1 +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=NDB; +# Subtest 6A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: DROP INDEX IDX1 ON t1 +# Subtest 6B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: DROP INDEX IDX1 ON t1 +# Subtest 6C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: DROP INDEX IDX1 ON t1 +# Subtest 6D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: DROP INDEX IDX1 ON t1 +DROP TABLE t1; +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=NDB; +INSERT INTO t1 VALUES(1,1); +CREATE INDEX IDX ON t1 (f2); +DROP INDEX IDX ON t1; +CREATE UNIQUE INDEX IDX ON t1 (f2); +DROP INDEX IDX ON t1; +# Subtest 8A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +DROP TABLE t1; +DEALLOCATE PREPARE stmt_start; +DEALLOCATE PREPARE stmt_break; diff --git a/mysql-test/suite/stress/t/ddl_archive.test b/mysql-test/suite/stress/t/ddl_archive.test new file mode 100644 index 00000000000..0c47b5fcdd5 --- /dev/null +++ b/mysql-test/suite/stress/t/ddl_archive.test @@ -0,0 +1,51 @@ +######## t/ddl_archive.test ###### +# +# Stress the storage engine ARCHIVE with CREATE/DROP TABLE/INDEX +# +# Please look for details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + +# Storage engine to be used in CREATE TABLE +--source include/have_archive.inc +let $engine_type= ARCHIVE; + + +if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) +{ + --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled +} +let $run= `SELECT '$BIG_TEST' = '1'`; +if ($run) +{ + # A run started with "--big-test" should be allowed to consume more time. + # Rough intended runtime per subtest variant in seconds + let $runtime = 5; + # number of rounds till we look at the clock again + let $loop_size= 100; +} +if (!$run) +{ + let $runtime = 1; + let $loop_size= 20; +} + + +##### Some preparations needed for the ddl*.inc scripts +--source suite/stress/include/ddl.pre + +# Tests set to comment fail because of CSV limitations +# (limited number of keys, NULL within index not supported) +# --source suite/stress/include/ddl1.inc +--source suite/stress/include/ddl2.inc +--source suite/stress/include/ddl3.inc +# --source suite/stress/include/ddl4.inc +--source suite/stress/include/ddl5.inc +# --source suite/stress/include/ddl6.inc +# --source suite/stress/include/ddl7.inc +# --source suite/stress/include/ddl8.inc + +##### Cleanup +--source suite/stress/include/ddl.cln diff --git a/mysql-test/suite/stress/t/ddl_csv.test b/mysql-test/suite/stress/t/ddl_csv.test new file mode 100644 index 00000000000..9f6185c76be --- /dev/null +++ b/mysql-test/suite/stress/t/ddl_csv.test @@ -0,0 +1,51 @@ +######## t/ddl_csv.test ###### +# +# Stress the storage engine CSV with CREATE/DROP TABLE/INDEX +# +# Please look for details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + +# Storage engine to be used in CREATE TABLE +--source include/have_csv.inc +let $engine_type= CSV; + + +if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) +{ + --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled +} +let $run= `SELECT '$BIG_TEST' = '1'`; +if ($run) +{ + # A run started with "--big-test" should be allowed to consume more time. + # Rough intended runtime per subtest variant in seconds + let $runtime = 5; + # number of rounds till we look at the clock again + let $loop_size= 100; +} +if (!$run) +{ + let $runtime = 1; + let $loop_size= 20; +} + + +##### Some preparations needed for the ddl*.inc scripts +--source suite/stress/include/ddl.pre + +# Tests set to comment fail because of CSV limitations +# (limited number of keys, AUTOINC not supported) +# --source suite/stress/include/ddl1.inc +--source suite/stress/include/ddl2.inc +--source suite/stress/include/ddl3.inc +# --source suite/stress/include/ddl4.inc +# --source suite/stress/include/ddl5.inc +# --source suite/stress/include/ddl6.inc +# --source suite/stress/include/ddl7.inc +# --source suite/stress/include/ddl8.inc + +##### Cleanup +--source suite/stress/include/ddl.cln diff --git a/mysql-test/suite/stress/t/ddl_innodb.test b/mysql-test/suite/stress/t/ddl_innodb.test new file mode 100644 index 00000000000..784ba8ff003 --- /dev/null +++ b/mysql-test/suite/stress/t/ddl_innodb.test @@ -0,0 +1,49 @@ +######## t/ddl_innodb.test ###### +# +# Stress the storage engine InnoDB with CREATE/DROP TABLE/INDEX +# +# Please look for details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + +# Storage engine to be used in CREATE TABLE +--source include/have_innodb.inc +let $engine_type= InnoDB; + + +if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) +{ + --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled +} +let $run= `SELECT '$BIG_TEST' = '1'`; +if ($run) +{ + # A run started with "--big-test" should be allowed to consume more time. + # Rough intended runtime per subtest variant in seconds + let $runtime = 5; + # number of rounds till we look at the clock again + let $loop_size= 100; +} +if (!$run) +{ + let $runtime = 1; + let $loop_size= 20; +} + + +##### Some preparations needed for the ddl*.inc scripts +--source suite/stress/include/ddl.pre + +--source suite/stress/include/ddl1.inc +--source suite/stress/include/ddl2.inc +--source suite/stress/include/ddl3.inc +--source suite/stress/include/ddl4.inc +--source suite/stress/include/ddl5.inc +--source suite/stress/include/ddl6.inc +--source suite/stress/include/ddl7.inc +--source suite/stress/include/ddl8.inc + +##### Cleanup +--source suite/stress/include/ddl.cln diff --git a/mysql-test/suite/stress/t/ddl_memory.test b/mysql-test/suite/stress/t/ddl_memory.test new file mode 100644 index 00000000000..5178439bff1 --- /dev/null +++ b/mysql-test/suite/stress/t/ddl_memory.test @@ -0,0 +1,48 @@ +######## t/ddl_memory.test ###### +# +# Stress the storage engine MEMORY with CREATE/DROP TABLE/INDEX +# +# Please look for details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + +# Storage engine to be used in CREATE TABLE +let $engine_type= MEMORY; + + +if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) +{ + --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled +} +let $run= `SELECT '$BIG_TEST' = '1'`; +if ($run) +{ + # A run started with "--big-test" should be allowed to consume more time. + # Rough intended runtime per subtest variant in seconds + let $runtime = 5; + # number of rounds till we look at the clock again + let $loop_size= 100; +} +if (!$run) +{ + let $runtime = 1; + let $loop_size= 20; +} + + +##### Some preparations needed for the ddl*.inc scripts +--source suite/stress/include/ddl.pre + +--source suite/stress/include/ddl1.inc +--source suite/stress/include/ddl2.inc +--source suite/stress/include/ddl3.inc +--source suite/stress/include/ddl4.inc +--source suite/stress/include/ddl5.inc +--source suite/stress/include/ddl6.inc +--source suite/stress/include/ddl7.inc +--source suite/stress/include/ddl8.inc + +##### Cleanup +--source suite/stress/include/ddl.cln diff --git a/mysql-test/suite/stress/t/ddl_myisam.test b/mysql-test/suite/stress/t/ddl_myisam.test new file mode 100644 index 00000000000..8d6226e573b --- /dev/null +++ b/mysql-test/suite/stress/t/ddl_myisam.test @@ -0,0 +1,48 @@ +######## t/ddl_myisam.test ###### +# +# Stress the storage engine MyISAM with CREATE/DROP TABLE/INDEX +# +# Please look for details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + +# Storage engine to be used in CREATE TABLE +let $engine_type= MyISAM; + + +if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) +{ + --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled +} +let $run= `SELECT '$BIG_TEST' = '1'`; +if ($run) +{ + # A run started with "--big-test" should be allowed to consume more time. + # Rough intended runtime per subtest variant in seconds + let $runtime = 5; + # number of rounds till we look at the clock again + let $loop_size= 100; +} +if (!$run) +{ + let $runtime = 1; + let $loop_size= 20; +} + + +##### Some preparations needed for the ddl*.inc scripts +--source suite/stress/include/ddl.pre + +--source suite/stress/include/ddl1.inc +--source suite/stress/include/ddl2.inc +--source suite/stress/include/ddl3.inc +--source suite/stress/include/ddl4.inc +--source suite/stress/include/ddl5.inc +--source suite/stress/include/ddl6.inc +--source suite/stress/include/ddl7.inc +--source suite/stress/include/ddl8.inc + +##### Cleanup +--source suite/stress/include/ddl.cln diff --git a/mysql-test/suite/stress/t/ddl_ndb.test b/mysql-test/suite/stress/t/ddl_ndb.test new file mode 100644 index 00000000000..7eb45da8739 --- /dev/null +++ b/mysql-test/suite/stress/t/ddl_ndb.test @@ -0,0 +1,56 @@ +######## t/ddl_ndb.test ###### +# +# Stress the storage engine NDB with CREATE/DROP TABLE/INDEX +# +# Please look for details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + +# Storage engine to be used in CREATE TABLE +--source include/have_ndb.inc +let $engine_type= NDB; + + +if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) +{ + --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled +} +# Attention: We set here much smaller values for $runtime and $loop_size compared +# to the other storage engines. +# The reason is that NDB is extreme slow and should not exceed +# the "testcase-timeout". +let $run= `SELECT '$BIG_TEST' = '1'`; +if ($run) +{ + # A run started with "--big-test" should be allowed to consume more time. + # Rough intended runtime per subtest variant in seconds + let $runtime = 5; + # number of rounds till we look at the clock again + let $loop_size= 3; +} +if (!$run) +{ + let $runtime = 1; + let $loop_size= 1; +} + + +##### Some preparations needed for the ddl*.inc scripts +--source suite/stress/include/ddl.pre + +--source suite/stress/include/ddl1.inc +--source suite/stress/include/ddl2.inc +--source suite/stress/include/ddl3.inc +--source suite/stress/include/ddl4.inc +--source suite/stress/include/ddl5.inc +--source suite/stress/include/ddl6.inc +# The following test suffers from +# Bug#26043 UNIQUE INDEX create always fails after constraint violation +# and is therefore set to comment. +# --source suite/stress/include/ddl7.inc +--source suite/stress/include/ddl8.inc + +##### Cleanup +--source suite/stress/include/ddl.cln |