~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
drop table if exists t1, t2;
2
SET SQL_WARNINGS=1;
3
create table t1 (a int);
4
create table t1 (a int);
5
ERROR 42S01: Table 't1' already exists
6
show count(*) errors;
7
@@session.error_count
8
1
9
show errors;
10
Level	Code	Message
11
Error	1050	Table 't1' already exists
12
show warnings;
13
Level	Code	Message
14
Error	1050	Table 't1' already exists
15
create table t (i);
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
16
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near ')' at line 1
1 by brian
clean slate
17
show count(*) errors;
18
@@session.error_count
19
1
20
show errors;
21
Level	Code	Message
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
22
Error	1064	You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near ')' at line 1
1 by brian
clean slate
23
insert into t1 values (1);
24
insert into t1 values ("hej");
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
25
ERROR HY000: Incorrect integer value: 'hej' for column 'a' at row 1
1 by brian
clean slate
26
insert into t1 values ("hej"),("då");
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
27
ERROR HY000: Incorrect integer value: 'hej' for column 'a' at row 1
1 by brian
clean slate
28
set SQL_WARNINGS=1;
29
insert into t1 values ("hej");
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
30
ERROR HY000: Incorrect integer value: 'hej' for column 'a' at row 1
1 by brian
clean slate
31
insert into t1 values ("hej"),("då");
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
32
ERROR HY000: Incorrect integer value: 'hej' for column 'a' at row 1
1 by brian
clean slate
33
drop table t1;
34
set SQL_WARNINGS=0;
35
drop temporary table if exists not_exists;
36
Warnings:
37
Note	1051	Unknown table 'not_exists'
38
drop table if exists not_exists_table;
39
Warnings:
40
Note	1051	Unknown table 'not_exists_table'
41
show warnings limit 1;
42
Level	Code	Message
43
Note	1051	Unknown table 'not_exists_table'
44
drop database if exists not_exists_db;
45
Warnings:
46
Note	1008	Can't drop database 'not_exists_db'; database doesn't exist
47
show count(*) warnings;
48
@@session.warning_count
49
1
50
create table t1(id int);
51
create table if not exists t1(id int);
52
Warnings:
53
Note	1050	Table 't1' already exists
54
select @@warning_count;
55
@@warning_count
56
1
57
drop table t1;
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
58
create table t1(a int, b int not null, c date, d char(5));
1 by brian
clean slate
59
load data infile '../std_data_ln/warnings_loaddata.dat' into table t1 fields terminated by ',';
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
60
ERROR 22004: Column set to default value; NULL supplied to NOT NULL column 'b' at row 2
1 by brian
clean slate
61
select @@warning_count;
62
@@warning_count
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
63
1
1 by brian
clean slate
64
drop table t1;
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
65
create table t1(a int NOT NULL, b int, c char(5));
66
insert into t1 values(-1,100,'mysql'),(10,-1,'mysql ab'),(500,256,'open source'),(20,NULL,'test');
67
ERROR 22001: Data too long for column 'c' at row 2
68
insert into t1 values(-1,100,'mysql'),(10,-1,'dri '),(500,256,'zzle'),(20,NULL,'test');
1 by brian
clean slate
69
alter table t1 modify c char(4);
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
70
ERROR 01000: Data truncated for column 'c' at row 1
1 by brian
clean slate
71
alter table t1 add d char(2);
72
update t1 set a=NULL where a=10;
73
ERROR 23000: Column 'a' cannot be null
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
74
update t1 set c='drizzle' where c='test';
75
ERROR 22001: Data too long for column 'c' at row 4
1 by brian
clean slate
76
update t1 set d=c;
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
77
ERROR 22001: Data too long for column 'd' at row 1
78
create table t2(a int NOT NULL, b char(3));
1 by brian
clean slate
79
insert into t2 select b,c from t1;
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
80
ERROR 22001: Data too long for column 'b' at row 1
1 by brian
clean slate
81
insert into t2(b) values('mysqlab');
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
82
ERROR HY000: Field 'a' doesn't have a default value
83
insert into t2(a) values(1);
1 by brian
clean slate
84
set sql_warnings=1;
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
85
insert into t2(a,b) values(1,'mysqlab');
86
ERROR 22001: Data too long for column 'b' at row 1
87
insert into t2(a,b) values(1,'mys');
1 by brian
clean slate
88
set sql_warnings=0;
89
drop table t1, t2;
90
create table t1(a char(10));
91
alter table t1 add b char;
92
set max_error_count=10;
93
update t1 set b=a;
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
94
ERROR 22001: Data too long for column 'b' at row 1
95
alter table t1 modify b char(10);
96
update t1 set b=a;
1 by brian
clean slate
97
select @@warning_count;
98
@@warning_count
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
99
0
1 by brian
clean slate
100
set max_error_count=0;
101
show variables like 'max_error_count';
102
Variable_name	Value
103
max_error_count	0
104
update t1 set b='hi';
105
select @@warning_count;
106
@@warning_count
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
107
0
1 by brian
clean slate
108
show warnings;
109
Level	Code	Message
110
set max_error_count=65535;
111
show variables like 'max_error_count';
112
Variable_name	Value
113
max_error_count	65535
114
set max_error_count=10;
115
show variables like 'max_error_count';
116
Variable_name	Value
117
max_error_count	10
118
drop table t1;
119
create table t1 (a int);
120
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
121
update t1 set a='abc';
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
122
ERROR HY000: Incorrect integer value: 'abc' for column 'a' at row 1
1 by brian
clean slate
123
show warnings limit 2, 1;
124
Level	Code	Message
125
show warnings limit 0, 10;
126
Level	Code	Message
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
127
Error	1366	Incorrect integer value: 'abc' for column 'a' at row 1
1 by brian
clean slate
128
show warnings limit 9, 1;
129
Level	Code	Message
130
show warnings limit 10, 1;
131
Level	Code	Message
132
show warnings limit 9, 2;
133
Level	Code	Message
134
show warnings limit 0, 0;
135
Level	Code	Message
136
show warnings limit 1;
137
Level	Code	Message
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
138
Error	1366	Incorrect integer value: 'abc' for column 'a' at row 1
1 by brian
clean slate
139
show warnings limit 0;
140
Level	Code	Message
141
show warnings limit 1, 0;
142
Level	Code	Message
143
select * from t1 limit 0;
144
a
145
select * from t1 limit 1, 0;
146
a
147
select * from t1 limit 0, 0;
148
a
149
drop table t1;
150
End of 4.1 tests
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
151
create table t1 (c_char char(255), c_varchar varchar(255), c_tinytext blob);
1 by brian
clean slate
152
set @c = repeat(' ', 256);
153
set @q = repeat('q', 256);
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
154
insert into t1 values(@c, @c, @c);
155
Warnings:
156
Note	1265	Data truncated for column 'c_char' at row 1
157
Note	1265	Data truncated for column 'c_varchar' at row 1
158
show warnings;
159
Level	Code	Message
160
Note	1265	Data truncated for column 'c_char' at row 1
161
Note	1265	Data truncated for column 'c_varchar' at row 1
1 by brian
clean slate
162
insert into t1 values(@q, NULL, NULL);
163
ERROR 22001: Data too long for column 'c_char' at row 1
164
insert into t1 values(NULL, @q, NULL);
165
ERROR 22001: Data too long for column 'c_varchar' at row 1
166
insert into t1 values(NULL, NULL, @q);
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
167
drop table t1;
168
End of Drizzle tests