4
select charset(database());
7
select database() = "test";
10
select database() = _utf8"test";
11
database() = _utf8"test"
13
select database() = _latin1"test";
14
database() = _latin1"test"
16
select user() like "%@%";
19
select user() like _utf8"%@%";
20
user() like _utf8"%@%"
22
select user() like _latin1"%@%";
23
user() like _latin1"%@%"
25
select charset(user());
28
select version()>="3.23.29";
31
select version()>=_utf8"3.23.29";
32
version()>=_utf8"3.23.29"
34
select version()>=_latin1"3.23.29";
35
version()>=_latin1"3.23.29"
37
select charset(version());
40
explain extended select database(), user();
41
id select_type table type possible_keys key key_len ref rows filtered Extra
42
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
44
Note 1003 select database() AS "database()",user() AS "user()"
45
create table t1 (version char(60)) select database(), user(), version() as 'version';
48
t1 CREATE TABLE "t1" (
49
"database()" varchar(34) CHARACTER SET utf8,
50
"user()" varchar(77) CHARACTER SET utf8 NOT NULL,
52
) ENGINE=MyISAM DEFAULT CHARSET=latin1
54
select charset(charset(_utf8'a')), charset(collation(_utf8'a'));
55
charset(charset(_utf8'a')) charset(collation(_utf8'a'))
57
select collation(charset(_utf8'a')), collation(collation(_utf8'a'));
58
collation(charset(_utf8'a')) collation(collation(_utf8'a'))
59
utf8_general_ci utf8_general_ci
60
create table t1 select charset(_utf8'a'), collation(_utf8'a');
63
t1 CREATE TABLE "t1" (
64
"charset(_utf8'a')" varchar(64) CHARACTER SET utf8 NOT NULL,
65
"collation(_utf8'a')" varchar(64) CHARACTER SET utf8 NOT NULL
66
) ENGINE=MyISAM DEFAULT CHARSET=latin1
68
select TRUE,FALSE,NULL;
71
create table t1 (c1 char(5)) character set=latin1;
72
insert into t1 values('row 1');
73
insert into t1 values('row 2');
74
insert into t1 values('row 3');
75
select concat(user(), '--', c1) from t1;
76
concat(user(), '--', c1)
80
select concat(database(), '--', c1) from t1;
81
concat(database(), '--', c1)
86
create table t1 (a char(10)) character set latin1;
87
select * from t1 where a=version();
89
select * from t1 where a=database();
91
select * from t1 where a=user();
93
insert into t1 values ('a');
94
select left(concat(a,version()),1) from t1;
95
left(concat(a,version()),1)