~drizzle-trunk/drizzle/development

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#
# Test some error conditions
#

--disable_warnings
drop table if exists t1;
--enable_warnings
--error ER_TABLE_UNKNOWN
insert into t1 values(1);
--error ER_TABLE_UNKNOWN
delete from t1;
--error ER_TABLE_UNKNOWN
update t1 set a=1;
create table t1 (a int);
--error ER_BAD_FIELD_ERROR
select count(test.t1.b) from t1;
--error ER_BAD_FIELD_ERROR
select count(not_existing_database.t1) from t1;
--error ER_BAD_FIELD_ERROR
select count(not_existing_database.t1.a) from t1;
--error ER_DBACCESS_DENIED_ERROR, ER_TABLE_UNKNOWN
select count(not_existing_database.t1.a) from not_existing_database.t1;
--error ER_BAD_FIELD_ERROR
select 1 from t1 order by 2;
--error ER_BAD_FIELD_ERROR
select 1 from t1 group by 2;
--error ER_BAD_FIELD_ERROR
select 1 from t1 order by t1.b;
--error ER_BAD_FIELD_ERROR
select count(*),b from t1;
drop table t1;

# End of 4.1 tests

#
# Bug #6080: Error message for a field with a display width that is too long
#
--error ER_TOO_BIG_FIELDLENGTH
create table t1 (a varchar(66000));

#
# Bug #27513: mysql 5.0.x + NULL pointer DoS
#
CREATE TABLE t1 (a INT);
--error ER_DIVISION_BY_ZERO
SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
INSERT INTO t1 VALUES(1);
--error ER_DIVISION_BY_ZERO
SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
INSERT INTO t1 VALUES(2),(3);
--error ER_DIVISION_BY_ZERO
SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
DROP TABLE t1;

#
# Bug #28677: SELECT on missing column gives extra error
#
CREATE TABLE t1( a INT );
--error ER_BAD_FIELD_ERROR
SELECT b FROM t1;
SHOW ERRORS;
--error ER_BAD_FIELD_ERROR
CREATE TABLE t2 SELECT b FROM t1;
SHOW ERRORS;
--error ER_BAD_FIELD_ERROR
INSERT INTO t1 SELECT b FROM t1;
DROP TABLE t1;
# End of 5.0 tests