81
81
# attributes from values they were initialized to.
85
select charset(@a),collation(@a),coercibility(@a);
86
select @a=_latin2'TEST';
87
select @a=_latin2'TEST' collate latin2_bin;
85
select collation(@a),coercibility(@a);
87
select @a='TEST' collate utf8_bin;
89
set @a=_latin2'test' collate latin2_general_ci;
90
select charset(@a),collation(@a),coercibility(@a);
91
select @a=_latin2'TEST';
92
select @a=_latin2'TEST' collate latin2_bin;
89
set @a='test' collate utf8_general_ci;
90
select collation(@a),coercibility(@a);
92
select @a='TEST' collate utf8_bin;
95
95
# Check the same invoking Item_set_user_var
97
select charset(@a:=_latin2'test');
98
select collation(@a:=_latin2'test');
99
select coercibility(@a:=_latin2'test');
100
select collation(@a:=_latin2'test' collate latin2_bin);
101
select coercibility(@a:=_latin2'test' collate latin2_bin);
102
select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST';
103
select charset(@a),collation(@a),coercibility(@a);
104
select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' collate latin2_general_ci;
97
select collation(@a:='test');
98
select coercibility(@a:='test');
99
select collation(@a:='test' collate utf8_bin);
100
select coercibility(@a:='test' collate utf8_bin);
101
select (@a:='test' collate utf8_bin) = 'TEST';
102
select collation(@a),coercibility(@a);
103
select (@a:='test' collate utf8_bin) = 'TEST' collate utf8_general_ci;
107
106
# Bug #6321 strange error:
152
149
set @first_var= NULL;
153
150
create table t1 select @first_var;
154
show create table t1;
156
set @first_var= cast(NULL as signed integer);
157
create table t1 select @first_var;
158
show create table t1;
151
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
152
show create table t1;
155
# This is not supported by Drizzle
157
set @first_var= cast(NULL as integer);
158
#create table t1 select @first_var;
159
#--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
160
#show create table t1;
160
163
set @first_var= NULL;
161
164
create table t1 select @first_var;
165
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
162
166
show create table t1;
164
168
set @first_var= concat(NULL);
165
169
create table t1 select @first_var;
170
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
166
171
show create table t1;
168
173
set @first_var=1;
169
174
set @first_var= cast(NULL as CHAR);
170
175
create table t1 select @first_var;
176
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
171
177
show create table t1;
175
# Bug #7498 User variable SET saves SIGNED BIGINT as UNSIGNED BIGINT
181
# Bug #7498 User variable SET saves SIGNED BIGINT as BIGINT
178
184
# First part, set user var to large number and select it
182
188
# Second part, set user var from large number in table
184
190
CREATE TABLE `bigfailure` (
185
`afield` BIGINT UNSIGNED NOT NULL
191
`afield` BIGINT NOT NULL
187
193
INSERT INTO `bigfailure` VALUES (18446744071710965857);
188
194
SELECT * FROM bigfailure;
190
196
select * from bigfailure where afield = (SELECT afield FROM bigfailure);
191
197
select * from bigfailure where afield = 18446744071710965857;
192
198
# This is fixed in 5.0, to be uncommented there
193
#select * from bigfailure where afield = '18446744071710965857';
199
select * from bigfailure where afield = '18446744071710965857';
194
200
select * from bigfailure where afield = 18446744071710965856+1;
196
202
SET @a := (SELECT afield FROM bigfailure);
210
216
insert into t1 values (1,2),(2,3),(3,1);
211
217
select @var:=f2 from t1 group by f1 order by f2 desc limit 1;
213
create table t2 as select @var:=f2 from t1 group by f1 order by f2 desc limit 1;
219
# Bug 310977, uncomment this test after the bug is fixed
220
#create table t2 as select @var:=f2 from t1 group by f1 order by f2 desc limit 1;
219
227
# Bug#19024 - SHOW COUNT(*) WARNINGS not return Errors