1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#
# system functions
#
select database();
select database() = "test";
select user() like "%@%";
select version() > "2009.01.756";
explain extended select database(), user();
create table t1 (version char(60)) select database(), user(), version() as 'version';
show create table t1;
drop table t1;
select TRUE,FALSE,NULL;
#
# Bug#12351: CONCAT with USER()/DATEBASE() and
# a constant and a column gets strange results
#
create table t1 (c1 char(5));
insert into t1 values('row 1');
insert into t1 values('row 2');
insert into t1 values('row 3');
select concat(SUBSTRING(user(), 0, 4), '--', c1) from t1;
select concat(database(), '--', c1) from t1;
drop table t1;
#
# Bug#8291 Illegal collation mix with USER() function
#
create table t1 (a char(10));
select * from t1 where a=version();
select * from t1 where a=database();
select * from t1 where a=user();
insert into t1 values ('a');
select left(concat(a,version()),1) from t1;
drop table t1;
# End of 4.1 tests
|