-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
358 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--character-set-server=utf32,latin1 --collation-server=utf32_general_ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
call mtr.add_suppression("'utf32' can not be used as client character set"); | ||
# | ||
# MDEV-23269 SIGSEGV in ft_boolean_check_syntax_string on setting ft_boolean_syntax | ||
# | ||
SET GLOBAL ft_boolean_syntax='+ -><()~*:""&|'; | ||
SET GLOBAL ft_boolean_syntax=DEFAULT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--source include/have_utf32.inc | ||
call mtr.add_suppression("'utf32' can not be used as client character set"); | ||
|
||
--echo # | ||
--echo # MDEV-23269 SIGSEGV in ft_boolean_check_syntax_string on setting ft_boolean_syntax | ||
--echo # | ||
|
||
SET GLOBAL ft_boolean_syntax='+ -><()~*:""&|'; | ||
SET GLOBAL ft_boolean_syntax=DEFAULT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--init_connect="set @a='something unique to have MTR start a dedicated mariadbd for this test and shutdown it after the test'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# | ||
# MDEV-25925 Warning: Memory not freed: 32 on INSERT DELAYED | ||
# | ||
SET sql_mode='TRADITIONAL'; | ||
CREATE TABLE t1 (c BLOB) ENGINE=MyISAM; | ||
INSERT DELAYED INTO t1 VALUES (''||''); | ||
ERROR 22007: Truncated incorrect DOUBLE value: '' | ||
DROP TABLE t1; | ||
SET sql_mode=DEFAULT; | ||
# | ||
# MDEV-24467 Memory not freed after failed INSERT DELAYED | ||
# | ||
CREATE TABLE t1 (a VARCHAR(1)) ENGINE=MyISAM; | ||
ALTER TABLE t1 ADD b BLOB DEFAULT 'x'; | ||
INSERT DELAYED INTO t1 (a) VALUES ('foo'); | ||
ERROR 22001: Data too long for column 'a' at row 1 | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--echo # | ||
--echo # MDEV-25925 Warning: Memory not freed: 32 on INSERT DELAYED | ||
--echo # | ||
|
||
SET sql_mode='TRADITIONAL'; | ||
CREATE TABLE t1 (c BLOB) ENGINE=MyISAM; | ||
--error ER_TRUNCATED_WRONG_VALUE | ||
INSERT DELAYED INTO t1 VALUES (''||''); | ||
DROP TABLE t1; | ||
SET sql_mode=DEFAULT; | ||
|
||
|
||
--echo # | ||
--echo # MDEV-24467 Memory not freed after failed INSERT DELAYED | ||
--echo # | ||
|
||
CREATE TABLE t1 (a VARCHAR(1)) ENGINE=MyISAM; | ||
ALTER TABLE t1 ADD b BLOB DEFAULT 'x'; | ||
--error ER_DATA_TOO_LONG | ||
INSERT DELAYED INTO t1 (a) VALUES ('foo'); | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
CREATE TABLE t1 ( | ||
pk INT, | ||
f1 VARCHAR(10) NOT NULL, | ||
f2 VARCHAR(10) NULL, | ||
f3 INT UNSIGNED NULL, | ||
KEY (f1), | ||
PRIMARY KEY (pk) | ||
) ENGINE=InnoDB; | ||
CREATE OR REPLACE ALGORITHM=MERGE VIEW v4 AS SELECT * FROM t1; | ||
INSERT INTO t1 VALUES (1,'k','g',6),(2,'y','r',0),(3,'t','q',1),(4,'a','r',NULL),(5,'z','t',NULL); | ||
CREATE TABLE t2 (f VARCHAR(10) NULL) ENGINE=InnoDB; | ||
INSERT INTO t2 VALUES (NULL),('g'),('e'),('g'); | ||
CREATE TABLE t3 ( | ||
f1 VARCHAR(10) NOT NULL, | ||
f2 VARCHAR(10) NULL, | ||
f3 INT UNSIGNED NULL | ||
) ENGINE=InnoDB; | ||
INSERT INTO t3 VALUES ('k','n',9),('y','b',8),('m','w',6); | ||
CREATE TABLE t4 (f INT NULL) ENGINE=InnoDB; | ||
INSERT INTO t4 VALUES (8),(9); | ||
UPDATE t1 SET t1.pk = -109 WHERE t1.f1 IN ( SELECT 'a' FROM t4 WHERE f >= 1 ); | ||
SET DEBUG_SYNC='now SIGNAL con1_dml'; | ||
connect con1,localhost,root,,test; | ||
SET DEBUG_SYNC='now WAIT_FOR con1_dml'; | ||
begin; | ||
SELECT * FROM t1 for update; | ||
pk f1 f2 f3 | ||
-109 a r NULL | ||
1 k g 6 | ||
2 y r 0 | ||
3 t q 1 | ||
5 z t NULL | ||
SET DEBUG_SYNC='now SIGNAL default_dml'; | ||
connection default; | ||
SET DEBUG_SYNC='now WAIT_FOR default_dml'; | ||
UPDATE t3 AS alias1 LEFT JOIN t3 AS alias2 ON ( alias1.f1 <> alias1.f2 ) SET alias1.f3 = 59 WHERE ( EXISTS ( SELECT t1.f3 FROM t1 WHERE t1.f1 = alias1.f1 ) ) OR alias2.f1 = 'h'; | ||
connect con2,localhost,root,,test; | ||
set debug_sync='now WAIT_FOR default_dml'; | ||
SET DEBUG_SYNC='now SIGNAL con1_dml2'; | ||
disconnect con2; | ||
connection con1; | ||
SET DEBUG_SYNC='now WAIT_FOR con1_dml2'; | ||
UPDATE v4, t1 SET t1.pk = 76 WHERE t1.f2 IN ( SELECT t2.f FROM t2 INNER JOIN t3 ); | ||
connection default; | ||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction | ||
connection con1; | ||
COMMIT; | ||
disconnect con1; | ||
connection default; | ||
DROP VIEW v4; | ||
DROP TABLE t1, t2, t3, t4; | ||
set debug_sync= reset; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--loose-innodb_lock_waits |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--source include/have_innodb.inc | ||
--source include/count_sessions.inc | ||
--source include/have_debug_sync.inc | ||
|
||
CREATE TABLE t1 ( | ||
pk INT, | ||
f1 VARCHAR(10) NOT NULL, | ||
f2 VARCHAR(10) NULL, | ||
f3 INT UNSIGNED NULL, | ||
KEY (f1), | ||
PRIMARY KEY (pk) | ||
) ENGINE=InnoDB; | ||
|
||
CREATE OR REPLACE ALGORITHM=MERGE VIEW v4 AS SELECT * FROM t1; | ||
INSERT INTO t1 VALUES (1,'k','g',6),(2,'y','r',0),(3,'t','q',1),(4,'a','r',NULL),(5,'z','t',NULL); | ||
|
||
CREATE TABLE t2 (f VARCHAR(10) NULL) ENGINE=InnoDB; | ||
INSERT INTO t2 VALUES (NULL),('g'),('e'),('g'); | ||
|
||
CREATE TABLE t3 ( | ||
f1 VARCHAR(10) NOT NULL, | ||
f2 VARCHAR(10) NULL, | ||
f3 INT UNSIGNED NULL | ||
) ENGINE=InnoDB; | ||
|
||
INSERT INTO t3 VALUES ('k','n',9),('y','b',8),('m','w',6); | ||
|
||
CREATE TABLE t4 (f INT NULL) ENGINE=InnoDB; | ||
INSERT INTO t4 VALUES (8),(9); | ||
UPDATE t1 SET t1.pk = -109 WHERE t1.f1 IN ( SELECT 'a' FROM t4 WHERE f >= 1 ); | ||
SET DEBUG_SYNC='now SIGNAL con1_dml'; | ||
|
||
--connect (con1,localhost,root,,test) | ||
SET DEBUG_SYNC='now WAIT_FOR con1_dml'; | ||
begin; | ||
SELECT * FROM t1 for update; # Holds x lock of all records in the table t1 | ||
SET DEBUG_SYNC='now SIGNAL default_dml'; | ||
|
||
--connection default | ||
SET DEBUG_SYNC='now WAIT_FOR default_dml'; | ||
--send UPDATE t3 AS alias1 LEFT JOIN t3 AS alias2 ON ( alias1.f1 <> alias1.f2 ) SET alias1.f3 = 59 WHERE ( EXISTS ( SELECT t1.f3 FROM t1 WHERE t1.f1 = alias1.f1 ) ) OR alias2.f1 = 'h' | ||
# It holds the lock of all record in t3 and tries to acquire record lock for the table t1. | ||
|
||
--connect (con2,localhost,root,,test) | ||
set debug_sync='now WAIT_FOR default_dml'; | ||
let $wait_condition= | ||
select count(*) > 0 from information_schema.innodb_lock_waits; | ||
--source include/wait_condition.inc | ||
SET DEBUG_SYNC='now SIGNAL con1_dml2'; | ||
disconnect con2; | ||
|
||
# Cleanup | ||
--connection con1 | ||
SET DEBUG_SYNC='now WAIT_FOR con1_dml2'; | ||
UPDATE v4, t1 SET t1.pk = 76 WHERE t1.f2 IN ( SELECT t2.f FROM t2 INNER JOIN t3 ); | ||
# It holds the record lock on table t1 and tries to acquire record lock on t3. | ||
# leads to deadlock (con1 trx is waiting for default trx and vice versa) | ||
|
||
--connection default | ||
--error ER_LOCK_DEADLOCK | ||
--reap | ||
|
||
connection con1; | ||
COMMIT; | ||
disconnect con1; | ||
|
||
--connection default | ||
DROP VIEW v4; | ||
DROP TABLE t1, t2, t3, t4; | ||
set debug_sync= reset; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.