diff options
Diffstat (limited to 'mysql-test/suite/innodb/t')
12 files changed, 18 insertions, 93 deletions
diff --git a/mysql-test/suite/innodb/t/auto_increment_dup.test b/mysql-test/suite/innodb/t/auto_increment_dup.test index abbff46075a..798a4ecbff7 100644 --- a/mysql-test/suite/innodb/t/auto_increment_dup.test +++ b/mysql-test/suite/innodb/t/auto_increment_dup.test @@ -23,16 +23,10 @@ CREATE TABLE t1( --connection con1 ---echo # ---echo # Connection 1 ---echo # SET DEBUG_SYNC='ha_write_row_end SIGNAL continue2 WAIT_FOR continue1'; --send INSERT INTO t1(k) VALUES (1), (2), (3) ON DUPLICATE KEY UPDATE c='1' --connection con2 ---echo # ---echo # Connection 2 ---echo # SET DEBUG_SYNC='ha_write_row_start WAIT_FOR continue2'; SET DEBUG_SYNC='after_mysql_insert SIGNAL continue1'; INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2'; diff --git a/mysql-test/suite/innodb/t/binlog_consistent.test b/mysql-test/suite/innodb/t/binlog_consistent.test index 4ab2903e693..1c8198bb321 100644 --- a/mysql-test/suite/innodb/t/binlog_consistent.test +++ b/mysql-test/suite/innodb/t/binlog_consistent.test @@ -14,7 +14,6 @@ connect(con3,localhost,root,,); connect(con4,localhost,root,,); connection default; ---echo # Connection default CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb; let pos=`select $binlog_start_pos + 238`; @@ -26,12 +25,10 @@ BEGIN; INSERT INTO t1 VALUES (0, ""); connection con1; ---echo # Connection con1 BEGIN; INSERT INTO t1 VALUES (1, ""); connection con2; ---echo # Connection con2 CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=myisam; BEGIN; INSERT INTO t1 VALUES (2, "first"); @@ -39,26 +36,22 @@ INSERT INTO t2 VALUES (2); INSERT INTO t1 VALUES (2, "second"); connection default; ---echo # Connection default COMMIT; SET TRANSACTION ISOLATION LEVEL REPEATABLE READ; START TRANSACTION WITH CONSISTENT SNAPSHOT; connection con3; ---echo # Connection con3 BEGIN; INSERT INTO t1 VALUES (3, ""); INSERT INTO t2 VALUES (3); connection con4; ---echo # Connection con4 BEGIN; INSERT INTO t1 VALUES (4, ""); COMMIT; connection default; ---echo # Connection default SELECT * FROM t1 ORDER BY a,b; let pos=`select $binlog_start_pos + 740`; --replace_result $pos <pos> @@ -69,21 +62,17 @@ SHOW MASTER STATUS; SELECT * FROM t2 ORDER BY a; connection con1; ---echo # Connection con1 COMMIT; connection con2; ---echo # Connection con2 COMMIT; connection con3; ---echo # Connection con3 COMMIT; FLUSH LOGS; --source include/wait_for_binlog_checkpoint.inc connection default; ---echo # Connection default SELECT * FROM t1 ORDER BY a,b; let pos=`select $binlog_start_pos + 740`; --replace_result $pos <pos> diff --git a/mysql-test/suite/innodb/t/innodb-agregate.test b/mysql-test/suite/innodb/t/innodb-agregate.test new file mode 100644 index 00000000000..e15548c087a --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-agregate.test @@ -0,0 +1,18 @@ +--source include/have_innodb.inc + +# +# MDEV-9667: Server hangs after select count(distinct name) from t2 where a=8366 and b>=5 and b<=5; +# + +create table t2 (a smallint(6) not null, b int(10) not null, name varchar(20), primary key(a,b), key(name)) engine=InnoDB; + +insert into t2 values (8355,3,"sanja"),(8355,4,"wlad"),(8366,5, "lawrin"),(8366,6,"markusjm"); + +select count(distinct name) from t2 where a=8366 and b>=5 and b<=5; +select count(distinct name) from t2 where a=8366 and b=5; +select count(distinct name) from t2 where a=8366 and b between 5 and 5.5; +select sum(distinct a) from t2 where a=8366 and b>=5 and b<=5; +select sum(distinct a) from t2 where a=8366 and b=5; +select sum(distinct a) from t2 where a=8366 and b between 5 and 5.5; + +drop table t2; diff --git a/mysql-test/suite/innodb/t/innodb-autoinc-61209.test b/mysql-test/suite/innodb/t/innodb-autoinc-61209.test index 2a981fe9d44..0b285fb2ebc 100644 --- a/mysql-test/suite/innodb/t/innodb-autoinc-61209.test +++ b/mysql-test/suite/innodb/t/innodb-autoinc-61209.test @@ -17,35 +17,23 @@ CREATE TABLE bug_61209 (a INT auto_increment, PRIMARY KEY(a)) ENGINE=InnoDB; INSERT INTO bug_61209 VALUES (), (), (), (); ---echo ---echo # Connect con1 --connect (con1,localhost,root,,) ---echo ---echo # Connect con2 --connect (con2,localhost,root,,) ---echo ---echo # Connection con1 --connection con1 SET SESSION auto_increment_increment=3; SET SESSION auto_increment_offset=2; SELECT GET_LOCK('a', 9); ---echo ---echo # Connection con2 --connection con2 SET SESSION auto_increment_increment=3; SET SESSION auto_increment_offset=2; send INSERT INTO bug_61209 (a) VALUES (NULL), (NULL), (NULL + GET_LOCK('a', 10)); ---echo ---echo # Connection con1 reap --connection con1 INSERT INTO bug_61209 (a) VALUES (NULL), (NULL), (NULL); SELECT RELEASE_LOCK('a'); ---echo ---echo # Connection con2 reap --connection con2 reap; diff --git a/mysql-test/suite/innodb/t/innodb-lock.test b/mysql-test/suite/innodb/t/innodb-lock.test index e3026ac505b..47246c53759 100644 --- a/mysql-test/suite/innodb/t/innodb-lock.test +++ b/mysql-test/suite/innodb/t/innodb-lock.test @@ -71,7 +71,6 @@ insert into t1 values(0, 0),(1,1),(2,2); commit; SELECT * from t1 where id = 0 FOR UPDATE; ---echo # Connection 'con2'. connection con2; set autocommit=0; set @@innodb_table_locks=0; @@ -82,7 +81,6 @@ set @@innodb_table_locks=0; --echo # Sending: --send lock table t1 write; ---echo # Connection 'con1'. connection con1; --echo # Wait until LOCK TABLE is blocked on SQL-level lock. let $wait_condition= @@ -96,18 +94,15 @@ select * from t1; --echo # Unblock LOCK TABLE. commit; ---echo # Connection 'con2'. connection con2; --echo # Reap LOCK TABLE. --reap unlock tables; ---echo # Connection 'con1'. connection con1; select * from t1 where id = 0 for update; ---echo # Connection 'con2'. connection con2; --echo # The below statement should not be blocked as LOCK TABLES ... READ --echo # does not take strong SQL-level lock on t1. SELECTs which do not @@ -120,7 +115,6 @@ unlock tables; select * from t1; commit; ---echo # Connection 'con1'. connection con1; commit; diff --git a/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test b/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test index 16fb570737d..8553d97bd9e 100644 --- a/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test +++ b/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test @@ -7,7 +7,6 @@ call mtr.add_suppression("InnoDB: The total blob data length"); let $old_max_allowed_packet = `select @@max_allowed_packet`; SET GLOBAL max_allowed_packet = 100*1024*1024; ---echo # Connection big_packets: connect(big_packets,localhost,root,,); connection big_packets; @@ -28,7 +27,6 @@ start transaction; --error ER_TOO_BIG_ROWSIZE INSERT INTO t1 (a, b) VALUES (6, REPEAT('a', 20*1024*1024)); ---echo # Connection default: connection default; # We expect a restart. @@ -41,7 +39,6 @@ connection default; --enable_reconnect --source include/wait_until_connected_again.inc ---echo # Connection default: connection default; # We should see (1,2,3,4,5) here. diff --git a/mysql-test/suite/innodb/t/innodb_bug53756.test b/mysql-test/suite/innodb/t/innodb_bug53756.test index c298c945434..4aee0f87746 100644 --- a/mysql-test/suite/innodb/t/innodb_bug53756.test +++ b/mysql-test/suite/innodb/t/innodb_bug53756.test @@ -47,65 +47,45 @@ START TRANSACTION; SELECT @@tx_isolation; SELECT * FROM bug_53756; ---echo ---echo # connection con1 deletes row 1 --connect (con1,localhost,root,,) START TRANSACTION; SELECT @@tx_isolation; DELETE FROM bug_53756 WHERE pk=1; ---echo ---echo # connection con2 deletes row 2 --connect (con2,localhost,root,,) START TRANSACTION; SELECT @@tx_isolation; DELETE FROM bug_53756 WHERE pk=2; ---echo ---echo # connection con3 updates row 3 --connect (con3,localhost,root,,) START TRANSACTION; SELECT @@tx_isolation; UPDATE bug_53756 SET c1=77 WHERE pk=3; ---echo ---echo # connection con4 updates row 4 --connect (con4,localhost,root,,) START TRANSACTION; SELECT @@tx_isolation; UPDATE bug_53756 SET c1=88 WHERE pk=4; ---echo ---echo # connection con5 inserts row 5 --connect (con5,localhost,root,,) START TRANSACTION; SELECT @@tx_isolation; INSERT INTO bug_53756 VALUES(5, 55); ---echo ---echo # connection con6 inserts row 6 --connect (con6,localhost,root,,) START TRANSACTION; SELECT @@tx_isolation; INSERT INTO bug_53756 VALUES(6, 66); ---echo ---echo # connection con1 commits. --connection con1 COMMIT; ---echo ---echo # connection con3 commits. --connection con3 COMMIT; ---echo ---echo # connection con4 rolls back. --connection con4 ROLLBACK; ---echo ---echo # connection con6 rolls back. --connection con6 ROLLBACK; @@ -113,7 +93,6 @@ ROLLBACK; --echo # The connections 2 and 5 stay open. --echo ---echo # connection default selects resulting data. --echo # Delete of row 1 was committed. --echo # Update of row 3 was committed. --echo # Due to isolation level read committed, these should be included. @@ -121,8 +100,6 @@ ROLLBACK; --connection default SELECT * FROM bug_53756; ---echo ---echo # connection default --connection default --echo # --echo # Crash server. @@ -144,8 +121,6 @@ SET SESSION debug_dbug="+d,crash_commit_before"; --error 2013 COMMIT; --echo ---echo # ---echo # disconnect con1, con2, con3, con4, con5, con6. --disconnect con1 --disconnect con2 --disconnect con3 @@ -182,4 +157,3 @@ DROP TABLE bug_53756; eval SET GLOBAL tx_isolation= '$global_isolation'; eval SET SESSION tx_isolation= '$session_isolation'; --enable_query_log - diff --git a/mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test b/mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test index f6f65391b82..3968321d7d5 100644 --- a/mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test +++ b/mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test @@ -166,8 +166,6 @@ begin; select 1 from t1 natural join (select 2 as a, 1 as b union all select 2 as a, 2 as b) as t2 for update; connect (con1,localhost,root,,); ---echo # ---echo # Switching to connection con1 connection con1; --echo # We should be able to delete all records from t1 except (2, null), --echo # since they were not locked. @@ -189,8 +187,6 @@ delete from t1 where a in (19,20); --error ER_LOCK_WAIT_TIMEOUT delete from t1; rollback; ---echo # ---echo # Switching to connection default connection default; --echo # --echo # Show that the original contents of t1 is intact: @@ -211,8 +207,6 @@ delete t1.* from t1 natural join (select 2 as a, 2 as b union all select 0 as a, 0 as b) as t2; --echo # Demonstrate that nothing was deleted form t1 select * from t1; ---echo # ---echo # Switching to connection con1 connection con1; begin; --echo # Since there is another distinct record in the derived table @@ -222,8 +216,6 @@ delete from t1; rollback; select * from t1; commit; ---echo # ---echo # Switching to connection default connection default; rollback; begin; @@ -245,7 +237,6 @@ select 1 from t1 natural join (select 3 as a, 2 as b union all --echo # Lock the record. select 1 from t1 natural join (select 3 as a, 2 as b union all select 3 as a, 1 as b) as t2 for update; ---echo # Switching to connection con1 connection con1; --echo # --echo # We should not be able to delete record (3,1) from t1, @@ -253,7 +244,6 @@ connection con1; --echo # --error ER_LOCK_WAIT_TIMEOUT delete from t1 where a=3; ---echo # Switching to connection default connection default; commit; diff --git a/mysql-test/suite/innodb/t/innodb_mysql.test b/mysql-test/suite/innodb/t/innodb_mysql.test index 7c2ae98f001..ee3975fd350 100644 --- a/mysql-test/suite/innodb/t/innodb_mysql.test +++ b/mysql-test/suite/innodb/t/innodb_mysql.test @@ -907,11 +907,9 @@ INSERT INTO t1 VALUES (1, 0), (2, 0); CREATE FUNCTION f1(z INT) RETURNS INT READS SQL DATA RETURN (SELECT x FROM t1 WHERE x = z); ---echo # Connection default START TRANSACTION; SELECT f1(1); ---echo # Connection con2 --disable_query_log connect (con2, localhost, root); --enable_query_log @@ -924,7 +922,6 @@ COMMIT; disconnect con2; --source include/wait_until_disconnected.inc ---echo # Connection default connection default; COMMIT; DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test b/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test index 21a5753e909..adae10df2ad 100644 --- a/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test +++ b/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test @@ -43,20 +43,17 @@ INSERT INTO worklog5743 VALUES(REPEAT("a", 3500) , REPEAT("o", 3500)); SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM worklog5743; ---echo "In connection 1" --connect (con1,localhost,root,,) SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM worklog5743; SELECT COUNT(*) FROM worklog5743; ---echo "In connection 2" --connect (con2,localhost,root,,) START TRANSACTION; INSERT INTO worklog5743 VALUES(REPEAT("b", 3500) , REPEAT("o", 3500)); ---echo "In connection 1" --connection con1 SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM worklog5743; @@ -64,7 +61,6 @@ SELECT COUNT(*) FROM worklog5743; START TRANSACTION; ---echo "In connection default ....restarting the server" --connection default # Restart the server -- source include/restart_mysqld.inc @@ -75,7 +71,6 @@ worklog5743; --disconnect con1 --disconnect con2 ---echo "In connection 1" --connect (con1,localhost,root,,) SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM worklog5743; @@ -86,7 +81,6 @@ DELETE FROM worklog5743 WHERE col_1_text = REPEAT("b", 3500); SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM worklog5743; ---echo "In connection default ....restarting the server" --connection default # Restart the server -- source include/restart_mysqld.inc @@ -96,7 +90,6 @@ worklog5743; --disconnect con1 ---echo "In connection 1" --connect (con2,localhost,root,,) SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM worklog5743; @@ -106,7 +99,6 @@ UPDATE worklog5743 SET col_1_text = REPEAT("b", 3500) WHERE col_1_text = REPEAT( SELECT col_1_text = REPEAT("b", 3500) , col_2_text = REPEAT("o", 3500) FROM worklog5743; ---echo "In connection default ....restarting the server" --connection default # Restart the server -- source include/restart_mysqld.inc @@ -122,4 +114,3 @@ DROP TABLE worklog5743; eval SET GLOBAL innodb_file_format=$innodb_file_format_orig; eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig; eval SET GLOBAL innodb_large_prefix=$innodb_large_prefix_orig; - diff --git a/mysql-test/suite/innodb/t/innodb_sys_semaphore_waits.test b/mysql-test/suite/innodb/t/innodb_sys_semaphore_waits.test index 800199dbc54..53d43e6b711 100644 --- a/mysql-test/suite/innodb/t/innodb_sys_semaphore_waits.test +++ b/mysql-test/suite/innodb/t/innodb_sys_semaphore_waits.test @@ -5,16 +5,13 @@ # DEBUG_SYNC must be compiled in. --source include/have_debug_sync.inc ---echo # Establish connection con1 (user=root) connect (con1,localhost,root,,); ---echo # Establish connection con2 (user=root) connect (con2,localhost,root,,); --disable_warnings drop table if exists t1; --enable_warnings ---echo # Switch to connection con1 connection con1; eval create table t1 (id integer, x integer) engine = InnoDB; insert into t1 values(0, 0); @@ -33,7 +30,6 @@ SELECT * from t1 where id = 0 FOR UPDATE; # To make sure con1 holding the lock table mutex and sleeping --sleep 2 ---echo # Switch to connection con2 connection con2; set autocommit=0; @@ -61,7 +57,6 @@ SELECT * from t1 where id = 0 FOR UPDATE; # so mysqld will abort after 600 * 10 + 1 * 10 = 6010 seconds # in debug mode and 600 + 1 * 10 = 610 seconds in release mode. ---echo # Switched to the default connection connection default; --disable_result_log diff --git a/mysql-test/suite/innodb/t/tmpdir.test b/mysql-test/suite/innodb/t/tmpdir.test index abe455adda5..98517a97c7a 100644 --- a/mysql-test/suite/innodb/t/tmpdir.test +++ b/mysql-test/suite/innodb/t/tmpdir.test @@ -18,7 +18,6 @@ create table t1(a int primary key)engine=innodb; show session variables like 'innodb_tmpdir'; alter table t1 add column b int not null; set global innodb_tmpdir=NULL; ---echo # Connection con1 connect (con1,localhost,root); show session variables like 'innodb_tmpdir'; alter table t1 add key(b); @@ -56,7 +55,6 @@ insert into t1 values('text1', 'text2'); set @tmpdir = @@global.tmpdir; set global innodb_tmpdir = @tmpdir; show session variables like 'innodb_tmpdir'; ---echo # Connection con3 connect (con3,localhost,root); # Following alter using innodb_tmpdir as a path to create temporary files alter table t1 add fulltext(b); |