16
16
create table t1 (id int not null auto_increment primary key, username varchar(32) not null, unique (username));
17
insert into t1 values (0,"mysql");
18
insert into t1 values (0,"mysql ab");
19
insert into t1 values (0,"mysql a");
20
insert into t1 values (0,"r1manic");
21
insert into t1 values (0,"r1man");
17
insert into t1 values (NULL,"mysql");
18
insert into t1 values (NULL,"mysql ab");
19
insert into t1 values (NULL,"mysql a");
20
insert into t1 values (NULL,"r1manic");
21
insert into t1 values (NULL,"r1man");
23
create table t1 (a int not null auto_increment, primary key (a), t timestamp, c char(10) default "hello", i int);
24
insert into t1 values (default,default,default,default), (default,default,default,default), (4,0,"a",5),(default,default,default,default);
25
select a,t>0,c,i from t1;
23
create table t1 (a int not null auto_increment, primary key (a), t timestamp null, c char(10) default "hello", i int);
24
insert into t1 values (default,default,default,default);
25
insert into t1 values (default,default,default,default);
26
insert into t1 values (4,0,"a",5);
27
ERROR HY000: Received an invalid timestamp value '0'.
28
insert into t1 values (default,default,default,default);
29
select a,t is not null,c,i from t1;
32
35
insert into t1 set a=default,t=default,c=default;
33
36
insert into t1 set a=default,t=default,c=default,i=default;
34
insert into t1 set a=4,t=0,c="a",i=5;
35
insert into t1 set a=5,t=0,c="a",i=null;
37
insert into t1 set a=4,t= NULL,c="a",i=5;
38
insert into t1 set a=5,t= NULL,c="a",i=null;
36
39
insert into t1 set a=default,t=default,c=default,i=default;
37
select a,t>0,c,i from t1;
40
select a,t is not null,c,i from t1;
45
48
create table t1 (id int NOT NULL DEFAULT 8);
46
49
insert into t1 values(NULL);
53
56
create table t1 (email varchar(50));
54
57
insert into t1 values ('sasha@mysql.com'),('monty@mysql.com'),('foo@hotmail.com'),('foo@aol.com'),('bar@aol.com');
55
58
create table t2(id int not null auto_increment primary key, t2 varchar(50), unique(t2));
56
insert delayed into t2 (t2) select distinct substring(email, locate('@', email)+1) from t1;
59
insert into t2 (t2) select distinct substring(email, locate('@', email)+1) from t1;