~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
#
2
# Test some error conditions
3
#
4
5
--disable_warnings
6
drop table if exists t1;
7
--enable_warnings
8
--error 1146
9
insert into t1 values(1);
10
--error 1146
11
delete from t1;
12
--error 1146
13
update t1 set a=1;
14
create table t1 (a int);
15
--error 1054
16
select count(test.t1.b) from t1;
17
--error 1054
18
select count(not_existing_database.t1) from t1;
19
--error 1054
20
select count(not_existing_database.t1.a) from t1;
21
--error 1044,1146
22
select count(not_existing_database.t1.a) from not_existing_database.t1;
23
--error 1054
24
select 1 from t1 order by 2;
25
--error 1054
26
select 1 from t1 group by 2;
27
--error 1054
28
select 1 from t1 order by t1.b;
29
--error 1054
30
select count(*),b from t1;
31
drop table t1;
32
33
# End of 4.1 tests
34
35
#
36
# Bug #6080: Error message for a field with a display width that is too long
37
#
38
--error 1439
39
create table t1 (a int(256));
40
set sql_mode='traditional';
41
--error 1074
42
create table t1 (a varchar(66000));
43
set sql_mode=default;
44
45
#
46
# Bug #27513: mysql 5.0.x + NULL pointer DoS
47
#
48
CREATE TABLE t1 (a INT);
49
SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
50
INSERT INTO t1 VALUES(1);
51
SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
52
INSERT INTO t1 VALUES(2),(3);
53
SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
54
DROP TABLE t1;
55
56
#
57
# Bug #28677: SELECT on missing column gives extra error
58
#
59
CREATE TABLE t1( a INT );
60
--error ER_BAD_FIELD_ERROR
61
SELECT b FROM t1;
62
SHOW ERRORS;
63
--error ER_BAD_FIELD_ERROR
64
CREATE TABLE t2 SELECT b FROM t1;
65
SHOW ERRORS;
66
--error ER_BAD_FIELD_ERROR
67
INSERT INTO t1 SELECT b FROM t1;
68
DROP TABLE t1;
69
# End of 5.0 tests