summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2023-03-18 20:04:47 +0100
committerSergei Golubchik <serg@mariadb.org>2023-03-20 11:28:51 +0100
commit83a4449ab98b5b6f08e18833bf9dd3e61e96c680 (patch)
treec568aa067f6194acbc8ea96ff47fc3cef63e5cc9
parent98ef21c3dcfcc0cbe8823996dd4fae56a78ecca1 (diff)
downloadmariadb-git-preview-11.1-preview.tar.gz
cleanup main.delayedpreview-11.1-preview
-rw-r--r--mysql-test/main/delayed.result99
-rw-r--r--mysql-test/main/delayed.test165
2 files changed, 99 insertions, 165 deletions
diff --git a/mysql-test/main/delayed.result b/mysql-test/main/delayed.result
index d5397e73a22..b52e71f8888 100644
--- a/mysql-test/main/delayed.result
+++ b/mysql-test/main/delayed.result
@@ -1,4 +1,7 @@
-drop table if exists t1;
+#
+# test of DELAYED insert and timestamps
+# (Can't be tested with purify :( )
+#
create table t1 (a char(10), tmsp timestamp);
insert into t1 set a = 1;
insert delayed into t1 set a = 2;
@@ -17,6 +20,10 @@ a tmsp
6 1971-10-06 01:02:03
8 1971-10-06 01:02:03
drop table t1;
+#
+# Test bug when inserting NULL into an auto_increment field with
+# INSERT DELAYED
+#
create table t1 (a int not null auto_increment primary key, b char(10));
insert delayed into t1 values (1,"b");
insert delayed into t1 values (null,"c");
@@ -34,6 +41,12 @@ a b
3 d
4 e
drop table t1;
+#
+# End of 4.1 tests
+#
+#
+# Bug #12226: Crash when a delayed insert fails due to a duplicate key
+#
create table t1 (a int not null primary key);
insert into t1 values (1);
insert delayed into t1 values (1);
@@ -41,6 +54,9 @@ select * from t1;
a
1
drop table t1;
+#
+# Bug #20195: INSERT DELAYED with auto_increment is assigned wrong values
+#
CREATE TABLE t1 ( a int(10) NOT NULL auto_increment, PRIMARY KEY (a));
insert delayed into t1 values(null);
insert into t1 values(null);
@@ -72,18 +88,10 @@ a
12
13
DROP TABLE t1;
-SET @bug20627_old_auto_increment_offset=
-@@auto_increment_offset;
-SET @bug20627_old_auto_increment_increment=
-@@auto_increment_increment;
-SET @bug20627_old_session_auto_increment_offset=
-@@session.auto_increment_offset;
-SET @bug20627_old_session_auto_increment_increment=
-@@session.auto_increment_increment;
-SET @@auto_increment_offset= 2;
-SET @@auto_increment_increment= 3;
-SET @@session.auto_increment_offset= 4;
-SET @@session.auto_increment_increment= 5;
+#
+# Bug#20627 - INSERT DELAYED does not honour auto_increment_* variables
+#
+SET @@auto_increment_offset= 4, @@auto_increment_increment= 5;
CREATE TABLE t1 (
c1 INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (c1)
@@ -107,26 +115,11 @@ c1
9
14
DROP TABLE t1;
-SET @@auto_increment_offset=
-@bug20627_old_auto_increment_offset;
-SET @@auto_increment_increment=
-@bug20627_old_auto_increment_increment;
-SET @@session.auto_increment_offset=
-@bug20627_old_session_auto_increment_offset;
-SET @@session.auto_increment_increment=
-@bug20627_old_session_auto_increment_increment;
-SET @bug20830_old_auto_increment_offset=
-@@auto_increment_offset;
-SET @bug20830_old_auto_increment_increment=
-@@auto_increment_increment;
-SET @bug20830_old_session_auto_increment_offset=
-@@session.auto_increment_offset;
-SET @bug20830_old_session_auto_increment_increment=
-@@session.auto_increment_increment;
-SET @@auto_increment_offset= 2;
-SET @@auto_increment_increment= 3;
-SET @@session.auto_increment_offset= 4;
-SET @@session.auto_increment_increment= 5;
+SET @@auto_increment_offset=default, @@auto_increment_increment=default;
+#
+# Bug#20830 - INSERT DELAYED does not honour SET INSERT_ID
+#
+SET @@auto_increment_offset= 4, @@auto_increment_increment= 5;
CREATE TABLE t1 (
c1 INT(11) NOT NULL AUTO_INCREMENT,
c2 INT(11) DEFAULT NULL,
@@ -235,14 +228,10 @@ SELECT SUM(c1) FROM t1;
SUM(c1)
2569
DROP TABLE t1;
-SET @@auto_increment_offset=
-@bug20830_old_auto_increment_offset;
-SET @@auto_increment_increment=
-@bug20830_old_auto_increment_increment;
-SET @@session.auto_increment_offset=
-@bug20830_old_session_auto_increment_offset;
-SET @@session.auto_increment_increment=
-@bug20830_old_session_auto_increment_increment;
+SET @@auto_increment_offset=default, @@auto_increment_increment=default;
+#
+# BUG#26238 - inserted delayed always inserts 0 for BIT columns
+#
CREATE TABLE t1(a BIT);
INSERT DELAYED INTO t1 VALUES(1);
FLUSH TABLE t1;
@@ -250,6 +239,9 @@ SELECT HEX(a) FROM t1;
HEX(a)
1
DROP TABLE t1;
+#
+# Bug #32676: insert delayed crash with wrong column and function specified
+#
CREATE TABLE t1 (a INT);
INSERT DELAYED INTO t1 SET a= b();
ERROR 42000: FUNCTION test.b does not exist
@@ -258,8 +250,12 @@ ERROR 42S22: Unknown column 'b' in 'field list'
INSERT DELAYED INTO t1 SET b= b();
ERROR 42000: FUNCTION test.b does not exist
DROP TABLE t1;
-End of 5.0 tests
-DROP TABLE IF EXISTS t1,t2;
+#
+# End of 5.0 tests
+#
+#
+# Bug#27358 INSERT DELAYED does not honour SQL_MODE of the client
+#
SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO';
CREATE TABLE `t1` (
`id` int(11) PRIMARY KEY auto_increment,
@@ -288,12 +284,15 @@ ERROR 22007: Incorrect date value: '0000-00-00' for column `test`.`t2`.`f1` at r
INSERT DELAYED INTO t2 VALUES (0,'2007-00-00');
ERROR 22007: Incorrect date value: '2007-00-00' for column `test`.`t2`.`f1` at row 1
DROP TABLE t1,t2;
+#
+# Bug#40536: SELECT is blocked by INSERT DELAYED waiting on upgrading lock,
+# even with low_priority_updates
+#
set @old_delayed_updates = @@global.low_priority_updates;
set global low_priority_updates = 1;
select @@global.low_priority_updates;
@@global.low_priority_updates
1
-drop table if exists t1;
create table t1 (a int, b int);
insert into t1 values (1,1);
lock table t1 read;
@@ -322,7 +321,6 @@ set global low_priority_updates = @old_delayed_updates;
#
# Bug #47682 strange behaviour of INSERT DELAYED
#
-DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (f1 integer);
CREATE TABLE t2 (f1 integer);
FLUSH TABLES WITH READ LOCK;
@@ -331,12 +329,12 @@ INSERT DELAYED INTO t2 VALUES (1);
Got one of the listed errors
UNLOCK TABLES;
DROP TABLE t1, t2;
-End of 5.1 tests
+#
+# End of 5.1 tests
+#
#
# Bug #47274 assert in open_table on CREATE TABLE <already existing>
#
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t2;
CREATE TABLE t1 ( f1 INTEGER AUTO_INCREMENT, PRIMARY KEY (f1));
# The following CREATE TABLEs before gave an assert.
INSERT DELAYED t1 VALUES (4);
@@ -359,7 +357,6 @@ DROP TABLE t1;
#
# This test is not supposed to work under --ps-protocol since
# INSERT DELAYED doesn't work under LOCK TABLES with this protocol.
-DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
CREATE TABLE t3 (a INT);
@@ -450,7 +447,6 @@ DROP TABLE t1, t2, t3;
#
connect con1,localhost,root,,;
connection default;
-drop table if exists t1, t2, tm;
create table t1(a int);
create table t2(a int);
create table tm(a int) engine=merge union=(t1, t2);
@@ -519,3 +515,6 @@ CREATE TABLE t1 (c0 INT,UNIQUE (c0) USING HASH) ENGINE=MYISAM;
INSERT DELAYED INTO t1 VALUES (0);
INSERT DELAYED INTO t1 VALUES (0);
DROP TABLE t1;
+#
+# End of 10.4 tests
+#
diff --git a/mysql-test/main/delayed.test b/mysql-test/main/delayed.test
index aa63c47b260..66e4e4f73a7 100644
--- a/mysql-test/main/delayed.test
+++ b/mysql-test/main/delayed.test
@@ -4,26 +4,12 @@
--source include/not_valgrind.inc
# Avoid CrashReporter popup on Mac
--source include/not_crashrep.inc
-# Binary must be compiled with debug for crash to occur
---source include/have_debug_sync.inc
-#
-# test of DELAYED insert and timestamps
-# (Can't be tested with purify :( )
-#
+--echo #
+--echo # test of DELAYED insert and timestamps
+--echo # (Can't be tested with purify :( )
+--echo #
-# limit the test to engines which support INSERT DELAYED
-disable_query_log;
---require include/true.require
-select @@global.default_storage_engine in
-("memory","myisam","archive","blackhole") and
-@@session.default_storage_engine in
-("memory","myisam","archive","blackhole") as `TRUE`;
-enable_query_log;
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
create table t1 (a char(10), tmsp timestamp);
insert into t1 set a = 1;
insert delayed into t1 set a = 2;
@@ -39,10 +25,10 @@ select * from t1 where tmsp=0;
select * from t1 where tmsp=19711006010203;
drop table t1;
-#
-# Test bug when inserting NULL into an auto_increment field with
-# INSERT DELAYED
-#
+--echo #
+--echo # Test bug when inserting NULL into an auto_increment field with
+--echo # INSERT DELAYED
+--echo #
create table t1 (a int not null auto_increment primary key, b char(10));
insert delayed into t1 values (1,"b");
@@ -56,20 +42,22 @@ show status like 'not_flushed_delayed_rows';
select * from t1;
drop table t1;
-# End of 4.1 tests
+--echo #
+--echo # End of 4.1 tests
+--echo #
-#
-# Bug #12226: Crash when a delayed insert fails due to a duplicate key
-#
+--echo #
+--echo # Bug #12226: Crash when a delayed insert fails due to a duplicate key
+--echo #
create table t1 (a int not null primary key);
insert into t1 values (1);
insert delayed into t1 values (1);
select * from t1;
drop table t1;
-#
-# Bug #20195: INSERT DELAYED with auto_increment is assigned wrong values
-#
+--echo #
+--echo # Bug #20195: INSERT DELAYED with auto_increment is assigned wrong values
+--echo #
CREATE TABLE t1 ( a int(10) NOT NULL auto_increment, PRIMARY KEY (a));
# Make one delayed insert to start the separate thread
@@ -115,21 +103,10 @@ select * from t1 order by a;
DROP TABLE t1;
-#
-# Bug#20627 - INSERT DELAYED does not honour auto_increment_* variables
-#
-SET @bug20627_old_auto_increment_offset=
- @@auto_increment_offset;
-SET @bug20627_old_auto_increment_increment=
- @@auto_increment_increment;
-SET @bug20627_old_session_auto_increment_offset=
- @@session.auto_increment_offset;
-SET @bug20627_old_session_auto_increment_increment=
- @@session.auto_increment_increment;
-SET @@auto_increment_offset= 2;
-SET @@auto_increment_increment= 3;
-SET @@session.auto_increment_offset= 4;
-SET @@session.auto_increment_increment= 5;
+--echo #
+--echo # Bug#20627 - INSERT DELAYED does not honour auto_increment_* variables
+--echo #
+SET @@auto_increment_offset= 4, @@auto_increment_increment= 5;
#
# Normal insert as reference.
CREATE TABLE t1 (
@@ -153,31 +130,12 @@ FLUSH TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
#
-# Cleanup
-SET @@auto_increment_offset=
- @bug20627_old_auto_increment_offset;
-SET @@auto_increment_increment=
- @bug20627_old_auto_increment_increment;
-SET @@session.auto_increment_offset=
- @bug20627_old_session_auto_increment_offset;
-SET @@session.auto_increment_increment=
- @bug20627_old_session_auto_increment_increment;
+SET @@auto_increment_offset=default, @@auto_increment_increment=default;
-#
-# Bug#20830 - INSERT DELAYED does not honour SET INSERT_ID
-#
-SET @bug20830_old_auto_increment_offset=
- @@auto_increment_offset;
-SET @bug20830_old_auto_increment_increment=
- @@auto_increment_increment;
-SET @bug20830_old_session_auto_increment_offset=
- @@session.auto_increment_offset;
-SET @bug20830_old_session_auto_increment_increment=
- @@session.auto_increment_increment;
-SET @@auto_increment_offset= 2;
-SET @@auto_increment_increment= 3;
-SET @@session.auto_increment_offset= 4;
-SET @@session.auto_increment_increment= 5;
+--echo #
+--echo # Bug#20830 - INSERT DELAYED does not honour SET INSERT_ID
+--echo #
+SET @@auto_increment_offset= 4, @@auto_increment_increment= 5;
#
# Normal insert as reference.
CREATE TABLE t1 (
@@ -241,27 +199,20 @@ SELECT SUM(c1) FROM t1;
DROP TABLE t1;
#
# Cleanup
-SET @@auto_increment_offset=
- @bug20830_old_auto_increment_offset;
-SET @@auto_increment_increment=
- @bug20830_old_auto_increment_increment;
-SET @@session.auto_increment_offset=
- @bug20830_old_session_auto_increment_offset;
-SET @@session.auto_increment_increment=
- @bug20830_old_session_auto_increment_increment;
+SET @@auto_increment_offset=default, @@auto_increment_increment=default;
-#
-# BUG#26238 - inserted delayed always inserts 0 for BIT columns
-#
+--echo #
+--echo # BUG#26238 - inserted delayed always inserts 0 for BIT columns
+--echo #
CREATE TABLE t1(a BIT);
INSERT DELAYED INTO t1 VALUES(1);
FLUSH TABLE t1;
SELECT HEX(a) FROM t1;
DROP TABLE t1;
-#
-# Bug #32676: insert delayed crash with wrong column and function specified
-#
+--echo #
+--echo # Bug #32676: insert delayed crash with wrong column and function specified
+--echo #
CREATE TABLE t1 (a INT);
--error ER_SP_DOES_NOT_EXIST
INSERT DELAYED INTO t1 SET a= b();
@@ -271,14 +222,13 @@ INSERT DELAYED INTO t1 SET b= 1;
INSERT DELAYED INTO t1 SET b= b();
DROP TABLE t1;
---echo End of 5.0 tests
+--echo #
+--echo # End of 5.0 tests
+--echo #
-#
-# Bug#27358 INSERT DELAYED does not honour SQL_MODE of the client
-#
---disable_warnings
-DROP TABLE IF EXISTS t1,t2;
---enable_warnings
+--echo #
+--echo # Bug#27358 INSERT DELAYED does not honour SQL_MODE of the client
+--echo #
SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO';
CREATE TABLE `t1` (
`id` int(11) PRIMARY KEY auto_increment,
@@ -305,19 +255,16 @@ INSERT DELAYED INTO t2 VALUES (0,'0000-00-00');
INSERT DELAYED INTO t2 VALUES (0,'2007-00-00');
DROP TABLE t1,t2;
-#
-# Bug#40536: SELECT is blocked by INSERT DELAYED waiting on upgrading lock,
-# even with low_priority_updates
-#
+--echo #
+--echo # Bug#40536: SELECT is blocked by INSERT DELAYED waiting on upgrading lock,
+--echo # even with low_priority_updates
+--echo #
--disable_service_connection
set @old_delayed_updates = @@global.low_priority_updates;
set global low_priority_updates = 1;
select @@global.low_priority_updates;
---disable_warnings
-drop table if exists t1;
---enable_warnings
create table t1 (a int, b int);
insert into t1 values (1,1);
lock table t1 read;
@@ -351,10 +298,6 @@ set global low_priority_updates = @old_delayed_updates;
--echo # Bug #47682 strange behaviour of INSERT DELAYED
--echo #
---disable_warnings
-DROP TABLE IF EXISTS t1, t2;
---enable_warnings
-
CREATE TABLE t1 (f1 integer);
CREATE TABLE t2 (f1 integer);
@@ -370,19 +313,14 @@ UNLOCK TABLES;
DROP TABLE t1, t2;
---echo End of 5.1 tests
-
-
+--echo #
+--echo # End of 5.1 tests
+--echo #
--echo #
--echo # Bug #47274 assert in open_table on CREATE TABLE <already existing>
--echo #
---disable_warnings
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t2;
---enable_warnings
-
CREATE TABLE t1 ( f1 INTEGER AUTO_INCREMENT, PRIMARY KEY (f1));
--echo # The following CREATE TABLEs before gave an assert.
@@ -416,10 +354,6 @@ DROP TABLE t1;
--echo # INSERT DELAYED doesn't work under LOCK TABLES with this protocol.
--disable_ps_protocol
---disable_warnings
-DROP TABLE IF EXISTS t1, t2;
---enable_warnings
-
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
CREATE TABLE t3 (a INT);
@@ -570,9 +504,6 @@ DROP TABLE t1, t2, t3;
--echo #
connect (con1,localhost,root,,);
connection default;
---disable_warnings
-drop table if exists t1, t2, tm;
---enable_warnings
create table t1(a int);
create table t2(a int);
create table tm(a int) engine=merge union=(t1, t2);
@@ -656,3 +587,7 @@ INSERT DELAYED INTO t1 VALUES (0);
INSERT DELAYED INTO t1 VALUES (0);
DROP TABLE t1;
+--echo #
+--echo # End of 10.4 tests
+--echo #
+