2
# Test some error conditions
6
drop table if exists t1;
8
--error ER_TABLE_UNKNOWN
9
insert into t1 values(1);
10
--error ER_TABLE_UNKNOWN
12
--error ER_TABLE_UNKNOWN
14
create table t1 (a int);
15
--error ER_BAD_FIELD_ERROR
16
select count(test.t1.b) from t1;
17
--error ER_BAD_FIELD_ERROR
18
select count(not_existing_database.t1) from t1;
19
--error ER_BAD_FIELD_ERROR
20
select count(not_existing_database.t1.a) from t1;
21
--error ER_DBACCESS_DENIED_ERROR, ER_TABLE_UNKNOWN
22
select count(not_existing_database.t1.a) from not_existing_database.t1;
23
--error ER_BAD_FIELD_ERROR
24
select 1 from t1 order by 2;
25
--error ER_BAD_FIELD_ERROR
26
select 1 from t1 group by 2;
27
--error ER_BAD_FIELD_ERROR
28
select 1 from t1 order by t1.b;
29
--error ER_BAD_FIELD_ERROR
30
select count(*),b from t1;
36
# Bug #6080: Error message for a field with a display width that is too long
38
--error ER_TOO_BIG_FIELDLENGTH
39
create table t1 (a varchar(66000));
42
# Bug #27513: mysql 5.0.x + NULL pointer DoS
44
CREATE TABLE t1 (a INT);
45
--error ER_DIVISION_BY_ZERO
46
SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
47
INSERT INTO t1 VALUES(1);
48
--error ER_DIVISION_BY_ZERO
49
SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
50
INSERT INTO t1 VALUES(2),(3);
51
--error ER_DIVISION_BY_ZERO
52
SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
56
# Bug #28677: SELECT on missing column gives extra error
58
CREATE TABLE t1( a INT );
59
--error ER_BAD_FIELD_ERROR
62
--error ER_BAD_FIELD_ERROR
63
CREATE TABLE t2 SELECT b FROM t1;
65
--error ER_BAD_FIELD_ERROR
66
INSERT INTO t1 SELECT b FROM t1;