Oracle 5.0 Reference Manual page 985

Table of Contents

Advertisement

Name
[965]
GET_LOCK()
[966]
INET_ATON()
[966]
INET_NTOA()
[966]
IS_FREE_LOCK()
[966]
IS_USED_LOCK()
MASTER_POS_WAIT()
[967]
NAME_CONST()
[912]
RAND()
[967]
RELEASE_LOCK()
[967]
SLEEP()
[967]
UUID()
[968]
VALUES()
DEFAULT(col_name)
Returns the default value for a table column. Starting with MySQL 5.0.2, an error results if the
column has no default value.
mysql>
UPDATE t SET i = DEFAULT(i)+1 WHERE id < 100;
[889]
FORMAT(X,D)
Formats the number
the result as a string. For details, see
GET_LOCK(str,timeout)
Tries to obtain a lock with a name given by the string str, using a timeout of
Returns
if the lock was obtained successfully,
1
another client has previously locked the name), or
of memory or the thread was killed with
[965], it is released when you execute
GET_LOCK()
[965], or your connection terminates (either normally or abnormally). Locks obtained
GET_LOCK()
with
[965]
GET_LOCK()
not release any such locks obtained during the transaction.
This function can be used to implement application locks or to simulate record locks. Names are
locked on a server-wide basis. If a name has been locked by one client,
any request by another client for a lock with the same name. This enables clients that agree on a
given lock name to use the name to perform cooperative advisory locking. But be aware that it also
enables a client that is not among the set of cooperating clients to lock a name, either inadvertently
or deliberately, and thus prevent any of the cooperating clients from locking that name. One way to
reduce the likelihood of this is to use lock names that are database-specific or application-specific.
For example, use lock names of the form
mysql>
SELECT GET_LOCK('lock1',10);
-> 1
mysql>
SELECT IS_FREE_LOCK('lock2');
-> 1
mysql>
SELECT GET_LOCK('lock2',10);
-> 1
mysql>
SELECT RELEASE_LOCK('lock2');
-> 1
mysql>
SELECT RELEASE_LOCK('lock1');
Miscellaneous Functions
Description
Get a named lock
Return the numeric value of an IP address
Return the IP address from a numeric value
Checks whether the named lock is free
Checks whether the named lock is in use. Return connection
identifier if true.
[966]
Block until the slave has read and applied all updates up to
the specified position
Causes the column to have the given name
Return a random floating-point value
Releases the named lock
Sleep for a number of seconds
Return a Universal Unique Identifier (UUID)
Defines the values to be used during an INSERT
[965]
to a format like '#,###,###.##', rounded to
X
Section 12.5, "String
[965]
mysqladmin
do not interact with transactions. That is, committing a transaction does
db_name.str
965
D
Functions".
if the attempt timed out (for example, because
0
if an error occurred (such as running out
NULL
kill). If you have a lock obtained with
RELEASE_LOCK()
or app_name.str.
decimal places, and returns
seconds.
timeout
[967], execute a new
[965]
blocks
GET_LOCK()

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents