summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/r/alter_crash.result
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2020-05-25 21:42:26 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2020-05-26 12:44:33 +0530
commit7476e8c7cdd73d60294126a2840baee97e7644b6 (patch)
treec7647390d7e02cc899607233f30e01233b7c8494 /mysql-test/suite/innodb/r/alter_crash.result
parentecc7f305dde85d704a37e584c29df0ed3f97f7be (diff)
downloadmariadb-git-7476e8c7cdd73d60294126a2840baee97e7644b6.tar.gz
MDEV-22637 Rollback of insert fails when column reorder happens
- During column reorder table rebuild, rollback of insert fails. Reason is that InnoDB tries to fetch the column position from new clustered index and it exceeds default column value tuple fields. So InnoDB should use the table column position while searching for defaults column value.
Diffstat (limited to 'mysql-test/suite/innodb/r/alter_crash.result')
-rw-r--r--mysql-test/suite/innodb/r/alter_crash.result38
1 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/r/alter_crash.result b/mysql-test/suite/innodb/r/alter_crash.result
index cb9c17e45ea..70c2102ee0d 100644
--- a/mysql-test/suite/innodb/r/alter_crash.result
+++ b/mysql-test/suite/innodb/r/alter_crash.result
@@ -148,3 +148,41 @@ SELECT * FROM t1;
a b d
1 NULL NULL
DROP TABLE t1;
+#
+# MDEV-22637 Rollback of insert fails when column reorder happens
+#
+SET @@SQL_MODE = REPLACE(@@SQL_MODE, 'STRICT_TRANS_TABLES', '');
+SET @@SQL_MODE = REPLACE(@@SQL_MODE, 'STRICT_ALL_TABLES', '');
+CREATE TABLE t1(f1 INT NOT NULL, f2 CHAR(100),
+f3 CHAR(100), f4 CHAR(100))ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1, "This is column2", "This is column3",
+"This is column4");
+set DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL scanned WAIT_FOR insert_done';
+ALTER TABLE t1 ADD COLUMN f6 int after f3, add primary key(f6, f4(3), f3(3));
+connect con1,localhost,root,,;
+SET DEBUG_SYNC = 'now WAIT_FOR scanned';
+BEGIN;
+INSERT INTO t1(f1, f2) VALUES(2, "This is column2 value");
+ROLLBACK;
+set DEBUG_SYNC = 'now SIGNAL insert_done';
+connection default;
+Warnings:
+Warning 1265 Data truncated for column 'f3' at row 3
+Warning 1265 Data truncated for column 'f4' at row 3
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) NOT NULL,
+ `f2` char(100) DEFAULT NULL,
+ `f3` char(100) NOT NULL,
+ `f6` int(11) NOT NULL,
+ `f4` char(100) NOT NULL,
+ PRIMARY KEY (`f6`,`f4`(3),`f3`(3))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+disconnect con1;
+DROP TABLE t1;
+SET DEBUG_SYNC = 'RESET';
+SET SQL_MODE=DEFAULT;