2003-05-23 07:55:49 +02:00
|
|
|
select database();
|
|
|
|
database()
|
|
|
|
test
|
|
|
|
select charset(database());
|
|
|
|
charset(database())
|
|
|
|
utf8
|
|
|
|
select database() = "test";
|
|
|
|
database() = "test"
|
|
|
|
1
|
|
|
|
select database() = _utf8"test";
|
|
|
|
database() = _utf8"test"
|
|
|
|
1
|
|
|
|
select database() = _latin1"test";
|
|
|
|
database() = _latin1"test"
|
|
|
|
1
|
|
|
|
select user() like "%@%";
|
|
|
|
user() like "%@%"
|
|
|
|
1
|
|
|
|
select user() like _utf8"%@%";
|
|
|
|
user() like _utf8"%@%"
|
|
|
|
1
|
|
|
|
select user() like _latin1"%@%";
|
|
|
|
user() like _latin1"%@%"
|
|
|
|
1
|
|
|
|
select charset(user());
|
|
|
|
charset(user())
|
|
|
|
utf8
|
|
|
|
select version()>="3.23.29";
|
|
|
|
version()>="3.23.29"
|
|
|
|
1
|
2003-03-19 16:13:28 +01:00
|
|
|
select version()>=_utf8"3.23.29";
|
|
|
|
version()>=_utf8"3.23.29"
|
2000-12-28 02:56:38 +01:00
|
|
|
1
|
2003-05-23 07:55:49 +02:00
|
|
|
select version()>=_latin1"3.23.29";
|
|
|
|
version()>=_latin1"3.23.29"
|
|
|
|
1
|
|
|
|
select charset(version());
|
|
|
|
charset(version())
|
|
|
|
utf8
|
2003-10-30 11:57:26 +01:00
|
|
|
explain extended select database(), user();
|
|
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
|
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
|
|
|
Warnings:
|
2004-05-13 22:47:20 +02:00
|
|
|
Note 1003 select sql_no_cache database() AS `database()`,user() AS `user()`
|
2003-06-04 17:28:51 +02:00
|
|
|
create table t1 (version char(40)) select database(), user(), version() as 'version';
|
2003-05-23 07:55:49 +02:00
|
|
|
show create table t1;
|
|
|
|
Table Create Table
|
|
|
|
t1 CREATE TABLE `t1` (
|
2003-08-11 15:18:34 +02:00
|
|
|
`database()` char(34) character set utf8 NOT NULL default '',
|
|
|
|
`user()` char(77) character set utf8 NOT NULL default '',
|
|
|
|
`version` char(40) default NULL
|
2003-12-10 05:31:42 +01:00
|
|
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
2003-05-23 07:55:49 +02:00
|
|
|
drop table t1;
|
2004-02-11 13:53:39 +01:00
|
|
|
select charset(charset(_utf8'a')), charset(collation(_utf8'a'));
|
|
|
|
charset(charset(_utf8'a')) charset(collation(_utf8'a'))
|
|
|
|
utf8 utf8
|
|
|
|
select collation(charset(_utf8'a')), collation(collation(_utf8'a'));
|
|
|
|
collation(charset(_utf8'a')) collation(collation(_utf8'a'))
|
|
|
|
utf8_general_ci utf8_general_ci
|
|
|
|
create table t1 select charset(_utf8'a'), collation(_utf8'a');
|
|
|
|
show create table t1;
|
|
|
|
Table Create Table
|
|
|
|
t1 CREATE TABLE `t1` (
|
|
|
|
`charset(_utf8'a')` char(64) character set utf8 NOT NULL default '',
|
|
|
|
`collation(_utf8'a')` char(64) character set utf8 NOT NULL default ''
|
|
|
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
|
|
|
drop table t1;
|
2002-11-21 01:07:14 +01:00
|
|
|
select TRUE,FALSE,NULL;
|
|
|
|
TRUE FALSE NULL
|
|
|
|
1 0 NULL
|