diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-05-05 10:23:14 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-05-05 10:23:14 +0300 |
commit | b132b8895e2e59df457e063451f186b53576b034 (patch) | |
tree | 565a5529facdca326b36d4418fae3522d8715e02 /mysql-test | |
parent | 27980b0f83529725435dc8f37cb51878eb074d1d (diff) | |
parent | 4d59f45260547b3230f177498b6fa07a12647fdc (diff) | |
download | mariadb-git-b132b8895e2e59df457e063451f186b53576b034.tar.gz |
Merge 10.3 into 10.4
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/main/multi_update_innodb.result | 40 | ||||
-rw-r--r-- | mysql-test/main/multi_update_innodb.test | 49 | ||||
-rw-r--r-- | mysql-test/std_data/frm/mdev16518.frm | bin | 0 -> 8619 bytes | |||
-rw-r--r-- | mysql-test/suite/binlog/r/flashback.result | 18 | ||||
-rw-r--r-- | mysql-test/suite/binlog/t/flashback.test | 30 | ||||
-rw-r--r-- | mysql-test/suite/gcol/r/innodb_virtual_debug.result | 30 | ||||
-rw-r--r-- | mysql-test/suite/gcol/t/innodb_virtual_debug.test | 34 | ||||
-rw-r--r-- | mysql-test/suite/rpl/r/rpl_row_big_table_id.result | 12 | ||||
-rw-r--r-- | mysql-test/suite/vcol/r/vcol_keys_myisam.result | 25 | ||||
-rw-r--r-- | mysql-test/suite/vcol/r/vcol_misc.result | 16 | ||||
-rw-r--r-- | mysql-test/suite/vcol/t/vcol_keys_myisam.test | 28 | ||||
-rw-r--r-- | mysql-test/suite/vcol/t/vcol_misc.test | 23 |
12 files changed, 297 insertions, 8 deletions
diff --git a/mysql-test/main/multi_update_innodb.result b/mysql-test/main/multi_update_innodb.result index 5890fd24f5f..294ebfcebdf 100644 --- a/mysql-test/main/multi_update_innodb.result +++ b/mysql-test/main/multi_update_innodb.result @@ -151,3 +151,43 @@ create table t2 like t1; insert into t2 select * from t1; delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b; drop table t1,t2; +# +# MDEV-16240: Assertion `0' failed in +# row_sel_convert_mysql_key_to_innobase +# +SET @save_sql_mode=@@sql_mode; +set sql_mode=''; +CREATE TABLE `t3` ( +`f1` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(), +`f2` datetime DEFAULT '2000-01-01 00:00:00' ON UPDATE current_timestamp(), +`f3` TIMESTAMP NULL DEFAULT '2000-01-01 00:00:00', +`pk` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', +`f4` datetime DEFAULT current_timestamp(), +PRIMARY KEY (`pk`), +UNIQUE KEY `f2k` (`f2`), +KEY `f4k` (`f4`) +) ENGINE=InnoDB; +INSERT INTO `t3` VALUES ('2018-05-18 15:08:07','2018-05-18 17:08:07','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00'),('0000-00-00 00:00:00','0000-00-00 00:00:00','1999-12-31 23:00:00','2002-07-03 23:04:40','0000-00-00 00:00:00'); +CREATE VIEW `v1` AS +SELECT `t3`.`pk` AS `pk`, +`t3`.`f3` AS `f3`, +`t3`.`f4` AS `f4`, +`t3`.`f2` AS `f2`, +`t3`.`f1` AS `f1` +FROM `t3`; +CREATE TABLE `t4` ( +`f1` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(), +`f3` timestamp NULL DEFAULT NULL, +`f2` timestamp NULL DEFAULT '1999-12-31 23:00:00' ON UPDATE current_timestamp(), +`pk` int(11) NOT NULL, +`f4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), +PRIMARY KEY (`pk`) +) ENGINE=InnoDB; +INSERT INTO `t4` VALUES ('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,1,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,3,'2018-05-18 15:08:06'),('0000-00-00 00:00:00','0000-00-00 00:00:00',NULL,1976,'0000-00-00 00:00:00'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2000,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2001,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2002,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2003,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2004,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','2018-05-18 15:08:06',2005,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','2018-05-18 15:08:06',2018,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','2018-05-18 15:08:06',2019,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','2018-05-18 15:08:06',2024,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','1999-12-31 23:00:00',2025,'2018-05-18 15:08:06'),('0000-00-00 00:00:00',NULL,'2018-05-18 15:08:06',2026,'2018-05-18 15:08:06'),('2018-05-18 17:08:07','0000-00-00 00:00:00','0000-00-00 00:00:00',2027,'0000-00-00 00:00:00'); +UPDATE `v1` t1, `t4` t2 +SET t1.`f2` = 6452736 WHERE t1.`f4` = 6272000; +ERROR 23000: Duplicate entry '0000-00-00 00:00:00' for key 'f2k' +DROP VIEW v1; +DROP TABLE t3,t4; +SET @@sql_mode=@save_sql_mode; +# End of 10.2 tests diff --git a/mysql-test/main/multi_update_innodb.test b/mysql-test/main/multi_update_innodb.test index f5f8f91edb8..2e46ee06d4d 100644 --- a/mysql-test/main/multi_update_innodb.test +++ b/mysql-test/main/multi_update_innodb.test @@ -173,3 +173,52 @@ delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b; drop table t1,t2; +--echo # +--echo # MDEV-16240: Assertion `0' failed in +--echo # row_sel_convert_mysql_key_to_innobase +--echo # + +SET @save_sql_mode=@@sql_mode; +set sql_mode=''; + +CREATE TABLE `t3` ( + `f1` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(), + `f2` datetime DEFAULT '2000-01-01 00:00:00' ON UPDATE current_timestamp(), + `f3` TIMESTAMP NULL DEFAULT '2000-01-01 00:00:00', + `pk` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `f4` datetime DEFAULT current_timestamp(), + PRIMARY KEY (`pk`), + UNIQUE KEY `f2k` (`f2`), + KEY `f4k` (`f4`) + ) ENGINE=InnoDB; + +INSERT INTO `t3` VALUES ('2018-05-18 15:08:07','2018-05-18 17:08:07','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00'),('0000-00-00 00:00:00','0000-00-00 00:00:00','1999-12-31 23:00:00','2002-07-03 23:04:40','0000-00-00 00:00:00'); + +CREATE VIEW `v1` AS +SELECT `t3`.`pk` AS `pk`, + `t3`.`f3` AS `f3`, + `t3`.`f4` AS `f4`, + `t3`.`f2` AS `f2`, + `t3`.`f1` AS `f1` +FROM `t3`; + +CREATE TABLE `t4` ( + `f1` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `f3` timestamp NULL DEFAULT NULL, + `f2` timestamp NULL DEFAULT '1999-12-31 23:00:00' ON UPDATE current_timestamp(), + `pk` int(11) NOT NULL, + `f4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + PRIMARY KEY (`pk`) +) ENGINE=InnoDB; + +INSERT INTO `t4` VALUES ('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,1,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,3,'2018-05-18 15:08:06'),('0000-00-00 00:00:00','0000-00-00 00:00:00',NULL,1976,'0000-00-00 00:00:00'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2000,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2001,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2002,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2003,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2004,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','2018-05-18 15:08:06',2005,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','2018-05-18 15:08:06',2018,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','2018-05-18 15:08:06',2019,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','2018-05-18 15:08:06',2024,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','1999-12-31 23:00:00',2025,'2018-05-18 15:08:06'),('0000-00-00 00:00:00',NULL,'2018-05-18 15:08:06',2026,'2018-05-18 15:08:06'),('2018-05-18 17:08:07','0000-00-00 00:00:00','0000-00-00 00:00:00',2027,'0000-00-00 00:00:00'); + +--error ER_DUP_ENTRY +UPDATE `v1` t1, `t4` t2 +SET t1.`f2` = 6452736 WHERE t1.`f4` = 6272000; + +DROP VIEW v1; +DROP TABLE t3,t4; +SET @@sql_mode=@save_sql_mode; + +--echo # End of 10.2 tests diff --git a/mysql-test/std_data/frm/mdev16518.frm b/mysql-test/std_data/frm/mdev16518.frm Binary files differnew file mode 100644 index 00000000000..72a4c41f0b4 --- /dev/null +++ b/mysql-test/std_data/frm/mdev16518.frm diff --git a/mysql-test/suite/binlog/r/flashback.result b/mysql-test/suite/binlog/r/flashback.result index 24c9b735fe5..05143a98381 100644 --- a/mysql-test/suite/binlog/r/flashback.result +++ b/mysql-test/suite/binlog/r/flashback.result @@ -684,6 +684,24 @@ world.city 563256876 DROP TABLE test.test; DROP TABLE world.city; DROP DATABASE world; +# < CASE 7 > +# Test Case for MDEV-17260 +# +RESET MASTER; +CREATE TABLE t1 ( f INT PRIMARY KEY ) ENGINE=innodb; +INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6); +# 6- Rows must be present +SELECT COUNT(*) FROM t1; +COUNT(*) +6 +FLUSH LOGS; +DELETE FROM t1; +FLUSH LOGS; +# 0- Rows must be present +include/assert.inc [Table t1 should have 0 rows.] +# 6- Rows must be present upon restoring from flashback +include/assert.inc [Table t1 should have six rows.] +DROP TABLE t1; SET binlog_format=statement; Warnings: Warning 1105 MariaDB Galera and flashback do not support binlog format: STATEMENT diff --git a/mysql-test/suite/binlog/t/flashback.test b/mysql-test/suite/binlog/t/flashback.test index 3fc8c44c60c..9782fa4ec83 100644 --- a/mysql-test/suite/binlog/t/flashback.test +++ b/mysql-test/suite/binlog/t/flashback.test @@ -335,8 +335,36 @@ DROP TABLE test.test; DROP TABLE world.city; DROP DATABASE world; -## Clear +--echo # < CASE 7 > +--echo # Test Case for MDEV-17260 +--echo # + +RESET MASTER; + +CREATE TABLE t1 ( f INT PRIMARY KEY ) ENGINE=innodb; +INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6); +--echo # 6- Rows must be present +SELECT COUNT(*) FROM t1; +FLUSH LOGS; +DELETE FROM t1; +FLUSH LOGS; +--echo # 0- Rows must be present +--let $assert_cond= COUNT(*) = 0 FROM t1 +--let $assert_text= Table t1 should have 0 rows. +--source include/assert.inc + +--exec $MYSQL_BINLOG -vv -B --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002> $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback_7.sql +--exec $MYSQL -e "SET binlog_format= ROW; source $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback_7.sql;" + +--echo # 6- Rows must be present upon restoring from flashback +--let $assert_cond= COUNT(*) = 6 FROM t1 +--let $assert_text= Table t1 should have six rows. +--source include/assert.inc + +DROP TABLE t1; + +## Clear SET binlog_format=statement; --error ER_FLASHBACK_NOT_SUPPORTED SET GLOBAL binlog_format=statement; diff --git a/mysql-test/suite/gcol/r/innodb_virtual_debug.result b/mysql-test/suite/gcol/r/innodb_virtual_debug.result index 50b714566d9..806cf1a98c8 100644 --- a/mysql-test/suite/gcol/r/innodb_virtual_debug.result +++ b/mysql-test/suite/gcol/r/innodb_virtual_debug.result @@ -94,3 +94,33 @@ NULL 29 DROP TABLE t; SET DEBUG_SYNC = 'RESET'; +# +# Bug#28825718 - ASSERTION FAILURE: TRX0REC.CC:NNN:N_IDX > 0 WHILE DOING REPLACE/INSERT +# +CREATE TABLE t1(a INT PRIMARY KEY, b INT, c INT GENERATED ALWAYS AS(b+1) VIRTUAL) ENGINE=InnoDB; +INSERT INTO t1(a, b) VALUES(1, 1); +connect con1,localhost,root,,; +SET DEBUG_SYNC = 'row_log_apply_after SIGNAL s1 WAIT_FOR s2'; +SET lock_wait_timeout = 1; +ALTER TABLE t1 ADD UNIQUE INDEX(c, b); +connection default; +SET DEBUG_SYNC = 'now WAIT_FOR s1'; +SET DEBUG_SYNC = 'row_ins_sec_index_enter SIGNAL s2 WAIT_FOR s3'; +INSERT INTO t1(a, b) VALUES(2, 2); +connection con1; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +SET DEBUG_SYNC = 'now SIGNAL s3'; +disconnect con1; +connection default; +SET DEBUG_SYNC = 'RESET'; +ALTER TABLE t1 ADD KEY(b); +INSERT INTO t1(a, b) VALUES(3, 3); +SELECT * FROM t1; +a b c +1 1 2 +2 2 3 +3 3 4 +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; diff --git a/mysql-test/suite/gcol/t/innodb_virtual_debug.test b/mysql-test/suite/gcol/t/innodb_virtual_debug.test index ccdd16c9ebe..40446b991cd 100644 --- a/mysql-test/suite/gcol/t/innodb_virtual_debug.test +++ b/mysql-test/suite/gcol/t/innodb_virtual_debug.test @@ -60,7 +60,6 @@ SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL start_create WAIT_FOR --send ALTER TABLE t FORCE connection con1; - SET DEBUG_SYNC = 'now WAIT_FOR start_create'; start transaction; update t set a=1 where a = 0; @@ -280,4 +279,37 @@ disconnect con1; } SET DEBUG_SYNC = 'RESET'; + +--echo # +--echo # Bug#28825718 - ASSERTION FAILURE: TRX0REC.CC:NNN:N_IDX > 0 WHILE DOING REPLACE/INSERT +--echo # + +CREATE TABLE t1(a INT PRIMARY KEY, b INT, c INT GENERATED ALWAYS AS(b+1) VIRTUAL) ENGINE=InnoDB; + +INSERT INTO t1(a, b) VALUES(1, 1); + +connect (con1,localhost,root,,); +SET DEBUG_SYNC = 'row_log_apply_after SIGNAL s1 WAIT_FOR s2'; +SET lock_wait_timeout = 1; +--send ALTER TABLE t1 ADD UNIQUE INDEX(c, b) + +connection default; +SET DEBUG_SYNC = 'now WAIT_FOR s1'; +SET DEBUG_SYNC = 'row_ins_sec_index_enter SIGNAL s2 WAIT_FOR s3'; +--send INSERT INTO t1(a, b) VALUES(2, 2) + +connection con1; +--error ER_LOCK_WAIT_TIMEOUT +reap; +SET DEBUG_SYNC = 'now SIGNAL s3'; +disconnect con1; +connection default; +reap; +SET DEBUG_SYNC = 'RESET'; +ALTER TABLE t1 ADD KEY(b); +INSERT INTO t1(a, b) VALUES(3, 3); +SELECT * FROM t1; +CHECK TABLE t1; +DROP TABLE t1; + --source include/wait_until_count_sessions.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_big_table_id.result b/mysql-test/suite/rpl/r/rpl_row_big_table_id.result index 6fece52dda3..7a0a964dc5e 100644 --- a/mysql-test/suite/rpl/r/rpl_row_big_table_id.result +++ b/mysql-test/suite/rpl/r/rpl_row_big_table_id.result @@ -22,22 +22,22 @@ master-bin.000002 # Gtid 1 # GTID #-#-# master-bin.000002 # Query 1 # use `test`; ALTER TABLE t comment '' master-bin.000002 # Gtid 1 # BEGIN GTID #-#-# master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 1 -master-bin.000002 # Table_map 1 # table_id: 4294967295 (test.t) -master-bin.000002 # Write_rows_v1 1 # table_id: 4294967295 flags: STMT_END_F +master-bin.000002 # Table_map 1 # table_id: 4294967298 (test.t) +master-bin.000002 # Write_rows_v1 1 # table_id: 4294967298 flags: STMT_END_F master-bin.000002 # Query 1 # COMMIT master-bin.000002 # Gtid 1 # GTID #-#-# master-bin.000002 # Query 1 # use `test`; ALTER TABLE t comment '' master-bin.000002 # Gtid 1 # BEGIN GTID #-#-# master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 2 -master-bin.000002 # Table_map 1 # table_id: 4294967296 (test.t) -master-bin.000002 # Write_rows_v1 1 # table_id: 4294967296 flags: STMT_END_F +master-bin.000002 # Table_map 1 # table_id: 4294967299 (test.t) +master-bin.000002 # Write_rows_v1 1 # table_id: 4294967299 flags: STMT_END_F master-bin.000002 # Query 1 # COMMIT master-bin.000002 # Gtid 1 # GTID #-#-# master-bin.000002 # Query 1 # use `test`; ALTER TABLE t comment '' master-bin.000002 # Gtid 1 # BEGIN GTID #-#-# master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 3 -master-bin.000002 # Table_map 1 # table_id: 4294967297 (test.t) -master-bin.000002 # Write_rows_v1 1 # table_id: 4294967297 flags: STMT_END_F +master-bin.000002 # Table_map 1 # table_id: 4294967300 (test.t) +master-bin.000002 # Write_rows_v1 1 # table_id: 4294967300 flags: STMT_END_F master-bin.000002 # Query 1 # COMMIT connection slave; connection master; diff --git a/mysql-test/suite/vcol/r/vcol_keys_myisam.result b/mysql-test/suite/vcol/r/vcol_keys_myisam.result index a2613e0dfa1..9400127211c 100644 --- a/mysql-test/suite/vcol/r/vcol_keys_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_keys_myisam.result @@ -384,3 +384,28 @@ select * from t1; id hexid 100 64 drop table t1; +# +# MDEV-15881 Assertion `is_valid_value_slow()' failed in Datetime::Datetime or corrupt data after ALTER with indexed persistent column +# +CREATE TABLE t1 (i INT, d1 DATE, d2 DATE NOT NULL, t TIMESTAMP, KEY(t)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,'2023-03-16','2023-03-15','2012-12-12 12:12:12'); +ALTER TABLE t1 MODIFY t FLOAT AS (i) PERSISTENT; +SELECT i, d1, d2 INTO OUTFILE 'load_t1' FROM t1; +DELETE FROM t1; +LOAD DATA INFILE 'load_t1' INTO TABLE t1 (i,d1,d2); +SELECT * FROM t1 WHERE d2 < d1; +i d1 d2 t +1 2023-03-16 2023-03-15 1 +DROP TABLE t1; +CREATE TABLE t1 ( +i INT DEFAULT NULL, +d1 DATE DEFAULT NULL, +d2 DATE NOT NULL, +t FLOAT GENERATED ALWAYS AS (i) STORED, +KEY (t) +) ENGINE=MyISAM; +LOAD DATA INFILE 'load_t1' INTO TABLE t1 (i,d1,d2); +SELECT * FROM t1 WHERE d2 < d1; +i d1 d2 t +1 2023-03-16 2023-03-15 1 +DROP TABLE t1; diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result index 7d6bb0b3195..c3321872a45 100644 --- a/mysql-test/suite/vcol/r/vcol_misc.result +++ b/mysql-test/suite/vcol/r/vcol_misc.result @@ -429,3 +429,19 @@ Warning 1918 Encountered illegal value '\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7' when c # # End of 10.1 tests # +# +# Start of 10.2 tests +# +# +# MDEV-16518 MYSQL57_GENERATED_FIELD: The code in TABLE_SHARE::init_from_binary_frm_image() is not safe +# +SHOW TABLES; +Tables_in_test +t1 +SHOW CREATE TABLE t1; +ERROR HY000: Incorrect information in file: './test/t1.frm' +ALTER TABLE t1; +ERROR HY000: Incorrect information in file: './test/t1.frm' +# +# End of 10.2 tests +# diff --git a/mysql-test/suite/vcol/t/vcol_keys_myisam.test b/mysql-test/suite/vcol/t/vcol_keys_myisam.test index 3269979fc9e..86fb8aecbe2 100644 --- a/mysql-test/suite/vcol/t/vcol_keys_myisam.test +++ b/mysql-test/suite/vcol/t/vcol_keys_myisam.test @@ -272,3 +272,31 @@ create table t1 ( id int primary key, insert into t1 (id) select 100; select * from t1; drop table t1; + + +--echo # +--echo # MDEV-15881 Assertion `is_valid_value_slow()' failed in Datetime::Datetime or corrupt data after ALTER with indexed persistent column +--echo # + +CREATE TABLE t1 (i INT, d1 DATE, d2 DATE NOT NULL, t TIMESTAMP, KEY(t)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,'2023-03-16','2023-03-15','2012-12-12 12:12:12'); +ALTER TABLE t1 MODIFY t FLOAT AS (i) PERSISTENT; +SELECT i, d1, d2 INTO OUTFILE 'load_t1' FROM t1; +DELETE FROM t1; +LOAD DATA INFILE 'load_t1' INTO TABLE t1 (i,d1,d2); +SELECT * FROM t1 WHERE d2 < d1; +DROP TABLE t1; + +CREATE TABLE t1 ( + i INT DEFAULT NULL, + d1 DATE DEFAULT NULL, + d2 DATE NOT NULL, + t FLOAT GENERATED ALWAYS AS (i) STORED, + KEY (t) +) ENGINE=MyISAM; +LOAD DATA INFILE 'load_t1' INTO TABLE t1 (i,d1,d2); +SELECT * FROM t1 WHERE d2 < d1; +DROP TABLE t1; +# Cleanup +--let $datadir= `SELECT @@datadir` +--remove_file $datadir/test/load_t1 diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test index 95b707e3e12..4e6bd169b7d 100644 --- a/mysql-test/suite/vcol/t/vcol_misc.test +++ b/mysql-test/suite/vcol/t/vcol_misc.test @@ -388,3 +388,26 @@ SELECT COLUMN_GET(@aaa, 'price' AS DOUBLE) aaa; --echo # --echo # End of 10.1 tests --echo # + + +--echo # +--echo # Start of 10.2 tests +--echo # + +--echo # +--echo # MDEV-16518 MYSQL57_GENERATED_FIELD: The code in TABLE_SHARE::init_from_binary_frm_image() is not safe +--echo # + +--copy_file std_data/frm/mdev16518.frm $MYSQLD_DATADIR/test/t1.frm +SHOW TABLES; +--replace_result $MYSQLD_DATADIR ./ +--error ER_NOT_FORM_FILE +SHOW CREATE TABLE t1; +--replace_result $MYSQLD_DATADIR ./ +--error ER_NOT_FORM_FILE +ALTER TABLE t1; +--remove_file $MYSQLD_DATADIR/test/t1.frm + +--echo # +--echo # End of 10.2 tests +--echo # |