From b76881a23cff7aeef1126560410613d9d7bbbb7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 29 Jan 2018 16:39:54 +0200 Subject: Do not SET DEBUG_DBUG=-d,... in tests To disable debug instrumentation, save and restore the original value of the variable DEBUG_DBUG. Assigning -d,... will enable the output of a lot of unrelated DBUG messages to the server error log. --- mysql-test/suite/innodb/r/innodb_bug11754376.result | 1 - mysql-test/suite/innodb/r/innodb_bug56947.result | 1 - mysql-test/suite/innodb/t/innodb_bug11754376.test | 2 -- mysql-test/suite/innodb/t/innodb_bug14147491.test | 3 --- mysql-test/suite/innodb/t/innodb_bug56947.test | 1 - mysql-test/suite/innodb_fts/r/innobase_drop_fts_index_table.result | 1 - mysql-test/suite/innodb_fts/r/innodb_fts_misc_debug.result | 3 ++- mysql-test/suite/innodb_fts/r/innodb_fts_result_cache_limit.result | 1 - mysql-test/suite/innodb_fts/t/innobase_drop_fts_index_table.test | 2 -- mysql-test/suite/innodb_fts/t/innodb_fts_misc_debug.test | 3 ++- mysql-test/suite/innodb_fts/t/innodb_fts_result_cache_limit.test | 2 -- 11 files changed, 4 insertions(+), 16 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/innodb/r/innodb_bug11754376.result b/mysql-test/suite/innodb/r/innodb_bug11754376.result index 034e4f07403..b9f2a169a73 100644 --- a/mysql-test/suite/innodb/r/innodb_bug11754376.result +++ b/mysql-test/suite/innodb/r/innodb_bug11754376.result @@ -1,4 +1,3 @@ CREATE TABLE bug11754376 (c INT) ENGINE=INNODB; SET SESSION DEBUG_DBUG='+d,test_normalize_table_name_low'; DROP TABLE bug11754376; -SET SESSION DEBUG_DBUG='-d,test_normalize_table_name_low'; diff --git a/mysql-test/suite/innodb/r/innodb_bug56947.result b/mysql-test/suite/innodb/r/innodb_bug56947.result index 878450144a2..4248013b088 100644 --- a/mysql-test/suite/innodb/r/innodb_bug56947.result +++ b/mysql-test/suite/innodb/r/innodb_bug56947.result @@ -3,7 +3,6 @@ create table bug56947(a int not null) engine = innodb; SET DEBUG_DBUG='+d,ib_rebuild_cannot_rename'; alter table bug56947 add unique index (a); ERROR HY000: Got error 11 "xxx" from storage engine InnoDB -SET DEBUG_DBUG='-d,ib_rebuild_cannot_rename'; check table bug56947; Table Op Msg_type Msg_text test.bug56947 check status OK diff --git a/mysql-test/suite/innodb/t/innodb_bug11754376.test b/mysql-test/suite/innodb/t/innodb_bug11754376.test index b740b7e08fe..a7f35c1a960 100644 --- a/mysql-test/suite/innodb/t/innodb_bug11754376.test +++ b/mysql-test/suite/innodb/t/innodb_bug11754376.test @@ -12,5 +12,3 @@ CREATE TABLE bug11754376 (c INT) ENGINE=INNODB; SET SESSION DEBUG_DBUG='+d,test_normalize_table_name_low'; DROP TABLE bug11754376; - -SET SESSION DEBUG_DBUG='-d,test_normalize_table_name_low'; diff --git a/mysql-test/suite/innodb/t/innodb_bug14147491.test b/mysql-test/suite/innodb/t/innodb_bug14147491.test index 6f0bfca8e1d..2efd3c5e56b 100644 --- a/mysql-test/suite/innodb/t/innodb_bug14147491.test +++ b/mysql-test/suite/innodb/t/innodb_bug14147491.test @@ -107,8 +107,5 @@ SLEEP 1; --enable_reconnect --source include/wait_until_connected_again.inc -# Note SET DEBUG = '-d,innodb_page_corruption_retries' is not required -# because the session information is lost after server restart - --echo # Cleanup DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb_bug56947.test b/mysql-test/suite/innodb/t/innodb_bug56947.test index 7883cafe291..84c5e70e1b5 100644 --- a/mysql-test/suite/innodb/t/innodb_bug56947.test +++ b/mysql-test/suite/innodb/t/innodb_bug56947.test @@ -11,7 +11,6 @@ SET DEBUG_DBUG='+d,ib_rebuild_cannot_rename'; --replace_regex /"[^"]*"/"xxx"/ --error ER_GET_ERRNO alter table bug56947 add unique index (a); -SET DEBUG_DBUG='-d,ib_rebuild_cannot_rename'; check table bug56947; drop table bug56947; diff --git a/mysql-test/suite/innodb_fts/r/innobase_drop_fts_index_table.result b/mysql-test/suite/innodb_fts/r/innobase_drop_fts_index_table.result index 8c0658cbf0f..e84971a43d9 100644 --- a/mysql-test/suite/innodb_fts/r/innobase_drop_fts_index_table.result +++ b/mysql-test/suite/innodb_fts/r/innobase_drop_fts_index_table.result @@ -2,5 +2,4 @@ CREATE TABLE t (a INT, b TEXT) engine=innodb; SET debug_dbug='+d,alter_table_rollback_new_index'; ALTER TABLE t ADD FULLTEXT INDEX (b(64)); ERROR HY000: Unknown error -SET debug_dbug='-d,alter_table_rollback_new_index'; DROP TABLE t; diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_misc_debug.result b/mysql-test/suite/innodb_fts/r/innodb_fts_misc_debug.result index b09fe632116..7115a761ea4 100644 --- a/mysql-test/suite/innodb_fts/r/innodb_fts_misc_debug.result +++ b/mysql-test/suite/innodb_fts/r/innodb_fts_misc_debug.result @@ -88,9 +88,10 @@ title VARCHAR(200), body TEXT, FULLTEXT (title,body) ) ENGINE=InnoDB; +SET @saved_debug_dbug = @@SESSION.debug_dbug; SET SESSION debug_dbug="+d,ib_dict_create_index_tree_fail"; CREATE FULLTEXT INDEX idx ON articles(body); ERROR HY000: Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space -SET SESSION debug_dbug="-d,ib_dict_create_index_tree_fail"; +SET SESSION debug_dbug=@saved_debug_dbug; ALTER TABLE articles STATS_PERSISTENT=DEFAULT; DROP TABLE articles; diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_result_cache_limit.result b/mysql-test/suite/innodb_fts/r/innodb_fts_result_cache_limit.result index b4fe5154cc3..3db84161e6a 100644 --- a/mysql-test/suite/innodb_fts/r/innodb_fts_result_cache_limit.result +++ b/mysql-test/suite/innodb_fts/r/innodb_fts_result_cache_limit.result @@ -26,6 +26,5 @@ SELECT COUNT(*) FROM t1 WHERE MATCH (a,b) AGAINST ('"mysql database"' IN BOOLEAN ERROR HY000: Table handler out of memory SELECT COUNT(*) FROM t1 WHERE MATCH (a,b) AGAINST ('"mysql database" @ 5' IN BOOLEAN MODE); ERROR HY000: Table handler out of memory -SET SESSION debug_dbug="-d,fts_instrument_result_cache_limit"; DROP TABLE t1; SET GLOBAL innodb_ft_result_cache_limit=default; diff --git a/mysql-test/suite/innodb_fts/t/innobase_drop_fts_index_table.test b/mysql-test/suite/innodb_fts/t/innobase_drop_fts_index_table.test index 9d60160c14e..09383709f74 100644 --- a/mysql-test/suite/innodb_fts/t/innobase_drop_fts_index_table.test +++ b/mysql-test/suite/innodb_fts/t/innobase_drop_fts_index_table.test @@ -14,6 +14,4 @@ SET debug_dbug='+d,alter_table_rollback_new_index'; -- error ER_UNKNOWN_ERROR ALTER TABLE t ADD FULLTEXT INDEX (b(64)); -SET debug_dbug='-d,alter_table_rollback_new_index'; - DROP TABLE t; diff --git a/mysql-test/suite/innodb_fts/t/innodb_fts_misc_debug.test b/mysql-test/suite/innodb_fts/t/innodb_fts_misc_debug.test index db1d226990f..8be5ccb5c32 100644 --- a/mysql-test/suite/innodb_fts/t/innodb_fts_misc_debug.test +++ b/mysql-test/suite/innodb_fts/t/innodb_fts_misc_debug.test @@ -197,10 +197,11 @@ CREATE TABLE articles ( # Abort the operation in dict_create_index_step by setting # return status of dict_create_index_tree_step() to DB_OUT_OF_MEMORY # The newly create dict_index_t should be removed from fts cache +SET @saved_debug_dbug = @@SESSION.debug_dbug; SET SESSION debug_dbug="+d,ib_dict_create_index_tree_fail"; --error ER_OUT_OF_RESOURCES CREATE FULLTEXT INDEX idx ON articles(body); -SET SESSION debug_dbug="-d,ib_dict_create_index_tree_fail"; +SET SESSION debug_dbug=@saved_debug_dbug; # This simply go through ha_innobase::commit_inplace_alter_table # and do a fts_check_cached_index() diff --git a/mysql-test/suite/innodb_fts/t/innodb_fts_result_cache_limit.test b/mysql-test/suite/innodb_fts/t/innodb_fts_result_cache_limit.test index dc55712b47c..21e4b543647 100644 --- a/mysql-test/suite/innodb_fts/t/innodb_fts_result_cache_limit.test +++ b/mysql-test/suite/innodb_fts/t/innodb_fts_result_cache_limit.test @@ -44,8 +44,6 @@ SELECT COUNT(*) FROM t1 WHERE MATCH (a,b) AGAINST ('"mysql database"' IN BOOLEAN --error 128 SELECT COUNT(*) FROM t1 WHERE MATCH (a,b) AGAINST ('"mysql database" @ 5' IN BOOLEAN MODE); -SET SESSION debug_dbug="-d,fts_instrument_result_cache_limit"; - DROP TABLE t1; SET GLOBAL innodb_ft_result_cache_limit=default; -- cgit v1.2.1 From dae4fb0acb373e653f826f0ec7bdaf2485ef0b93 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 30 Jan 2018 11:07:35 +0400 Subject: MDEV-15118 ExtractValue(xml,something_complex) does not work Item_xml_str_func::fix_fields() used a local "String tmp" as a buffer for args[1]->val_str(). "tmp" was freed at the end of fix_fields(), while Items created during my_xpath_parse() still pointed to its fragments. Adding a new member Item_xml_str_func::m_xpath_query and store the result of args[1]->val_str() into it. --- mysql-test/r/xml.result | 12 ++++++++++++ mysql-test/t/xml.test | 9 +++++++++ 2 files changed, 21 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result index 24b95f0e204..b12243bdfb9 100644 --- a/mysql-test/r/xml.result +++ b/mysql-test/r/xml.result @@ -1268,5 +1268,17 @@ c1 c2 2 b2 DROP TABLE t1; # +# MDEV-15118 ExtractValue(xml,something_complex) does not work +# +CREATE TABLE t1 (a TEXT); +INSERT INTO t1 VALUES (CONCAT('aaa')); +SELECT ExtractValue(a, '/a') AS a FROM t1; +a +aaa +SELECT ExtractValue(a, FROM_BASE64(TO_BASE64('/a'))) AS a FROM t1; +a +aaa +DROP TABLE t1; +# # End of 10.0 tests # diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test index 371fcb72b0d..e9e7864c418 100644 --- a/mysql-test/t/xml.test +++ b/mysql-test/t/xml.test @@ -748,6 +748,15 @@ SELECT *,IF(@i:=c1,ExtractValue('b1b2','//b[$@i]'),0) AS xp SELECT * FROM t1 WHERE c2=IF(@i:=c1,ExtractValue('b1b2','//b[$@i]'),0); DROP TABLE t1; +--echo # +--echo # MDEV-15118 ExtractValue(xml,something_complex) does not work +--echo # + +CREATE TABLE t1 (a TEXT); +INSERT INTO t1 VALUES (CONCAT('aaa')); +SELECT ExtractValue(a, '/a') AS a FROM t1; +SELECT ExtractValue(a, FROM_BASE64(TO_BASE64('/a'))) AS a FROM t1; +DROP TABLE t1; --echo # --echo # End of 10.0 tests -- cgit v1.2.1 From c4a908cb56d3ed81879573631d1f180d4962ed4e Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 30 Jan 2018 11:35:27 +0400 Subject: MDEV-13790 UNHEX() of a somewhat complicated CONCAT() returns NULL --- mysql-test/r/func_concat.result | 6 ++++++ mysql-test/t/func_concat.test | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_concat.result b/mysql-test/r/func_concat.result index b87ee7bfc52..9ab6f74653e 100644 --- a/mysql-test/r/func_concat.result +++ b/mysql-test/r/func_concat.result @@ -262,3 +262,9 @@ c2 abcdefghi-abcdefghi DROP TABLE t1; SET optimizer_switch=@save_optimizer_switch; +# +# MDEV-13790 UNHEX() of a somewhat complicated CONCAT() returns NULL +# +SELECT UNHEX(CONCAT('414C2', HEX(8 + ROUND(RAND()*7)), SUBSTR(SHA(UUID()),6,33),HEX(2+ROUND(RAND()*8)))) IS NULL AS c1; +c1 +0 diff --git a/mysql-test/t/func_concat.test b/mysql-test/t/func_concat.test index be573f494a2..69dd2c4063e 100644 --- a/mysql-test/t/func_concat.test +++ b/mysql-test/t/func_concat.test @@ -236,3 +236,9 @@ SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT TRIM(t) t2 FROM t1) sub; DROP TABLE t1; SET optimizer_switch=@save_optimizer_switch; + +--echo # +--echo # MDEV-13790 UNHEX() of a somewhat complicated CONCAT() returns NULL +--echo # + +SELECT UNHEX(CONCAT('414C2', HEX(8 + ROUND(RAND()*7)), SUBSTR(SHA(UUID()),6,33),HEX(2+ROUND(RAND()*8)))) IS NULL AS c1; -- cgit v1.2.1 From 6b4a4a85a7f42ba8d47bde2a879066a54b3ca798 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Tue, 30 Jan 2018 11:28:21 +0400 Subject: MDEV-14696 Server crashes in in prep_alter_part_table on 2nd execution of PS. The thd->lex->part_info should be kept intact during PS execution. Or the second execution gets that modified part_info. Let's modify ths->work_part_info instead. --- mysql-test/r/partition.result | 11 +++++++++++ mysql-test/t/partition.test | 13 +++++++++++++ 2 files changed, 24 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index d4b719f3a75..c6669176b3d 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -2634,3 +2634,14 @@ alter table t1 drop partition if exists p5; Warnings: Note 1507 Error in list of partitions to DROP DROP TABLE t1; +CREATE TABLE t1 (a INT) ENGINE=MyISAM PARTITION BY RANGE(a) (PARTITION p1 VALUES LESS THAN (0)); +ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES LESS THAN (1)); +PREPARE stmt FROM 'ALTER TABLE t1 ADD PARTITION IF NOT EXISTS (PARTITION p2 VALUES LESS THAN (2))'; +EXECUTE stmt; +Warnings: +Note 1517 Duplicate partition name p2 +EXECUTE stmt; +Warnings: +Note 1517 Duplicate partition name p2 +DEALLOCATE PREPARE stmt; +DROP TABLE t1; diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 754677e9b37..1c8cd0375d6 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -2884,3 +2884,16 @@ alter table t1 drop partition if exists p5; DROP TABLE t1; +# +# MDEV-14696 Server crashes in in prep_alter_part_table on 2nd execution of PS. +# + +CREATE TABLE t1 (a INT) ENGINE=MyISAM PARTITION BY RANGE(a) (PARTITION p1 VALUES LESS THAN (0)); +ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES LESS THAN (1)); +PREPARE stmt FROM 'ALTER TABLE t1 ADD PARTITION IF NOT EXISTS (PARTITION p2 VALUES LESS THAN (2))'; +EXECUTE stmt; +EXECUTE stmt; + +DEALLOCATE PREPARE stmt; +DROP TABLE t1; + -- cgit v1.2.1 From 96cb428b350ba48ee17ad9968d08f5318e48258c Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Mon, 29 Jan 2018 09:44:17 +0100 Subject: MDEV-14862: Server crashes in Bitmap<64u>::merge / add_key_field Do not unwrap view references to keep table info. (Row-IN subselect does not unwrap items so it does not need fix) --- mysql-test/r/update_innodb.result | 10 ++++++++++ mysql-test/t/update_innodb.test | 13 +++++++++++++ 2 files changed, 23 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/update_innodb.result b/mysql-test/r/update_innodb.result index 88c86c50625..6dae6abebb1 100644 --- a/mysql-test/r/update_innodb.result +++ b/mysql-test/r/update_innodb.result @@ -29,3 +29,13 @@ CREATE ALGORITHM=UNDEFINED VIEW `v1` AS select `t4`.`c1` AS `c1`,`t4`.`c2` AS `c UPDATE t1 a JOIN t2 b ON a.c1 = b.c1 JOIN v1 vw ON b.c2 = vw.c1 JOIN t3 del ON vw.c2 = del.c2 SET a.c2 = ( SELECT max(t.c1) FROM t3 t, v1 i WHERE del.c2 = t.c2 AND vw.c3 = i.c3 AND t.c3 = 4 ) WHERE a.c2 IS NULL OR a.c2 < '2011-05-01'; drop view v1; drop table t1,t2,t3,t4; +# +# MDEV-14862: Server crashes in Bitmap<64u>::merge / add_key_field +# +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +CREATE VIEW v1 AS SELECT * FROM t1; +CREATE TABLE t2 (b INT) ENGINE=InnoDB; +DELETE FROM v1 WHERE a IN ( SELECT a FROM t2 ); +DELETE FROM v1 WHERE (a,a) IN ( SELECT a,a FROM t2 ); +drop view v1; +drop table t1,t2; diff --git a/mysql-test/t/update_innodb.test b/mysql-test/t/update_innodb.test index 67c356c4e2e..059ae8abbb0 100644 --- a/mysql-test/t/update_innodb.test +++ b/mysql-test/t/update_innodb.test @@ -37,3 +37,16 @@ UPDATE t1 a JOIN t2 b ON a.c1 = b.c1 JOIN v1 vw ON b.c2 = vw.c1 JOIN t3 del ON v drop view v1; drop table t1,t2,t3,t4; + +--echo # +--echo # MDEV-14862: Server crashes in Bitmap<64u>::merge / add_key_field +--echo # + +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +CREATE VIEW v1 AS SELECT * FROM t1; +CREATE TABLE t2 (b INT) ENGINE=InnoDB; +DELETE FROM v1 WHERE a IN ( SELECT a FROM t2 ); +DELETE FROM v1 WHERE (a,a) IN ( SELECT a,a FROM t2 ); + +drop view v1; +drop table t1,t2; -- cgit v1.2.1 From cb5374801e594282b41883bf38892d4788668df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 5 Feb 2018 09:23:36 +0200 Subject: MDEV-15202 innodb.log_file_size failed in buildbot Suppress some messages that are emitted rarely (when the FIL_PAGE_FILE_FLUSH_LSN of the first page of ibdata1 does not match the latest redo log checkpoint). --- mysql-test/suite/innodb/t/log_file_size.test | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/innodb/t/log_file_size.test b/mysql-test/suite/innodb/t/log_file_size.test index 6c1003881cf..05ef93aa94e 100644 --- a/mysql-test/suite/innodb/t/log_file_size.test +++ b/mysql-test/suite/innodb/t/log_file_size.test @@ -26,7 +26,8 @@ call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE faile call mtr.add_suppression("InnoDB: Plugin initialization aborted"); call mtr.add_suppression("InnoDB: innodb_read_only prevents crash recovery"); call mtr.add_suppression("InnoDB: Are you sure you are using the right ib_logfiles"); -call mtr.add_suppression("InnoDB: Cannot create log files in read-only mode"); +call mtr.add_suppression("InnoDB: Cannot (create|resize) log files in read-only mode"); +call mtr.add_suppression("InnoDB: Can't initiate database recovery, running in read-only-mode"); call mtr.add_suppression("InnoDB: Only one log file found"); call mtr.add_suppression("InnoDB: Log file .*ib_logfile[01].* size"); call mtr.add_suppression("InnoDB: Unable to open .*ib_logfile0. to check native AIO read support"); -- cgit v1.2.1 From b6455479e588fe1309157e8cc77cca10b90942b6 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Wed, 7 Feb 2018 18:14:45 +0100 Subject: MDEV-15230: column_json breaks cyrillic in 10.1.31 Use unsigned comparison. --- mysql-test/r/dyncol.result | 10 ++++++++++ mysql-test/t/dyncol.test | 9 +++++++++ 2 files changed, 19 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/dyncol.result b/mysql-test/r/dyncol.result index 81446da9e14..fe4ee3f7de2 100644 --- a/mysql-test/r/dyncol.result +++ b/mysql-test/r/dyncol.result @@ -1883,5 +1883,15 @@ SELECT COLUMN_JSON(COLUMN_CREATE('test','First line\nSecond line')) AS json; json {"test":"First line\u000ASecond line"} # +# MDEV-15230: column_json breaks cyrillic in 10.1.31 +# +set names utf8; +create table t1 (b blob); +insert into t1 values (column_create('description',column_create('title','Описание'))); +select column_json(b) from t1; +column_json(b) +{"description":{"title":"Описание"}} +drop table t1; +# # end of 10.0 tests # diff --git a/mysql-test/t/dyncol.test b/mysql-test/t/dyncol.test index 2c93f75cb5a..7807d1a9f9e 100644 --- a/mysql-test/t/dyncol.test +++ b/mysql-test/t/dyncol.test @@ -928,6 +928,15 @@ SELECT COLUMN_JSON(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL)); SELECT COLUMN_JSON(COLUMN_CREATE('test','"\\\t\n\Z')) AS json; SELECT COLUMN_JSON(COLUMN_CREATE('test','First line\nSecond line')) AS json; +--echo # +--echo # MDEV-15230: column_json breaks cyrillic in 10.1.31 +--echo # +set names utf8; +create table t1 (b blob); +insert into t1 values (column_create('description',column_create('title','Описание'))); +select column_json(b) from t1; +drop table t1; + --echo # --echo # end of 10.0 tests --echo # -- cgit v1.2.1 From 5421e3aee7b44c3c400c5dc82b8af00436790ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 8 Feb 2018 12:51:19 +0200 Subject: MDEV-15249 Crash in MVCC read after IMPORT TABLESPACE PageConverter::adjust_cluster_record(): Instead of writing the invalid value DB_ROLL_PTR=0, write a value that indicates a fresh insert, that is, prevents the DB_ROLL_PTR from being dereferenced in any circumstances. It can be argued that IMPORT TABLESPACE should actually update the dict_index_t::trx_id to prevent older transactions from accessing the table, similar to what I did on table rebuild in MySQL 5.6.6 in https://github.com/mysql/mysql-server/commit/03f81a55f221095d397c375afe8a10c8038da339 --- mysql-test/suite/innodb/r/mvcc.result | 26 ++++++++++++++++++ mysql-test/suite/innodb/t/mvcc.test | 52 +++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 mysql-test/suite/innodb/r/mvcc.result create mode 100644 mysql-test/suite/innodb/t/mvcc.test (limited to 'mysql-test') diff --git a/mysql-test/suite/innodb/r/mvcc.result b/mysql-test/suite/innodb/r/mvcc.result new file mode 100644 index 00000000000..6bbabc8d87a --- /dev/null +++ b/mysql-test/suite/innodb/r/mvcc.result @@ -0,0 +1,26 @@ +SET @save_per_table= @@GLOBAL.innodb_file_per_table; +SET GLOBAL innodb_file_per_table= 1; +# +# MDEV-15249 Crash in MVCC read after IMPORT TABLESPACE +# +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES(0); +FLUSH TABLES t1 WITH READ LOCK; +UNLOCK TABLES; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +ALTER TABLE t1 FORCE, ALGORITHM=COPY; +SELECT * FROM t1; +ERROR HY000: Table definition has changed, please retry transaction +COMMIT; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +ALTER TABLE t1 DISCARD TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; +# FIXME: Block this with ER_TABLE_DEF_CHANGED +SELECT * FROM t1; +a +COMMIT; +SELECT * FROM t1; +a +0 +DROP TABLE t1; +SET GLOBAL innodb_file_per_table= @save_per_table; diff --git a/mysql-test/suite/innodb/t/mvcc.test b/mysql-test/suite/innodb/t/mvcc.test new file mode 100644 index 00000000000..bf76a5de798 --- /dev/null +++ b/mysql-test/suite/innodb/t/mvcc.test @@ -0,0 +1,52 @@ +--source include/have_innodb.inc + +SET @save_per_table= @@GLOBAL.innodb_file_per_table; +SET GLOBAL innodb_file_per_table= 1; + +let MYSQLD_DATADIR =`SELECT @@datadir`; + +--echo # +--echo # MDEV-15249 Crash in MVCC read after IMPORT TABLESPACE +--echo # + +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES(0); +FLUSH TABLES t1 WITH READ LOCK; +perl; +do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; +ib_backup_tablespace("test", "t1"); +EOF +UNLOCK TABLES; + +START TRANSACTION WITH CONSISTENT SNAPSHOT; + +connect (con1,localhost,root,,); +ALTER TABLE t1 FORCE, ALGORITHM=COPY; + +connection default; +--error ER_TABLE_DEF_CHANGED +SELECT * FROM t1; +COMMIT; +START TRANSACTION WITH CONSISTENT SNAPSHOT; + +connection con1; + +ALTER TABLE t1 DISCARD TABLESPACE; + +perl; +do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; +ib_restore_tablespace("test", "t1"); +EOF + +ALTER TABLE t1 IMPORT TABLESPACE; +disconnect con1; + +connection default; +--echo # FIXME: Block this with ER_TABLE_DEF_CHANGED +SELECT * FROM t1; +COMMIT; +SELECT * FROM t1; + +DROP TABLE t1; + +SET GLOBAL innodb_file_per_table= @save_per_table; -- cgit v1.2.1 From 9216a4f69f113390cc55bd9c58c9f347ef4321c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 8 Feb 2018 13:26:44 +0200 Subject: Make the test innodb.recovery_shutdown more robust Before killing the server, we have to FLUSH TABLES in order to prevent the corruption of any MyISAM system tables. --- mysql-test/suite/innodb/r/recovery_shutdown.result | 2 +- mysql-test/suite/innodb/t/recovery_shutdown.test | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/innodb/r/recovery_shutdown.result b/mysql-test/suite/innodb/r/recovery_shutdown.result index 861461dd072..47398c1ca23 100644 --- a/mysql-test/suite/innodb/r/recovery_shutdown.result +++ b/mysql-test/suite/innodb/r/recovery_shutdown.result @@ -52,5 +52,5 @@ INSERT INTO t1(a) SELECT NULL FROM t1; INSERT INTO t1(a) SELECT NULL FROM t1; SET GLOBAL innodb_flush_log_at_trx_commit=1; CREATE TABLE u(a SERIAL) ENGINE=INNODB; -# Kill and restart +FLUSH TABLES; DROP TABLE t,u; diff --git a/mysql-test/suite/innodb/t/recovery_shutdown.test b/mysql-test/suite/innodb/t/recovery_shutdown.test index 28b80cd3818..42d98ca34c7 100644 --- a/mysql-test/suite/innodb/t/recovery_shutdown.test +++ b/mysql-test/suite/innodb/t/recovery_shutdown.test @@ -41,7 +41,11 @@ INSERT INTO t1(a) SELECT NULL FROM t1; SET GLOBAL innodb_flush_log_at_trx_commit=1; CREATE TABLE u(a SERIAL) ENGINE=INNODB; ---source include/kill_and_restart_mysqld.inc +FLUSH TABLES; + +--let $shutdown_timeout=0 +--source include/restart_mysqld.inc +--let $shutdown_timeout=60 --source include/restart_mysqld.inc --disable_query_log -- cgit v1.2.1 From b0a92333c00f8facd20c55cf7a8dfaf896b7f24d Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 9 Feb 2018 19:47:00 +0400 Subject: MDEV-15262 Wrong results for SELECT..WHERE non_indexed_datetime_column=indexed_time_column --- mysql-test/r/type_time_6065.result | 44 ++++++++++++++++++++++++++++++++++++++ mysql-test/t/type_time_6065.test | 23 ++++++++++++++++++++ 2 files changed, 67 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/type_time_6065.result b/mysql-test/r/type_time_6065.result index db3efc3bcbb..1f64f9e90e2 100644 --- a/mysql-test/r/type_time_6065.result +++ b/mysql-test/r/type_time_6065.result @@ -2308,3 +2308,47 @@ col_int_nokey 1 DROP TABLE t1,t2,t3; SET TIMESTAMP=0; +# +# MDEV-15262 Wrong results for SELECT..WHERE non_indexed_datetime_column=indexed_time_column +# +SET TIMESTAMP=UNIX_TIMESTAMP('2012-01-31 10:14:35'); +CREATE TABLE t1 (col_time_key TIME, KEY(col_time_key)); +CREATE TABLE t2 (col_datetime_key DATETIME); +INSERT INTO t1 VALUES ('-760:00:00'),('760:00:00'); +INSERT INTO t1 VALUES ('-770:00:00'),('770:00:00'); +INSERT INTO t2 SELECT * FROM t1; +SELECT * FROM t2 STRAIGHT_JOIN t1 IGNORE INDEX(col_time_key) WHERE col_time_key = col_datetime_key; +col_datetime_key col_time_key +2011-12-30 08:00:00 -760:00:00 +2012-03-02 16:00:00 760:00:00 +2011-12-29 22:00:00 -770:00:00 +2012-03-03 02:00:00 770:00:00 +SELECT * FROM t2 STRAIGHT_JOIN t1 FORCE INDEX (col_time_key) WHERE col_time_key = col_datetime_key; +col_datetime_key col_time_key +2011-12-29 22:00:00 -770:00:00 +2011-12-30 08:00:00 -760:00:00 +2012-03-02 16:00:00 760:00:00 +2012-03-03 02:00:00 770:00:00 +INSERT INTO t1 VALUES ('-838:59:59'),('838:59:59'); +INSERT INTO t2 VALUES (DATE_ADD(CURRENT_DATE, INTERVAL '-838:59:59' HOUR_SECOND)); +INSERT INTO t2 VALUES (DATE_ADD(CURRENT_DATE, INTERVAL '838:59:59' HOUR_SECOND)); +INSERT INTO t2 VALUES (DATE_ADD(CURRENT_DATE, INTERVAL '-839:00:00' HOUR_SECOND)); +INSERT INTO t2 VALUES (DATE_ADD(CURRENT_DATE, INTERVAL '839:00:00' HOUR_SECOND)); +SELECT * FROM t2 STRAIGHT_JOIN t1 IGNORE INDEX(col_time_key) WHERE col_time_key = col_datetime_key; +col_datetime_key col_time_key +2011-12-30 08:00:00 -760:00:00 +2012-03-02 16:00:00 760:00:00 +2011-12-29 22:00:00 -770:00:00 +2012-03-03 02:00:00 770:00:00 +2011-12-27 01:00:01 -838:59:59 +2012-03-05 22:59:59 838:59:59 +SELECT * FROM t2 STRAIGHT_JOIN t1 FORCE INDEX (col_time_key) WHERE col_time_key = col_datetime_key; +col_datetime_key col_time_key +2011-12-29 22:00:00 -770:00:00 +2011-12-30 08:00:00 -760:00:00 +2012-03-02 16:00:00 760:00:00 +2012-03-03 02:00:00 770:00:00 +2011-12-27 01:00:01 -838:59:59 +2012-03-05 22:59:59 838:59:59 +DROP TABLE t1, t2; +SET TIMESTAMP=DEFAULT; diff --git a/mysql-test/t/type_time_6065.test b/mysql-test/t/type_time_6065.test index 6e29b849be5..fc91c530760 100644 --- a/mysql-test/t/type_time_6065.test +++ b/mysql-test/t/type_time_6065.test @@ -172,6 +172,29 @@ eval $query; DROP TABLE t1,t2,t3; SET TIMESTAMP=0; # back to current time + +--echo # +--echo # MDEV-15262 Wrong results for SELECT..WHERE non_indexed_datetime_column=indexed_time_column +--echo # + +SET TIMESTAMP=UNIX_TIMESTAMP('2012-01-31 10:14:35'); +CREATE TABLE t1 (col_time_key TIME, KEY(col_time_key)); +CREATE TABLE t2 (col_datetime_key DATETIME); +INSERT INTO t1 VALUES ('-760:00:00'),('760:00:00'); +INSERT INTO t1 VALUES ('-770:00:00'),('770:00:00'); +INSERT INTO t2 SELECT * FROM t1; +SELECT * FROM t2 STRAIGHT_JOIN t1 IGNORE INDEX(col_time_key) WHERE col_time_key = col_datetime_key; +SELECT * FROM t2 STRAIGHT_JOIN t1 FORCE INDEX (col_time_key) WHERE col_time_key = col_datetime_key; +INSERT INTO t1 VALUES ('-838:59:59'),('838:59:59'); +INSERT INTO t2 VALUES (DATE_ADD(CURRENT_DATE, INTERVAL '-838:59:59' HOUR_SECOND)); +INSERT INTO t2 VALUES (DATE_ADD(CURRENT_DATE, INTERVAL '838:59:59' HOUR_SECOND)); +INSERT INTO t2 VALUES (DATE_ADD(CURRENT_DATE, INTERVAL '-839:00:00' HOUR_SECOND)); +INSERT INTO t2 VALUES (DATE_ADD(CURRENT_DATE, INTERVAL '839:00:00' HOUR_SECOND)); +SELECT * FROM t2 STRAIGHT_JOIN t1 IGNORE INDEX(col_time_key) WHERE col_time_key = col_datetime_key; +SELECT * FROM t2 STRAIGHT_JOIN t1 FORCE INDEX (col_time_key) WHERE col_time_key = col_datetime_key; +DROP TABLE t1, t2; +SET TIMESTAMP=DEFAULT; + # # End of 10.0 tests # -- cgit v1.2.1 From c051eaba46f2a9570bba3f3a64708502ff0aa03c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 13 Feb 2018 13:01:14 +0200 Subject: MDEV-14988 innodb_read_only tries to modify files if transactions were recovered in COMMITTED state lock_trx_release_locks(): Relax a debug assertion to allow recovered TRX_STATE_COMMITTED_IN_MEMORY transactions. trx_commit_in_memory(): Add DEBUG_SYNC instrumentation. trx_undo_insert_cleanup(): Skip persistent changes if innodb_read_only is set. This should only happen when a recovered committed transaction would be cleaned up at shutdown. --- .../innodb/r/read_only_recover_committed.result | 43 ++++++++++++++ .../innodb/t/read_only_recover_committed.test | 68 ++++++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 mysql-test/suite/innodb/r/read_only_recover_committed.result create mode 100644 mysql-test/suite/innodb/t/read_only_recover_committed.test (limited to 'mysql-test') diff --git a/mysql-test/suite/innodb/r/read_only_recover_committed.result b/mysql-test/suite/innodb/r/read_only_recover_committed.result new file mode 100644 index 00000000000..593bcae40ee --- /dev/null +++ b/mysql-test/suite/innodb/r/read_only_recover_committed.result @@ -0,0 +1,43 @@ +CREATE TABLE t(a INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t VALUES(1); +BEGIN; +INSERT INTO t VALUES(2); +DELETE FROM t WHERE a=2; +# Normal MariaDB shutdown would roll back the above transaction. +# We want the transaction to remain open, so we will kill the server +# after ensuring that any non-transactional files are clean. +FLUSH TABLES; +# Create another transaction that will be recovered as COMMITTED. +BEGIN; +SET DEBUG_SYNC='after_trx_committed_in_memory SIGNAL committed WAIT_FOR ever'; +COMMIT; +SET DEBUG_SYNC='now WAIT_FOR committed'; +# Ensure that the above incomplete transactions become durable. +SET GLOBAL innodb_flush_log_at_trx_commit=1; +BEGIN; +INSERT INTO t VALUES(-10000); +ROLLBACK; +SELECT * FROM t; +a +1 +SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT * FROM t; +a +1 +UPDATE t SET a=3 WHERE a=1; +ERROR HY000: Table 't' is read only +# Starting with MariaDB 10.2, innodb_read_only implies READ UNCOMMITTED. +# In earlier versions, this would return the last committed version +# (empty table)! +SELECT * FROM t; +a +1 +SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT * FROM t; +a +1 +SELECT * FROM t; +a +1 +DROP TABLE t; +NOT FOUND /Rolled back recovered transaction [^0]/ in mysqld.1.err diff --git a/mysql-test/suite/innodb/t/read_only_recover_committed.test b/mysql-test/suite/innodb/t/read_only_recover_committed.test new file mode 100644 index 00000000000..402cbeba1b9 --- /dev/null +++ b/mysql-test/suite/innodb/t/read_only_recover_committed.test @@ -0,0 +1,68 @@ +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc +# need to restart server +--source include/not_embedded.inc + +--connect(con1, localhost, root) +CREATE TABLE t(a INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t VALUES(1); +BEGIN; +# Generate insert_undo log. +INSERT INTO t VALUES(2); +# Generate update_undo log. +DELETE FROM t WHERE a=2; +--connect(con2, localhost, root) +--echo # Normal MariaDB shutdown would roll back the above transaction. +--echo # We want the transaction to remain open, so we will kill the server +--echo # after ensuring that any non-transactional files are clean. +FLUSH TABLES; +--echo # Create another transaction that will be recovered as COMMITTED. +BEGIN; +# Generate multiple pages of both insert_undo and update_undo, so that +# the state TRX_UNDO_CACHE will not be chosen. +--disable_query_log +let $n= 10000; +while ($n) { +dec $n; +eval INSERT INTO t VALUES(-$n); +eval DELETE FROM t WHERE a=-$n; +} +--enable_query_log +SET DEBUG_SYNC='after_trx_committed_in_memory SIGNAL committed WAIT_FOR ever'; +send COMMIT; + +connection default; +SET DEBUG_SYNC='now WAIT_FOR committed'; +--echo # Ensure that the above incomplete transactions become durable. +SET GLOBAL innodb_flush_log_at_trx_commit=1; +BEGIN; +INSERT INTO t VALUES(-10000); +ROLLBACK; +--let $restart_parameters= --innodb-force-recovery=3 +--let $shutdown_timeout= 0 +--source include/restart_mysqld.inc +--let $shutdown_timeout= 30 +--disconnect con1 +--disconnect con2 +SELECT * FROM t; +SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT * FROM t; +# refused on MySQL 5.6, MariaDB 10.0, 10.1, but not MariaDB 10.2+ +--error ER_OPEN_AS_READONLY +UPDATE t SET a=3 WHERE a=1; +--let $restart_parameters= --innodb-read-only +--source include/restart_mysqld.inc +--echo # Starting with MariaDB 10.2, innodb_read_only implies READ UNCOMMITTED. +--echo # In earlier versions, this would return the last committed version +--echo # (empty table)! +SELECT * FROM t; +SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT * FROM t; +--let $restart_parameters= +--source include/restart_mysqld.inc +SELECT * FROM t; +DROP TABLE t; +let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err; +--let SEARCH_PATTERN= Rolled back recovered transaction [^0] +--source include/search_pattern_in_file.inc -- cgit v1.2.1 From 48c11d407b409a1291c84782518c69ee9138ce72 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 13 Mar 2018 12:42:41 +0400 Subject: MDEV-13202 Assertion `ltime->neg == 0' failed in date_to_datetime --- mysql-test/r/func_time.result | 24 ++++++++++++++++++++++++ mysql-test/t/func_time.test | 16 ++++++++++++++++ 2 files changed, 40 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index ab0576c69a7..7316724a16f 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -2878,5 +2878,29 @@ NULL Warnings: Warning 1441 Datetime function: datetime field overflow # +# MDEV-13202 Assertion `ltime->neg == 0' failed in date_to_datetime +# +CREATE TABLE t1 (i INT, d DATE); +INSERT INTO t1 VALUES (1, '1970-01-01'); +SELECT MAX(NULLIF(i,1)) FROM t1 ORDER BY DATE_SUB(d,INTERVAL 17300000 HOUR); +MAX(NULLIF(i,1)) +NULL +Warnings: +Warning 1441 Datetime function: datetime field overflow +DROP TABLE t1; +CREATE TABLE t1 (i INT, d DATE); +INSERT INTO t1 VALUES (1, '1970-01-01'); +SELECT CONCAT(DATE_SUB(d, INTERVAL 17300000 HOUR)) FROM t1; +CONCAT(DATE_SUB(d, INTERVAL 17300000 HOUR)) +NULL +Warnings: +Warning 1441 Datetime function: datetime field overflow +DROP TABLE t1; +SELECT CONCAT(DATE_SUB(TIMESTAMP'1970-01-01 00:00:00', INTERVAL 17300000 HOUR)); +CONCAT(DATE_SUB(TIMESTAMP'1970-01-01 00:00:00', INTERVAL 17300000 HOUR)) +NULL +Warnings: +Warning 1441 Datetime function: datetime field overflow +# # End of 10.0 tests # diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 1f1f3a29574..1baded9fef7 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -1758,6 +1758,22 @@ SELECT ADDDATE(DATE'0000-01-01', INTERVAL '3652423:0:0:315569433559' DAY_SECOND) SELECT ADDDATE(DATE'0000-01-01', INTERVAL '0:87658175:0:315569433559' DAY_SECOND); SELECT ADDDATE(DATE'0000-01-01', INTERVAL '0:0:5259490559:315569433599' DAY_SECOND); +--echo # +--echo # MDEV-13202 Assertion `ltime->neg == 0' failed in date_to_datetime +--echo # + +CREATE TABLE t1 (i INT, d DATE); +INSERT INTO t1 VALUES (1, '1970-01-01'); +SELECT MAX(NULLIF(i,1)) FROM t1 ORDER BY DATE_SUB(d,INTERVAL 17300000 HOUR); +DROP TABLE t1; + +CREATE TABLE t1 (i INT, d DATE); +INSERT INTO t1 VALUES (1, '1970-01-01'); +SELECT CONCAT(DATE_SUB(d, INTERVAL 17300000 HOUR)) FROM t1; +DROP TABLE t1; + +SELECT CONCAT(DATE_SUB(TIMESTAMP'1970-01-01 00:00:00', INTERVAL 17300000 HOUR)); + --echo # --echo # End of 10.0 tests -- cgit v1.2.1 From e3dd9a95e50ef2019435b01bd9e161d552673a28 Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Fri, 16 Mar 2018 18:57:21 +0530 Subject: MDEV-6736: Valgrind warnings 'Invalid read' in subselect_engine::calc_const_tables with SQ in WHERE and HAVING, ORDER BY, materialization+semijoin During cleanup a pointer to the materialised table that was freed was not set to NULL --- mysql-test/r/having.result | 14 ++++++++++++++ mysql-test/t/having.test | 18 ++++++++++++++++++ 2 files changed, 32 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result index 0b933427303..c509458d830 100644 --- a/mysql-test/r/having.result +++ b/mysql-test/r/having.result @@ -723,4 +723,18 @@ SELECT * FROM t1 JOIN t2 ON c1 = c2 HAVING c2 > 'a' ORDER BY c2 LIMIT 1; c1 c2 x x DROP TABLE t1,t2; +# +# MDEV-6736: Valgrind warnings 'Invalid read' in subselect_engine::calc_const_tables with SQ +# in WHERE and HAVING, ORDER BY, materialization+semijoin +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (3),(8); +CREATE TABLE t2 (b INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (2),(1); +SELECT a FROM t1 +WHERE 9 IN ( SELECT MIN( a ) FROM t1 ) +HAVING a <> ( SELECT COUNT(*) FROM t2 ) +ORDER BY a; +a +DROP TABLE t1,t2; End of 10.0 tests diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test index 1682fe5b874..51cf3fb426d 100644 --- a/mysql-test/t/having.test +++ b/mysql-test/t/having.test @@ -759,4 +759,22 @@ SELECT * FROM t1 JOIN t2 ON c1 = c2 HAVING c2 > 'a' ORDER BY c2 LIMIT 1; DROP TABLE t1,t2; +--echo # +--echo # MDEV-6736: Valgrind warnings 'Invalid read' in subselect_engine::calc_const_tables with SQ +--echo # in WHERE and HAVING, ORDER BY, materialization+semijoin +--echo # + +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (3),(8); + +CREATE TABLE t2 (b INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (2),(1); + +SELECT a FROM t1 +WHERE 9 IN ( SELECT MIN( a ) FROM t1 ) +HAVING a <> ( SELECT COUNT(*) FROM t2 ) +ORDER BY a; + +DROP TABLE t1,t2; + --echo End of 10.0 tests -- cgit v1.2.1 From 6aff5fa27ae863670608ae88b134453fe53c3e17 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 26 Mar 2018 10:33:58 +0400 Subject: MDEV-15619 using CONVERT() inside AES_ENCRYPT() in an UPDATE corrupts data --- mysql-test/r/func_str.result | 37 +++++++++++++++++++++++++++++++++++++ mysql-test/t/func_str.test | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 9a9b9f0d73d..ceaeb64fa01 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -4551,3 +4551,40 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: Note 1003 select char(0xdf) AS `CHAR(0xDF)` +# +# MDEV-15619 using CONVERT() inside AES_ENCRYPT() in an UPDATE corrupts data +# +CREATE TABLE t1 ( +id int(11) NOT NULL, +session_id varchar(255) DEFAULT NULL, +directory mediumtext, +checksum int(10) DEFAULT NULL, +last_update datetime DEFAULT NULL, +PRIMARY KEY (id), +KEY lastupdate (last_update) +) DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (1,'',NULL,38391,'2017-06-24 07:35:28'); +UPDATE t1 SET directory = AES_ENCRYPT(CONVERT('test stringrererejrjerjehrjekhrjkehrjkehrkjehrjkerhkjehrjekrhkjehrkjerhjkehrkjehrkjehrjkehrjkehrjkehrjkerjkehrjkehrjkehrjke rekjhrejrejhrjehgrehjgrhjerjhegrjherejhgrjhegrjehgrjhegrejhrgjehgrjhegrjhegrjhergjhegrjhegrhjegrjerhthkjjkdhjkgdfjkgjkdgdjkfjkhgjkfdhjgjkfdghkjdfghkjfdghfjkdghkdjfghdkjfghfjkdghfkjdghkjfdghfkjdghfkdjghfkjdghfdjkghjkdfhgdfjkghfjkdghfjkdghfjdkghfjkdghkfjdghfkjdghfkjdghkjdfghfjdkghjkfdghkjdfhgjkdfhgjkfdhgkjfdghkfjdhgkjfdgdjkejktjherjthkjrethkjrethjkerthjkerhtjkerhtkjerhtjkerhtjkerhtjkrehtkjerhtkjrehtjkrehtkjrehtkjerhtkjerhtjkrehtkjrehtjkrehtkjrethjkrethkjrehtkjethjkerhtjkrehtjkretkjerhtkjrehtjkerhtjkrehtjrehtkjrekjtrfgdsfgdhjsghjgfdhjsfhjdfgdhjshjdshjfghjdsfgjhsfgjhsdfgjhdsfgjdhsfgsjhfgjhsdfgsdjhfgjdhsfdjshfgdsjhfgjsdhfdjshfgdjhsfgdjshfgjdhsfgjhsdfgjhsdgfjhsdgfjhdsgfjhsgfjhsdgfjhdsgfhjsdehkjthrkjethjkre' USING latin1), '95F5A1F52A554'), last_update= NOW(); +SELECT directory IS NULL FROM t1; +directory IS NULL +0 +DROP TABLE t1; +CREATE TABLE t1 ( +id int(11) NOT NULL PRIMARY KEY, +directory mediumtext +) DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (1,AES_ENCRYPT(CONVERT(REPEAT('a',800) USING latin1),'95F5A1F52A554')); +SELECT AES_DECRYPT(directory,'95F5A1F52A554') FROM t1; +AES_DECRYPT(directory,'95F5A1F52A554') +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +DROP TABLE t1; +SET @enc=AES_ENCRYPT(REPEAT(_latin1'a',800),'95F5A1F52A554'); +CREATE TABLE t1 ( +id int(11) NOT NULL PRIMARY KEY, +directory mediumtext +) DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (1,AES_DECRYPT(CONVERT(@enc USING binary),'95F5A1F52A554')); +SELECT * FROM t1; +id directory +1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +DROP TABLE t1; diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index bdeca8d0d86..019d17518dd 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -1754,3 +1754,39 @@ EXECUTE stmt; EXPLAIN EXTENDED SELECT CHAR(0xDF USING latin1); EXPLAIN EXTENDED SELECT CHAR(0xDF USING `binary`); EXPLAIN EXTENDED SELECT CHAR(0xDF); + + +--echo # +--echo # MDEV-15619 using CONVERT() inside AES_ENCRYPT() in an UPDATE corrupts data +--echo # + +CREATE TABLE t1 ( + id int(11) NOT NULL, + session_id varchar(255) DEFAULT NULL, + directory mediumtext, + checksum int(10) DEFAULT NULL, + last_update datetime DEFAULT NULL, + PRIMARY KEY (id), + KEY lastupdate (last_update) +) DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (1,'',NULL,38391,'2017-06-24 07:35:28'); +UPDATE t1 SET directory = AES_ENCRYPT(CONVERT('test stringrererejrjerjehrjekhrjkehrjkehrkjehrjkerhkjehrjekrhkjehrkjerhjkehrkjehrkjehrjkehrjkehrjkehrjkerjkehrjkehrjkehrjke rekjhrejrejhrjehgrehjgrhjerjhegrjherejhgrjhegrjehgrjhegrejhrgjehgrjhegrjhegrjhergjhegrjhegrhjegrjerhthkjjkdhjkgdfjkgjkdgdjkfjkhgjkfdhjgjkfdghkjdfghkjfdghfjkdghkdjfghdkjfghfjkdghfkjdghkjfdghfkjdghfkdjghfkjdghfdjkghjkdfhgdfjkghfjkdghfjkdghfjdkghfjkdghkfjdghfkjdghfkjdghkjdfghfjdkghjkfdghkjdfhgjkdfhgjkfdhgkjfdghkfjdhgkjfdgdjkejktjherjthkjrethkjrethjkerthjkerhtjkerhtkjerhtjkerhtjkerhtjkrehtkjerhtkjrehtjkrehtkjrehtkjerhtkjerhtjkrehtkjrehtjkrehtkjrethjkrethkjrehtkjethjkerhtjkrehtjkretkjerhtkjrehtjkerhtjkrehtjrehtkjrekjtrfgdsfgdhjsghjgfdhjsfhjdfgdhjshjdshjfghjdsfgjhsfgjhsdfgjhdsfgjdhsfgsjhfgjhsdfgsdjhfgjdhsfdjshfgdsjhfgjsdhfdjshfgdjhsfgdjshfgjdhsfgjhsdfgjhsdgfjhsdgfjhdsgfjhsgfjhsdgfjhdsgfhjsdehkjthrkjethjkre' USING latin1), '95F5A1F52A554'), last_update= NOW(); +SELECT directory IS NULL FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 ( + id int(11) NOT NULL PRIMARY KEY, + directory mediumtext +) DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (1,AES_ENCRYPT(CONVERT(REPEAT('a',800) USING latin1),'95F5A1F52A554')); +SELECT AES_DECRYPT(directory,'95F5A1F52A554') FROM t1; +DROP TABLE t1; + +SET @enc=AES_ENCRYPT(REPEAT(_latin1'a',800),'95F5A1F52A554'); +CREATE TABLE t1 ( + id int(11) NOT NULL PRIMARY KEY, + directory mediumtext +) DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (1,AES_DECRYPT(CONVERT(@enc USING binary),'95F5A1F52A554')); +SELECT * FROM t1; +DROP TABLE t1; -- cgit v1.2.1 From 10f6b7001bd7b683c013ae407c2c48793caa3633 Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Mon, 2 Apr 2018 13:14:30 +0300 Subject: MDEV-9744: session optimizer_use_condition_selectivity=5 causing SQL Error (1918): Encountered illegal value '' when converting to DECIMAL The issue was that EITS data was allocated but then not read for some reason (one being to avoid a deadlock), then the optimizer was using these bzero'ed buffers as EITS statistics. This should not be allowed, we should use statistcs for a table only when we have successfully loaded/read the stats from the statistical tables. --- mysql-test/r/statistics.result | 18 ++++++++++++++++++ mysql-test/t/statistics.test | 20 ++++++++++++++++++++ 2 files changed, 38 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/statistics.result b/mysql-test/r/statistics.result index bd6a0849e3d..74997c92d3e 100644 --- a/mysql-test/r/statistics.result +++ b/mysql-test/r/statistics.result @@ -1641,3 +1641,21 @@ FROM mysql.column_stats; db_name table_name column_name HEX(min_value) HEX(max_value) nulls_ratio avg_frequency hist_size hist_type HEX(histogram) test t1 a D879626AF872675F73E662F8 D879626AF872675F73E662F8 0.0000 1.0000 0 NULL NULL drop table t1; +# +# MDEB-9744: session optimizer_use_condition_selectivity=5 causing SQL Error (1918): +# Encountered illegal value '' when converting to DECIMAL +# +set @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity; +set optimizer_use_condition_selectivity=3, use_stat_tables=preferably; +create table t1 (id int(10),cost decimal(9,2)) engine=innodb; +ANALYZE TABLE t1 PERSISTENT FOR ALL; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +create temporary table t2 (id int); +insert into t2 (id) select id from t1 where cost > 0; +select * from t2; +id +set use_stat_tables=@save_use_stat_tables; +set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +drop table t1,t2; diff --git a/mysql-test/t/statistics.test b/mysql-test/t/statistics.test index 2c8dec307cc..0ab42453125 100644 --- a/mysql-test/t/statistics.test +++ b/mysql-test/t/statistics.test @@ -717,3 +717,23 @@ select db_name, table_name, column_name, FROM mysql.column_stats; drop table t1; + +--echo # +--echo # MDEB-9744: session optimizer_use_condition_selectivity=5 causing SQL Error (1918): +--echo # Encountered illegal value '' when converting to DECIMAL +--echo # + +set @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity; +set optimizer_use_condition_selectivity=3, use_stat_tables=preferably; + +create table t1 (id int(10),cost decimal(9,2)) engine=innodb; +ANALYZE TABLE t1 PERSISTENT FOR ALL; + +create temporary table t2 (id int); +insert into t2 (id) select id from t1 where cost > 0; +select * from t2; + +set use_stat_tables=@save_use_stat_tables; +set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +drop table t1,t2; + -- cgit v1.2.1 From 8ffbb825e6a09d3055f46ed4b456573aef5c474c Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Tue, 27 Mar 2018 07:55:56 +1100 Subject: increase upper value of max_prepared_stmt_count to UINT32_MAX The upper 1M limit for max_prepared_stmt_count was set over 10 years ago. It doesn't suite current hardware and a sysbench oltp_read_write test with 512 threads will hit this limit. --- mysql-test/r/perror.result | 2 +- mysql-test/r/ps.result | 2 +- .../sys_vars/r/max_prepared_stmt_count_basic.result | 20 ++++++++++---------- .../sys_vars/t/max_prepared_stmt_count_basic.test | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/perror.result b/mysql-test/r/perror.result index 30a56840b1b..9e17addf704 100644 --- a/mysql-test/r/perror.result +++ b/mysql-test/r/perror.result @@ -3,4 +3,4 @@ MySQL error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192s' for key %d MySQL error code 1408 (ER_STARTUP): %s: ready for connections. Version: '%s' socket: '%s' port: %d %s MySQL error code 1459 (ER_TABLE_NEEDS_UPGRADE): Table upgrade required. Please do "REPAIR TABLE `%-.32s`" or dump/reload to fix it! -MySQL error code 1461 (ER_MAX_PREPARED_STMT_COUNT_REACHED): Can't create more than max_prepared_stmt_count statements (current value: %lu) +MySQL error code 1461 (ER_MAX_PREPARED_STMT_COUNT_REACHED): Can't create more than max_prepared_stmt_count statements (current value: %u) diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 0217af9ed61..d3fbc595f17 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -820,7 +820,7 @@ Warnings: Warning 1292 Truncated incorrect max_prepared_stmt_count value: '10000000000000000' select @@max_prepared_stmt_count; @@max_prepared_stmt_count -1048576 +4294967295 set global max_prepared_stmt_count=default; select @@max_prepared_stmt_count; @@max_prepared_stmt_count diff --git a/mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result b/mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result index 9419f251930..d3de7707f84 100644 --- a/mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result +++ b/mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result @@ -46,40 +46,40 @@ Warnings: Warning 1292 Truncated incorrect max_prepared_stmt_count value: '100000000000' SELECT @@global.max_prepared_stmt_count; @@global.max_prepared_stmt_count -1048576 +4294967295 SET @@global.max_prepared_stmt_count = 10000.01; ERROR 42000: Incorrect argument type to variable 'max_prepared_stmt_count' SELECT @@global.max_prepared_stmt_count; @@global.max_prepared_stmt_count -1048576 +4294967295 SET @@global.max_prepared_stmt_count = -1024; Warnings: Warning 1292 Truncated incorrect max_prepared_stmt_count value: '-1024' SELECT @@global.max_prepared_stmt_count; @@global.max_prepared_stmt_count 0 -SET @@global.max_prepared_stmt_count = 1048577; +SET @@global.max_prepared_stmt_count = 4294967296; Warnings: -Warning 1292 Truncated incorrect max_prepared_stmt_count value: '1048577' +Warning 1292 Truncated incorrect max_prepared_stmt_count value: '4294967296' SELECT @@global.max_prepared_stmt_count; @@global.max_prepared_stmt_count -1048576 -SET @@global.max_prepared_stmt_count = 104857612; +4294967295 +SET @@global.max_prepared_stmt_count = 4294967295*1024; Warnings: -Warning 1292 Truncated incorrect max_prepared_stmt_count value: '104857612' +Warning 1292 Truncated incorrect max_prepared_stmt_count value: '4398046510080' SELECT @@global.max_prepared_stmt_count; @@global.max_prepared_stmt_count -1048576 +4294967295 SET @@global.max_prepared_stmt_count = ON; ERROR 42000: Incorrect argument type to variable 'max_prepared_stmt_count' SELECT @@global.max_prepared_stmt_count; @@global.max_prepared_stmt_count -1048576 +4294967295 SET @@global.max_prepared_stmt_count = 'test'; ERROR 42000: Incorrect argument type to variable 'max_prepared_stmt_count' SELECT @@global.max_prepared_stmt_count; @@global.max_prepared_stmt_count -1048576 +4294967295 '#-------------------FN_DYNVARS_081_05----------------------------#' SET @@session.max_prepared_stmt_count = 4096; ERROR HY000: Variable 'max_prepared_stmt_count' is a GLOBAL variable and should be set with SET GLOBAL diff --git a/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test b/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test index 5bf5d9c8834..a97256d84a4 100644 --- a/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test +++ b/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test @@ -92,9 +92,9 @@ SET @@global.max_prepared_stmt_count = 10000.01; SELECT @@global.max_prepared_stmt_count; SET @@global.max_prepared_stmt_count = -1024; SELECT @@global.max_prepared_stmt_count; -SET @@global.max_prepared_stmt_count = 1048577; +SET @@global.max_prepared_stmt_count = 4294967296; SELECT @@global.max_prepared_stmt_count; -SET @@global.max_prepared_stmt_count = 104857612; +SET @@global.max_prepared_stmt_count = 4294967295*1024; SELECT @@global.max_prepared_stmt_count; --Error ER_WRONG_TYPE_FOR_VAR -- cgit v1.2.1 From 890115578007af9da9907c87d53f639166d564e7 Mon Sep 17 00:00:00 2001 From: Ian Gilfillan Date: Wed, 4 Apr 2018 23:35:47 +0200 Subject: Update contributors --- mysql-test/r/contributors.result | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/contributors.result b/mysql-test/r/contributors.result index 927c0bcccbf..36d033f4cb3 100644 --- a/mysql-test/r/contributors.result +++ b/mysql-test/r/contributors.result @@ -4,13 +4,12 @@ Booking.com https://www.booking.com Founding member, Platinum Sponsor of the Mar Alibaba Cloud https://www.alibabacloud.com/ Platinum Sponsor of the MariaDB Foundation Tencent Cloud https://cloud.tencent.com Platinum Sponsor of the MariaDB Foundation Microsoft https://microsoft.com/ Platinum Sponsor of the MariaDB Foundation -MariaDB Corporation https://mariadb.com Founding member, Gold Sponsor of the MariaDB Foundation +MariaDB Corporation https://mariadb.com Founding member, Platinum Sponsor of the MariaDB Foundation Visma https://visma.com Gold Sponsor of the MariaDB Foundation DBS https://dbs.com Gold Sponsor of the MariaDB Foundation IBM https://www.ibm.com Gold Sponsor of the MariaDB Foundation Nexedi https://www.nexedi.com Silver Sponsor of the MariaDB Foundation Acronis http://www.acronis.com Silver Sponsor of the MariaDB Foundation -Auttomattic https://automattic.com Bronze Sponsor of the MariaDB Foundation Verkkokauppa.com https://www.verkkokauppa.com Bronze Sponsor of the MariaDB Foundation Virtuozzo https://virtuozzo.com Bronze Sponsor of the MariaDB Foundation Tencent Game DBA http://tencentdba.com/about Bronze Sponsor of the MariaDB Foundation -- cgit v1.2.1 From bcb36ee21e2515d17dcf03b760487e64eb780f2b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 20 Apr 2018 10:10:33 +0200 Subject: MDEV-15456 Server crashes upon adding or dropping a partition in ALTER under LOCK TABLE after ER_SAME_NAME_PARTITION ALTER TABLE ... ADD PARTITION modifies the open TABLE structure, and sets table->need_reopen=1 to reset these modifications in case of an error. But under LOCK TABLES the table isn't get reopened, despite need_reopen. Fixed by reopening need_reopen tables under LOCK TABLE. --- mysql-test/suite/parts/inc/part_alter_values.inc | 10 ++++++++++ mysql-test/suite/parts/r/partition_alter_innodb.result | 6 ++++++ mysql-test/suite/parts/r/partition_alter_maria.result | 6 ++++++ mysql-test/suite/parts/r/partition_alter_myisam.result | 6 ++++++ 4 files changed, 28 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/parts/inc/part_alter_values.inc b/mysql-test/suite/parts/inc/part_alter_values.inc index 0d4929d9820..1b0605ff57b 100644 --- a/mysql-test/suite/parts/inc/part_alter_values.inc +++ b/mysql-test/suite/parts/inc/part_alter_values.inc @@ -35,3 +35,13 @@ ALTER TABLE t1 REORGANIZE PARTITION p1 INTO PARTITION p3 VALUES IN (4,5,6) ); DROP TABLE t1; + +# +# MDEV-15456 Server crashes upon adding or dropping a partition in ALTER under LOCK TABLE after ER_SAME_NAME_PARTITION +# +create table t1 (i int) partition by range(i) (partition p0 values less than (10)); +lock table t1 write; +--error ER_SAME_NAME_PARTITION +alter table t1 add partition (partition p0 values less than (20)); +alter table t1 add partition (partition p1 values less than (20)) /* comment */; +drop table t1; diff --git a/mysql-test/suite/parts/r/partition_alter_innodb.result b/mysql-test/suite/parts/r/partition_alter_innodb.result index 29076a3c178..08f0c321119 100644 --- a/mysql-test/suite/parts/r/partition_alter_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter_innodb.result @@ -47,3 +47,9 @@ PARTITION p3 VALUES IN (4,5,6) ); ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition DROP TABLE t1; +create table t1 (i int) partition by range(i) (partition p0 values less than (10)); +lock table t1 write; +alter table t1 add partition (partition p0 values less than (20)); +ERROR HY000: Duplicate partition name p0 +alter table t1 add partition (partition p1 values less than (20)) /* comment */; +drop table t1; diff --git a/mysql-test/suite/parts/r/partition_alter_maria.result b/mysql-test/suite/parts/r/partition_alter_maria.result index 7d923570cfe..5e53dc99db8 100644 --- a/mysql-test/suite/parts/r/partition_alter_maria.result +++ b/mysql-test/suite/parts/r/partition_alter_maria.result @@ -69,3 +69,9 @@ PARTITION p3 VALUES IN (4,5,6) ); ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition DROP TABLE t1; +create table t1 (i int) partition by range(i) (partition p0 values less than (10)); +lock table t1 write; +alter table t1 add partition (partition p0 values less than (20)); +ERROR HY000: Duplicate partition name p0 +alter table t1 add partition (partition p1 values less than (20)) /* comment */; +drop table t1; diff --git a/mysql-test/suite/parts/r/partition_alter_myisam.result b/mysql-test/suite/parts/r/partition_alter_myisam.result index 9f2381039d3..0d3094418ff 100644 --- a/mysql-test/suite/parts/r/partition_alter_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter_myisam.result @@ -42,3 +42,9 @@ PARTITION p3 VALUES IN (4,5,6) ); ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition DROP TABLE t1; +create table t1 (i int) partition by range(i) (partition p0 values less than (10)); +lock table t1 write; +alter table t1 add partition (partition p0 values less than (20)); +ERROR HY000: Duplicate partition name p0 +alter table t1 add partition (partition p1 values less than (20)) /* comment */; +drop table t1; -- cgit v1.2.1 From 01b2e773ef7a19dbd28a345021cd3a9aa6b10603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 20 Apr 2018 10:35:22 +0300 Subject: MDEV-15937 Assertion failure 'key->flags & 1' on ALTER TABLE While the test case crashes a MariaDB 10.2 debug build only, let us apply the fix to the earliest applicable MariaDB series (10.0) to avoid any data corruption on a table-rebuilding ALTER TABLE using ALGORITHM=INPLACE. innobase_create_key_defs(): Use altered_table->s->primary_key when a new primary key is being created. --- mysql-test/suite/innodb/r/innodb-alter-nullable.result | 4 ++++ mysql-test/suite/innodb/t/innodb-alter-nullable.test | 5 +++++ 2 files changed, 9 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/innodb/r/innodb-alter-nullable.result b/mysql-test/suite/innodb/r/innodb-alter-nullable.result index e9711b2ac31..2769bfdf1f5 100644 --- a/mysql-test/suite/innodb/r/innodb-alter-nullable.result +++ b/mysql-test/suite/innodb/r/innodb-alter-nullable.result @@ -51,3 +51,7 @@ WHERE NAME='test/t'; TABLE_ID NAME FLAG N_COLS SPACE FILE_FORMAT ROW_FORMAT ZIP_PAGE_SIZE # test/t 1 6 # Antelope Compact 0 DROP TABLE t; +CREATE TABLE t1(c1 INT) ENGINE=InnoDB; +ALTER TABLE t1 ADD CONSTRAINT UNIQUE KEY i1(c1); +ALTER TABLE t1 CHANGE c1 c1 INT NOT NULL,ADD KEY(c1); +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb-alter-nullable.test b/mysql-test/suite/innodb/t/innodb-alter-nullable.test index bb5cdee000a..d039459f91f 100644 --- a/mysql-test/suite/innodb/t/innodb-alter-nullable.test +++ b/mysql-test/suite/innodb/t/innodb-alter-nullable.test @@ -71,6 +71,11 @@ WHERE NAME='test/t'; DROP TABLE t; +CREATE TABLE t1(c1 INT) ENGINE=InnoDB; +ALTER TABLE t1 ADD CONSTRAINT UNIQUE KEY i1(c1); +ALTER TABLE t1 CHANGE c1 c1 INT NOT NULL,ADD KEY(c1); +DROP TABLE t1; + # Check that all connections opened by test cases in this file are really # gone so execution of other tests won't be affected by their presence. --source include/wait_until_count_sessions.inc -- cgit v1.2.1 From adaa891ae7113069e402b40637dd9ddbd96d27bc Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Thu, 12 Apr 2018 14:55:43 +0200 Subject: MDEV-13699: Assertion `!new_field->field_name.str || strlen(new_field->field_name.str) == new_field->field_name.length' failed in create_tmp_table on 2nd execution of PS with semijoin The problem was that SJ (semi-join) used secondary list (array) of subquery select list. The items there was prepared once then cleaned up (but not really freed from memory because it was made in statement memory). Original list was not prepared after first execution because select was removed by conversion to SJ. The solution is to use original list but prepare it first. --- mysql-test/r/subselect_sj.result | 26 ++++++++++++++++++++++++++ mysql-test/r/subselect_sj_jcl6.result | 26 ++++++++++++++++++++++++++ mysql-test/t/subselect_sj.test | 30 ++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result index 74384141998..519d53eb98f 100644 --- a/mysql-test/r/subselect_sj.result +++ b/mysql-test/r/subselect_sj.result @@ -3153,4 +3153,30 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1003 select `test`.`t1`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2`,`test`.`t4`.`c4` AS `c4` from `test`.`t1` left join (`test`.`t2` join `test`.`t4`) on(((`test`.`t2`.`c2` = `test`.`t1`.`c1`) and (`test`.`t1`.`c1`,(select `test`.`t3`.`c3` from `test`.`t3` where ((`test`.`t2`.`c2`) = `test`.`t3`.`c3`))))) where 1 DROP TABLE t1,t2,t3,t4; +# +# MDEV-13699: Assertion `!new_field->field_name.str || +# strlen(new_field->field_name.str) == new_field->field_name.length' +# failed in create_tmp_table on 2nd execution of PS with semijoin +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (3),(4); +CREATE TABLE t3 (c INT); +CREATE ALGORITHM=MERGE VIEW v3 AS SELECT * FROM t3; +INSERT INTO t3 VALUES (5),(6); +PREPARE stmt FROM +"SELECT * FROM t1 + WHERE EXISTS ( + SELECT * FROM t2 WHERE t1.a IN ( SELECT c AS fld FROM v3 ) + )"; +EXECUTE stmt; +a +EXECUTE stmt; +a +EXECUTE stmt; +a +drop view v3; +drop table t1,t2,t3; +# End of 5.5 test set optimizer_switch=@subselect_sj_tmp; diff --git a/mysql-test/r/subselect_sj_jcl6.result b/mysql-test/r/subselect_sj_jcl6.result index 47dbdd782b5..32704060208 100644 --- a/mysql-test/r/subselect_sj_jcl6.result +++ b/mysql-test/r/subselect_sj_jcl6.result @@ -3167,6 +3167,32 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1003 select `test`.`t1`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2`,`test`.`t4`.`c4` AS `c4` from `test`.`t1` left join (`test`.`t2` join `test`.`t4`) on(((`test`.`t2`.`c2` = `test`.`t1`.`c1`) and (`test`.`t1`.`c1`,(select `test`.`t3`.`c3` from `test`.`t3` where ((`test`.`t2`.`c2`) = `test`.`t3`.`c3`))))) where 1 DROP TABLE t1,t2,t3,t4; +# +# MDEV-13699: Assertion `!new_field->field_name.str || +# strlen(new_field->field_name.str) == new_field->field_name.length' +# failed in create_tmp_table on 2nd execution of PS with semijoin +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (3),(4); +CREATE TABLE t3 (c INT); +CREATE ALGORITHM=MERGE VIEW v3 AS SELECT * FROM t3; +INSERT INTO t3 VALUES (5),(6); +PREPARE stmt FROM +"SELECT * FROM t1 + WHERE EXISTS ( + SELECT * FROM t2 WHERE t1.a IN ( SELECT c AS fld FROM v3 ) + )"; +EXECUTE stmt; +a +EXECUTE stmt; +a +EXECUTE stmt; +a +drop view v3; +drop table t1,t2,t3; +# End of 5.5 test set optimizer_switch=@subselect_sj_tmp; # # BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off diff --git a/mysql-test/t/subselect_sj.test b/mysql-test/t/subselect_sj.test index acee1a67d63..0a35a61ecd3 100644 --- a/mysql-test/t/subselect_sj.test +++ b/mysql-test/t/subselect_sj.test @@ -2841,5 +2841,35 @@ eval EXPLAIN EXTENDED $q2; DROP TABLE t1,t2,t3,t4; +--echo # +--echo # MDEV-13699: Assertion `!new_field->field_name.str || +--echo # strlen(new_field->field_name.str) == new_field->field_name.length' +--echo # failed in create_tmp_table on 2nd execution of PS with semijoin +--echo # + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); + +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (3),(4); + +CREATE TABLE t3 (c INT); +CREATE ALGORITHM=MERGE VIEW v3 AS SELECT * FROM t3; +INSERT INTO t3 VALUES (5),(6); + +PREPARE stmt FROM + "SELECT * FROM t1 + WHERE EXISTS ( + SELECT * FROM t2 WHERE t1.a IN ( SELECT c AS fld FROM v3 ) + )"; +EXECUTE stmt; +EXECUTE stmt; +EXECUTE stmt; + +drop view v3; +drop table t1,t2,t3; + +--echo # End of 5.5 test + # The following command must be the last one the file set optimizer_switch=@subselect_sj_tmp; -- cgit v1.2.1 From eb057dce2027b673b7b140bae42963774027e0a5 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Tue, 24 Apr 2018 15:51:49 -0700 Subject: MDEV-15035 Wrong results when calling a stored procedure multiple times with different arguments. If the ON expression of an outer join is an OR formula with one of the disjunct being a constant formula then the expression cannot be null-rejected if the constant formula is true. Otherwise it can be null-rejected and if so the outer join can be converted into inner join. This optimization was added in the patch for mdev-4817. Yet the code had a defect: if the query was used in a stored procedure with parameters and the constant item contained some of them then the value of this constant item depended on the values of the parameters. With some parameters it may be true, for others not. The validity of conversion to inner join is checked only once and it happens only for the first call of procedure. So if the parameters in the first call allowed the conversion it was done and next calls used the transformed query though there could be calls whose parameters made the conversion invalid. Fixed by cheking whether the constant disjunct in the ON expression originally contained an SP parameter. If so the expression is not considered as null-rejected. For this check a new item's attribute was intruduced: Item::with_param. It is calculated for each item by fix fields() functions. Also moved the call of optimize_constant_subqueries() in JOIN::optimize after the call of simplify_joins(). The reason for this is that after the optimization introduced by the patch for mdev-4817 simplify_joins() can use the results of execution of non-expensive constant subqueries and this is not valid. --- mysql-test/r/sp-innodb.result | 34 ++++++++++++++++++++++++++++++++++ mysql-test/t/sp-innodb.test | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/sp-innodb.result b/mysql-test/r/sp-innodb.result index b5fe920c675..9daf2c457f5 100644 --- a/mysql-test/r/sp-innodb.result +++ b/mysql-test/r/sp-innodb.result @@ -138,3 +138,37 @@ SET @@innodb_lock_wait_timeout= @innodb_lock_wait_timeout_saved; # # BUG 16041903: End of test case # +# +# MDEV-15035: SP using query with outer join and a parameter +# in ON expression +# +CREATE TABLE t1 ( +id int NOT NULL, +PRIMARY KEY (id) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1), (2); +CREATE TABLE t2 ( +id int NOT NULL, +id_foo int NOT NULL, +PRIMARY KEY (id) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1, 1); +DROP PROCEDURE IF EXISTS test_proc; +CREATE PROCEDURE test_proc(IN param int) +LANGUAGE SQL +READS SQL DATA +BEGIN +SELECT DISTINCT f.id +FROM t1 f +LEFT OUTER JOIN t2 b ON b.id_foo = f.id +WHERE (param <> 0 OR b.id IS NOT NULL); +END| +CALL test_proc(0); +id +1 +CALL test_proc(1); +id +1 +2 +DROP PROCEDURE IF EXISTS test_proc; +DROP TABLE t1, t2; diff --git a/mysql-test/t/sp-innodb.test b/mysql-test/t/sp-innodb.test index 23715166a02..e44a853e713 100644 --- a/mysql-test/t/sp-innodb.test +++ b/mysql-test/t/sp-innodb.test @@ -158,5 +158,47 @@ SET @@innodb_lock_wait_timeout= @innodb_lock_wait_timeout_saved; --echo # BUG 16041903: End of test case --echo # +--echo # +--echo # MDEV-15035: SP using query with outer join and a parameter +--echo # in ON expression +--echo # + +CREATE TABLE t1 ( + id int NOT NULL, + PRIMARY KEY (id) +) ENGINE=InnoDB; + +INSERT INTO t1 VALUES (1), (2); + +CREATE TABLE t2 ( + id int NOT NULL, + id_foo int NOT NULL, + PRIMARY KEY (id) +) ENGINE=InnoDB; + +INSERT INTO t2 VALUES (1, 1); + +--disable_warnings +DROP PROCEDURE IF EXISTS test_proc; +--enable_warnings + +DELIMITER |; +CREATE PROCEDURE test_proc(IN param int) +LANGUAGE SQL +READS SQL DATA +BEGIN + SELECT DISTINCT f.id + FROM t1 f + LEFT OUTER JOIN t2 b ON b.id_foo = f.id + WHERE (param <> 0 OR b.id IS NOT NULL); +END| +DELIMITER ;| + +CALL test_proc(0); +CALL test_proc(1); + +DROP PROCEDURE IF EXISTS test_proc; +DROP TABLE t1, t2; + # Wait till we reached the initial number of concurrent sessions --source include/wait_until_count_sessions.inc -- cgit v1.2.1 From e86c0a5f2aeb98fa06df01ec008bf70cab61da10 Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 26 Apr 2018 14:21:36 +0300 Subject: Increase number of max table_open_cache instances This is a backport of MDEV-11429 from 10.1 --- mysql-test/suite/sys_vars/r/table_open_cache_basic.result | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/sys_vars/r/table_open_cache_basic.result b/mysql-test/suite/sys_vars/r/table_open_cache_basic.result index 2381dfe4900..465a61f2473 100644 --- a/mysql-test/suite/sys_vars/r/table_open_cache_basic.result +++ b/mysql-test/suite/sys_vars/r/table_open_cache_basic.result @@ -27,7 +27,7 @@ Warnings: Warning 1292 Truncated incorrect table_open_cache value: '1073741824' SELECT @@global.table_open_cache ; @@global.table_open_cache -524288 +1048576 SET @@global.table_open_cache = 18000; SELECT @@global.table_open_cache ; @@global.table_open_cache @@ -48,7 +48,7 @@ Warnings: Warning 1292 Truncated incorrect table_open_cache value: '100000000000' SELECT @@global.table_open_cache ; @@global.table_open_cache -524288 +1048576 SET @@global.table_open_cache = -1024; Warnings: Warning 1292 Truncated incorrect table_open_cache value: '-1024' -- cgit v1.2.1 From 619afb151b38a538ef64d5387643c01f86e203d8 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 25 Apr 2018 13:20:44 +0200 Subject: MDEV-15456 Server crashes upon adding or dropping a partition in ALTER under LOCK TABLE after ER_SAME_NAME_PARTITION followup for bcb36ee21e2 move reopening before trans_commit_stmt(thd); --- mysql-test/suite/parts/inc/part_alter_values.inc | 2 +- mysql-test/suite/parts/r/partition_alter_innodb.result | 2 +- mysql-test/suite/parts/r/partition_alter_maria.result | 2 +- mysql-test/suite/parts/r/partition_alter_myisam.result | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/parts/inc/part_alter_values.inc b/mysql-test/suite/parts/inc/part_alter_values.inc index 1b0605ff57b..ac69169a9ca 100644 --- a/mysql-test/suite/parts/inc/part_alter_values.inc +++ b/mysql-test/suite/parts/inc/part_alter_values.inc @@ -39,7 +39,7 @@ DROP TABLE t1; # # MDEV-15456 Server crashes upon adding or dropping a partition in ALTER under LOCK TABLE after ER_SAME_NAME_PARTITION # -create table t1 (i int) partition by range(i) (partition p0 values less than (10)); +--eval create table t1 (i int) engine=$engine partition by range(i) (partition p0 values less than (10)) lock table t1 write; --error ER_SAME_NAME_PARTITION alter table t1 add partition (partition p0 values less than (20)); diff --git a/mysql-test/suite/parts/r/partition_alter_innodb.result b/mysql-test/suite/parts/r/partition_alter_innodb.result index 08f0c321119..87c113a2720 100644 --- a/mysql-test/suite/parts/r/partition_alter_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter_innodb.result @@ -47,7 +47,7 @@ PARTITION p3 VALUES IN (4,5,6) ); ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition DROP TABLE t1; -create table t1 (i int) partition by range(i) (partition p0 values less than (10)); +create table t1 (i int) engine=InnoDB partition by range(i) (partition p0 values less than (10)); lock table t1 write; alter table t1 add partition (partition p0 values less than (20)); ERROR HY000: Duplicate partition name p0 diff --git a/mysql-test/suite/parts/r/partition_alter_maria.result b/mysql-test/suite/parts/r/partition_alter_maria.result index 5e53dc99db8..5f1f882d2ea 100644 --- a/mysql-test/suite/parts/r/partition_alter_maria.result +++ b/mysql-test/suite/parts/r/partition_alter_maria.result @@ -69,7 +69,7 @@ PARTITION p3 VALUES IN (4,5,6) ); ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition DROP TABLE t1; -create table t1 (i int) partition by range(i) (partition p0 values less than (10)); +create table t1 (i int) engine=Aria partition by range(i) (partition p0 values less than (10)); lock table t1 write; alter table t1 add partition (partition p0 values less than (20)); ERROR HY000: Duplicate partition name p0 diff --git a/mysql-test/suite/parts/r/partition_alter_myisam.result b/mysql-test/suite/parts/r/partition_alter_myisam.result index 0d3094418ff..248c8627b2f 100644 --- a/mysql-test/suite/parts/r/partition_alter_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter_myisam.result @@ -42,7 +42,7 @@ PARTITION p3 VALUES IN (4,5,6) ); ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition DROP TABLE t1; -create table t1 (i int) partition by range(i) (partition p0 values less than (10)); +create table t1 (i int) engine=MyISAM partition by range(i) (partition p0 values less than (10)); lock table t1 write; alter table t1 add partition (partition p0 values less than (20)); ERROR HY000: Duplicate partition name p0 -- cgit v1.2.1 From d6dbe8e2071bf9fdc21b5530abce88ff01b40e25 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Thu, 26 Apr 2018 22:42:42 +0300 Subject: List of unstable tests for 10.0.35 release --- mysql-test/unstable-tests | 137 +++++++++++++++++++++++----------------------- 1 file changed, 70 insertions(+), 67 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests index 4f74a7d744d..d50a9acc92e 100644 --- a/mysql-test/unstable-tests +++ b/mysql-test/unstable-tests @@ -23,59 +23,59 @@ # ############################################################################## +# Based on 10.0 48636f09720af45454e5db1183b62a1991db8faf + main.count_distinct2 : MDEV-11768 - timeout -main.create : Modified in 10.0.34 main.create_delayed : MDEV-10605 - failed with timeout -main.ctype_utf8 : Modified in 10.0.34 -main.ctype_utf8mb4 : Modified in 10.0.34 +main.ctype_ucs : Modified in 10.0.35 +main.ctype_utf8mb4 : Modified in 10.0.35 main.debug_sync : MDEV-10607 - internal error -main.derived : Modified in 10.0.34 main.derived_opt : MDEV-11768 - timeout -main.dyncol : Modified in 10.0.34 +main.dyncol : Modified in 10.0.35 main.events_slowlog : MDEV-12821 - wrong result -main.fulltext : Modified in 10.0.34 -main.func_isnull : Modified in 10.0.34 -main.func_misc : Modified in 10.0.34 -main.func_set : Modified in 10.0.34 -main.func_str : Modified in 10.0.34 +main.func_concat : Modified in 10.0.35 +main.func_misc : Modified in 10.0.35 +main.func_str : Modified in 10.0.35 +main.func_time : Modified in 10.0.35 +main.having : Modified in 10.0.35 main.gis : MDEV-13411 - wrong result on P8 -main.group_by : Modified in 10.0.34 -main.having : Modified in 10.0.34 main.host_cache_size_functionality : MDEV-10606 - sporadic failure on shutdown main.index_intersect_innodb : MDEV-10643 - failed with timeout main.index_merge_innodb : MDEV-7142 - wrong result main.innodb_mysql_lock : MDEV-7861 - sporadic lock detection failure -main.join_cache : Modified in 10.0.34 -main.join_outer : Modified in 10.0.34 +main.join_outer : Modified in 10.0.35 main.kill_processlist-6619 : MDEV-10793 - wrong result main.log_tables-big : MDEV-13408 - wrong result -main.mdev_14586 : Added in 10.0.34 main.mdev-504 : MDEV-10607 - sporadic "can't connect" main.mdev375 : MDEV-10607 - sporadic "can't connect" -main.merge : MDEV-10607 - sporadic "can't connect"; modified in 10.0.34 -main.myisam_optimize : Modified in 10.0.34 -main.mysqlbinlog : Modified in 10.0.34 -main.mysqldump-nl : Modified in 10.0.34 +main.merge : MDEV-10607 - sporadic "can't connect" main.mysqlhotcopy_myisam : MDEV-10995 - test hangs on debug build main.mysqltest : MDEV-9269 - fails on Alpha main.mysql_client_test_nonblock : MDEV-15096 - exec failed -main.order_by : Modified in 10.0.34 -main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count; modified in 10.0.34 -main.query_cache_debug : Modified in 10.0.34 -main.repair : Modified in 10.0.34 +main.parser : Modified in 10.0.35 +main.partition : Modified in 10.0.35 +main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count +main.ps_qc_innodb : Added in 10.0.35 +main.query_cache_debug : MDEV-15281 - resize or similar command in progress +main.read_only_innodb : Modified in 10.0.35 main.show_explain : MDEV-10674 - wrong result +main.sp-destruct : Modified in 10.0.35 main.sp_notembedded : MDEV-10607 - internal error main.sp-security : MDEV-10607 - sporadic "can't connect" main.stat_tables_par_innodb : MDEV-14155 - wrong rounding -main.subselect : Modified in 10.0.34 -main.subselect_exists2in : Modified in 10.0.34 +main.statistics : Modified in 10.0.35 main.subselect_innodb : MDEV-10614 - sporadic wrong results +main.subselect_mat : Modified in 10.0.35 +main.subselect4 : Modified in 10.0.35 main.symlink-aria-11902 : MDEV-15098 - error 40 from storage engine main.symlink-myisam-11902 : MDEV-15098 - error 40 from storage engine +main.tc_heuristic_recover : MDEV-15200 - wrong error on mysqld_stub_cmd main.type_datetime : MDEV-14322 - wrong result -main.union : Modified in 10.0.34 -main.view : Modified in 10.0.34 -main.xa : MDEV-11769 - lock wait timeout; modified in 10.0.34 +main.type_time_6065 : Modified in 10.0.35 +main.update_innodb : Modified in 10.0.35 +main.view : Modified in 10.0.35 +main.xa : MDEV-11769 - lock wait timeout +main.xml : Modified in 10.0.35 #---------------------------------------------------------------- @@ -91,8 +91,21 @@ binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint #---------------------------------------------------------------- -connect.json : Sporadic wrong result -connect.zip : Sporadic wrong result +connect.jdbc : Included file modified in 10.0.35 +connect.jdbc_new : Included file modified in 10.0.35 +connect.jdbc_oracle : Included file modified in 10.0.35 +connect.jdbc_postgresql : Modified in 10.0.35 +connect.json_java_2 : Included file modified in 10.0.35 +connect.json_java_3 : Included file modified in 10.0.35 +connect.json_mongo_c : Included file modified in 10.0.35 +connect.json_udf : Modified in 10.0.35 +connect.mongo_c : Included file modified in 10.0.35 +connect.mongo_java_2 : Included file modified in 10.0.35 +connect.mongo_java_3 : Included file modified in 10.0.35 +connect.mongo_test : Modified in 10.0.35 +connect.tbl_thread : Modified in 10.0.35 +connect.vcol : Added in 10.0.35 +connect.zip : MDEV-13884 - wrong result #---------------------------------------------------------------- @@ -119,28 +132,31 @@ funcs_2/charset.* : MDEV-10999 - test not maintained innodb.binlog_consistent : MDEV-10618 - Server fails to start innodb.group_commit_crash : MDEV-11770 - checksum mismatch innodb.group_commit_crash_no_optimize_thread : MDEV-11770 - checksum mismatch -innodb.innodb : Modified in 10.0.34 +innodb.innodb-alter-nullable : Modified in 10.0.35 innodb.innodb-alter-table : MDEV-10619 - Testcase timeout -innodb.innodb-autoinc : Modified in 10.0.34 +innodb.innodb_bug11754376 : Modified in 10.0.35 +innodb.innodb_bug27216817 : Added in 10.0.35 innodb.innodb_bug30423 : MDEV-7311 - Wrong number of rows in the plan innodb.innodb_bug48024 : MDEV-14352 - Assertion failure -innodb.innodb-index-debug : Modified in 10.0.34 -innodb.innodb-index-online : Modified in 10.0.34 +innodb.innodb_bug56947 : Modified in 10.0.35 +innodb.innodb_corrupt_bit : Modified in 10.0.35 innodb.innodb_monitor : MDEV-10939 - Testcase timeout -innodb.innodb-replace-debug : Added in 10.0.34 -innodb.innodb-wl5522-debug : Modified in 10.0.34 -innodb.recovery_shutdown : Added in 10.0.34 - +innodb.innodb-replace-debug : Modified in 10.0.35 +innodb.log_file_size : MDEV-15668 - Not found pattern; modified in 10.0.35 +innodb.mvcc : Added in 10.0.35 +innodb.read_only_recover_committed : Added in 10.0.35 +innodb.recovery_shutdown : MDEV-15671 - Warning: database page corruption; modified in 10.0.35 +innodb.xa_recovery : MDEV-15279 - mysqld got exception + +innodb_fts.innobase_drop_fts_index_table : Modified in 10.0.35 innodb_fts.innodb-fts-fic : MDEV-14154 - Assertion failure -innodb_fts.innodb_fts_misc_debug : MDEV-14156 - Unexpected warning - -innodb_zip.wl5522_debug_zip : Added in 10.0.34 +innodb_fts.innodb_fts_misc_debug : MDEV-14156 - Unexpected warning; modified in 10.0.35 +innodb_fts.innodb_fts_result_cache_limit : Modified in 10.0.35 #---------------------------------------------------------------- -maria.lock : Modified in 10.0.34 -maria.maria : MDEV-14430 - Wrong result; modified in 10.0.34 -maria.repair : Added in 10.0.34 +maria.dynamic : Added in 10.0.35 +maria.maria : MDEV-14430 - Wrong result #---------------------------------------------------------------- @@ -162,9 +178,9 @@ multi_source.status_vars : MDEV-4632 - failed while waiting for Slave_received_h #---------------------------------------------------------------- -parts.partition_alter_innodb : Added in 10.0.34 -parts.partition_alter_maria : Modified in 10.0.34 -parts.partition_alter_myisam : Added in 10.0.34 +parts.partition_alter_innodb : Include file modified in 10.0.35 +parts.partition_alter_maria : Modified in 10.0.35 +parts.partition_alter_myisam : Include file modified in 10.0.35 parts.partition_auto_increment_maria : MDEV-14430 - wrong result parts.partition_debug_innodb : MDEV-15095 - table does not exist parts.partition_exch_qa_10 : MDEV-11765 - wrong result @@ -182,14 +198,12 @@ perfschema_stress.* : MDEV-10996 - tests not maintained #---------------------------------------------------------------- plugins.feedback_plugin_send : MDEV-7932 - ssl failed for url, MDEV-11118 - wrong result -plugins.server_audit : MDEV-9562 - crashes on sol10-sparc; modified in 10.0.34 -plugins.thread_pool_server_audit : MDEV-9562 - crashes on sol10-sparc, MDEV-14295 - wrong result; modified in 10.0.34 +plugins.server_audit : MDEV-9562 - crashes on sol10-sparc; modified in 10.0.35 +plugins.thread_pool_server_audit : MDEV-9562 - crashes on sol10-sparc, MDEV-14295 - wrong result #---------------------------------------------------------------- roles.create_and_grant_role : MDEV-11772 - wrong result -roles.flush_roles-12366 : Added in 10.0.34 -roles.set_role-13655 : Added in 10.0.34 #---------------------------------------------------------------- @@ -233,7 +247,7 @@ spider/bg.direct_aggregate : MDEV-7098 - Trying to unlock mutex that wasn't spider/bg.direct_aggregate_part : MDEV-7098 - Trying to unlock mutex that wasn't locked spider/bg.spider3_fixes : MDEV-7098 - Trying to unlock mutex that wasn't locked spider/bg.spider_fixes_part : MDEV-7098 - Trying to unlock mutex that wasn't locked -spider/bg.ha : MDEV-7914, MDEV-9329 - Crash, failures on s390x +spider/bg.ha : MDEV-7914 (fixed in 10.3), MDEV-9329 - Crash, failures on s390x spider/bg.ha_part : MDEV-9329 - Fails on Ubuntu/s390x spider/bg.spider_fixes : MDEV-7098, MDEV-9329 - Mutex problem, failures on s390x spider/bg.vp_fixes : MDEV-9329 - Fails on Ubuntu/s390x @@ -253,15 +267,11 @@ stress.ddl_innodb : MDEV-10635 - Testcase timeout #---------------------------------------------------------------- sys_vars.autocommit_func2 : MDEV-9329 - Fails on Ubuntu/s390x -sys_vars.innodb_buffer_pool_dump_now_basic : Modified in 10.0.34 -sys_vars.innodb_buffer_pool_dump_pct_basic : Modified in 10.0.34 -sys_vars.innodb_buffer_pool_load_now_basic : Modified in 10.0.34 -sys_vars.innodb_print_lock_wait_timeout_info_basic : Added in 10.0.34 +sys_vars.max_prepared_stmt_count_basic : Modified in 10.0.35 sys_vars.thread_cache_size_func : MDEV-11775 - wrong result #---------------------------------------------------------------- -tokudb.card_scale_percent : Modified in 10.0.34 tokudb.change_column_all_1000_10 : MDEV-12640 - Lost connection during query tokudb.change_column_bin : MDEV-12640 - Lost connection during query tokudb.change_column_char : MDEV-12822 - Lost connection during query @@ -269,14 +279,12 @@ tokudb.cluster_filter_unpack_varchar : MDEV-10636 - Wrong execution plan tokudb.dir_per_db : MDEV-11537 - wrong result tokudb.dir_per_db_rename_to_nonexisting_schema : MDEV-12823 - Valgrind tokudb.hotindex-insert-bigchar : MDEV-13870 - ASAN failures +tokudb.hotindex-update-0 : MDEV-15198 - Timeout tokudb.hotindex-update-1 : MDEV-12640 - Lost connection during query -tokudb.locking-read-repeatable-read-1 : Added in 10.0.34 -tokudb.locking-read-repeatable-read-2 : Added in 10.0.34 tokudb.locks-select-update-1 : MDEV-13406 - Lock wait timeout -tokudb.nonflushing_analyze_debug : Added in 10.0.34 tokudb.rows-32m-rand-insert : MDEV-12640 - Lost connection during query tokudb.rows-32m-seq-insert : MDEV-12640 - Lost connection during query -tokudb.row_format : Modified in 10.0.34 +tokudb.savepoint-5 : MDEV-15280 - wrong result tokudb_backup.* : MDEV-11001 - tests don't work @@ -287,11 +295,6 @@ tokudb_bugs.frm_store2 : MDEV-12823 - Valgrind tokudb_bugs.frm_store3 : MDEV-12823 - Valgrind tokudb_bugs.xa : MDEV-11804 - Lock wait timeout -tokudb_parts.nonflushing_analyze_debug : Added in 10.0.34 - -tokudb_perfschema.crash_tokudb : Added in 10.0.34 -tokudb_perfschema.start_server_tokudb : Added in 10.0.34 - tokudb_rpl.* : MDEV-11001 - tests don't work tokudb_sys_vars.* : MDEV-11001 - tests don't work @@ -301,7 +304,7 @@ rpl-tokudb.* : MDEV-14354 - Tests fail with tcmalloc unit.lf : MDEV-12897 - Unexpected return code unit.ma_test_loghandler : MDEV-10638 - record read not ok -unit.pfs : MySQL:84457 - unittest pft-t failing +unit.my_atomic : MDEV-15670 - Signal 11 thrown #---------------------------------------------------------------- -- cgit v1.2.1 From fab383aac0a713b48765d0464428199470ae8c0a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 30 Apr 2018 23:06:09 +0200 Subject: Use after free in authentication --- mysql-test/r/connect_debug.result | 5 +++++ mysql-test/t/connect_debug.test | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 mysql-test/r/connect_debug.result create mode 100644 mysql-test/t/connect_debug.test (limited to 'mysql-test') diff --git a/mysql-test/r/connect_debug.result b/mysql-test/r/connect_debug.result new file mode 100644 index 00000000000..0452b238db9 --- /dev/null +++ b/mysql-test/r/connect_debug.result @@ -0,0 +1,5 @@ +set @old_dbug=@@global.debug_dbug; +set global debug_dbug='+d,auth_disconnect'; +create user 'bad' identified by 'worse'; +set global debug_dbug=@old_dbug; +drop user bad; diff --git a/mysql-test/t/connect_debug.test b/mysql-test/t/connect_debug.test new file mode 100644 index 00000000000..299b605b2cd --- /dev/null +++ b/mysql-test/t/connect_debug.test @@ -0,0 +1,12 @@ +source include/have_debug.inc; +set @old_dbug=@@global.debug_dbug; + +# +# use after free if need plugin change and auth aborted +# +set global debug_dbug='+d,auth_disconnect'; +create user 'bad' identified by 'worse'; +--error 1 +--exec $MYSQL --default-auth=mysql_old_password --user=bad --password=worse +set global debug_dbug=@old_dbug; +drop user bad; -- cgit v1.2.1