| 1 |
set @@sql_mode=strict_trans_tables; |
| 2 |
create table t1(a text not null) row_format=dynamic engine=innodb; |
| 3 |
create index idx1 on t1(a(3073)); |
| 4 |
Warnings: |
| 5 |
Note 1071 Specified key was too long; max key length is 3072 bytes |
| 6 |
show create table t1; |
| 7 |
Table Create Table |
| 8 |
t1 CREATE TABLE `t1` ( |
| 9 |
`a` text NOT NULL, |
| 10 |
KEY `idx1` (`a`(768)) |
| 11 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci ROW_FORMAT=DYNAMIC |
| 12 |
drop table t1; |
| 13 |
set @@sql_mode=default; |
| 14 |
create table t1 ( |
| 15 |
id1 int(11) not null auto_increment, |
| 16 |
id2 varchar(30) not null, |
| 17 |
id3 datetime not null default current_timestamp, |
| 18 |
primary key (id1), |
| 19 |
unique key unique_id2 (id2) |
| 20 |
) engine=innodb; |
| 21 |
alter table t1 change column id2 id4 varchar(100) not null; |
| 22 |
select * from t1 where id4 like 'a'; |
| 23 |
id1 id4 id3 |
| 24 |
drop table t1; |
| 25 |
# |
| 26 |
# MDEV-17725 Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed in Diagnostics_area::set_ok_status upon ALTER failing due to error from engine |
| 27 |
# |
| 28 |
SET sql_mode=STRICT_ALL_TABLES; |
| 29 |
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB; |
| 30 |
ALTER TABLE t1 ORDER BY a; |
| 31 |
Warnings: |
| 32 |
Warning 1105 ORDER BY ignored as there is a user-defined clustered index in the table 't1' |
| 33 |
DROP TABLE t1; |
| 34 |
SET sql_mode=''; |
| 35 |
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB; |
| 36 |
ALTER TABLE t1 ORDER BY a; |
| 37 |
Warnings: |
| 38 |
Warning 1105 ORDER BY ignored as there is a user-defined clustered index in the table 't1' |
| 39 |
DROP TABLE t1; |
| 40 |
SET sql_mode=DEFAULT; |
| 41 |
# |
| 42 |
# MDEV-18775 Server crashes in dict_table_t::instant_column |
| 43 |
# upon ADD COLUMN |
| 44 |
# |
| 45 |
CREATE TABLE tx (pk INT PRIMARY KEY) ENGINE=InnoDB; |
| 46 |
CREATE TABLE t1 (pk INT, a INT, PRIMARY KEY (pk), KEY (a), FOREIGN KEY (a) REFERENCES tx (pk)) ENGINE=InnoDB; |
| 47 |
SET FOREIGN_KEY_CHECKS=OFF; |
| 48 |
ALTER TABLE t1 DROP a; |
| 49 |
ERROR HY000: Cannot drop column 'a': needed in a foreign key constraint 'test/t1_ibfk_1' |
| 50 |
SET FOREIGN_KEY_CHECKS=ON; |
| 51 |
ALTER TABLE t1 ADD b INT; |
| 52 |
ALTER TABLE t1 DROP a; |
| 53 |
ERROR HY000: Cannot drop index 'a': needed in a foreign key constraint |
| 54 |
ALTER TABLE t1 ADD c INT; |
| 55 |
DROP TABLE t1, tx; |
| 56 |
# |
| 57 |
# MDEV-14119 Assertion cmp_rec_rec() on ALTER TABLE |
| 58 |
# |
| 59 |
CREATE TABLE t1(a INT NOT NULL UNIQUE) ENGINE=InnoDB; |
| 60 |
INSERT INTO t1 SELECT * FROM seq_1_to_128; |
| 61 |
ALTER TABLE t1 ADD b TINYINT AUTO_INCREMENT PRIMARY KEY, DROP KEY a; |
| 62 |
DROP TABLE t1; |
| 63 |
# |
| 64 |
# MDEV-22939 Server crashes in row_make_new_pathname() |
| 65 |
# |
| 66 |
CREATE TABLE t (a INT) ENGINE=INNODB; |
| 67 |
ALTER TABLE t DISCARD TABLESPACE; |
| 68 |
ALTER TABLE t ENGINE INNODB; |
| 69 |
ERROR HY000: Tablespace has been discarded for table `t` |
| 70 |
ALTER TABLE t FORCE; |
| 71 |
ERROR HY000: Tablespace has been discarded for table `t` |
| 72 |
DROP TABLE t; |
| 73 |
# |
| 74 |
# MDEV-24763 ALTER TABLE fails to rename a column in SYS_FIELDS |
| 75 |
# |
| 76 |
CREATE TABLE t1 (a INT, b TEXT, c INT, PRIMARY KEY(b(9)), INDEX(c,a)) |
| 77 |
ENGINE=InnoDB; |
| 78 |
ALTER TABLE t1 CHANGE COLUMN a u INT; |
| 79 |
SELECT sf.* FROM information_schema.innodb_sys_fields sf |
| 80 |
INNER JOIN information_schema.innodb_sys_indexes si ON sf.index_id=si.index_id |
| 81 |
INNER JOIN information_schema.innodb_sys_tables st ON si.table_id=st.table_id |
| 82 |
WHERE st.name='test/t1' ORDER BY sf.index_id,sf.pos; |
| 83 |
INDEX_ID NAME POS |
| 84 |
ID b 0 |
| 85 |
ID c 0 |
| 86 |
ID u 1 |
| 87 |
DROP TABLE t1; |
| 88 |
# |
| 89 |
# End of 10.2 tests |
| 90 |
# |
| 91 |
# |
| 92 |
# Check that innodb supports transactional=1 |
| 93 |
# |
| 94 |
create table t1 (a int) transactional=1 engine=aria; |
| 95 |
create table t2 (a int) transactional=1 engine=innodb; |
| 96 |
show create table t1; |
| 97 |
Table Create Table |
| 98 |
t1 CREATE TABLE `t1` ( |
| 99 |
`a` int(11) DEFAULT NULL |
| 100 |
) ENGINE=Aria DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci PAGE_CHECKSUM=1 TRANSACTIONAL=1 |
| 101 |
show create table t2; |
| 102 |
Table Create Table |
| 103 |
t2 CREATE TABLE `t2` ( |
| 104 |
`a` int(11) DEFAULT NULL |
| 105 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci TRANSACTIONAL=1 |
| 106 |
alter table t1 engine=innodb; |
| 107 |
alter table t1 add column b int; |
| 108 |
drop table t1,t2; |
| 109 |
# |
| 110 |
# MDEV-19272 Assertion unireg_check...Field::NEXT_NUMBER failed |
| 111 |
# |
| 112 |
CREATE TABLE t1 (c INT AUTO_INCREMENT NULL UNIQUE) ENGINE=InnoDB; |
| 113 |
ALTER TABLE t1 MODIFY c INT NOT NULL, ALGORITHM=INPLACE; |
| 114 |
DROP TABLE t1; |
| 115 |
CREATE TABLE t1 (c TIMESTAMP AUTO_INCREMENT UNIQUE) ENGINE=InnoDB; |
| 116 |
ERROR 42000: Incorrect column specifier for column 'c' |
| 117 |
CREATE TABLE t1 (c DATETIME AUTO_INCREMENT UNIQUE) ENGINE=InnoDB; |
| 118 |
ERROR 42000: Incorrect column specifier for column 'c' |
| 119 |
# |
| 120 |
# MDEV-31000 Assertion failed on ALTER TABLE...page_compressed=1 |
| 121 |
# |
| 122 |
SET @save_file_per_table=@@GLOBAL.innodb_file_per_table; |
| 123 |
SET GLOBAL innodb_file_per_table=0; |
| 124 |
Warnings: |
| 125 |
Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release |
| 126 |
CREATE TABLE t (c INT PRIMARY KEY) ENGINE=INNODB; |
| 127 |
SET GLOBAL innodb_file_per_table=1; |
| 128 |
Warnings: |
| 129 |
Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release |
| 130 |
ALTER TABLE t page_compressed=1; |
| 131 |
SET GLOBAL innodb_file_per_table=@save_file_per_table; |
| 132 |
Warnings: |
| 133 |
Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release |
| 134 |
SELECT space>0 FROM information_schema.innodb_sys_tables WHERE name='test/t'; |
| 135 |
space>0 |
| 136 |
1 |
| 137 |
DROP TABLE t; |
| 138 |
# End of 10.4 tests |
| 139 |
# |
| 140 |
# MDEV-21748 ASAN use-after-poison in PageBulk::insertPage() |
| 141 |
# |
| 142 |
CREATE TABLE t1 (pk TIMESTAMP PRIMARY KEY, a TIMESTAMP NULL UNIQUE) |
| 143 |
ENGINE=InnoDB; |
| 144 |
INSERT INTO t1 VALUES |
| 145 |
('2020-03-10 10:21:00', NULL), |
| 146 |
('0000-00-00 00:00:00', '0000-00-00 00:00:00'); |
| 147 |
ALTER TABLE t1 FORCE, ALGORITHM=INPLACE; |
| 148 |
DROP TABLE t1; |
| 149 |
# |
| 150 |
# MDEV-21850 ASAN use-after-poison in page_cur_insert_rec_low() |
| 151 |
# |
| 152 |
CREATE TABLE t1 (id INT PRIMARY KEY, a YEAR, INDEX(id,a)) ENGINE=InnoDB; |
| 153 |
INSERT INTO t1 VALUES (1,NULL),(2,NULL); |
| 154 |
UPDATE t1 SET a=0; |
| 155 |
DROP TABLE t1; |
| 156 |
# End of 10.5 tests |