mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Merge branch '10.2' into bb-10.2-ext
This commit is contained in:
@@ -921,90 +921,6 @@ alter table t add unique index (c(39));
|
||||
replace into t set a = 'a',b =1;
|
||||
replace into t set a = 'a',b =1;
|
||||
drop table t;
|
||||
CREATE TABLE t (a INT, b INT, h VARCHAR(10));
|
||||
INSERT INTO t VALUES (12, 3, "ss");
|
||||
INSERT INTO t VALUES (13, 4, "ss");
|
||||
INSERT INTO t VALUES (14, 0, "ss");
|
||||
alter table t add c INT GENERATED ALWAYS AS(a/b);
|
||||
create index idx on t(c);
|
||||
Warnings:
|
||||
Warning 1365 Division by 0
|
||||
DROP TABLE t;
|
||||
CREATE TABLE t (
|
||||
pk INTEGER AUTO_INCREMENT,
|
||||
col_int_nokey INTEGER /*! NULL */,
|
||||
col_int INT GENERATED ALWAYS AS (col_int_nokey + col_int_nokey) STORED,
|
||||
col_int_key INTEGER GENERATED ALWAYS AS (col_int + col_int_nokey) VIRTUAL,
|
||||
col_date_nokey DATE /*! NULL */,
|
||||
col_date DATE GENERATED ALWAYS AS (DATE_ADD(col_date_nokey,interval 30 day)) STORED,
|
||||
col_date_key DATE GENERATED ALWAYS AS (DATE_ADD(col_date,interval 30 day)) VIRTUAL,
|
||||
col_datetime_nokey DATETIME /*! NULL */,
|
||||
col_time_nokey TIME /*! NULL */,
|
||||
col_datetime DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) STORED,
|
||||
col_time TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) STORED,
|
||||
col_datetime_key DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime, col_time_nokey)) VIRTUAL,
|
||||
col_time_key TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time)) VIRTUAL,
|
||||
col_varchar_nokey VARCHAR(1) /*! NULL */,
|
||||
col_varchar VARCHAR(2) GENERATED ALWAYS AS (CONCAT(col_varchar_nokey,col_varchar_nokey)) STORED,
|
||||
col_varchar_key VARCHAR(2) GENERATED ALWAYS AS (CONCAT(col_varchar, 'x')) VIRTUAL,
|
||||
unique KEY (pk,col_int_key),
|
||||
KEY(col_int),
|
||||
KEY(col_date),
|
||||
KEY(col_datetime),
|
||||
KEY(col_time),
|
||||
KEY(col_varchar),
|
||||
UNIQUE KEY (col_int_key),
|
||||
KEY (col_time_key),
|
||||
KEY (col_datetime_key),
|
||||
UNIQUE KEY (col_int_key, col_varchar_key),
|
||||
KEY (col_int_key, col_int_nokey),
|
||||
KEY(col_int_key,col_date_key),
|
||||
KEY(col_int_key, col_time_key),
|
||||
KEY(col_int_key, col_datetime_key),
|
||||
KEY(col_date_key,col_time_key,col_datetime_key),
|
||||
KEY (col_varchar_key, col_varchar_nokey),
|
||||
UNIQUE KEY (col_int_key, col_varchar_key, col_date_key, col_time_key, col_datetime_key)
|
||||
) AUTO_INCREMENT=10 ENGINE=INNODB PARTITION BY KEY(col_int_key) PARTITIONS 3;
|
||||
ALTER TABLE t DROP COLUMN `pk`;
|
||||
SHOW CREATE TABLE t;
|
||||
Table Create Table
|
||||
t CREATE TABLE `t` (
|
||||
`col_int_nokey` int(11) DEFAULT NULL,
|
||||
`col_int` int(11) GENERATED ALWAYS AS (`col_int_nokey` + `col_int_nokey`) STORED,
|
||||
`col_int_key` int(11) GENERATED ALWAYS AS (`col_int` + `col_int_nokey`) VIRTUAL,
|
||||
`col_date_nokey` date DEFAULT NULL,
|
||||
`col_date` date GENERATED ALWAYS AS (`col_date_nokey` + interval 30 day) STORED,
|
||||
`col_date_key` date GENERATED ALWAYS AS (`col_date` + interval 30 day) VIRTUAL,
|
||||
`col_datetime_nokey` datetime DEFAULT NULL,
|
||||
`col_time_nokey` time DEFAULT NULL,
|
||||
`col_datetime` datetime GENERATED ALWAYS AS (addtime(`col_datetime_nokey`,`col_time_nokey`)) STORED,
|
||||
`col_time` time GENERATED ALWAYS AS (addtime(`col_datetime_nokey`,`col_time_nokey`)) STORED,
|
||||
`col_datetime_key` datetime GENERATED ALWAYS AS (addtime(`col_datetime`,`col_time_nokey`)) VIRTUAL,
|
||||
`col_time_key` time GENERATED ALWAYS AS (addtime(`col_datetime_nokey`,`col_time`)) VIRTUAL,
|
||||
`col_varchar_nokey` varchar(1) DEFAULT NULL,
|
||||
`col_varchar` varchar(2) GENERATED ALWAYS AS (concat(`col_varchar_nokey`,`col_varchar_nokey`)) STORED,
|
||||
`col_varchar_key` varchar(2) GENERATED ALWAYS AS (concat(`col_varchar`,'x')) VIRTUAL,
|
||||
UNIQUE KEY `pk` (`col_int_key`),
|
||||
UNIQUE KEY `col_int_key` (`col_int_key`),
|
||||
UNIQUE KEY `col_int_key_2` (`col_int_key`,`col_varchar_key`),
|
||||
UNIQUE KEY `col_int_key_7` (`col_int_key`,`col_varchar_key`,`col_date_key`,`col_time_key`,`col_datetime_key`),
|
||||
KEY `col_int` (`col_int`),
|
||||
KEY `col_date` (`col_date`),
|
||||
KEY `col_datetime` (`col_datetime`),
|
||||
KEY `col_time` (`col_time`),
|
||||
KEY `col_varchar` (`col_varchar`),
|
||||
KEY `col_time_key` (`col_time_key`),
|
||||
KEY `col_datetime_key` (`col_datetime_key`),
|
||||
KEY `col_int_key_3` (`col_int_key`,`col_int_nokey`),
|
||||
KEY `col_int_key_4` (`col_int_key`,`col_date_key`),
|
||||
KEY `col_int_key_5` (`col_int_key`,`col_time_key`),
|
||||
KEY `col_int_key_6` (`col_int_key`,`col_datetime_key`),
|
||||
KEY `col_date_key` (`col_date_key`,`col_time_key`,`col_datetime_key`),
|
||||
KEY `col_varchar_key` (`col_varchar_key`,`col_varchar_nokey`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
PARTITION BY KEY (`col_int_key`)
|
||||
PARTITIONS 3
|
||||
DROP TABLE t;
|
||||
CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10));
|
||||
INSERT INTO t VALUES (11, 3, DEFAULT, 'mm');
|
||||
INSERT INTO t VALUES (18, 1, DEFAULT, 'mm');
|
||||
|
Reference in New Issue
Block a user