10
10
# Insert causes warnings for no default values and corrupts tables
12
CREATE TABLE t1 (a varchar(30) binary NOT NULL DEFAULT ' ',
13
b varchar(1) binary NOT NULL DEFAULT ' ',
14
c varchar(4) binary NOT NULL DEFAULT '0000',
28
q varchar(30) binary NOT NULL DEFAULT ' ',
29
r varchar(30) binary NOT NULL DEFAULT ' ',
31
t varchar(4) binary NOT NULL DEFAULT ' ',
32
u varchar(1) binary NOT NULL DEFAULT ' ',
33
v varchar(30) binary NOT NULL DEFAULT ' ',
34
w varchar(30) binary NOT NULL DEFAULT ' ',
36
y varchar(5) binary NOT NULL DEFAULT ' ',
37
z varchar(20) binary NOT NULL DEFAULT ' ',
38
a1 varchar(30) binary NOT NULL DEFAULT ' ',
40
ENGINE=InnoDB DEFAULT CHARACTER SET = latin1 COLLATE latin1_bin;
12
CREATE TABLE t1 (a varbinary(30) NOT NULL DEFAULT ' ',
13
b varbinary(1) NOT NULL DEFAULT ' ',
14
c varbinary(4) NOT NULL DEFAULT '0000',
28
q varbinary(30) NOT NULL DEFAULT ' ',
29
r varbinary(30) NOT NULL DEFAULT ' ',
31
t varbinary(4) NOT NULL DEFAULT ' ',
32
u varbinary(1) NOT NULL DEFAULT ' ',
33
v varbinary(30) NOT NULL DEFAULT ' ',
34
w varbinary(30) NOT NULL DEFAULT ' ',
36
y varbinary(5) NOT NULL DEFAULT ' ',
37
z varbinary(20) NOT NULL DEFAULT ' ',
38
a1 varbinary(30) NOT NULL DEFAULT ' ',
40
ENGINE=InnoDB DEFAULT COLLATE utf8_bin;
43
42
INSERT into t1 (b) values ('1');
47
CREATE TABLE t2 (a varchar(30) binary NOT NULL DEFAULT ' ',
48
b varchar(1) binary NOT NULL DEFAULT ' ',
49
c varchar(4) binary NOT NULL DEFAULT '0000',
63
q varchar(30) binary NOT NULL DEFAULT ' ',
64
r varchar(30) binary NOT NULL DEFAULT ' ',
66
t varchar(4) binary NOT NULL DEFAULT ' ',
67
u varchar(1) binary NOT NULL DEFAULT ' ',
68
v varchar(30) binary NOT NULL DEFAULT ' ',
69
w varchar(30) binary NOT NULL DEFAULT ' ',
71
y varchar(5) binary NOT NULL DEFAULT ' ',
72
z varchar(20) binary NOT NULL DEFAULT ' ',
73
a1 varchar(30) binary NOT NULL DEFAULT ' ',
75
ENGINE=MyISAM DEFAULT CHARACTER SET = latin1 COLLATE latin1_bin;
46
CREATE TABLE t2 (a varbinary(30) NOT NULL DEFAULT ' ',
47
b varbinary(1) NOT NULL DEFAULT ' ',
48
c varbinary(4) NOT NULL DEFAULT '0000',
62
q varbinary(30) NOT NULL DEFAULT ' ',
63
r varbinary(30) NOT NULL DEFAULT ' ',
65
t varbinary(4) NOT NULL DEFAULT ' ',
66
u varbinary(1) NOT NULL DEFAULT ' ',
67
v varbinary(30) NOT NULL DEFAULT ' ',
68
w varbinary(30) NOT NULL DEFAULT ' ',
70
y varbinary(5) NOT NULL DEFAULT ' ',
71
z varbinary(20) NOT NULL DEFAULT ' ',
72
a1 varbinary(30) NOT NULL DEFAULT ' ',
74
ENGINE=MyISAM DEFAULT COLLATE utf8_bin;
77
76
SHOW CREATE TABLE t2;
78
77
INSERT into t2 (b) values ('1');
104
103
# multiple-row statement, the preceding rows will have been inserted.
106
105
create table bug20691 (i int, d datetime NOT NULL, dn datetime not null default '0000-00-00 00:00:00');
107
insert into bug20691 values (1, DEFAULT, DEFAULT), (1, '1975-07-10 07:10:03', '1978-01-13 14:08:51'), (1, DEFAULT, DEFAULT);
108
insert into bug20691 (i) values (2);
110
insert into bug20691 values (3, DEFAULT, DEFAULT), (3, '1975-07-10 07:10:03', '1978-01-13 14:08:51'), (3, DEFAULT, DEFAULT);
111
insert into bug20691 (i) values (4);
112
insert into bug20691 values (5, DEFAULT, DEFAULT), (5, '1975-07-10 07:10:03', '1978-01-13 14:08:51'), (5, DEFAULT, DEFAULT);
113
SET sql_mode = 'ALLOW_INVALID_DATES';
114
insert into bug20691 values (6, DEFAULT, DEFAULT), (6, '1975-07-10 07:10:03', '1978-01-13 14:08:51'), (6, DEFAULT, DEFAULT);
115
SET sql_mode = 'STRICT_ALL_TABLES';
117
107
insert into bug20691 values (7, DEFAULT, DEFAULT), (7, '1975-07-10 07:10:03', '1978-01-13 14:08:51'), (7, DEFAULT, DEFAULT);
108
insert into bug20691 values (7, '1975-07-10 07:10:03', DEFAULT);
118
109
select * from bug20691 order by i asc;
119
110
drop table bug20691;
122
112
create table bug20691 (
123
a set('one', 'two', 'three') not null,
124
113
b enum('small', 'medium', 'large', 'enormous', 'ellisonego') not null,
130
118
h datetime not null,
131
119
i decimal not null,
133
insert into bug20691 values (2, 3, 5, '0007-01-01', 11, 13, 17, '0019-01-01 00:00:00', 23, 1);
121
insert into bug20691 values (3, 5, '0007-01-01', 11, 17, '0019-01-01 00:00:00', 23, 1);
134
123
insert into bug20691 (x) values (2);
135
insert into bug20691 values (2, 3, 5, '0007-01-01', 11, 13, 17, '0019-01-01 00:00:00', 23, 3);
136
insert into bug20691 values (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, 4);
124
insert into bug20691 values (3, 5, '0007-01-01', 11, 17, '0019-01-01 00:00:00', 23, 3);
126
insert into bug20691 values (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, 4);
137
127
select * from bug20691 order by x asc;
138
128
drop table bug20691;
140
create table t1 (id int not null);
130
create table t1 (id int not null default 1);
141
131
insert into t1 values(default);
143
create view v1 (c) as select id from t1;
144
insert into t1 values(default);
148
--echo End of 5.0 tests.