Oracle 5.0 Reference Manual page 979

Table of Contents

Advertisement

Coercibility
Meaning
Implicit
2
collation
System
3
constant
Coercible
4
Ignorable
5
Before MySQL 5.0.3, the return values are shown as follows, and functions such as
have a coercibility of 2:
Coercibility
Meaning
Explicit
0
collation
No collation
1
Implicit
2
collation
Coercible
3
[959]
COLLATION(str)
Returns the collation of the string argument.
mysql>
SELECT COLLATION('abc');
-> 'latin1_swedish_ci'
mysql>
SELECT COLLATION(_utf8'abc');
-> 'utf8_general_ci'
CONNECTION_ID()
Returns the connection ID (thread ID) for the connection. Every connection has an ID that is unique
among the set of currently connected clients.
mysql>
SELECT CONNECTION_ID();
-> 23786
[959],
CURRENT_USER
Returns the user name and host name combination for the MySQL account that the server used to
authenticate the current client. This account determines your access privileges. The return value is a
string in the
character set.
utf8
The value of
CURRENT_USER()
mysql>
SELECT USER();
-> 'davida@localhost'
mysql>
SELECT * FROM mysql.user;
ERROR 1044: Access denied for user ''@'localhost' to
database 'mysql'
mysql>
SELECT CURRENT_USER();
-> '@localhost'
The example illustrates that although the client specified a user name of
value of the
USER()
account (as seen by the empty user name part of the
this might occur is that there is no account listed in the grant tables for davida.
Within a stored program or view,
who defined the object (as given by its
Information Functions
Example
Column value
[964]
USER()
Literal string
or an expression derived from
NULL
Example
Value with
COLLATE
Concatenation of strings with different collations
Column value, stored routine parameter or local variable
Literal string
[959]
[959]
CURRENT_USER()
[959]
can differ from the value of
[964]
function), the server authenticated the client using an anonymous user
CURRENT_USER()
DEFINER
959
return value
NULL
clause
USER()
CURRENT_USER()
[959]
returns the account for the user
value) unless defined with the
[964]
USER()
[964].
(as indicated by the
davida
[959]
value). One way
SQL SECURITY

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents