summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/r/alter_table.result
blob: e47bfb90152f90867a03b51b9fa8381786ab9841 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
set @@sql_mode=strict_trans_tables;
create table t1(a text not null) row_format=dynamic engine=innodb;
create index idx1 on t1(a(3073));
Warnings:
Note	1071	Specified key was too long; max key length is 3072 bytes
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` text NOT NULL,
  KEY `idx1` (`a`(3072))
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
drop table t1;
set @@sql_mode=default;
create table t1 (
id1    int(11)      not null auto_increment,
id2    varchar(30)  not null,
id3    datetime     not null default current_timestamp,
primary key (id1),
unique key unique_id2 (id2)
) engine=innodb;
alter table t1 change column id2 id4 varchar(100) not null;
select * from t1 where id4 like 'a';
id1	id4	id3
drop table t1;
#
# 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
#
SET sql_mode=STRICT_ALL_TABLES;
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB;
ALTER TABLE t1 ORDER BY a;
Warnings:
Warning	1105	ORDER BY ignored as there is a user-defined clustered index in the table 't1'
DROP TABLE t1;
SET sql_mode='';
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB;
ALTER TABLE t1 ORDER BY a;
Warnings:
Warning	1105	ORDER BY ignored as there is a user-defined clustered index in the table 't1'
DROP TABLE t1;
SET sql_mode=DEFAULT;
#
# MDEV-18775 Server crashes in dict_table_t::instant_column
# upon ADD COLUMN
#
CREATE TABLE tx (pk INT PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t1 (pk INT, a INT, PRIMARY KEY (pk), KEY (a), FOREIGN KEY (a) REFERENCES tx (pk)) ENGINE=InnoDB;
SET FOREIGN_KEY_CHECKS=OFF;
ALTER TABLE t1 DROP a;
ERROR HY000: Cannot drop column 'a': needed in a foreign key constraint 'test/t1_ibfk_1'
SET FOREIGN_KEY_CHECKS=ON;
ALTER TABLE t1 ADD b INT;
ALTER TABLE t1 DROP a;
ERROR HY000: Cannot drop index 'a': needed in a foreign key constraint
ALTER TABLE t1 ADD c INT;
DROP TABLE t1, tx;