~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/errors.test

  • Committer: Mats Kindahl
  • Date: 2008-08-26 07:32:59 UTC
  • mto: (489.1.2 codestyle)
  • mto: This revision was merged to the branch mainline in revision 491.
  • Revision ID: mats@mysql.com-20080826073259-9k4evtajgldgolli
Replaced use of thd_proc_info() macro with calls to
set_proc_info() and get_proc_info() internally.  Introduced
functions set_thd_proc_info() and get_thd_proc_info() for
external users, i.e., plug-ins.

The set_thd_proc_info() accepted callers info that can be used to
print debug output, but the information was not used. The return
value was changed to void and the old value is not fetched any
more. To be able to get the value of proc_info for external
users, the function get_thd_proc_info() was introduced.

The thd_proc_info() macro called set_thd_proc_info() but almost
never used the return value of set_thd_proc_info() so the macro
was replaced with a call of THD::set_proc_info().

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#
2
 
# Test some error conditions
3
 
#
4
 
 
5
 
--disable_warnings
6
 
drop table if exists t1;
7
 
--enable_warnings
8
 
--error ER_NO_SUCH_TABLE
9
 
insert into t1 values(1);
10
 
--error ER_NO_SUCH_TABLE
11
 
delete from t1;
12
 
--error ER_NO_SUCH_TABLE
13
 
update t1 set a=1;
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_NO_SUCH_TABLE
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;
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 ER_PARSE_ERROR
39
 
create table t1 (a int(256));
40
 
--error ER_TOO_BIG_FIELDLENGTH
41
 
create table t1 (a varchar(66000));
42
 
 
43
 
#
44
 
# Bug #27513: mysql 5.0.x + NULL pointer DoS
45
 
#
46
 
CREATE TABLE t1 (a INT);
47
 
--error ER_DIVISION_BY_ZERO
48
 
SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
49
 
INSERT INTO t1 VALUES(1);
50
 
--error ER_DIVISION_BY_ZERO
51
 
SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
52
 
INSERT INTO t1 VALUES(2),(3);
53
 
--error ER_DIVISION_BY_ZERO
54
 
SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
55
 
DROP TABLE t1;
56
 
 
57
 
#
58
 
# Bug #28677: SELECT on missing column gives extra error
59
 
#
60
 
CREATE TABLE t1( a INT );
61
 
--error ER_BAD_FIELD_ERROR
62
 
SELECT b FROM t1;
63
 
SHOW ERRORS;
64
 
--error ER_BAD_FIELD_ERROR
65
 
CREATE TABLE t2 SELECT b FROM t1;
66
 
SHOW ERRORS;
67
 
--error ER_BAD_FIELD_ERROR
68
 
INSERT INTO t1 SELECT b FROM t1;
69
 
DROP TABLE t1;
70
 
# End of 5.0 tests