1drop table if exists t1;
2insert into t1 values(1);
3ERROR 42S02: Table 'test.t1' doesn't exist
4delete from t1;
5ERROR 42S02: Table 'test.t1' doesn't exist
6update t1 set a=1;
7ERROR 42S02: Table 'test.t1' doesn't exist
8create table t1 (a int);
9select count(test.t1.b) from t1;
10ERROR 42S22: Unknown column 'test.t1.b' in 'field list'
11select count(not_existing_database.t1) from t1;
12ERROR 42S22: Unknown column 'not_existing_database.t1' in 'field list'
13select count(not_existing_database.t1.a) from t1;
14ERROR 42S22: Unknown column 'not_existing_database.t1.a' in 'field list'
15select count(not_existing_database.t1.a) from not_existing_database.t1;
16Got one of the listed errors
17select 1 from t1 order by 2;
18ERROR 42S22: Unknown column '2' in 'order clause'
19select 1 from t1 group by 2;
20ERROR 42S22: Unknown column '2' in 'group statement'
21select 1 from t1 order by t1.b;
22ERROR 42S22: Unknown column 't1.b' in 'order clause'
23select count(*),b from t1;
24ERROR 42S22: Unknown column 'b' in 'field list'
25drop table t1;
26create table t1 (a int(256));
27ERROR 42000: Display width out of range for column 'a' (max = 255)
28set sql_mode='traditional';
29create table t1 (a varchar(66000));
30ERROR 42000: Column length too big for column 'a' (max = 65535); use BLOB or TEXT instead
31set sql_mode=default;
32SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
33Warnings:
34Warning	3090	Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release.
35CREATE TABLE t1 (a INT);
36SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
37a
38INSERT INTO t1 VALUES(1);
39SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
40a
411
42INSERT INTO t1 VALUES(2),(3);
43SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
44a
451
46DROP TABLE t1;
47SET sql_mode = default;
48CREATE TABLE t1( a INT );
49SELECT b FROM t1;
50ERROR 42S22: Unknown column 'b' in 'field list'
51SHOW ERRORS;
52Level	Code	Message
53Error	1054	Unknown column 'b' in 'field list'
54CREATE TABLE t2 SELECT b FROM t1;
55ERROR 42S22: Unknown column 'b' in 'field list'
56SHOW ERRORS;
57Level	Code	Message
58Error	1054	Unknown column 'b' in 'field list'
59INSERT INTO t1 SELECT b FROM t1;
60ERROR 42S22: Unknown column 'b' in 'field list'
61DROP TABLE t1;
62flush status;
63drop table if exists t1, t2;
64create table t1 (a int unique);
65create table t2 (a int);
66drop function if exists f1;
67Warnings:
68Note	1305	FUNCTION test.f1 does not exist
69drop function if exists f2;
70Warnings:
71Note	1305	FUNCTION test.f2 does not exist
72create function f1() returns int
73begin
74insert into t1 (a) values (1);
75insert into t1 (a) values (1);
76return 1;
77end|
78create function f2() returns int
79begin
80insert into t2 (a) values (1);
81return 2;
82end|
83flush status;
84select f1(), f2();
85ERROR 23000: Duplicate entry '1' for key 'a'
86show status like 'Com_insert';
87Variable_name	Value
88Com_insert	2
89select * from t1;
90a
911
92select * from t2;
93a
94drop table t1;
95drop table t2;
96drop function f1;
97drop function f2;
98SET NAMES utf8;
99SET sql_quote_show_create= _binary x'5452C39C45';
100ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TR\xC3\x9CE'
101SET sql_quote_show_create= _utf8 x'5452C39C45';
102ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE'
103SET sql_quote_show_create=_latin1 x'5452DC45';
104ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE'
105SET sql_quote_show_create='TRÜE';
106ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE'
107SET sql_quote_show_create=TRÜE;
108ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE'
109SET NAMES latin1;
110SET sql_quote_show_create= _binary x'5452C39C45';
111ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TR\xC3\x9CE'
112SET sql_quote_show_create= _utf8 x'5452C39C45';
113ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TR�E'
114SET sql_quote_show_create=_latin1 x'5452DC45';
115ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TR�E'
116SET sql_quote_show_create='TR�E';
117ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TR�E'
118SET sql_quote_show_create=TR�E;
119ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TR�E'
120SET NAMES binary;
121SET sql_quote_show_create= _binary x'5452C39C45';
122ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TR\xC3\x9CE'
123SET sql_quote_show_create= _utf8 x'5452C39C45';
124ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE'
125SET sql_quote_show_create=_latin1 x'5452DC45';
126ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE'
127#
128# Bug#52430 Incorrect key in the error message for duplicate key error involving BINARY type
129#
130CREATE TABLE t1(c1 BINARY(10), c2 BINARY(10), c3 BINARY(10),
131PRIMARY KEY(c1,c2,c3));
132INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
133INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
134ERROR 23000: Duplicate entry 'abc-abc-abc' for key 'PRIMARY'
135DROP TABLE t1;
136CREATE TABLE t1 (f1 VARBINARY(19) PRIMARY KEY);
137INSERT INTO t1 VALUES ('abc\0\0');
138INSERT INTO t1 VALUES ('abc\0\0');
139ERROR 23000: Duplicate entry 'abc\x00\x00' for key 'PRIMARY'
140DROP TABLE t1;
141#
142# Bug#57882: Item_func_conv_charset::val_str(String*):
143#            Assertion `fixed == 1' failed
144#
145SELECT (CONVERT('0' USING latin1) IN (CHAR(COT('v') USING utf8),''));
146ERROR 22003: DOUBLE value is out of range in 'cot('v')'
147SET NAMES utf8 COLLATE utf8_latvian_ci ;
148SELECT UPDATEXML(-73 * -2465717823867977728,@@global.auto_increment_increment,null);
149ERROR 22003: BIGINT value is out of range in '(-(73) * -(2465717823867977728))'
150#
151# End Bug#57882
152#
153CREATE TABLE t1 (a INT);
154CREATE TABLE t2(a INT PRIMARY KEY, b INT);
155SELECT '' AS b FROM t1 GROUP BY VALUES(b);
156ERROR 42S22: Unknown column '' in 'VALUES() function'
157REPLACE t2(b) SELECT '' AS b FROM t1 GROUP BY VALUES(b);
158ERROR 42S22: Unknown column '' in 'VALUES() function'
159UPDATE t2 SET a=(SELECT '' AS b FROM t1 GROUP BY VALUES(b));
160ERROR 42S22: Unknown column '' in 'VALUES() function'
161INSERT INTO t2 VALUES (1,0) ON DUPLICATE KEY UPDATE
162b=(SELECT '' AS b FROM t1 GROUP BY VALUES(b));
163ERROR 42S22: Unknown column '' in 'VALUES() function'
164INSERT INTO t2(a,b) VALUES (1,0) ON DUPLICATE KEY UPDATE
165b=(SELECT VALUES(a)+2 FROM t1);
166DROP TABLE t1, t2;
167