~ubuntu-branches/ubuntu/saucy/drizzle/saucy-proposed

« back to all changes in this revision

Viewing changes to tests/r/warnings.result

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-03-18 12:12:31 UTC
  • Revision ID: james.westby@ubuntu.com-20100318121231-k6g1xe6cshbwa0f8
Tags: upstream-2010.03.1347
Import upstream version 2010.03.1347

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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);
 
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
 
17
show count(*) errors;
 
18
@@session.error_count
 
19
1
 
20
show errors;
 
21
Level   Code    Message
 
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
 
23
insert into t1 values (1);
 
24
insert into t1 values ("hej");
 
25
ERROR HY000: Incorrect integer value: 'hej' for column 'a' at row 1
 
26
insert into t1 values ("hej"),("d�");
 
27
ERROR HY000: Incorrect integer value: 'hej' for column 'a' at row 1
 
28
set SQL_WARNINGS=1;
 
29
insert into t1 values ("hej");
 
30
ERROR HY000: Incorrect integer value: 'hej' for column 'a' at row 1
 
31
insert into t1 values ("hej"),("d�");
 
32
ERROR HY000: Incorrect integer value: 'hej' for column 'a' at row 1
 
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;
 
58
create table t1(a int, b int not null, c date, d char(5));
 
59
load data infile '../std_data_ln/warnings_loaddata.dat' into table t1 fields terminated by ',';
 
60
ERROR 22004: Column set to default value; NULL supplied to NOT NULL column 'b' at row 2
 
61
select @@warning_count;
 
62
@@warning_count
 
63
1
 
64
drop table t1;
 
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');
 
69
alter table t1 modify c char(4);
 
70
ERROR 01000: Data truncated for column 'c' at row 1
 
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
 
74
update t1 set c='drizzle' where c='test';
 
75
ERROR 22001: Data too long for column 'c' at row 4
 
76
update t1 set d=c;
 
77
ERROR 22001: Data too long for column 'd' at row 1
 
78
create table t2(a int NOT NULL, b char(3));
 
79
insert into t2 select b,c from t1;
 
80
ERROR 22001: Data too long for column 'b' at row 1
 
81
insert into t2(b) values('mysqlab');
 
82
ERROR HY000: Field 'a' doesn't have a default value
 
83
insert into t2(a) values(1);
 
84
set sql_warnings=1;
 
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');
 
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;
 
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;
 
97
select @@warning_count;
 
98
@@warning_count
 
99
0
 
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
 
107
0
 
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';
 
122
ERROR HY000: Incorrect integer value: 'abc' for column 'a' at row 1
 
123
show warnings limit 2, 1;
 
124
Level   Code    Message
 
125
show warnings limit 0, 10;
 
126
Level   Code    Message
 
127
Error   1366    Incorrect integer value: 'abc' for column 'a' at row 1
 
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
 
138
Error   1366    Incorrect integer value: 'abc' for column 'a' at row 1
 
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
 
151
create table t1 (c_char char(255), c_varchar varchar(255), c_tinytext blob);
 
152
set @c = repeat(' ', 256);
 
153
set @q = repeat('q', 256);
 
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
 
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);
 
167
drop table t1;
 
168
End of Drizzle tests