diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:07:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:07:14 +0000 |
commit | a175314c3e5827eb193872241446f2f8f5c9d33c (patch) | |
tree | cd3d60ca99ae00829c52a6ca79150a5b6e62528b /mysql-test/suite/innodb/r/innodb-virtual-columns2.result | |
parent | Initial commit. (diff) | |
download | mariadb-10.5-a175314c3e5827eb193872241446f2f8f5c9d33c.tar.xz mariadb-10.5-a175314c3e5827eb193872241446f2f8f5c9d33c.zip |
Adding upstream version 1:10.5.12.upstream/1%10.5.12upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/innodb/r/innodb-virtual-columns2.result')
-rw-r--r-- | mysql-test/suite/innodb/r/innodb-virtual-columns2.result | 89 |
1 files changed, 89 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 new file mode 100644 index 00000000..99a1c610 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-virtual-columns2.result @@ -0,0 +1,89 @@ +CREATE TABLE t1 ( +y YEAR NULL, +i SMALLINT NULL, +c VARCHAR(8) NOT NULL DEFAULT '', +vi SMALLINT AS (i) VIRTUAL, +INDEX(y) +) ENGINE=InnoDB; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `y` year(4) DEFAULT NULL, + `i` smallint(6) DEFAULT NULL, + `c` varchar(8) NOT NULL DEFAULT '', + `vi` smallint(6) GENERATED ALWAYS AS (`i`) VIRTUAL, + KEY `y` (`y`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SELECT * FROM t1 WHERE y BETWEEN 2012 AND 2016 FOR UPDATE; +y i c vi +INSERT INTO t1 (i) VALUES (1),(2); +SELECT * FROM t1 WHERE y BETWEEN 2012 AND 2016 FOR UPDATE; +y i c vi +DROP TABLE t1; +CREATE TABLE t1 ( +y YEAR NULL, +i SMALLINT NULL, +vi SMALLINT AS (i) VIRTUAL, +INDEX(y) +) ENGINE=InnoDB; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `y` year(4) DEFAULT NULL, + `i` smallint(6) DEFAULT NULL, + `vi` smallint(6) GENERATED ALWAYS AS (`i`) VIRTUAL, + KEY `y` (`y`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SELECT * FROM t1 WHERE y BETWEEN 2012 AND 2016 FOR UPDATE; +y i vi +INSERT INTO t1 (i) VALUES (1),(2); +SELECT * FROM t1 WHERE y BETWEEN 2012 AND 2016 FOR UPDATE; +y i vi +DROP TABLE t1; +CREATE TABLE t1 ( +y YEAR NULL, +i SMALLINT NULL, +b BLOB NULL, +vi SMALLINT AS (i) VIRTUAL, +INDEX(y) +) ENGINE=InnoDB; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `y` year(4) DEFAULT NULL, + `i` smallint(6) DEFAULT NULL, + `b` blob DEFAULT NULL, + `vi` smallint(6) GENERATED ALWAYS AS (`i`) VIRTUAL, + KEY `y` (`y`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SELECT * FROM t1 WHERE y BETWEEN 2012 AND 2016 FOR UPDATE; +y i b vi +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; |