summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/r/innodb-virtual-columns2.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/innodb/r/innodb-virtual-columns2.result')
-rw-r--r--mysql-test/suite/innodb/r/innodb-virtual-columns2.result25
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/r/innodb-virtual-columns2.result b/mysql-test/suite/innodb/r/innodb-virtual-columns2.result
index 3574ba72849..99a1c610bd3 100644
--- a/mysql-test/suite/innodb/r/innodb-virtual-columns2.result
+++ b/mysql-test/suite/innodb/r/innodb-virtual-columns2.result
@@ -62,3 +62,28 @@ INSERT INTO t1 (i) VALUES (1),(2);
SELECT * FROM t1 WHERE y BETWEEN 2012 AND 2016 FOR UPDATE;
y i b vi
DROP TABLE t1;
+#
+# MDEV-23632 ALTER TABLE...ADD KEY creates corrupted index on virtual column
+#
+CREATE TABLE t1(a INT PRIMARY KEY, b INT, g INT GENERATED ALWAYS AS(b)VIRTUAL) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,1,default);
+ALTER TABLE t1 ADD COLUMN c INT;
+ALTER TABLE t1 ADD KEY(g);
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+SELECT g FROM t1 FORCE INDEX (g);
+g
+1
+DROP TABLE t1;
+CREATE TABLE t1(a INT, b INT, g INT GENERATED ALWAYS AS(b)VIRTUAL) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,1,default);
+ALTER TABLE t1 ADD COLUMN c INT PRIMARY KEY;
+ALTER TABLE t1 ADD KEY(g);
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+SELECT g FROM t1 FORCE INDEX (g);
+g
+1
+DROP TABLE t1;