~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/warnings.test

  • Committer: Brian Aker
  • Date: 2010-11-11 04:16:59 UTC
  • mto: (1932.2.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 1930.
  • Revision ID: brian@tangent.org-20101111041659-5xb7ymjrasq1520p
Adding in support for EXECUTE to have WITH NO RETURN.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
SET SQL_WARNINGS=1;
8
8
 
9
9
create table t1 (a int);
10
 
--error 1050
 
10
--error ER_TABLE_EXISTS_ERROR
11
11
create table t1 (a int);
12
12
show count(*) errors;
13
13
show errors;
14
14
show warnings;
15
 
--error 1064
 
15
--error ER_PARSE_ERROR
16
16
create table t (i);
17
17
show count(*) errors;
18
18
show errors;
19
19
insert into t1 values (1);
20
 
--error 1366
 
20
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
21
21
insert into t1 values ("hej");
22
 
--error 1366
 
22
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
23
23
insert into t1 values ("hej"),("d�");
24
24
set SQL_WARNINGS=1;
25
 
--error 1366
 
25
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
26
26
insert into t1 values ("hej");
27
 
--error 1366
 
27
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
28
28
insert into t1 values ("hej"),("d�");
29
29
drop table t1;
30
30
set SQL_WARNINGS=0;
50
50
#
51
51
 
52
52
create table t1(a int, b int not null, c date, d char(5));
53
 
--error 1263
54
 
load data infile '../std_data_ln/warnings_loaddata.dat' into table t1 fields terminated by ',';
 
53
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
 
54
--error ER_WARN_NULL_TO_NOTNULL
 
55
eval load data infile '$DRIZZLETEST_VARDIR/std_data_ln/warnings_loaddata.dat' into table t1 fields terminated by ',';
55
56
# PS doesn't work good with @@warning_count
56
57
--disable_ps_protocol
57
58
select @@warning_count;
65
66
create table t1(a int NOT NULL, b int, c char(5));
66
67
 
67
68
# Error data to big for character field
68
 
--error 1406
 
69
--error ER_DATA_TOO_LONG
69
70
insert into t1 values(-1,100,'mysql'),(10,-1,'mysql ab'),(500,256,'open source'),(20,NULL,'test');
70
71
insert into t1 values(-1,100,'mysql'),(10,-1,'dri '),(500,256,'zzle'),(20,NULL,'test');
71
72
 
72
73
# Error as changing width truncates data
73
 
--error 1265  
 
74
--error ER_WARN_DATA_TRUNCATED  
74
75
alter table t1 modify c char(4);
75
76
alter table t1 add d char(2);
76
77
 
77
78
# Error trying to insert NULL data into NOT NULL field
78
 
--error 1048
 
79
--error ER_BAD_NULL_ERROR
79
80
update t1 set a=NULL where a=10;
80
81
 
81
82
# Error data to big for character field
82
 
--error 1406
 
83
--error ER_DATA_TOO_LONG
83
84
update t1 set c='drizzle' where c='test';
84
85
 
85
86
# Error data to big for character field
86
 
--error 1406
 
87
--error ER_DATA_TOO_LONG
87
88
update t1 set d=c;
88
89
 
89
90
create table t2(a int NOT NULL, b char(3));
90
91
 
91
92
# Error data to big for character field
92
 
--error 1406
 
93
--error ER_DATA_TOO_LONG
93
94
insert into t2 select b,c from t1;
94
95
 
95
96
# Error 'a' doesn't have a default value
96
 
--error 1364
 
97
--error ER_NO_DEFAULT_FOR_FIELD
97
98
insert into t2(b) values('mysqlab');
98
99
insert into t2(a) values(1);
99
100
 
100
101
set sql_warnings=1;
101
102
 
102
103
# Error data to big for character field
103
 
--error 1406
 
104
--error ER_DATA_TOO_LONG
104
105
insert into t2(a,b) values(1,'mysqlab');
105
106
insert into t2(a,b) values(1,'mys');
106
107
 
126
127
set max_error_count=10;
127
128
 
128
129
# Error data to big for character field
129
 
--error 1406
 
130
--error ER_DATA_TOO_LONG
130
131
update t1 set b=a;
131
132
 
132
133
alter table t1 modify b char(10);
156
157
create table t1 (a int);
157
158
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
158
159
# Incorrect integer value abc for column a
159
 
--error 1366
 
160
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
160
161
update t1 set a='abc';
161
162
show warnings limit 2, 1;
162
163
show warnings limit 0, 10;
180
181
set @q = repeat('q', 256);
181
182
 
182
183
# BUG, 309791 currently only gives a warning but should give error
 
184
--error ER_DATA_TOO_LONG
183
185
insert into t1 values(@c, @c, @c);
184
186
show warnings;
185
 
--error 1406
 
187
--error ER_DATA_TOO_LONG
186
188
insert into t1 values(@q, NULL, NULL);
187
 
--error 1406
 
189
--error ER_DATA_TOO_LONG
188
190
insert into t1 values(NULL, @q, NULL);
189
191
insert into t1 values(NULL, NULL, @q);
190
192