1
# Test coercibility function
2
--source include/have_coercibility_function.inc
5
select coercibility('hello' collate utf8_roman_ci);
8
# Can't figure out any way of doing this without an error (probably as it should be)
12
select coercibility(@a);
15
select coercibility(user());
18
select coercibility('hello');
21
select coercibility(NULL);
23
# From func_group.test
24
create table t1 (a char(10));
25
insert into t1 values ('a'),('b'),('c');
26
select coercibility(max(a)) from t1;
30
explain extended select coercibility(conv(130,16,10));
32
# Next 3 from user_var.test
35
# Bug #2244: User variables didn't copy collation and derivation
36
# attributes from values they were initialized to.
40
select collation(@a),coercibility(@a);
42
select @a='TEST' collate utf8_bin;
44
set @a='test' collate utf8_general_ci;
45
select collation(@a),coercibility(@a);
47
select @a='TEST' collate utf8_bin;
50
# Check the same invoking Item_set_user_var
52
select collation(@a:='test');
53
select coercibility(@a:='test');
54
select collation(@a:='test' collate utf8_bin);
55
select coercibility(@a:='test' collate utf8_bin);
56
select (@a:='test' collate utf8_bin) = 'TEST';
57
select collation(@a),coercibility(@a);
58
select (@a:='test' collate utf8_bin) = 'TEST' collate utf8_general_ci;
61
# Bug#9425 A user variable doesn't always have implicit coercibility
63
select @v, coercibility(@v);
64
set @v1=null, @v2=1, @v3=1.1, @v4=now();
65
select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4);