1.route:list Doitforyou

WHILE

Syntax:
[begin_label:] WHILE search_condition DO
statement_list
END WHILE [end_label]

The statement list within a WHILE statement is repeated as long as the
search_condition expression is true. statement_list consists of one or
more SQL statements, each terminated by a semicolon (;) statement
delimiter.

A WHILE statement can be labeled. For the rules regarding label use,
see [HELP labels].

URL: https://mariadb.com/kb/en/while/


SHOW COLLATION

Syntax:
SHOW COLLATION
[LIKE 'pattern' | WHERE expr]

This statement lists collations supported by the server. By default,
the output from SHOW COLLATION includes all available collations. The
LIKE clause, if present, indicates which collation names to match. The
WHERE clause can be given to select rows using more general conditions,
as discussed in
https://mariadb.com/kb/en/extended-show/. For example:


MariaDB> SHOW COLLATION LIKE 'latin1%';
+-------------------+---------+----+---------+----------+---------+
| Collation | Charset | Id | Default | Compiled | Sortlen |
+-------------------+---------+----+---------+----------+---------+
| latin1_german1_ci | latin1 | 5 | | | 0 |
| latin1_swedish_ci | latin1 | 8 | Yes | Yes | 0 |
| latin1_danish_ci | latin1 | 15 | | | 0 |
| latin1_german2_ci | latin1 | 31 | | Yes | 2 |
| latin1_bin | latin1 | 47 | | Yes | 0 |
| latin1_general_ci | latin1 | 48 | | | 0 |
| latin1_general_cs | latin1 | 49 | | | 0 |
| latin1_spanish_ci | latin1 | 94 | | | 0 |
+-------------------+---------+----+---------+----------+---------+

URL: https://mariadb.com/kb/en/show-collation/


DATABASE

Syntax:
DATABASE()

Returns the default (current) database name as a string in the utf8
character set. If there is no default database, DATABASE() returns
NULL. Within a stored routine, the default database is the database
that the routine is associated with, which is not necessarily the same
as the database that is the default in the calling context.

URL: https://mariadb.com/kb/en/database/


IF FUNCTION

Syntax:
IF(expr1,expr2,expr3)

If expr1 is TRUE (expr1 <> 0 and expr1 <> NULL) then IF() returns
expr2; otherwise it returns expr3. IF() returns a numeric or string
value, depending on the context in which it is used.

URL: https://mariadb.com/kb/en/if-function/


ALTER TABLESPACE

Syntax:
ALTER TABLESPACE tablespace_name
{ADD|DROP} DATAFILE 'file_name'
[INITIAL_SIZE [=] size]
[WAIT]
ENGINE [=] engine_name

This statement is used with NDB cluster, which is not supported by MariaDB.

URL: https://mariadb.com/kb/en/alter-tablespace/


MAKETIME

Syntax:
MAKETIME(hour,minute,second)

Returns a time value calculated from the hour, minute, and second
arguments.

URL: https://mariadb.com/kb/en/maketime/


FIELD

Syntax:
FIELD(str,str1,str2,str3,...)

Returns the index (position) of str in the str1, str2, str3, ... list.
Returns 0 if str is not found.

If all arguments to FIELD() are strings, all arguments are compared as
strings. If all arguments are numbers, they are compared as numbers.
Otherwise, the arguments are compared as double.

If str is NULL, the return value is 0 because NULL fails equality
comparison with any value. FIELD() is the complement of ELT().

URL: https://mariadb.com/kb/en/field/


CREATE SERVER

Syntax:
CREATE SERVER server_name
FOREIGN DATA WRAPPER wrapper_name
OPTIONS (option [, option] ...)

option:
{ HOST character-literal
| DATABASE character-literal
| USER character-literal
| PASSWORD character-literal
| SOCKET character-literal
| OWNER character-literal
| PORT numeric-literal }

This statement creates the definition of a server for use with the
FEDERATED storage engine. The CREATE SERVER statement creates a new row
within the servers table within the mysql database. This statement
requires the SUPER privilege.

The server_name should be a unique reference to the server. Server
definitions are global within the scope of the server, it is not
possible to qualify the server definition to a specific database.
server_name has a maximum length of 64 characters (names longer than 64
characters are silently truncated), and is case insensitive. You may
specify the name as a quoted string.

The wrapper_name should be mysql, and may be quoted with single
quotation marks. Other values for wrapper_name are not currently
supported.

For each option you must specify either a character literal or numeric
literal. Character literals are UTF-8, support a maximum length of 64
characters and default to a blank (empty) string. String literals are
silently truncated to 64 characters. Numeric literals must be a number
between 0 and 9999, default value is 0.

*Note*: Note that the OWNER option is currently not applied, and has no
effect on the ownership or operation of the server connection that is
created.

The CREATE SERVER statement creates an entry in the mysql.servers table
that can later be used with the CREATE TABLE statement when creating a
FEDERATED table. The options that you specify will be used to populate
the columns in the mysql.servers table. The table columns are
Server_name, Host, Db, Username, Password, Port and Socket.

URL: https://mariadb.com/kb/en/create-server/


REPAIR TABLE

Syntax:
REPAIR [NO_WRITE_TO_BINLOG | LOCAL] TABLE
tbl_name [, tbl_name] ...
[QUICK] [EXTENDED] [USE_FRM]

REPAIR TABLE repairs a possibly corrupted table. By default, it has the
same effect as myisamchk --recover tbl_name. REPAIR TABLE works for
MyISAM, ARCHIVE, and CSV tables. See
https://mariadb.com/kb/en/myisam-storage-engine/, and
https://mariadb.com/kb/en/archive/, and
https://mariadb.com/kb/en/csv/

This statement requires SELECT and INSERT privileges for the table.

REPAIR TABLE is supported for partitioned tables. However, the USE_FRM
option cannot be used with this statement on a partitioned table.

You can use ALTER TABLE ... REPAIR PARTITION to repair one or more
partitions; for more information, see [HELP ALTER TABLE], and
http://dev.mysql.com/doc/refman/5.5/en/partitioning-maintenance.html.

URL: https://mariadb.com/kb/en/repair-table/


MPOINTFROMWKB

MPointFromWKB(wkb[,srid]), MultiPointFromWKB(wkb[,srid])

Constructs a MULTIPOINT value using its WKB representation and SRID.

URL: https://mariadb.com/kb/en/mpointfromwkb/


IS

Syntax:
IS boolean_value

Tests a value against a boolean value, where boolean_value can be TRUE,
FALSE, or UNKNOWN.

URL: https://mariadb.com/kb/en/is/


SIN

Syntax:
SIN(X)

Returns the sine of X, where X is given in radians.

URL: https://mariadb.com/kb/en/sin/


ISOLATION

Syntax:
SET [GLOBAL | SESSION] TRANSACTION ISOLATION LEVEL
{
REPEATABLE READ
| READ COMMITTED
| READ UNCOMMITTED
| SERIALIZABLE
}

This statement sets the transaction isolation level, used for
operations on InnoDB tables.

Scope of the Isolation Level

You can set the isolation level globally, for the current session, or
for the next transaction:

o With the GLOBAL keyword, the statement sets the default transaction
level globally for all subsequent sessions. Existing sessions are
unaffected.

o With the SESSION keyword, the statement sets the default transaction
level for all subsequent transactions performed within the current
session.

o Without any SESSION or GLOBAL keyword, the statement sets the
isolation level for the next (not started) transaction performed
within the current session.

A change to the global default isolation level requires the SUPER
privilege. Any session is free to change its session isolation level
(even in the middle of a transaction), or the isolation level for its
next transaction.

SET TRANSACTION ISOLATION LEVEL without GLOBAL or SESSION is not
permitted while there is an active transaction:

MariaDB> START TRANSACTION;
Query OK, 0 rows affected (0.02 sec)

MariaDB> SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
ERROR 1568 (25001): Transaction isolation level can't be changed
while a transaction is in progress

To set the global default isolation level at server startup, use the
--transaction-isolation=level option to mysqld on the command line or
in an option file. Values of level for this option use dashes rather
than spaces, so the permissible values are READ-UNCOMMITTED,
READ-COMMITTED, REPEATABLE-READ, or SERIALIZABLE. For example, to set
the default isolation level to REPEATABLE READ, use these lines in the
[mysqld] section of an option file:

[mysqld]
transaction-isolation = REPEATABLE-READ

It is possible to check or set the global and session transaction
isolation levels at runtime by using the tx_isolation system variable:

SELECT @@GLOBAL.tx_isolation, @@tx_isolation;
SET GLOBAL tx_isolation='REPEATABLE-READ';
SET SESSION tx_isolation='SERIALIZABLE';

Details and Usage of Isolation Levels

InnoDB supports each of the transaction isolation levels described here
using different locking strategies. You can enforce a high degree of
consistency with the default REPEATABLE READ level, for operations on
crucial data where ACID compliance is important. Or you can relax the
consistency rules with READ COMMITTED or even READ UNCOMMITTED, in
situations such as bulk reporting where precise consistency and
repeatable results are less important than minimizing the amount of
overhead for locking. SERIALIZABLE enforces even stricter rules than
REPEATABLE READ, and is used mainly in specialized situations, such as
with XA transactions and for troubleshooting issues with concurrency
and deadlocks.

For full information about how these isolation levels work with InnoDB
transactions, see
http://dev.mysql.com/doc/refman/5.1/en/innodb-transaction-model.html.
In particular, for additional information about InnoDB record-level
locks and how it uses them to execute various types of statements, see
http://dev.mysql.com/doc/refman/5.5/en/innodb-record-level-locks.html
and http://dev.mysql.com/doc/refman/5.5/en/innodb-locks-set.html.

The following list describes how MySQL supports the different
transaction levels. The list goes from the most commonly used level to
the least used.

o REPEATABLE READ

This is the default isolation level for InnoDB. For consistent reads,
there is an important difference from the READ COMMITTED isolation
level: All consistent reads within the same transaction read the
snapshot established by the first read. This convention means that if
you issue several plain (nonlocking) SELECT statements within the
same transaction, these SELECT statements are consistent also with
respect to each other. See
http://dev.mysql.com/doc/refman/5.5/en/innodb-consistent-read.html.

For locking reads (SELECT with FOR UPDATE or LOCK IN SHARE MODE),
UPDATE, and DELETE statements, locking depends on whether the
statement uses a unique index with a unique search condition, or a
range-type search condition. For a unique index with a unique search
condition, InnoDB locks only the index record found, not the gap
before it. For other search conditions, InnoDB locks the index range
scanned, using gap locks or next-key (gap plus index-record) locks to
block insertions by other sessions into the gaps covered by the
range.

o READ COMMITTED

A somewhat Oracle-like isolation level with respect to consistent
(nonlocking) reads: Each consistent read, even within the same
transaction, sets and reads its own fresh snapshot. See
http://dev.mysql.com/doc/refman/5.5/en/innodb-consistent-read.html.

For locking reads (SELECT with FOR UPDATE or LOCK IN SHARE MODE),
InnoDB locks only index records, not the gaps before them, and thus
permits the free insertion of new records next to locked records. For
UPDATE and DELETE statements, locking depends on whether the
statement uses a unique index with a unique search condition (such as
WHERE id = 100), or a range-type search condition (such as WHERE id >
100). For a unique index with a unique search condition, InnoDB locks
only the index record found, not the gap before it. For range-type
searches, InnoDB locks the index range scanned, using gap locks or
next-key (gap plus index-record) locks to block insertions by other
sessions into the gaps covered by the range. This is necessary
because "phantom rows" must be blocked for MySQL replication and
recovery to work.

*Note*: In MySQL 5.5, if the READ COMMITTED isolation level is used
or the innodb_locks_unsafe_for_binlog system variable is enabled,
there is no InnoDB gap locking except for foreign-key constraint
checking and duplicate-key checking. Also, record locks for
nonmatching rows are released after MySQL has evaluated the WHERE
condition. If you use READ COMMITTED or enable
innodb_locks_unsafe_for_binlog, you must use row-based binary
logging.

o READ UNCOMMITTED

SELECT statements are performed in a nonlocking fashion, but a
possible earlier version of a row might be used. Thus, using this
isolation level, such reads are not consistent. This is also called a
"dirty read." Otherwise, this isolation level works like READ
COMMITTED.

o SERIALIZABLE

This level is like REPEATABLE READ, but InnoDB implicitly converts
all plain SELECT statements to SELECT ... LOCK IN SHARE MODE if
autocommit is disabled. If autocommit is enabled, the SELECT is its
own transaction. It therefore is known to be read only and can be
serialized if performed as a consistent (nonlocking) read and need
not block for other transactions. (To force a plain SELECT to block
if other transactions have modified the selected rows, disable
autocommit.)

URL: https://mariadb.com/kb/en/set-transaction-isolation-level/


INET_NTOA

Syntax:
INET_NTOA(expr)

Given a numeric IPv4 network address in network byte order, returns the
dotted-quad representation of the address as a string. INET_NTOA()
returns NULL if it does not understand its argument.

As of MySQL 5.5.3, the return value is a nonbinary string in the
connection character set. Before 5.5.3, the return value is a binary
string.

URL: https://mariadb.com/kb/en/inet_ntoa/


BIT_COUNT

Syntax:
BIT_COUNT(N)

Returns the number of bits that are set in the argument N.

URL: https://mariadb.com/kb/en/bit_count/


ALTER PROCEDURE

Syntax:
ALTER PROCEDURE proc_name [characteristic ...]

characteristic:
COMMENT 'string'
| LANGUAGE SQL
| { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
| SQL SECURITY { DEFINER | INVOKER }

This statement can be used to change the characteristics of a stored
procedure. More than one change may be specified in an ALTER PROCEDURE
statement. However, you cannot change the parameters or body of a
stored procedure using this statement; to make such changes, you must
drop and re-create the procedure using DROP PROCEDURE and CREATE
PROCEDURE.

You must have the ALTER ROUTINE privilege for the procedure. By
default, that privilege is granted automatically to the procedure
creator. This behavior can be changed by disabling the
automatic_sp_privileges system variable. See
https://mariadb.com/kb/en/stored-routine-privileges/.

URL: https://mariadb.com/kb/en/alter-procedure/


EQUALS

Equals(g1,g2)

Returns 1 or 0 to indicate whether g1 is spatially equal to g2.

URL: https://mariadb.com/kb/en/equals/


DIMENSION

Dimension(g)

Returns the inherent dimension of the geometry value g. The result can
be -1, 0, 1, or 2. The meaning of these values is given in
https://mariadb.com/kb/en/dimension/.

URL: https://mariadb.com/kb/en/dimension/


UTC_DATE

Syntax:
UTC_DATE, UTC_DATE()

Returns the current UTC date as a value in 'YYYY-MM-DD' or YYYYMMDD
format, depending on whether the function is used in a string or
numeric context.

URL: https://mariadb.com/kb/en/utc_date/


CHAR

[NATIONAL] CHAR[(M)] [CHARACTER SET charset_name] [COLLATE
collation_name]

A fixed-length string that is always right-padded with spaces to the
specified length when stored. M represents the column length in
characters. The range of M is 0 to 255. If M is omitted, the length is
1.

*Note*: Trailing spaces are removed when CHAR values are retrieved
unless the PAD_CHAR_TO_FULL_LENGTH SQL mode is enabled.

URL: https://mariadb.com/kb/en/char/


PASSWORD

Syntax:
PASSWORD(str)

Calculates and returns a hashed password string from the plaintext
password str and returns a nonbinary string in the connection character
set (a binary string before MySQL 5.5.3), or NULL if the argument is
NULL. This function is the SQL interface to the algorithm used by the
server to encrypt MySQL passwords for storage in the mysql.user grant
table.

The password hashing method used by PASSWORD() depends on the value of
the old_passwords system variable:

URL: https://mariadb.com/kb/en/password/


SUBSTR

Syntax:
SUBSTR(str,pos), SUBSTR(str FROM pos), SUBSTR(str,pos,len), SUBSTR(str
FROM pos FOR len)

SUBSTR() is a synonym for SUBSTRING().

URL: https://mariadb.com/kb/en/substr/


SHA1

Syntax:
SHA1(str), SHA(str)

Calculates an SHA-1 160-bit checksum for the string, as described in
RFC 3174 (Secure Hash Algorithm). The value is returned as a string of
40 hex digits, or NULL if the argument was NULL. One of the possible
uses for this function is as a hash key. See the notes at the beginning
of this section about storing hash values efficiently. You can also use
SHA1() as a cryptographic function for storing passwords. SHA() is
synonymous with SHA1().

As of MySQL 5.5.3, the return value is a nonbinary string in the
connection character set. Before 5.5.3, the return value is a binary
string; see the notes at the beginning of this section about using the
value as a nonbinary string.

URL: https://mariadb.com/kb/en/sha1/


BLOB

BLOB[(M)]

A BLOB column with a maximum length of 65,535 (216 - 1) bytes. Each
BLOB value is stored using a 2-byte length prefix that indicates the
number of bytes in the value.

An optional length M can be given for this type. If this is done, MySQL
creates the column as the smallest BLOB type large enough to hold
values M bytes long.

URL: https://mariadb.com/kb/en/blob/


MPOINTFROMTEXT

MPointFromText(wkt[,srid]), MultiPointFromText(wkt[,srid])

Constructs a MULTIPOINT value using its WKT representation and SRID.

URL: https://mariadb.com/kb/en/mpointfromtext/


SHOW RELAYLOG EVENTS

Syntax:
SHOW RELAYLOG EVENTS
[IN 'log_name'] [FROM pos] [LIMIT [offset,] row_count]

Shows the events in the relay log of a replication slave. If you do not
specify 'log_name', the first relay log is displayed. This statement
has no effect on the master.

URL: https://mariadb.com/kb/en/show-relaylog-events/


LOCALTIME

Syntax:
LOCALTIME, LOCALTIME()

LOCALTIME and LOCALTIME() are synonyms for NOW().

URL: https://mariadb.com/kb/en/localtime/


MULTILINESTRING

MultiLineString(ls1,ls2,...)

Constructs a MultiLineString value using LineString or WKB LineString
arguments.

URL: https://mariadb.com/kb/en/multilinestring/


LOAD DATA

Syntax:
LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name'
[REPLACE | IGNORE]
INTO TABLE tbl_name
[CHARACTER SET charset_name]
[{FIELDS | COLUMNS}
[TERMINATED BY 'string']
[[OPTIONALLY] ENCLOSED BY 'char']
[ESCAPED BY 'char']
]
[LINES
[STARTING BY 'string']
[TERMINATED BY 'string']
]
[IGNORE number {LINES | ROWS}]
[(col_name_or_user_var,...)]
[SET col_name = expr,...]

The LOAD DATA INFILE statement reads rows from a text file into a table
at a very high speed. The file name must be given as a literal string.

LOAD DATA INFILE is the complement of SELECT ... INTO OUTFILE. (See
https://mariadb.com/kb/en/select-into/.) To write data
from a table to a file, use SELECT ... INTO OUTFILE. To read the file
back into a table, use LOAD DATA INFILE. The syntax of the FIELDS and
LINES clauses is the same for both statements. Both clauses are
optional, but FIELDS must precede LINES if both are specified.

For more information about the efficiency of INSERT versus LOAD DATA
INFILE and speeding up LOAD DATA INFILE, see
http://dev.mysql.com/doc/refman/5.5/en/insert-speed.html.

The character set indicated by the character_set_database system
variable is used to interpret the information in the file. SET NAMES
and the setting of character_set_client do not affect interpretation of
input. If the contents of the input file use a character set that
differs from the default, it is usually preferable to specify the
character set of the file by using the CHARACTER SET clause. A
character set of binary specifies "no conversion."

LOAD DATA INFILE interprets all fields in the file as having the same
character set, regardless of the data types of the columns into which
field values are loaded. For proper interpretation of file contents,
you must ensure that it was written with the correct character set. For
example, if you write a data file with mysqldump -T or by issuing a
SELECT ... INTO OUTFILE statement in mysql, be sure to use a
--default-character-set option with mysqldump or mysql so that output
is written in the character set to be used when the file is loaded with
LOAD DATA INFILE.

*Note*: It is not possible to load data files that use the ucs2, utf16,
or utf32 character set.

The character_set_filesystem system variable controls the
interpretation of the file name.

You can also load data files by using the mysqlimport utility; it
operates by sending a LOAD DATA INFILE statement to the server. The
--local option causes mysqlimport to read data files from the client
host. You can specify the --compress option to get better performance
over slow networks if the client and server support the compressed
protocol. See https://mariadb.com/kb/en/mysqlimport/.

If you use LOW_PRIORITY, execution of the LOAD DATA statement is
delayed until no other clients are reading from the table. This affects
only storage engines that use only table-level locking (such as MyISAM,
MEMORY, and MERGE).

If you specify CONCURRENT with a MyISAM table that satisfies the
condition for concurrent inserts (that is, it contains no free blocks
in the middle), other threads can retrieve data from the table while
LOAD DATA is executing. Using this option affects the performance of
LOAD DATA a bit, even if no other thread is using the table at the same
time.

Prior to MySQL 5.5.1, CONCURRENT was not replicated when using
statement-based replication (see Bug #34628). However, it is replicated
when using row-based replication, regardless of the version. See
http://dev.mysql.com/doc/refman/5.5/en/replication-features-load-data.h
tml, for more information.

The LOCAL keyword, if specified, is interpreted with respect to the
client end of the connection:

o If LOCAL is specified, the file is read by the client program on the
client host and sent to the server. The file can be given as a full
path name to specify its exact location. If given as a relative path
name, the name is interpreted relative to the directory in which the
client program was started.

When using LOCAL with LOAD DATA, a copy of the file is created in the
server's temporary directory. This is not the directory determined by
the value of tmpdir or slave_load_tmpdir, but rather the operating
system's temporary directory, and is not configurable in the MySQL
Server. (Typically the system temporary directory is /tmp on Linux
systems and C:\WINDOWS\TEMP on Windows.) Lack of sufficient space for
the copy in this directory can cause the LOAD DATA LOCAL statement to
fail.

o If LOCAL is not specified, the file must be located on the server
host and is read directly by the server. The server uses the
following rules to locate the file:

o If the file name is an absolute path name, the server uses it as
given.

o If the file name is a relative path name with one or more leading
components, the server searches for the file relative to the
server's data directory.

o If a file name with no leading components is given, the server
looks for the file in the database directory of the default
database.

Note that, in the non-LOCAL case, these rules mean that a file named as
./myfile.txt is read from the server's data directory, whereas the file
named as myfile.txt is read from the database directory of the default
database. For example, if db1 is the default database, the following
LOAD DATA statement reads the file data.txt from the database directory
for db1, even though the statement explicitly loads the file into a
table in the db2 database:

LOAD DATA INFILE 'data.txt' INTO TABLE db2.my_table;

Windows path names are specified using forward slashes rather than
backslashes. If you do use backslashes, you must double them.

For security reasons, when reading text files located on the server,
the files must either reside in the database directory or be readable
by all. Also, to use LOAD DATA INFILE on server files, you must have
the FILE privilege. See
https://mariadb.com/kb/en/grant/. For
non-LOCAL load operations, if the secure_file_priv system variable is
set to a nonempty directory name, the file to be loaded must be located
in that directory.

URL: https://mariadb.com/kb/en/load-data-infile/


DECLARE CURSOR

Syntax:
DECLARE cursor_name CURSOR FOR select_statement

This statement declares a cursor and associates it with a SELECT
statement that retrieves the rows to be traversed by the cursor. To
fetch the rows later, use a FETCH statement. The number of columns
retrieved by the SELECT statement must match the number of output
variables specified in the FETCH statement.

The SELECT statement cannot have an INTO clause.

Cursor declarations must appear before handler declarations and after
variable and condition declarations.

A stored program may contain multiple cursor declarations, but each
cursor declared in a given block must have a unique name. For an
example, see https://mariadb.com/kb/en/programmatic-and-compound-statements-cursors/.

For information available through SHOW statements, it is possible in
many cases to obtain equivalent information by using a cursor with an
INFORMATION_SCHEMA table.

URL: https://mariadb.com/kb/en/declare-cursor/


INSTALL PLUGIN

Syntax:
INSTALL PLUGIN plugin_name SONAME 'shared_library_name'

This statement installs a server plugin. It requires the INSERT
privilege for the mysql.plugin table.

plugin_name is the name of the plugin as defined in the plugin
descriptor structure contained in the library file (see
http://dev.mysql.com/doc/refman/5.5/en/plugin-data-structures.html).
Plugin names are not case sensitive. For maximal compatibility, plugin
names should be limited to ASCII letters, digits, and underscore
because they are used in C source files, shell command lines, M4 and
Bourne shell scripts, and SQL environments.

shared_library_name is the name of the shared library that contains the
plugin code. The name includes the file name extension (for example,
libmyplugin.so, libmyplugin.dll, or libmyplugin.dylib).

The shared library must be located in the plugin directory (the
directory named by the plugin_dir system variable). The library must be
in the plugin directory itself, not in a subdirectory. By default,
plugin_dir is the plugin directory under the directory named by the
pkglibdir configuration variable, but it can be changed by setting the
value of plugin_dir at server startup. For example, set its value in a
my.cnf file:

[mysqld]
plugin_dir=/path/to/plugin/directory

If the value of plugin_dir is a relative path name, it is taken to be
relative to the MySQL base directory (the value of the basedir system
variable).

INSTALL PLUGIN loads and initializes the plugin code to make the plugin
available for use. A plugin is initialized by executing its
initialization function, which handles any setup that the plugin must
perform before it can be used. When the server shuts down, it executes
the deinitialization function for each plugin that is loaded so that
the plugin has a change to perform any final cleanup.

INSTALL PLUGIN also registers the plugin by adding a line that
indicates the plugin name and library file name to the mysql.plugin
table. At server startup, the server loads and initializes any plugin
that is listed in the mysql.plugin table. This means that a plugin is
installed with INSTALL PLUGIN only once, not every time the server
starts. Plugin loading at startup does not occur if the server is
started with the --skip-grant-tables option.

A plugin library can contain multiple plugins. For each of them to be
installed, use a separate INSTALL PLUGIN statement. Each statement
names a different plugin, but all of them specify the same library
name.

URL: https://mariadb.com/kb/en/install-plugin/


BIN

Syntax:
BIN(N)

Returns a string representation of the binary value of N, where N is a
longlong (BIGINT) number. This is equivalent to CONV(N,10,2). Returns
NULL if N is NULL.

URL: https://mariadb.com/kb/en/bin/


CHECK TABLE

Syntax:
CHECK TABLE tbl_name [, tbl_name] ... [option] ...

option = {FOR UPGRADE | QUICK | FAST | MEDIUM | EXTENDED | CHANGED}

CHECK TABLE checks a table or tables for errors. CHECK TABLE works for
InnoDB, MyISAM, ARCHIVE, and CSV tables. For MyISAM tables, the key
statistics are updated as well.

To check a table, you must have some privilege for it.

CHECK TABLE can also check views for problems, such as tables that are
referenced in the view definition that no longer exist.

CHECK TABLE is supported for partitioned tables, and you can use ALTER
TABLE ... CHECK PARTITION to check one or more partitions; for more
information, see [HELP ALTER TABLE].

URL: https://mariadb.com/kb/en/sql-commands-check-table/


RIGHT

Syntax:
RIGHT(str,len)

Returns the rightmost len characters from the string str, or NULL if
any argument is NULL.

URL: https://mariadb.com/kb/en/right/


UUID_SHORT

Syntax:
UUID_SHORT()

Returns a "short" universal identifier as a 64-bit unsigned integer
(rather than a string-form 128-bit identifier as returned by the UUID()
function).

The value of UUID_SHORT() is guaranteed to be unique if the following
conditions hold:

o The server_id of the current host is unique among your set of master
and slave servers

o server_id is between 0 and 255

o You do not set back your system time for your server between mysqld
restarts

o You do not invoke UUID_SHORT() on average more than 16 million times
per second between mysqld restarts

The UUID_SHORT() return value is constructed this way:

(server_id & 255) << 56
+ (server_startup_time_in_seconds << 24)
+ incremented_variable++;

URL: https://mariadb.com/kb/en/uuid_short/


GEOMFROMTEXT

GeomFromText(wkt[,srid]), GeometryFromText(wkt[,srid])

Constructs a geometry value of any type using its WKT representation
and SRID.

URL: https://mariadb.com/kb/en/geomfromtext/


|

Syntax:
|

Bitwise OR:

URL: https://mariadb.com/kb/en/bitwise-or/


PERIOD_ADD

Syntax:
PERIOD_ADD(P,N)

Adds N months to period P (in the format YYMM or YYYYMM). Returns a
value in the format YYYYMM. Note that the period argument P is not a
date value.

URL: https://mariadb.com/kb/en/period_add/


DATE_SUB

Syntax:
DATE_SUB(date,INTERVAL expr unit)

See the description for DATE_ADD().

URL: https://mariadb.com/kb/en/date_sub/


STDDEV

Syntax:
STDDEV(expr)

Returns the population standard deviation of expr. This function is
provided for compatibility with Oracle. The standard SQL function
STDDEV_POP() can be used instead.

This function returns NULL if there were no matching rows.

URL: https://mariadb.com/kb/en/stddev/


DROP FUNCTION

The DROP FUNCTION statement is used to drop stored functions and
user-defined functions (UDFs):

o For information about dropping stored functions, see [HELP DROP
PROCEDURE].

o For information about dropping user-defined functions, see [HELP DROP
FUNCTION UDF].

URL: https://mariadb.com/kb/en/drop-function/


UTC_TIME

Syntax:
UTC_TIME, UTC_TIME()

Returns the current UTC time as a value in 'HH:MM:SS' or HHMMSS.uuuuuu
format, depending on whether the function is used in a string or
numeric context.

URL: https://mariadb.com/kb/en/utc_time/


INTERIORRINGN

InteriorRingN(poly,N)

Returns the N-th interior ring for the Polygon value poly as a
LineString. Rings are numbered beginning with 1.

URL: https://mariadb.com/kb/en/interiorringn/


NUMINTERIORRINGS

NumInteriorRings(poly)

Returns the number of interior rings in the Polygon value poly.

URL: https://mariadb.com/kb/en/numinteriorrings/


CHECKSUM TABLE

Syntax:
CHECKSUM TABLE tbl_name [, tbl_name] ... [ QUICK | EXTENDED ]

CHECKSUM TABLE reports a table checksum. This statement requires the
SELECT privilege for the table.

With QUICK, the live table checksum is reported if it is available, or
NULL otherwise. This is very fast. A live checksum is enabled by
specifying the CHECKSUM=1 table option when you create the table;
currently, this is supported only for MyISAM tables. See [HELP CREATE
TABLE].

With EXTENDED, the entire table is read row by row and the checksum is
calculated. This can be very slow for large tables.

If neither QUICK nor EXTENDED is specified, MySQL returns a live
checksum if the table storage engine supports it and scans the table
otherwise.

For a nonexistent table, CHECKSUM TABLE returns NULL and generates a
warning.

In MySQL 5.5, CHECKSUM TABLE returns 0 for partitioned tables unless
you include the EXTENDED option. This issue is resolved in MySQL 5.6.
(Bug #11933226, Bug #60681)

The checksum value depends on the table row format. If the row format
changes, the checksum also changes. For example, the storage format for
VARCHAR changed between MySQL 4.1 and 5.0, so if a 4.1 table is
upgraded to MySQL 5.0, the checksum value may change.

URL: https://mariadb.com/kb/en/checksum-table/


Y

Y(p)

Returns the Y-coordinate value for the Point object p as a
double-precision number.

URL: https://mariadb.com/kb/en/y/


CEIL

Syntax:
CEIL(X)

CEIL() is a synonym for CEILING().

URL: https://mariadb.com/kb/en/ceil/


DES_ENCRYPT

Syntax:
DES_ENCRYPT(str[,{key_num|key_str}])

Encrypts the string with the given key using the Triple-DES algorithm.

This function works only if MySQL has been configured with SSL support.
See https://mariadb.com/kb/en/ssl-connections/.

The encryption key to use is chosen based on the second argument to
DES_ENCRYPT(), if one was given. With no argument, the first key from
the DES key file is used. With a key_num argument, the given key number
(0 to 9) from the DES key file is used. With a key_str argument, the
given key string is used to encrypt str.

The key file can be specified with the --des-key-file server option.

The return string is a binary string where the first character is
CHAR(128 | key_num). If an error occurs, DES_ENCRYPT() returns NULL.

The 128 is added to make it easier to recognize an encrypted key. If
you use a string key, key_num is 127.

The string length for the result is given by this formula:

new_len = orig_len + (8 - (orig_len % 8)) + 1

Each line in the DES key file has the following format:

key_num des_key_str

Each key_num value must be a number in the range from 0 to 9. Lines in
the file may be in any order. des_key_str is the string that is used to
encrypt the message. There should be at least one space between the
number and the key. The first key is the default key that is used if
you do not specify any key argument to DES_ENCRYPT().

You can tell MySQL to read new key values from the key file with the
FLUSH DES_KEY_FILE statement. This requires the RELOAD privilege.

One benefit of having a set of default keys is that it gives
applications a way to check for the existence of encrypted column
values, without giving the end user the right to decrypt those values.

URL: https://mariadb.com/kb/en/des_encrypt/


POLYFROMTEXT

PolyFromText(wkt[,srid]), PolygonFromText(wkt[,srid])

Constructs a POLYGON value using its WKT representation and SRID.

URL: https://mariadb.com/kb/en/polyfromtext/


IS_USED_LOCK

Syntax:
IS_USED_LOCK(str)

Checks whether the lock named str is in use (that is, locked). If so,
it returns the connection identifier of the client that holds the lock.
Otherwise, it returns NULL.

URL: https://mariadb.com/kb/en/is_used_lock/


SHOW CREATE FUNCTION

Syntax:
SHOW CREATE FUNCTION func_name

This statement is similar to SHOW CREATE PROCEDURE but for stored
functions. See [HELP SHOW CREATE PROCEDURE].

URL: https://mariadb.com/kb/en/show-create-function/


POSITION

Syntax:
POSITION(substr IN str)

POSITION(substr IN str) is a synonym for LOCATE(substr,str).

URL: https://mariadb.com/kb/en/position/


QUARTER

Syntax:
QUARTER(date)

Returns the quarter of the year for date, in the range 1 to 4.

URL: https://mariadb.com/kb/en/quarter/


QUOTE

Syntax:
QUOTE(str)

Quotes a string to produce a result that can be used as a properly
escaped data value in an SQL statement. The string is returned enclosed
by single quotation marks and with each instance of backslash ("\"),
single quote ("'"), ASCII NUL, and Control+Z preceded by a backslash.
If the argument is NULL, the return value is the word "NULL" without
enclosing single quotation marks.

URL: https://mariadb.com/kb/en/quote/


IN

Syntax:
expr IN (value,...)

Returns 1 if expr is equal to any of the values in the IN list, else
returns 0. If all values are constants, they are evaluated according to
the type of expr and sorted. The search for the item then is done using
a binary search. This means IN is very quick if the IN value list
consists entirely of constants. Otherwise, type conversion takes place
according to the rules described in
https://mariadb.com/kb/en/type-conversion/, but
applied to all the arguments.

URL: https://mariadb.com/kb/en/in/


SESSION_USER

Syntax:
SESSION_USER()

SESSION_USER() is a synonym for USER().

URL: https://mariadb.com/kb/en/session_user/


MBRWITHIN

MBRWithin(g1,g2)

Returns 1 or 0 to indicate whether the Minimum Bounding Rectangle of g1
is within the Minimum Bounding Rectangle of g2. This tests the opposite
relationship as MBRContains().

URL: https://mariadb.com/kb/en/mbrwithin/


TRUE FALSE

The constants TRUE and FALSE evaluate to 1 and 0, respectively. The
constant names can be written in any lettercase.

MariaDB> SELECT TRUE, true, FALSE, false;
-> 1, 1, 0, 0

URL: https://mariadb.com/kb/en/true-false/


AVG

Syntax:
AVG([DISTINCT] expr)

Returns the average value of expr. The DISTINCT option can be used to
return the average of the distinct values of expr.

AVG() returns NULL if there were no matching rows.

URL: https://mariadb.com/kb/en/avg/


FETCH

Syntax:
FETCH [[NEXT] FROM] cursor_name INTO var_name [, var_name] ...

This statement fetches the next row for the SELECT statement associated
with the specified cursor (which must be open), and advances the cursor
pointer. If a row exists, the fetched columns are stored in the named
variables. The number of columns retrieved by the SELECT statement must
match the number of output variables specified in the FETCH statement.

If no more rows are available, a No Data condition occurs with SQLSTATE
value '02000'. To detect this condition, you can set up a handler for
it (or for a NOT FOUND condition). For an example, see
https://mariadb.com/kb/en/cursor-overview/.

URL: https://mariadb.com/kb/en/fetch/


>>

Syntax:
>>

Shifts a longlong (BIGINT) number to the right.

URL: https://mariadb.com/kb/en/shift-right/


MULTIPOINT

MultiPoint(pt1,pt2,...)

Constructs a MultiPoint value using Point or WKB Point arguments.

URL: https://mariadb.com/kb/en/multipoint/


LIKE

Syntax:
expr LIKE pat [ESCAPE 'escape_char']

Pattern matching using SQL simple regular expression comparison.
Returns 1 (TRUE) or 0 (FALSE). If either expr or pat is NULL, the
result is NULL.

The pattern need not be a literal string. For example, it can be
specified as a string expression or table column.

URL: https://mariadb.com/kb/en/like/


PERIOD_DIFF

Syntax:
PERIOD_DIFF(P1,P2)

Returns the number of months between periods P1 and P2. P1 and P2
should be in the format YYMM or YYYYMM. Note that the period arguments
P1 and P2 are not date values.

URL: https://mariadb.com/kb/en/period_diff/


SOUNDS LIKE

Syntax:
expr1 SOUNDS LIKE expr2

This is the same as SOUNDEX(expr1) = SOUNDEX(expr2).

URL: https://mariadb.com/kb/en/sounds-like/


CAST

Syntax:
CAST(expr AS type)

The CAST() function takes an expression of any type and produces a
result value of a specified type, similar to CONVERT(). See the
description of CONVERT() for more information.

URL: https://mariadb.com/kb/en/cast/


DATE_ADD

Syntax:
DATE_ADD(date,INTERVAL expr unit), DATE_SUB(date,INTERVAL expr unit)

These functions perform date arithmetic. The date argument specifies
the starting date or datetime value. expr is an expression specifying
the interval value to be added or subtracted from the starting date.
expr is a string; it may start with a "-" for negative intervals. unit
is a keyword indicating the units in which the expression should be
interpreted.

URL: https://mariadb.com/kb/en/date_add/


TIME FUNCTION

Syntax:
TIME(expr)

Extracts the time part of the time or datetime expression expr and
returns it as a string.

URL: https://mariadb.com/kb/en/time-function/


RESIGNAL

Syntax:
RESIGNAL [condition_value]
[SET signal_information_item
[, signal_information_item] ...]

condition_value:
SQLSTATE [VALUE] sqlstate_value
| condition_name

signal_information_item:
condition_information_item_name = simple_value_specification

condition_information_item_name:
CLASS_ORIGIN
| SUBCLASS_ORIGIN
| MESSAGE_TEXT
| MYSQL_ERRNO
| CONSTRAINT_CATALOG
| CONSTRAINT_SCHEMA
| CONSTRAINT_NAME
| CATALOG_NAME
| SCHEMA_NAME
| TABLE_NAME
| COLUMN_NAME
| CURSOR_NAME

condition_name, simple_value_specification:
(see following discussion)

RESIGNAL passes on the error condition information that is available
during execution of a condition handler within a compound statement
inside a stored procedure or function, trigger, or event. RESIGNAL may
change some or all information before passing it on. RESIGNAL is
related to SIGNAL, but instead of originating a condition as SIGNAL
does, RESIGNAL relays existing condition information, possibly after
modifying it.

RESIGNAL makes it possible to both handle an error and return the error
information. Otherwise, by executing an SQL statement within the
handler, information that caused the handler's activation is destroyed.
RESIGNAL also can make some procedures shorter if a given handler can
handle part of a situation, then pass the condition "up the line" to
another handler.

No special privileges are required to execute the RESIGNAL statement.

For condition_value and signal_information_item, the definitions and
rules are the same for RESIGNAL as for SIGNAL (see [HELP SIGNAL]).

The RESIGNAL statement takes condition_value and SET clauses, both of
which are optional. This leads to several possible uses:

o RESIGNAL alone:

RESIGNAL;

o RESIGNAL with new signal information:

RESIGNAL SET signal_information_item [, signal_information_item] ...;

o RESIGNAL with a condition value and possibly new signal information:

RESIGNAL condition_value
[SET signal_information_item [, signal_information_item] ...];

URL: https://mariadb.com/kb/en/resignal/


ALTER SERVER

Syntax:
ALTER SERVER server_name
OPTIONS (option [, option] ...)

Alters the server information for server_name, adjusting any of the
options permitted in the CREATE SERVER statement. See [HELP CREATE
SERVER]. The corresponding fields in the mysql.servers table are
updated accordingly. This statement requires the SUPER privilege.

URL: https://mariadb.com/kb/en/alter-server/



EXPORT_SET

Syntax:
EXPORT_SET(bits,on,off[,separator[,number_of_bits]])

Returns a string such that for every bit set in the value bits, you get
an on string and for every bit not set in the value, you get an off
string. Bits in bits are examined from right to left (from low-order to
high-order bits). Strings are added to the result from left to right,
separated by the separator string (the default being the comma
character ","). The number of bits examined is given by number_of_bits,
which has a default of 64 if not specified. number_of_bits is silently
clipped to 64 if larger than 64. It is treated as an unsigned integer,
so a value of -1 is effectively the same as 64.

URL: https://mariadb.com/kb/en/export_set/


WEEKDAY

Syntax:
WEEKDAY(date)

Returns the weekday index for date (0 = Monday, 1 = Tuesday, ... 6 =
Sunday).

URL: https://mariadb.com/kb/en/weekday/


TIME_TO_SEC

Syntax:
TIME_TO_SEC(time)

Returns the time argument, converted to seconds.

URL: https://mariadb.com/kb/en/time_to_sec/



CONVERT_TZ

Syntax:
CONVERT_TZ(dt,from_tz,to_tz)

CONVERT_TZ() converts a datetime value dt from the time zone given by
from_tz to the time zone given by to_tz and returns the resulting
value. Time zones are specified as described in
https://mariadb.com/kb/en/time-zones/. This
function returns NULL if the arguments are invalid.

URL: https://mariadb.com/kb/en/convert_tz/


IS NULL

Syntax:
IS NULL

Tests whether a value is NULL.

URL: https://mariadb.com/kb/en/is-null/


RELEASE_LOCK

Syntax:
RELEASE_LOCK(str)

Releases the lock named by the string str that was obtained with
GET_LOCK(). Returns 1 if the lock was released, 0 if the lock was not
established by this thread (in which case the lock is not released),
and NULL if the named lock did not exist. The lock does not exist if it
was never obtained by a call to GET_LOCK() or if it has previously been
released.

The DO statement is convenient to use with RELEASE_LOCK(). See [HELP
DO].

URL: https://mariadb.com/kb/en/release_lock/


NAME_CONST

Syntax:
NAME_CONST(name,value)

Returns the given value. When used to produce a result set column,
NAME_CONST() causes the column to have the given name. The arguments
should be constants.

MariaDB> SELECT NAME_CONST('myname', 14);
+--------+
| myname |
+--------+
| 14 |
+--------+

URL: https://mariadb.com/kb/en/name_const/


YEAR

Syntax:
YEAR(date)

Returns the year for date, in the range 1000 to 9999, or 0 for the
"zero" date.

URL: https://mariadb.com/kb/en/year/


BENCHMARK

Syntax:
BENCHMARK(count,expr)

The BENCHMARK() function executes the expression expr repeatedly count
times. It may be used to time how quickly MySQL processes the
expression. The result value is always 0. The intended use is from
within the mysql client, which reports query execution times:

URL: https://mariadb.com/kb/en/benchmark/


DATE_FORMAT

Syntax:
DATE_FORMAT(date,format)

Formats the date value according to the format string.

URL: https://mariadb.com/kb/en/date_format/


GROUP_CONCAT

Syntax:
GROUP_CONCAT(expr)

This function returns a string result with the concatenated non-NULL
values from a group. It returns NULL if there are no non-NULL values.
The full syntax is as follows:

GROUP_CONCAT([DISTINCT] expr [,expr ...]
[ORDER BY {unsigned_integer | col_name | expr}
[ASC | DESC] [,col_name ...]]
[SEPARATOR str_val])

URL: https://mariadb.com/kb/en/group_concat/


POINTFROMTEXT

PointFromText(wkt[,srid])

Constructs a POINT value using its WKT representation and SRID.

URL: https://mariadb.com/kb/en/pointfromtext/


LOAD_FILE

Syntax:
LOAD_FILE(file_name)

Reads the file and returns the file contents as a string. To use this
function, the file must be located on the server host, you must specify
the full path name to the file, and you must have the FILE privilege.
The file must be readable by all and its size less than
max_allowed_packet bytes. If the secure_file_priv system variable is
set to a nonempty directory name, the file to be loaded must be located
in that directory.

If the file does not exist or cannot be read because one of the
preceding conditions is not satisfied, the function returns NULL.

The character_set_filesystem system variable controls interpretation of
file names that are given as literal strings.

URL: https://mariadb.com/kb/en/load_file/


SHOW CREATE EVENT

Syntax:
SHOW CREATE EVENT event_name

This statement displays the CREATE EVENT statement needed to re-create
a given event. It requires the EVENT privilege for the database from
which the event is to be shown. For example (using the same event
e_daily defined and then altered in [HELP SHOW EVENTS]):

URL: https://mariadb.com/kb/en/show-create-event/


COT

Syntax:
COT(X)

Returns the cotangent of X.

URL: https://mariadb.com/kb/en/cot/


SELECT

Syntax:
SELECT
[ALL | DISTINCT | DISTINCTROW ]
[HIGH_PRIORITY]
[STRAIGHT_JOIN]
[SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]
[SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]
select_expr [, select_expr ...]
[FROM table_references
[WHERE where_condition]
[GROUP BY {col_name | expr | position}
[ASC | DESC], ... [WITH ROLLUP]]
[HAVING where_condition]
[ORDER BY {col_name | expr | position}
[ASC | DESC], ...]
[LIMIT {[offset,] row_count | row_count OFFSET offset}]
[PROCEDURE procedure_name(argument_list)]
[INTO OUTFILE 'file_name'
[CHARACTER SET charset_name]
export_options
| INTO DUMPFILE 'file_name'
| INTO var_name [, var_name]]
[FOR UPDATE | LOCK IN SHARE MODE]]

SELECT is used to retrieve rows selected from one or more tables, and
can include UNION statements and subqueries. See [HELP UNION], and
https://mariadb.com/kb/en/subqueries/.

The most commonly used clauses of SELECT statements are these:

o Each select_expr indicates a column that you want to retrieve. There
must be at least one select_expr.

o table_references indicates the table or tables from which to retrieve
rows. Its syntax is described in [HELP JOIN].

o The WHERE clause, if given, indicates the condition or conditions
that rows must satisfy to be selected. where_condition is an
expression that evaluates to true for each row to be selected. The
statement selects all rows if there is no WHERE clause.

In the WHERE expression, you can use any of the functions and
operators that MySQL supports, except for aggregate (summary)
functions. See
https://mariadb.com/kb/en/select#select-expressions, and
https://mariadb.com/kb/en/functions-and-operators/.

SELECT can also be used to retrieve rows computed without reference to
any table.

URL: https://mariadb.com/kb/en/select/


HOUR

Syntax:
HOUR(time)

Returns the hour for time. The range of the return value is 0 to 23 for
time-of-day values. However, the range of TIME values actually is much
larger, so HOUR can return values greater than 23.

URL: https://mariadb.com/kb/en/hour/


MBRCONTAINS

MBRContains(g1,g2)

Returns 1 or 0 to indicate whether the Minimum Bounding Rectangle of g1
contains the Minimum Bounding Rectangle of g2. This tests the opposite
relationship as MBRWithin().

URL: https://mariadb.com/kb/en/mbrcontains/


ATAN2

Syntax:
ATAN(Y,X), ATAN2(Y,X)

Returns the arc tangent of the two variables X and Y. It is similar to
calculating the arc tangent of Y / X, except that the signs of both
arguments are used to determine the quadrant of the result.

URL: https://mariadb.com/kb/en/atan2/


SECOND

Syntax:
SECOND(time)

Returns the second for time, in the range 0 to 59.

URL: https://mariadb.com/kb/en/second/


BIT_AND

Syntax:
BIT_AND(expr)

Returns the bitwise AND of all bits in expr. The calculation is
performed with 64-bit (BIGINT) precision.

URL: https://mariadb.com/kb/en/bit_and/


BINLOG

Syntax:
BINLOG 'str'

BINLOG is an internal-use statement. It is generated by the mysqlbinlog
program as the printable representation of certain events in binary log
files. (See https://mariadb.com/kb/en/mysqlbinlog/.)
The 'str' value is a base 64-encoded string the that server decodes to
determine the data change indicated by the corresponding event. This
statement requires the SUPER privilege.

URL: https://mariadb.com/kb/en/binlog/


SHOW VARIABLES

Syntax:
SHOW [GLOBAL | SESSION] VARIABLES
[LIKE 'pattern' | WHERE expr]

SHOW VARIABLES shows the values of MySQL system variables. This
information also can be obtained using the mysqladmin variables
command. The LIKE clause, if present, indicates which variable names to
match. The WHERE clause can be given to select rows using more general
conditions, as discussed in
https://mariadb.com/kb/en/extended-show/. This
statement does not require any privilege. It requires only the ability
to connect to the server.

With the GLOBAL modifier, SHOW VARIABLES displays the values that are
used for new connections to MySQL. As of MySQL 5.5.3, if a variable has
no global value, no value is displayed. Before 5.5.3, the session value
is displayed. With SESSION, SHOW VARIABLES displays the values that are
in effect for the current connection. If no modifier is present, the
default is SESSION. LOCAL is a synonym for SESSION.
With a LIKE clause, the statement displays only rows for those
variables with names that match the pattern. To obtain the row for a
specific variable, use a LIKE clause as shown:

SHOW VARIABLES LIKE 'max_join_size';
SHOW SESSION VARIABLES LIKE 'max_join_size';

To get a list of variables whose name match a pattern, use the "%"
wildcard character in a LIKE clause:

SHOW VARIABLES LIKE '%size%';
SHOW GLOBAL VARIABLES LIKE '%size%';

Wildcard characters can be used in any position within the pattern to
be matched. Strictly speaking, because "_" is a wildcard that matches
any single character, you should escape it as "\_" to match it
literally. In practice, this is rarely necessary.

URL: https://mariadb.com/kb/en/show-variables/


SHOW

SHOW has many forms that provide information about databases, tables,
columns, or status information about the server. This section describes
those following:

SHOW AUTHORS
SHOW {BINARY | MASTER} LOGS
SHOW BINLOG EVENTS [IN 'log_name'] [FROM pos] [LIMIT [offset,] row_count]
SHOW CHARACTER SET [like_or_where]
SHOW COLLATION [like_or_where]
SHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [like_or_where]
SHOW CONTRIBUTORS
SHOW CREATE DATABASE db_name
SHOW CREATE EVENT event_name
SHOW CREATE FUNCTION func_name
SHOW CREATE PROCEDURE proc_name
SHOW CREATE TABLE tbl_name
SHOW CREATE TRIGGER trigger_name
SHOW CREATE VIEW view_name
SHOW DATABASES [like_or_where]
SHOW ENGINE engine_name {STATUS | MUTEX}
SHOW [STORAGE] ENGINES
SHOW ERRORS [LIMIT [offset,] row_count]
SHOW EVENTS
SHOW FUNCTION CODE func_name
SHOW FUNCTION STATUS [like_or_where]
SHOW GRANTS FOR user
SHOW INDEX FROM tbl_name [FROM db_name]
SHOW MASTER STATUS
SHOW OPEN TABLES [FROM db_name] [like_or_where]
SHOW PLUGINS
SHOW PROCEDURE CODE proc_name
SHOW PROCEDURE STATUS [like_or_where]
SHOW PRIVILEGES
SHOW [FULL] PROCESSLIST
SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]
SHOW PROFILES
SHOW SLAVE HOSTS
SHOW SLAVE STATUS
SHOW [GLOBAL | SESSION] STATUS [like_or_where]
SHOW TABLE STATUS [FROM db_name] [like_or_where]
SHOW [FULL] TABLES [FROM db_name] [like_or_where]
SHOW TRIGGERS [FROM db_name] [like_or_where]
SHOW [GLOBAL | SESSION] VARIABLES [like_or_where]
SHOW WARNINGS [LIMIT [offset,] row_count]

like_or_where:
LIKE 'pattern'
| WHERE expr

If the syntax for a given SHOW statement includes a LIKE 'pattern'
part, 'pattern' is a string that can contain the SQL "%" and "_"
wildcard characters. The pattern is useful for restricting statement
output to matching values.

Several SHOW statements also accept a WHERE clause that provides more
flexibility in specifying which rows to display. See
https://mariadb.com/kb/en/extended-show/.

URL: https://mariadb.com/kb/en/show/


TIMESTAMPADD

Syntax:
TIMESTAMPADD(unit,interval,datetime_expr)

Adds the integer expression interval to the date or datetime expression
datetime_expr. The unit for interval is given by the unit argument,
which should be one of the following values: MICROSECOND
(microseconds), SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, or
YEAR.

It is possible to use FRAC_SECOND in place of MICROSECOND, but
FRAC_SECOND is deprecated. FRAC_SECOND was removed in MySQL 5.5.3.

The unit value may be specified using one of keywords as shown, or with
a prefix of SQL_TSI_. For example, DAY and SQL_TSI_DAY both are legal.

URL: https://mariadb.com/kb/en/timestampadd/


TRUNCATE

Syntax:
TRUNCATE(X,D)

Returns the number X, truncated to D decimal places. If D is 0, the
result has no decimal point or fractional part. D can be negative to
cause D digits left of the decimal point of the value X to become zero.

URL: https://mariadb.com/kb/en/truncate/


LOOP

Syntax:
[begin_label:] LOOP
statement_list
END LOOP [end_label]

LOOP implements a simple loop construct, enabling repeated execution of
the statement list, which consists of one or more statements, each
terminated by a semicolon (;) statement delimiter. The statements
within the loop are repeated until the loop is terminated. Usually,
this is accomplished with a LEAVE statement. Within a stored function,
RETURN can also be used, which exits the function entirely.

Neglecting to include a loop-termination statement results in an
infinite loop.

A LOOP statement can be labeled. For the rules regarding label use, see
[HELP labels].

URL: https://mariadb.com/kb/en/loop/


ENCODE

Syntax:
ENCODE(str,pass_str)

Encrypt str using pass_str as the password. To decrypt the result, use
DECODE().

The result is a binary string of the same length as str.


The strength of the encryption is based on how good the random
generator is. It should suffice for short strings.

URL: https://mariadb.com/kb/en/encode/


SUBSTRING_INDEX

Syntax:
SUBSTRING_INDEX(str,delim,count)

Returns the substring from string str before count occurrences of the
delimiter delim. If count is positive, everything to the left of the
final delimiter (counting from the left) is returned. If count is
negative, everything to the right of the final delimiter (counting from
the right) is returned. SUBSTRING_INDEX() performs a case-sensitive
match when searching for delim.

URL: https://mariadb.com/kb/en/substring_index/


VALUES

Syntax:
VALUES(col_name)

In an INSERT ... ON DUPLICATE KEY UPDATE statement, you can use the
VALUES(col_name) function in the UPDATE clause to refer to column
values from the INSERT portion of the statement. In other words,
VALUES(col_name) in the UPDATE clause refers to the value of col_name
that would be inserted, had no duplicate-key conflict occurred. This
function is especially useful in multiple-row inserts. The VALUES()
function is meaningful only in the ON DUPLICATE KEY UPDATE clause of
INSERT statements and returns NULL otherwise. See
https://mariadb.com/kb/en/insert-on-duplicate-key-update/.

URL: https://mariadb.com/kb/en/values/


MBRDISJOINT

MBRDisjoint(g1,g2)

Returns 1 or 0 to indicate whether the Minimum Bounding Rectangles of
the two geometries g1 and g2 are disjoint (do not intersect).

URL: https://mariadb.com/kb/en/mbrdisjoint/


CALL

Syntax:
CALL sp_name([parameter[,...]])
CALL sp_name[()]

The CALL statement invokes a stored procedure that was defined
previously with CREATE PROCEDURE.

Stored procedures that take no arguments can be invoked without
parentheses. That is, CALL p() and CALL p are equivalent.

CALL can pass back values to its caller using parameters that are
declared as OUT or INOUT parameters. When the procedure returns, a
client program can also obtain the number of rows affected for the
final statement executed within the routine: At the SQL level, call the
ROW_COUNT() function; from the C API, call the mysql_affected_rows()
function.

URL: https://mariadb.com/kb/en/call/


INTERSECTS

Intersects(g1,g2)

Returns 1 or 0 to indicate whether g1 spatially intersects g2.

URL: https://mariadb.com/kb/en/intersects/


LTRIM

Syntax:
LTRIM(str)

Returns the string str with leading space characters removed.

URL: https://mariadb.com/kb/en/ltrim/


SHOW FUNCTION STATUS

Syntax:
SHOW FUNCTION STATUS
[LIKE 'pattern' | WHERE expr]

This statement is similar to SHOW PROCEDURE STATUS but for stored
functions. See [HELP SHOW PROCEDURE STATUS].

URL: https://mariadb.com/kb/en/show-function-status/


ISEMPTY

IsEmpty(g)

Returns 1 if the geometry value g is the empty geometry, 0 if it is not
empty, and -1 if the argument is NULL. If the geometry is empty, it
represents the empty point set.

URL: https://mariadb.com/kb/en/isempty/


SUBSTRING

Syntax:
SUBSTRING(str,pos), SUBSTRING(str FROM pos), SUBSTRING(str,pos,len),
SUBSTRING(str FROM pos FOR len)

The forms without a len argument return a substring from string str
starting at position pos. The forms with a len argument return a
substring len characters long from string str, starting at position
pos. The forms that use FROM are standard SQL syntax. It is also
possible to use a negative value for pos. In this case, the beginning
of the substring is pos characters from the end of the string, rather
than the beginning. A negative value may be used for pos in any of the
forms of this function.

For all forms of SUBSTRING(), the position of the first character in
the string from which the substring is to be extracted is reckoned as
1.

URL: https://mariadb.com/kb/en/substring/


SHOW CHARACTER SET

Syntax:
SHOW CHARACTER SET
[LIKE 'pattern' | WHERE expr]

The SHOW CHARACTER SET statement shows all available character sets.
The LIKE clause, if present, indicates which character set names to
match. The WHERE clause can be given to select rows using more general
conditions, as discussed in
https://mariadb.com/kb/en/extended-show/. For example:

MariaDB> SHOW CHARACTER SET LIKE 'latin%';
+---------+-----------------------------+-------------------+--------+
| Charset | Description | Default collation | Maxlen |
+---------+-----------------------------+-------------------+--------+
| latin1 | cp1252 West European | latin1_swedish_ci | 1 |
| latin2 | ISO 8859-2 Central European | latin2_general_ci | 1 |
| latin5 | ISO 8859-9 Turkish | latin5_turkish_ci | 1 |
| latin7 | ISO 8859-13 Baltic | latin7_general_ci | 1 |
+---------+-----------------------------+-------------------+--------+

URL: https://mariadb.com/kb/en/show-character-set/


DROP USER

Syntax:
DROP USER user [, user] ...

The DROP USER statement removes one or more MySQL accounts and their
privileges. It removes privilege rows for the account from all grant
tables. To use this statement, you must have the global CREATE USER
privilege or the DELETE privilege for the mysql database. Each account
name uses the format described in
https://mariadb.com/kb/en/create-user#account-names. For example:

DROP USER 'jeffrey'@'localhost';

If you specify only the user name part of the account name, a host name
part of '%' is used.

URL: https://mariadb.com/kb/en/drop-user/


SHOW WARNINGS

Syntax:
SHOW WARNINGS [LIMIT [offset,] row_count]
SHOW COUNT(*) WARNINGS

SHOW WARNINGS shows information about the conditions (errors, warnings,
and notes) that resulted from the last statement in the current session
that generated messages. It shows nothing if the last statement used a
table and generated no messages. (That is, a statement that uses a
table but generates no messages clears the message list.) Statements
that do not use tables and do not generate messages have no effect on
the message list.

Warnings are generated for DML statements such as INSERT, UPDATE, and
LOAD DATA INFILE as well as DDL statements such as CREATE TABLE and
ALTER TABLE.

SHOW WARNINGS is also used following EXPLAIN EXTENDED, to display the
extra information generated by EXPLAIN when the EXTENDED keyword is
used. See https://mariadb.com/kb/en/explain#explain-extended.

The LIMIT clause has the same syntax as for the SELECT statement. See
https://mariadb.com/kb/en/select/.

A related statement, SHOW ERRORS, shows only the error conditions (it
excludes warnings and notes). See [HELP SHOW ERRORS].

The SHOW COUNT(*) WARNINGS statement displays the total number of
errors, warnings, and notes. You can also retrieve this number from the
warning_count system variable:

SHOW COUNT(*) WARNINGS;
SELECT @@warning_count;

URL: https://mariadb.com/kb/en/show-warnings/


DESCRIBE

Syntax:
{DESCRIBE | DESC} tbl_name [col_name | wild]

DESCRIBE provides information about the columns in a table. It is a
shortcut for SHOW COLUMNS FROM. These statements also display
information for views. (See [HELP SHOW COLUMNS].)

col_name can be a column name, or a string containing the SQL "%" and
"_" wildcard characters to obtain output only for the columns with
names matching the string. There is no need to enclose the string
within quotation marks unless it contains spaces or other special
characters.

MariaDB> DESCRIBE City;
+------------+----------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+----------+------+-----+---------+----------------+
| Id | int(11) | NO | PRI | NULL | auto_increment |
| Name | char(35) | NO | | | |
| Country | char(3) | NO | UNI | | |
| District | char(20) | YES | MUL | | |
| Population | int(11) | NO | | 0 | |
+------------+----------+------+-----+---------+----------------+
5 rows in set (0.00 sec)

The description for SHOW COLUMNS provides more information about the
output columns (see [HELP SHOW COLUMNS]).

URL: https://mariadb.com/kb/en/describe/


SHOW PROCEDURE STATUS

Syntax:
SHOW PROCEDURE STATUS
[LIKE 'pattern' | WHERE expr]

This statement is a MySQL extension. It returns characteristics of a
stored procedure, such as the database, name, type, creator, creation
and modification dates, and character set information. A similar
statement, SHOW FUNCTION STATUS, displays information about stored
functions (see [HELP SHOW FUNCTION STATUS]).

The LIKE clause, if present, indicates which procedure or function
names to match. The WHERE clause can be given to select rows using more
general conditions, as discussed in
https://mariadb.com/kb/en/extended-show/.

URL: https://mariadb.com/kb/en/show-procedure-status/


BEGIN END

Syntax:
[begin_label:] BEGIN
[statement_list]
END [end_label]

BEGIN ... END syntax is used for writing compound statements, which can
appear within stored programs (stored procedures and functions,
triggers, and events). A compound statement can contain multiple
statements, enclosed by the BEGIN and END keywords. statement_list
represents a list of one or more statements, each terminated by a
semicolon (;) statement delimiter. The statement_list itself is
optional, so the empty compound statement (BEGIN END) is legal.

BEGIN ... END blocks can be nested.

Use of multiple statements requires that a client is able to send
statement strings containing the ; statement delimiter. In the mysql
command-line client, this is handled with the delimiter command.
Changing the ; end-of-statement delimiter (for example, to //) permit ;
to be used in a program body. For an example, see
https://mariadb.com/kb/en/stored-procedure-overview/.

A BEGIN ... END block can be labeled. See [HELP labels].

URL: https://mariadb.com/kb/en/begin-end/


FLUSH

Syntax:
FLUSH [NO_WRITE_TO_BINLOG | LOCAL]
flush_option [, flush_option] ...

The FLUSH statement has several variant forms that clear or reload
various internal caches, flush tables, or acquire locks. To execute
FLUSH, you must have the RELOAD privilege. Specific flush options might
require additional privileges, as described later.

By default, the server writes FLUSH statements to the binary log so
that they replicate to replication slaves. To suppress logging, use the
optional NO_WRITE_TO_BINLOG keyword or its alias LOCAL.

*Note*: FLUSH LOGS, FLUSH MASTER, FLUSH SLAVE, and FLUSH TABLES WITH
READ LOCK (with or without a table list) are not written to the binary
log in any case because they would cause problems if replicated to a
slave.

The FLUSH statement causes an implicit commit. See
http://dev.mysql.com/doc/refman/5.5/en/implicit-commit.html.

The RESET statement is similar to FLUSH. See [HELP RESET], for
information about using the RESET statement with replication.

URL: https://mariadb.com/kb/en/flush/


AREA

Area(poly)

Returns as a double-precision number the area of the Polygon value
poly, as measured in its spatial reference system.

URL: https://mariadb.com/kb/en/area/


START SLAVE

Syntax:
START SLAVE [thread_types]

START SLAVE [SQL_THREAD] UNTIL
MASTER_LOG_FILE = 'log_name', MASTER_LOG_POS = log_pos

START SLAVE [SQL_THREAD] UNTIL
RELAY_LOG_FILE = 'log_name', RELAY_LOG_POS = log_pos

thread_types:
[thread_type [, thread_type] ... ]

thread_type: IO_THREAD | SQL_THREAD

START SLAVE with no thread_type options starts both of the slave
threads. The I/O thread reads events from the master server and stores
them in the relay log. The SQL thread reads events from the relay log
and executes them. START SLAVE requires the SUPER privilege.

If START SLAVE succeeds in starting the slave threads, it returns
without any error. However, even in that case, it might be that the
slave threads start and then later stop (for example, because they do
not manage to connect to the master or read its binary log, or some
other problem). START SLAVE does not warn you about this. You must
check the slave's error log for error messages generated by the slave
threads, or check that they are running satisfactorily with SHOW SLAVE
STATUS.

URL: https://mariadb.com/kb/en/start-slave/


CURRENT_DATE

Syntax:
CURRENT_DATE, CURRENT_DATE()

CURRENT_DATE and CURRENT_DATE() are synonyms for CURDATE().

URL: https://mariadb.com/kb/en/current_date/


BIT_XOR

Syntax:
BIT_XOR(expr)

Returns the bitwise XOR of all bits in expr. The calculation is
performed with 64-bit (BIGINT) precision.

URL: https://mariadb.com/kb/en/bit_xor/


TRUNCATE TABLE

Syntax:
TRUNCATE [TABLE] tbl_name

TRUNCATE TABLE empties a table completely. It requires the DROP
privilege.

Logically, TRUNCATE TABLE is similar to a DELETE statement that deletes
all rows, or a sequence of DROP TABLE and CREATE TABLE statements. To
achieve high performance, it bypasses the DML method of deleting data.
Thus, it cannot be rolled back, it does not cause ON DELETE triggers to
fire, and it cannot be performed for InnoDB tables with parent-child
foreign key relationships.

Although TRUNCATE TABLE is similar to DELETE, it is classified as a DDL
statement rather than a DML statement. It differs from DELETE in the
following ways in MySQL 5.5:

o Truncate operations drop and re-create the table, which is much
faster than deleting rows one by one, particularly for large tables.

o Truncate operations cause an implicit commit, and so cannot be rolled
back.

o Truncation operations cannot be performed if the session holds an
active table lock.

o TRUNCATE TABLE fails for an InnoDB table if there are any FOREIGN KEY
constraints from other tables that reference the table. Foreign key
constraints between columns of the same table are permitted.

o Truncation operations do not return a meaningful value for the number
of deleted rows. The usual result is "0 rows affected," which should
be interpreted as "no information."

o As long as the table format file tbl_name.frm is valid, the table can
be re-created as an empty table with TRUNCATE TABLE, even if the data
or index files have become corrupted.

o Any AUTO_INCREMENT value is reset to its start value. This is true
even for MyISAM and InnoDB, which normally do not reuse sequence
values.

o When used with partitioned tables, TRUNCATE TABLE preserves the
partitioning; that is, the data and index files are dropped and
re-created, while the partition definitions (.par) file is
unaffected.

o The TRUNCATE TABLE statement does not invoke ON DELETE triggers.

URL: https://mariadb.com/kb/en/truncate-table/


CROSSES

Crosses(g1,g2)

Returns 1 if g1 spatially crosses g2. Returns NULL if g1 is a Polygon
or a MultiPolygon, or if g2 is a Point or a MultiPoint. Otherwise,
returns 0.

The term spatially crosses denotes a spatial relation between two given
geometries that has the following properties:

o The two geometries intersect

o Their intersection results in a geometry that has a dimension that is
one less than the maximum dimension of the two given geometries

o Their intersection is not equal to either of the two given geometries

URL: https://mariadb.com/kb/en/crosses/


FOUND_ROWS

Syntax:
FOUND_ROWS()

A SELECT statement may include a LIMIT clause to restrict the number of
rows the server returns to the client. In some cases, it is desirable
to know how many rows the statement would have returned without the
LIMIT, but without running the statement again. To obtain this row
count, include a SQL_CALC_FOUND_ROWS option in the SELECT statement,
and then invoke FOUND_ROWS() afterward:

URL: https://mariadb.com/kb/en/found_rows/


SYSTEM_USER

Syntax:
SYSTEM_USER()

SYSTEM_USER() is a synonym for USER().

URL: https://mariadb.com/kb/en/system_user/


X

X(p)

Returns the X-coordinate value for the Point object p as a
double-precision number.

URL: https://mariadb.com/kb/en/x/


&&

Syntax:
AND, &&

Logical AND. Evaluates to 1 if all operands are nonzero and not NULL,
to 0 if one or more operands are 0, otherwise NULL is returned.

URL: https://mariadb.com/kb/en/and/



TIME

TIME

A time. The range is '-838:59:59' to '838:59:59'. MySQL displays TIME
values in 'HH:MM:SS' format, but permits assignment of values to TIME
columns using either strings or numbers.

URL: https://mariadb.com/kb/en/time/


DOUBLE

DOUBLE[(M,D)] [UNSIGNED] [ZEROFILL]

A normal-size (double-precision) floating-point number. Permissible
values are -1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and
2.2250738585072014E-308 to 1.7976931348623157E+308. These are the
theoretical limits, based on the IEEE standard. The actual range might
be slightly smaller depending on your hardware or operating system.

M is the total number of digits and D is the number of digits following
the decimal point. If M and D are omitted, values are stored to the
limits permitted by the hardware. A double-precision floating-point
number is accurate to approximately 15 decimal places.

UNSIGNED, if specified, disallows negative values.


URL: https://mariadb.com/kb/en/double/


DECLARE HANDLER

Syntax:
DECLARE handler_action HANDLER
FOR condition_value [, condition_value] ...
statement

handler_action:
CONTINUE
| EXIT
| UNDO

condition_value:
mysql_error_code
| SQLSTATE [VALUE] sqlstate_value
| condition_name
| SQLWARNING
| NOT FOUND
| SQLEXCEPTION

The DECLARE ... HANDLER statement specifies a handler that deals with
one or more conditions. If one of these conditions occurs, the
specified statement executes. statement can be a simple statement such
as SET var_name = value, or a compound statement written using BEGIN
and END (see [HELP BEGIN END]).

Handler declarations must appear after variable or condition
declarations.

The handler_action value indicates what action the handler takes after
execution of the handler statement:

o CONTINUE: Execution of the current program continues.

o EXIT: Execution terminates for the BEGIN ... END compound statement
in which the handler is declared. This is true even if the condition
occurs in an inner block.

o UNDO: Not supported.

The condition_value for DECLARE ... HANDLER indicates the specific
condition or class of conditions that activates the handler:

o A MySQL error code (a number) or an SQLSTATE value (a 5-character
string literal). You should not use MySQL error code 0 or SQLSTATE
values that begin with '00', because those indicate success rather
than an error condition. For a list of MySQL error codes and SQLSTATE
values, see
https://mariadb.com/kb/en/mariadb-error-codes/.

o A condition name previously specified with DECLARE ... CONDITION. A
condition name can be associated with a MySQL error code or SQLSTATE
value. See [HELP DECLARE CONDITION].

o SQLWARNING is shorthand for the class of SQLSTATE values that begin
with '01'.

o NOT FOUND is shorthand for the class of SQLSTATE values that begin
with '02'. This is relevant within the context of cursors and is used
to control what happens when a cursor reaches the end of a data set.
If no more rows are available, a No Data condition occurs with
SQLSTATE value '02000'. To detect this condition, you can set up a
handler for it (or for a NOT FOUND condition). For an example, see
https://mariadb.com/kb/en/cursor-overview/. This condition
also occurs for SELECT ... INTO var_list statements that retrieve no
rows.

o SQLEXCEPTION is shorthand for the class of SQLSTATE values that do
not begin with '00', '01', or '02'.

If a condition occurs for which no handler has been declared, the
action taken depends on the condition class:

o For SQLEXCEPTION conditions, the stored program terminates at the
statement that raised the condition, as if there were an EXIT
handler. If the program was called by another stored program, the
calling program handles the condition using the handler selection
rules applied to its own handlers.

o For SQLWARNING conditions, the program continues executing, as if
there were a CONTINUE handler.

o For NOT FOUND conditions, if the condition was raised normally, the
action is CONTINUE. If it was raised by SIGNAL or RESIGNAL, the
action is EXIT.

URL: https://mariadb.com/kb/en/declare-handler/


!

Syntax:
NOT, !

Logical NOT. Evaluates to 1 if the operand is 0, to 0 if the operand is
nonzero, and NOT NULL returns NULL.

URL: https://mariadb.com/kb/en/not/


NOT IN

Syntax:
expr NOT IN (value,...)

This is the same as NOT (expr IN (value,...)).

URL: https://mariadb.com/kb/en/not-in/


LEAVE

Syntax:
LEAVE label

This statement is used to exit the flow control construct that has the
given label. If the label is for the outermost stored program block,
LEAVE exits the program.

LEAVE can be used within BEGIN ... END or loop constructs (LOOP,
REPEAT, WHILE).

URL: https://mariadb.com/kb/en/leave/


SHOW CREATE DATABASE

Syntax:
SHOW CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name

Shows the CREATE DATABASE statement that creates the given database. If
the SHOW statement includes an IF NOT EXISTS clause, the output too
includes such a clause. SHOW CREATE SCHEMA is a synonym for SHOW CREATE
DATABASE.

URL: https://mariadb.com/kb/en/show-create-database/


SHOW INDEX

Syntax:
SHOW {INDEX | INDEXES | KEYS}
{FROM | IN} tbl_name
[{FROM | IN} db_name]
[WHERE expr]

SHOW INDEX returns table index information. The format resembles that
of the SQLStatistics call in ODBC. This statement requires some
privilege for any column in the table.
You can use db_name.tbl_name as an alternative to the tbl_name FROM
db_name syntax. These two statements are equivalent:

SHOW INDEX FROM mytable FROM mydb;
SHOW INDEX FROM mydb.mytable;

The WHERE clause can be given to select rows using more general
conditions, as discussed in
https://mariadb.com/kb/en/extended-show/.

You can also list a table's indexes with the mysqlshow -k db_name
tbl_name command.

URL: https://mariadb.com/kb/en/show-index/


NOT REGEXP

Syntax:
expr NOT REGEXP pat, expr NOT RLIKE pat

This is the same as NOT (expr REGEXP pat).

URL: https://mariadb.com/kb/en/not-regexp/


TO_DAYS

Syntax:
TO_DAYS(date)

Given a date date, returns a day number (the number of days since year
0).

URL: https://mariadb.com/kb/en/to_days/


UNION

Syntax:
SELECT ...
UNION [ALL | DISTINCT] SELECT ...
[UNION [ALL | DISTINCT] SELECT ...]

UNION is used to combine the result from multiple SELECT statements
into a single result set.

The column names from the first SELECT statement are used as the column
names for the results returned. Selected columns listed in
corresponding positions of each SELECT statement should have the same
data type. (For example, the first column selected by the first
statement should have the same type as the first column selected by the
other statements.)

URL: https://mariadb.com/kb/en/union/


LOAD INDEX

Syntax:
LOAD INDEX INTO CACHE
tbl_index_list [, tbl_index_list] ...

tbl_index_list:
tbl_name
[PARTITION (partition_list | ALL)]
[[INDEX|KEY] (index_name[, index_name] ...)]
[IGNORE LEAVES]

partition_list:
partition_name[, partition_name][, ...]

The LOAD INDEX INTO CACHE statement preloads a table index into the key
cache to which it has been assigned by an explicit CACHE INDEX
statement, or into the default key cache otherwise.

LOAD INDEX INTO CACHE is used only for MyISAM tables. In MySQL 5.5, it
is also supported for partitioned MyISAM tables; in addition, indexes
on partitioned tables can be preloaded for one, several, or all
partitions.

The IGNORE LEAVES modifier causes only blocks for the nonleaf nodes of
the index to be preloaded.

IGNORE LEAVES is also supported for partitioned MyISAM tables.

URL: https://mariadb.com/kb/en/load-index/


VARBINARY

VARBINARY(M)

The VARBINARY type is similar to the VARCHAR type, but stores binary
byte strings rather than nonbinary character strings. M represents the
maximum column length in bytes.

URL: https://mariadb.com/kb/en/varbinary/


CREATE PROCEDURE

Syntax:
CREATE
[DEFINER = { user | CURRENT_USER }]
PROCEDURE sp_name ([proc_parameter[,...]])
[characteristic ...] routine_body

CREATE
[DEFINER = { user | CURRENT_USER }]
FUNCTION sp_name ([func_parameter[,...]])
RETURNS type
[characteristic ...] routine_body

proc_parameter:
[ IN | OUT | INOUT ] param_name type

func_parameter:
param_name type

type:
Any valid MySQL data type

characteristic:
COMMENT 'string'
| LANGUAGE SQL
| [NOT] DETERMINISTIC
| { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
| SQL SECURITY { DEFINER | INVOKER }

routine_body:
Valid SQL routine statement

These statements create stored routines. By default, a routine is
associated with the default database. To associate the routine
explicitly with a given database, specify the name as db_name.sp_name
when you create it.

The CREATE FUNCTION statement is also used in MySQL to support UDFs
(user-defined functions). See
https://mariadb.com/kb/en/create-function-udf/. A UDF can
be regarded as an external stored function. Stored functions share
their namespace with UDFs. See
http://dev.mysql.com/doc/refman/5.5/en/function-resolution.html, for
the rules describing how the server interprets references to different
kinds of functions.

To invoke a stored procedure, use the CALL statement (see [HELP CALL]).
To invoke a stored function, refer to it in an expression. The function
returns a value during expression evaluation.

CREATE PROCEDURE and CREATE FUNCTION require the CREATE ROUTINE
privilege. They might also require the SUPER privilege, depending on
the DEFINER value, as described later in this section. If binary
logging is enabled, CREATE FUNCTION might require the SUPER privilege,
as described in
https://mariadb.com/kb/en/binary-logging-of-stored-routines/.

By default, MySQL automatically grants the ALTER ROUTINE and EXECUTE
privileges to the routine creator. This behavior can be changed by
disabling the automatic_sp_privileges system variable. See
https://mariadb.com/kb/en/stored-routine-privileges/.

The DEFINER and SQL SECURITY clauses specify the security context to be
used when checking access privileges at routine execution time, as
described later in this section.

If the routine name is the same as the name of a built-in SQL function,
a syntax error occurs unless you use a space between the name and the

following parenthesis when defining the routine or invoking it later.
For this reason, avoid using the names of existing SQL functions for
your own stored routines.

The IGNORE_SPACE SQL mode applies to built-in functions, not to stored
routines. It is always permissible to have spaces after a stored
routine name, regardless of whether IGNORE_SPACE is enabled.

The parameter list enclosed within parentheses must always be present.
If there are no parameters, an empty parameter list of () should be
used. Parameter names are not case sensitive.

Each parameter is an IN parameter by default. To specify otherwise for
a parameter, use the keyword OUT or INOUT before the parameter name.

*Note*: Specifying a parameter as IN, OUT, or INOUT is valid only for a
PROCEDURE. For a FUNCTION, parameters are always regarded as IN
parameters.

An IN parameter passes a value into a procedure. The procedure might
modify the value, but the modification is not visible to the caller
when the procedure returns. An OUT parameter passes a value from the
procedure back to the caller. Its initial value is NULL within the
procedure, and its value is visible to the caller when the procedure
returns. An INOUT parameter is initialized by the caller, can be
modified by the procedure, and any change made by the procedure is
visible to the caller when the procedure returns.

For each OUT or INOUT parameter, pass a user-defined variable in the
CALL statement that invokes the procedure so that you can obtain its
value when the procedure returns. If you are calling the procedure from
within another stored procedure or function, you can also pass a
routine parameter or local routine variable as an IN or INOUT
parameter.

The following example shows a simple stored procedure that uses an OUT
parameter:

MariaDB> delimiter //

MariaDB> CREATE PROCEDURE simpleproc (OUT param1 INT)
-> BEGIN
-> SELECT COUNT(*) INTO param1 FROM t;
-> END//
Query OK, 0 rows affected (0.00 sec)

MariaDB> delimiter ;

MariaDB> CALL simpleproc(@a);
Query OK, 0 rows affected (0.00 sec)

MariaDB> SELECT @a;
+------+
| @a |
+------+
| 3 |
+------+
1 row in set (0.00 sec)

The example uses the mysql client delimiter command to change the
statement delimiter from ; to // while the procedure is being defined.
This enables the ; delimiter used in the procedure body to be passed
through to the server rather than being interpreted by mysql itself.
See
https://mariadb.com/kb/en/stored-procedure-overview/.

The RETURNS clause may be specified only for a FUNCTION, for which it
is mandatory. It indicates the return type of the function, and the
function body must contain a RETURN value statement. If the RETURN
statement returns a value of a different type, the value is coerced to
the proper type. For example, if a function specifies an ENUM or SET
value in the RETURNS clause, but the RETURN statement returns an
integer, the value returned from the function is the string for the
corresponding ENUM member of set of SET members.

The following example function takes a parameter, performs an operation
using an SQL function, and returns the result. In this case, it is
unnecessary to use delimiter because the function definition contains
no internal ; statement delimiters:

MariaDB> CREATE FUNCTION hello (s CHAR(20))
MariaDB> RETURNS CHAR(50) DETERMINISTIC
-> RETURN CONCAT('Hello, ',s,'!');
Query OK, 0 rows affected (0.00 sec)

MariaDB> SELECT hello('world');
+----------------+
| hello('world') |
+----------------+
| Hello, world! |
+----------------+
1 row in set (0.00 sec)

Parameter types and function return types can be declared to use any
valid data type, except that the COLLATE attribute cannot be used prior
to MySQL 5.5.3. As of 5.5.3, COLLATE can be used if preceded by the
CHARACTER SET attribute.

The routine_body consists of a valid SQL routine statement. This can be
a simple statement such as SELECT or INSERT, or a compound statement
written using BEGIN and END. Compound statements can contain
declarations, loops, and other control structure statements. The syntax
for these statements is described in
https://mariadb.com/kb/programmatic-and-compound-statements.

MySQL permits routines to contain DDL statements, such as CREATE and
DROP. MySQL also permits stored procedures (but not stored functions)
to contain SQL transaction statements such as COMMIT. Stored functions
may not contain statements that perform explicit or implicit commit or
rollback. Support for these statements is not required by the SQL
standard, which states that each DBMS vendor may decide whether to
permit them.

Statements that return a result set can be used within a stored
procedure but not within a stored function. This prohibition includes
SELECT statements that do not have an INTO var_list clause and other
statements such as SHOW, EXPLAIN, and CHECK TABLE. For statements that
can be determined at function definition time to return a result set, a
Not allowed to return a result set from a function error occurs
(ER_SP_NO_RETSET). For statements that can be determined only at
runtime to return a result set, a PROCEDURE %s can't return a result
set in the given context error occurs (ER_SP_BADSELECT).

USE statements within stored routines are not permitted. When a routine
is invoked, an implicit USE db_name is performed (and undone when the
routine terminates). The causes the routine to have the given default
database while it executes. References to objects in databases other
than the routine default database should be qualified with the
appropriate database name.

For additional information about statements that are not permitted in
stored routines, see
https://mariadb.com/kb/en/stored-routine-privileges/
.

For information about invoking stored procedures from within programs
written in a language that has a MySQL interface, see [HELP CALL].

MySQL stores the sql_mode system variable setting that is in effect at
the time a routine is created, and always executes the routine with
this setting in force, regardless of the server SQL mode in effect when
the routine is invoked.

The switch from the SQL mode of the invoker to that of the routine
occurs after evaluation of arguments and assignment of the resulting
values to routine parameters. If you define a routine in strict SQL
mode but invoke it in nonstrict mode, assignment of arguments to
routine parameters does not take place in strict mode. If you require
that expressions passed to a routine be assigned in strict SQL mode,
you should invoke the routine with strict mode in effect.

URL: https://mariadb.com/kb/en/create-procedure/


INSERT SELECT

Syntax:
INSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]
[INTO] tbl_name [(col_name,...)]
SELECT ...
[ ON DUPLICATE KEY UPDATE col_name=expr, ... ]

With INSERT ... SELECT, you can quickly insert many rows into a table
from one or many tables. For example:

INSERT INTO tbl_temp2 (fld_id)
SELECT tbl_temp1.fld_order_id
FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100;

URL: https://mariadb.com/kb/en/insert-select/


DROP EVENT

Syntax:
DROP EVENT [IF EXISTS] event_name

This statement drops the event named event_name. The event immediately
ceases being active, and is deleted completely from the server.

If the event does not exist, the error ERROR 1517 (HY000): Unknown
event 'event_name' results. You can override this and cause the
statement to generate a warning for nonexistent events instead using IF
EXISTS.

This statement requires the EVENT privilege for the schema to which the
event to be dropped belongs.

URL: https://mariadb.com/kb/en/drop-event/


MBRTOUCHES

MBRTouches(g1,g2)

Returns 1 or 0 to indicate whether the Minimum Bounding Rectangles of
the two geometries g1 and g2 touch. Two geometries spatially touch if

the interiors of the geometries do not intersect, but the boundary of
one of the geometries intersects either the boundary or the interior of
the other.

URL: https://mariadb.com/kb/en/mbrtouches/


SOUNDEX

Syntax:
SOUNDEX(str)

Returns a soundex string from str. Two strings that sound almost the
same should have identical soundex strings. A standard soundex string
is four characters long, but the SOUNDEX() function returns an
arbitrarily long string. You can use SUBSTRING() on the result to get a
standard soundex string. All nonalphabetic characters in str are
ignored. All international alphabetic characters outside the A-Z range
are treated as vowels.

*Important*: When using SOUNDEX(), you should be aware of the following
limitations:

o This function, as currently implemented, is intended to work well
with strings that are in the English language only. Strings in other
languages may not produce reliable results.

o This function is not guaranteed to provide consistent results with
strings that use multi-byte character sets, including utf-8.

We hope to remove these limitations in a future release. See Bug
#22638 for more information.

URL: https://mariadb.com/kb/en/soundex/


MBROVERLAPS

MBROverlaps(g1,g2)


Returns 1 or 0 to indicate whether the Minimum Bounding Rectangles of
the two geometries g1 and g2 overlap. The term spatially overlaps is
used if two geometries intersect and their intersection results in a
geometry of the same dimension but not equal to either of the given
geometries.

URL: https://mariadb.com/kb/en/mbroverlaps/


BINARY OPERATOR

Syntax:
BINARY

The BINARY operator casts the string following it to a binary string.
This is an easy way to force a column comparison to be done byte by
byte rather than character by character. This causes the comparison to
be case sensitive even if the column is not defined as BINARY or BLOB.
BINARY also causes trailing spaces to be significant.

URL: https://mariadb.com/kb/en/binary-operator/



MAKEDATE

Syntax:
MAKEDATE(year,dayofyear)

Returns a date, given year and day-of-year values. dayofyear must be
greater than 0 or the result is NULL.

URL: https://mariadb.com/kb/en/makedate/


SHOW TABLES

Syntax:
SHOW [FULL] TABLES [{FROM | IN} db_name]
[LIKE 'pattern' | WHERE expr]

SHOW TABLES lists the non-TEMPORARY tables in a given database. You can
also get this list using the mysqlshow db_name command. The LIKE
clause, if present, indicates which table names to match. The WHERE
clause can be given to select rows using more general conditions, as
discussed in https://mariadb.com/kb/en/extended-show/.

This statement also lists any views in the database. The FULL modifier
is supported such that SHOW FULL TABLES displays a second output
column. Values for the second column are BASE TABLE for a table and
VIEW for a view.

If you have no privileges for a base table or view, it does not show up
in the output from SHOW TABLES or mysqlshow db_name.

URL: https://mariadb.com/kb/en/show-tables/


REPEAT FUNCTION

Syntax:
REPEAT(str,count)

Returns a string consisting of the string str repeated count times. If
count is less than 1, returns an empty string. Returns NULL if str or
count are NULL.

URL: https://mariadb.com/kb/en/repeat-function/


ASBINARY

AsBinary(g), AsWKB(g)

Converts a value in internal geometry format to its WKB representation
and returns the binary result.

URL: https://mariadb.com/kb/en/asbinary/


UNINSTALL PLUGIN

Syntax:
UNINSTALL PLUGIN plugin_name

This statement removes an installed server plugin. It requires the
DELETE privilege for the mysql.plugin table.

plugin_name must be the name of some plugin that is listed in the
mysql.plugin table. The server executes the plugin's deinitialization
function and removes the row for the plugin from the mysql.plugin
table, so that subsequent server restarts will not load and initialize
the plugin. UNINSTALL PLUGIN does not remove the plugin's shared
library file.

URL: https://mariadb.com/kb/en/uninstall-plugin/


SYSDATE

Syntax:
SYSDATE()

Returns the current date and time as a value in 'YYYY-MM-DD HH:MM:SS'
or YYYYMMDDHHMMSS.uuuuuu format, depending on whether the function is
used in a string or numeric context.

SYSDATE() returns the time at which it executes. This differs from the
behavior for NOW(), which returns a constant time that indicates the
time at which the statement began to execute. (Within a stored function
or trigger, NOW() returns the time at which the function or triggering
statement began to execute.)

MariaDB> SELECT NOW(), SLEEP(2), NOW();
+---------------------+----------+---------------------+
| NOW() | SLEEP(2) | NOW() |
+---------------------+----------+---------------------+
| 2006-04-12 13:47:36 | 0 | 2006-04-12 13:47:36 |
+---------------------+----------+---------------------+

MariaDB> SELECT SYSDATE(), SLEEP(2), SYSDATE();
+---------------------+----------+---------------------+
| SYSDATE() | SLEEP(2) | SYSDATE() |
+---------------------+----------+---------------------+
| 2006-04-12 13:47:44 | 0 | 2006-04-12 13:47:46 |
+---------------------+----------+---------------------+

In addition, the SET TIMESTAMP statement affects the value returned by
NOW() but not by SYSDATE(). This means that timestamp settings in the
binary log have no effect on invocations of SYSDATE().

Because SYSDATE() can return different values even within the same
statement, and is not affected by SET TIMESTAMP, it is nondeterministic
and therefore unsafe for replication if statement-based binary logging
is used. If that is a problem, you can use row-based logging.

Alternatively, you can use the --sysdate-is-now option to cause
SYSDATE() to be an alias for NOW(). This works if the option is used on
both the master and the slave.

The nondeterministic nature of SYSDATE() also means that indexes cannot
be used for evaluating expressions that refer to it.

URL: https://mariadb.com/kb/en/sysdate/


OCT

Syntax:
OCT(N)

Returns a string representation of the octal value of N, where N is a
longlong (BIGINT) number. This is equivalent to CONV(N,10,8). Returns
NULL if N is NULL.

URL: https://mariadb.com/kb/en/oct/


SUM

Syntax:
SUM([DISTINCT] expr)

Returns the sum of expr. If the return set has no rows, SUM() returns
NULL. The DISTINCT keyword can be used to sum only the distinct values
of expr.

SUM() returns NULL if there were no matching rows.

URL: https://mariadb.com/kb/en/sum/


YEAR DATA TYPE

YEAR[(2|4)]

A year in two-digit or four-digit format. The default is four-digit
format. YEAR(2) or YEAR(4) differ in display format, but have the same
range of values. In four-digit format, values display as 1901 to 2155,
and 0000. In two-digit format, values display as 70 to 69, representing
years from 1970 to 2069. MySQL displays YEAR values in YYYY or
YYformat, but permits assignment of values to YEAR columns using either
strings or numbers.

*Note*: The YEAR(2) data type has certain issues that you should
consider before choosing to use it. As of MySQL 5.5.27, YEAR(2) is
deprecated. For more information, see
http://dev.mysql.com/doc/refman/5.5/en/migrating-to-year4.html.

For additional information about YEAR display format and inerpretation
of input values, see https://mariadb.com/kb/en/year-data-type/.

URL: https://mariadb.com/kb/en/year-data-type/


POINTN

PointN(ls,N)

Returns the N-th Point in the Linestring value ls. Points are numbered
beginning with 1.

URL: https://mariadb.com/kb/en/pointn/


LONGBLOB

LONGBLOB

A BLOB column with a maximum length of 4,294,967,295 or 4GB (232 - 1)
bytes. The effective maximum length of LONGBLOB columns depends on the
configured maximum packet size in the client/server protocol and
available memory. Each LONGBLOB value is stored using a 4-byte length
prefix that indicates the number of bytes in the value.

URL: https://mariadb.com/kb/en/longblob/


EXP

Syntax:
EXP(X)

Returns the value of e (the base of natural logarithms) raised to the
power of X. The inverse of this function is LOG() (using a single
argument only) or LN().

URL: https://mariadb.com/kb/en/exp/


>=

Syntax:
>=

Greater than or equal:

URL: https://mariadb.com/kb/en/greater-than-or-equal/


SHOW ENGINES

Syntax:
SHOW [STORAGE] ENGINES

SHOW ENGINES displays status information about the server's storage
engines. This is particularly useful for checking whether a storage
engine is supported, or to see what the default engine is.

URL: https://mariadb.com/kb/en/show-engines/


NOW

Syntax:
NOW()

Returns the current date and time as a value in 'YYYY-MM-DD HH:MM:SS'
or YYYYMMDDHHMMSS.uuuuuu format, depending on whether the function is
used in a string or numeric context. The value is expressed in the
current time zone.


URL: https://mariadb.com/kb/en/now/


INSTR

Syntax:
INSTR(str,substr)

Returns the position of the first occurrence of substring substr in
string str. This is the same as the two-argument form of LOCATE(),
except that the order of the arguments is reversed.

URL: https://mariadb.com/kb/en/instr/


DUAL

You are permitted to specify DUAL as a dummy table name in situations
where no tables are referenced:

MariaDB> SELECT 1 + 1 FROM DUAL;
-> 2

DUAL is purely for the convenience of people who require that all
SELECT statements should have FROM and possibly other clauses. MySQL
may ignore the clauses. MySQL does not require FROM DUAL if no tables
are referenced.

URL: https://mariadb.com/kb/en/dual/


POW

Syntax:
POW(X,Y)

Returns the value of X raised to the power of Y.

URL: https://mariadb.com/kb/en/pow/


DROP TABLE

Syntax:
DROP [TEMPORARY] TABLE [IF EXISTS]
tbl_name [, tbl_name] ...
[RESTRICT | CASCADE]

DROP TABLE removes one or more tables. You must have the DROP privilege
for each table. All table data and the table definition are removed, so
be careful with this statement! If any of the tables named in the
argument list do not exist, MySQL returns an error indicating by name
which nonexisting tables it was unable to drop, but it also drops all
of the tables in the list that do exist.

*Important*: When a table is dropped, user privileges on the table are
not automatically dropped. See [HELP GRANT].

Note that for a partitioned table, DROP TABLE permanently removes the
table definition, all of its partitions, and all of the data which was
stored in those partitions. It also removes the partitioning definition
(.par) file associated with the dropped table.

Use IF EXISTS to prevent an error from occurring for tables that do not
exist. A NOTE is generated for each nonexistent table when using IF
EXISTS. See [HELP SHOW WARNINGS].

RESTRICT and CASCADE are permitted to make porting easier. In MySQL
5.5, they do nothing.

*Note*: DROP TABLE automatically commits the current active
transaction, unless you use the TEMPORARY keyword.

URL: https://mariadb.com/kb/en/drop-table/


UNCOMPRESSED_LENGTH

Syntax:
UNCOMPRESSED_LENGTH(compressed_string)

Returns the length that the compressed string had before being
compressed.

URL: https://mariadb.com/kb/en/uncompressed_length/


SUBTIME

Syntax:
SUBTIME(expr1,expr2)

SUBTIME() returns expr1 - expr2 expressed as a value in the same format
as expr1. expr1 is a time or datetime expression, and expr2 is a time
expression.

URL: https://mariadb.com/kb/en/subtime/


LOG2

Syntax:
LOG2(X)

Returns the base-2 logarithm of X.

URL: https://mariadb.com/kb/en/log2/


MLINEFROMWKB

MLineFromWKB(wkb[,srid]), MultiLineStringFromWKB(wkb[,srid])

Constructs a MULTILINESTRING value using its WKB representation and
SRID.

URL: https://mariadb.com/kb/en/mlinefromwkb/


SCHEMA

Syntax:
SCHEMA()

This function is a synonym for DATABASE().

URL: https://mariadb.com/kb/en/schema/


STDDEV_SAMP

Syntax:
STDDEV_SAMP(expr)

Returns the sample standard deviation of expr (the square root of
VAR_SAMP().

STDDEV_SAMP() returns NULL if there were no matching rows.

URL: https://mariadb.com/kb/en/stddev_samp/


PURGE BINARY LOGS

Syntax:
PURGE { BINARY | MASTER } LOGS
{ TO 'log_name' | BEFORE datetime_expr }

The binary log is a set of files that contain information about data
modifications made by the MySQL server. The log consists of a set of
binary log files, plus an index file (see
https://mariadb.com/kb/en/overview-of-the-binary-log/).

The PURGE BINARY LOGS statement deletes all the binary log files listed
in the log index file prior to the specified log file name or date.
BINARY and MASTER are synonyms. Deleted log files also are removed from
the list recorded in the index file, so that the given log file becomes
the first in the list.

This statement has no effect if the server was not started with the
--log-bin option to enable binary logging.

URL: https://mariadb.com/kb/en/sql-commands-purge-logs/


/

Syntax:
/

Division:

URL: https://mariadb.com/kb/en/division-operator/


WEEKOFYEAR

Syntax:
WEEKOFYEAR(date)

Returns the calendar week of the date as a number in the range from 1
to 53. WEEKOFYEAR() is a compatibility function that is equivalent to
WEEK(date,3).

URL: https://mariadb.com/kb/en/weekofyear/


PI

Syntax:
PI()

Returns the value of π (pi). The default number of decimal places
displayed is seven, but MySQL uses the full double-precision value
internally.

URL: https://mariadb.com/kb/en/pi/


TAN

Syntax:
TAN(X)

Returns the tangent of X, where X is given in radians.

URL: https://mariadb.com/kb/en/tan/


RESET MASTER

Syntax:
RESET MASTER

Deletes all binary log files listed in the index file, resets the
binary log index file to be empty, and creates a new binary log file.
This statement is intended to be used only when the master is started
for the first time.

URL: https://mariadb.com/kb/en/reset-master/


DROP TRIGGER

Syntax:
DROP TRIGGER [IF EXISTS] [schema_name.]trigger_name

This statement drops a trigger. The schema (database) name is optional.
If the schema is omitted, the trigger is dropped from the default
schema. DROP TRIGGER requires the TRIGGER privilege for the table
associated with the trigger.

Use IF EXISTS to prevent an error from occurring for a trigger that
does not exist. A NOTE is generated for a nonexistent trigger when
using IF EXISTS. See [HELP SHOW WARNINGS].

Triggers for a table are also dropped if you drop the table.

URL: https://mariadb.com/kb/en/drop-trigger/


COS

Syntax:
COS(X)

Returns the cosine of X, where X is given in radians.


URL: https://mariadb.com/kb/en/cos/


STD

Syntax:
STD(expr)

Returns the population standard deviation of expr. This is an extension
to standard SQL. The standard SQL function STDDEV_POP() can be used
instead.

This function returns NULL if there were no matching rows.

URL: https://mariadb.com/kb/en/std/


- UNARY

Syntax:
-

Unary minus. This operator changes the sign of the operand.

URL: https://mariadb.com/kb/en/subtraction-operator-/


UNHEX

Syntax:

UNHEX(str)

For a string argument str, UNHEX(str) performs the inverse operation of
HEX(str). That is, it interprets each pair of characters in the
argument as a hexadecimal number and converts it to the character
represented by the number. The return value is a binary string.

URL: https://mariadb.com/kb/en/unhex/


VARCHAR

[NATIONAL] VARCHAR(M) [CHARACTER SET charset_name] [COLLATE
collation_name]

A variable-length string. M represents the maximum column length in
characters. The range of M is 0 to 65,535. The effective maximum length
of a VARCHAR is subject to the maximum row size (65,535 bytes, which is
shared among all columns) and the character set used. For example, utf8
characters can require up to three bytes per character, so a VARCHAR
column that uses the utf8 character set can be declared to be a maximum
of 21,844 characters. See
http://dev.mysql.com/doc/refman/5.5/en/column-count-limit.html.

MySQL stores VARCHAR values as a 1-byte or 2-byte length prefix plus
data. The length prefix indicates the number of bytes in the value. A
VARCHAR column uses one length byte if values require no more than 255
bytes, two length bytes if values may require more than 255 bytes.

*Note*: MySQL 5.5 follows the standard SQL specification, and does not
remove trailing spaces from VARCHAR values.

VARCHAR is shorthand for CHARACTER VARYING. NATIONAL VARCHAR is the
standard SQL way to define that a VARCHAR column should use some
predefined character set. MySQL 4.1 and up uses utf8 as this predefined
character set.
https://mariadb.com/kb/en/varchar/. NVARCHAR
is shorthand for NATIONAL VARCHAR.

URL: https://mariadb.com/kb/en/varchar/


DEGREES

Syntax:
DEGREES(X)

Returns the argument X, converted from radians to degrees.

URL: https://mariadb.com/kb/en/degrees/


EXPLAIN

Syntax:
EXPLAIN [explain_type] SELECT select_options

explain_type:
EXTENDED
| PARTITIONS

Or:

EXPLAIN tbl_name

The EXPLAIN statement can be used either as a way to obtain information
about how MySQL executes a statement, or as a synonym for DESCRIBE:

o When you precede a SELECT statement with the keyword EXPLAIN, MySQL
displays information from the optimizer about the query execution
plan. That is, MySQL explains how it would process the statement,
including information about how tables are joined and in which order.
EXPLAIN EXTENDED can be used to obtain additional information.

For information about using EXPLAIN and EXPLAIN EXTENDED to obtain
query execution plan information, see
https://mariadb.com/kb/en/explain/.

o EXPLAIN PARTITIONS is useful only when examining queries involving
partitioned tables. For details, see
http://dev.mysql.com/doc/refman/5.5/en/partitioning-info.html.

o EXPLAIN tbl_name is synonymous with DESCRIBE tbl_name or SHOW COLUMNS
FROM tbl_name. For information about DESCRIBE and SHOW COLUMNS, see
[HELP DESCRIBE], and [HELP SHOW COLUMNS].

URL: https://mariadb.com/kb/en/explain/


RTRIM

Syntax:
RTRIM(str)

Returns the string str with trailing space characters removed.

URL: https://mariadb.com/kb/en/rtrim/


MEDIUMINT

MEDIUMINT[(M)] [UNSIGNED] [ZEROFILL]

A medium-sized integer. The signed range is -8388608 to 8388607. The
unsigned range is 0 to 16777215.

URL: https://mariadb.com/kb/en/mediumint/


LAST_DAY

Syntax:
LAST_DAY(date)

Takes a date or datetime value and returns the corresponding value for
the last day of the month. Returns NULL if the argument is invalid.

URL: https://mariadb.com/kb/en/last_day/


LAST_INSERT_ID

Syntax:
LAST_INSERT_ID(), LAST_INSERT_ID(expr)

LAST_INSERT_ID() (with no argument) returns a BIGINT (64-bit) value
representing the first automatically generated value successfully
inserted for an AUTO_INCREMENT column as a result of the most recently
executed INSERT statement. The value of LAST_INSERT_ID() remains
unchanged if no rows are successfully inserted.

For example, after inserting a row that generates an AUTO_INCREMENT
value, you can get the value like this:

MariaDB> SELECT LAST_INSERT_ID();
-> 195

The currently executing statement does not affect the value of
LAST_INSERT_ID(). Suppose that you generate an AUTO_INCREMENT value
with one statement, and then refer to LAST_INSERT_ID() in a
multiple-row INSERT statement that inserts rows into a table with its
own AUTO_INCREMENT column. The value of LAST_INSERT_ID() will remain
stable in the second statement; its value for the second and later rows
is not affected by the earlier row insertions. (However, if you mix
references to LAST_INSERT_ID() and LAST_INSERT_ID(expr), the effect is
undefined.)

If the previous statement returned an error, the value of
LAST_INSERT_ID() is undefined. For transactional tables, if the
statement is rolled back due to an error, the value of LAST_INSERT_ID()
is left undefined. For manual ROLLBACK, the value of LAST_INSERT_ID()
is not restored to that before the transaction; it remains as it was at
the point of the ROLLBACK.

Within the body of a stored routine (procedure or function) or a
trigger, the value of LAST_INSERT_ID() changes the same way as for
statements executed outside the body of these kinds of objects. The
effect of a stored routine or trigger upon the value of
LAST_INSERT_ID() that is seen by following statements depends on the
kind of routine:

o If a stored procedure executes statements that change the value of
LAST_INSERT_ID(), the changed value is seen by statements that follow
the procedure call.

o For stored functions and triggers that change the value, the value is
restored when the function or trigger ends, so following statements
will not see a changed value.

URL: https://mariadb.com/kb/en/last_insert_id/


REVOKE

Syntax:
REVOKE
priv_type [(column_list)]
[, priv_type [(column_list)]] ...
ON [object_type] priv_level
FROM user [, user] ...

REVOKE ALL PRIVILEGES, GRANT OPTION
FROM user [, user] ...

REVOKE PROXY ON user
FROM user [, user] ...

The REVOKE statement enables system administrators to revoke privileges
from MySQL accounts. Each account name uses the format described in
https://mariadb.com/kb/en/create-user#account-names. For example:

REVOKE INSERT ON *.* FROM 'jeffrey'@'localhost';

If you specify only the user name part of the account name, a host name
part of '%' is used.

For details on the levels at which privileges exist, the permissible
priv_type and priv_level values, and the syntax for specifying users
and passwords, see [HELP GRANT]

To use the first REVOKE syntax, you must have the GRANT OPTION
privilege, and you must have the privileges that you are revoking.

To revoke all privileges, use the second syntax, which drops all
global, database, table, column, and routine privileges for the named
user or users:

REVOKE ALL PRIVILEGES, GRANT OPTION FROM user [, user] ...

To use this REVOKE syntax, you must have the global CREATE USER
privilege or the UPDATE privilege for the mysql database.

URL: https://mariadb.com/kb/en/revoke/


CURRENT_TIME

Syntax:
CURRENT_TIME, CURRENT_TIME()

CURRENT_TIME and CURRENT_TIME() are synonyms for CURTIME().

URL: https://mariadb.com/kb/en/current_time/


GEOMCOLLFROMTEXT

GeomCollFromText(wkt[,srid]), GeometryCollectionFromText(wkt[,srid])

Constructs a GEOMETRYCOLLECTION value using its WKT representation and
SRID.

URL: https://mariadb.com/kb/en/geomcollfromtext/


ISSIMPLE

IsSimple(g)

Currently, this function is a placeholder and should not be used. If
implemented, its behavior will be as described in the next paragraph.

Returns 1 if the geometry value g has no anomalous geometric points,
such as self-intersection or self-tangency. IsSimple() returns 0 if the
argument is not simple, and -1 if it is NULL.

The description of each instantiable geometric class given earlier in
the chapter includes the specific conditions that cause an instance of
that class to be classified as not simple. (See [HELP Geometry
hierarchy].)

URL: https://mariadb.com/kb/en/issimple/


AUTO_INCREMENT

The AUTO_INCREMENT attribute can be used to generate a unique identity
for new rows:

URL: https://mariadb.com/kb/en/auto_increment/


INET_ATON

Syntax:
INET_ATON(expr)

Given the dotted-quad representation of an IPv4 network address as a
string, returns an integer that represents the numeric value of the
address in network byte order (big endian). INET_ATON() returns NULL if
it does not understand its argument.

URL: https://mariadb.com/kb/en/inet_aton/


TOUCHES

Touches(g1,g2)

Returns 1 or 0 to indicate whether g1 spatially touches g2. Two
geometries spatially touch if the interiors of the geometries do not
intersect, but the boundary of one of the geometries intersects either
the boundary or the interior of the other.

URL: https://mariadb.com/kb/en/touches/


IS_FREE_LOCK

Syntax:
IS_FREE_LOCK(str)

Checks whether the lock named str is free to use (that is, not locked).
Returns 1 if the lock is free (no one is using the lock), 0 if the lock
is in use, and NULL if an error occurs (such as an incorrect argument).

URL: https://mariadb.com/kb/en/is_free_lock/


ENVELOPE

Envelope(g)

Returns the Minimum Bounding Rectangle (MBR) for the geometry value g.
The result is returned as a Polygon value.

The polygon is defined by the corner points of the bounding box:

POLYGON((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))

URL: https://mariadb.com/kb/en/envelope/


DEALLOCATE PREPARE

Syntax:
{DEALLOCATE | DROP} PREPARE stmt_name

To deallocate a prepared statement produced with PREPARE, use a
DEALLOCATE PREPARE statement that refers to the prepared statement
name. Attempting to execute a prepared statement after deallocating it
results in an error.

URL: https://mariadb.com/kb/en/deallocate-drop-prepared-statement/


ORD

Syntax:
ORD(str)

If the leftmost character of the string str is a multi-byte character,
returns the code for that character, calculated from the numeric values
of its constituent bytes using this formula:

(1st byte code)
+ (2nd byte code * 256)
+ (3rd byte code * 2562) ...

If the leftmost character is not a multi-byte character, ORD() returns
the same value as the ASCII() function.

URL: https://mariadb.com/kb/en/ord/


SMALLINT

SMALLINT[(M)] [UNSIGNED] [ZEROFILL]

A small integer. The signed range is -32768 to 32767. The unsigned
range is 0 to 65535.

URL: https://mariadb.com/kb/en/smallint/


REPEAT LOOP

Syntax:
[begin_label:] REPEAT
statement_list
UNTIL search_condition
END REPEAT [end_label]

The statement list within a REPEAT statement is repeated until the
search_condition expression is true. Thus, a REPEAT always enters the
loop at least once. statement_list consists of one or more statements,
each terminated by a semicolon (;) statement delimiter.

A REPEAT statement can be labeled. For the rules regarding label use,
see [HELP labels].

URL: https://mariadb.com/kb/en/repeat-loop/


ADDDATE

Syntax:
ADDDATE(date,INTERVAL expr unit), ADDDATE(expr,days)

When invoked with the INTERVAL form of the second argument, ADDDATE()
is a synonym for DATE_ADD(). The related function SUBDATE() is a
synonym for DATE_SUB(). For information on the INTERVAL unit argument,
see the discussion for DATE_ADD().

MariaDB> SELECT DATE_ADD('2008-01-02', INTERVAL 31 DAY);
-> '2008-02-02'
MariaDB> SELECT ADDDATE('2008-01-02', INTERVAL 31 DAY);
-> '2008-02-02'

When invoked with the days form of the second argument, MySQL treats it
as an integer number of days to be added to expr.

URL: https://mariadb.com/kb/en/adddate/


CONVERT

Syntax:
CONVERT(expr,type), CONVERT(expr USING transcoding_name)

The CONVERT() and CAST() functions take an expression of any type and
produce a result value of a specified type.

The type for the result can be one of the following values:

o BINARY[(N)]

o CHAR[(N)]

o DATE

o DATETIME

o DECIMAL[(M[,D])]

o SIGNED [INTEGER]

o TIME

o UNSIGNED [INTEGER]

BINARY produces a string with the BINARY data type. See
https://mariadb.com/kb/en/binary/ for a
description of how this affects comparisons. If the optional length N
is given, BINARY(N) causes the cast to use no more than N bytes of the
argument. Values shorter than N bytes are padded with 0x00 bytes to a
length of N.

CHAR(N) causes the cast to use no more than N characters of the
argument.

CAST() and CONVERT(... USING ...) are standard SQL syntax. The
non-USING form of CONVERT() is ODBC syntax.

CONVERT() with USING is used to convert data between different
character sets. In MySQL, transcoding names are the same as the
corresponding character set names. For example, this statement converts
the string 'abc' in the default character set to the corresponding
string in the utf8 character set:

SELECT CONVERT('abc' USING utf8);

URL: https://mariadb.com/kb/en/convert/


ASSIGN-EQUAL

Syntax:
=

This operator is used to perform value assignments in two cases,
described in the next two paragraphs.

Within a SET statement, = is treated as an assignment operator that
causes the user variable on the left hand side of the operator to take
on the value to its right. (In other words, when used in a SET
statement, = is treated identically to :=.) The value on the right hand
side may be a literal value, another variable storing a value, or any
legal expression that yields a scalar value, including the result of a
query (provided that this value is a scalar value). You can perform
multiple assignments in the same SET statement.

In the SET clause of an UPDATE statement, = also acts as an assignment
operator; in this case, however, it causes the column named on the left
hand side of the operator to assume the value given to the right,
provided any WHERE conditions that are part of the UPDATE are met. You
can make multiple assignments in the same SET clause of an UPDATE
statement.

In any other context, = is treated as a comparison operator.

URL: https://mariadb.com/kb/en/assignment-operators-assignment-operator/


LOCALTIMESTAMP

Syntax:
LOCALTIMESTAMP, LOCALTIMESTAMP()

LOCALTIMESTAMP and LOCALTIMESTAMP() are synonyms for NOW().

URL: https://mariadb.com/kb/en/localtimestamp/


&

Syntax:
&

Bitwise AND:

URL: https://mariadb.com/kb/en/bitwise_and/


ALTER LOGFILE GROUP

Syntax:
ALTER LOGFILE GROUP logfile_group
ADD UNDOFILE 'file_name'
[INITIAL_SIZE [=] size]
[WAIT]
ENGINE [=] engine_name

This statement is used with NDB cluster, which is not supported by MariaDB.


NUMPOINTS

NumPoints(ls)

Returns the number of Point objects in the LineString value ls.

URL: https://mariadb.com/kb/en/numpoints/


GEOMETRY

MySQL provides a standard way of creating spatial columns for geometry
types, for example, with CREATE TABLE or ALTER TABLE. Currently,
spatial columns are supported for MyISAM, Aria, InnoDB and ARCHIVE
tables. See also the annotations about spatial indexes under [HELP
SPATIAL].

URL: https://mariadb.com/kb/en/gis-functionality/



SHOW SLAVE STATUS

Syntax:
SHOW SLAVE STATUS

This statement provides status information on essential parameters of
the slave threads. It requires either the SUPER or REPLICATION CLIENT
privilege.

If you issue this statement using the mysql client, you can use a G
statement terminator rather than a semicolon to obtain a more readable
vertical layout:

MariaDB> SHOW SLAVE STATUSG
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: localhost
Master_User: root
Master_Port: 3306
Connect_Retry: 3
Master_Log_File: gbichot-bin.005
Read_Master_Log_Pos: 79
Relay_Log_File: gbichot-relay-bin.005
Relay_Log_Pos: 548
Relay_Master_Log_File: gbichot-bin.005
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 79
Relay_Log_Space: 552
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 8
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids: 0
Master_Server_Id: 1

URL: https://mariadb.com/kb/en/show-slave-status/


RENAME USER

Syntax:
RENAME USER old_user TO new_user
[, old_user TO new_user] ...

The RENAME USER statement renames existing MySQL accounts. To use it,
you must have the global CREATE USER privilege or the UPDATE privilege
for the mysql database. An error occurs if any old account does not
exist or any new account exists. Each account name uses the format
described in https://mariadb.com/kb/en/create-user/#account-names.
For example:

RENAME USER 'jeffrey'@'localhost' TO 'jeff'@'127.0.0.1';

If you specify only the user name part of the account name, a host name
part of '%' is used.

RENAME USER causes the privileges held by the old user to be those held
by the new user. However, RENAME USER does not automatically drop or
invalidate databases or objects within them that the old user created.
This includes stored programs or views for which the DEFINER attribute
names the old user. Attempts to access such objects may produce an
error if they execute in definer security context. (For information
about security context, see
https://mariadb.com/kb/en/stored-routine-privileges/.)


The privilege changes take effect as indicated in
http://dev.mysql.com/doc/refman/5.5/en/privilege-changes.html.

URL: https://mariadb.com/kb/en/rename-user/


DIV

Syntax:
DIV

Integer division. Similar to FLOOR(), but is safe with BIGINT values.

As of MySQL 5.5.3, if either operand has a noninteger type, the
operands are converted to DECIMAL and divided using DECIMAL arithmetic
before converting the result to BIGINT. If the result exceeds BIGINT
range, an error occurs. Before MySQL 5.5.3, incorrect results may occur
for noninteger operands that exceed BIGINT range.

URL: https://mariadb.com/kb/en/div/


DAYOFMONTH

Syntax:
DAYOFMONTH(date)

Returns the day of the month for date, in the range 1 to 31, or 0 for
dates such as '0000-00-00' or '2008-00-00' that have a zero day part.


URL: https://mariadb.com/kb/en/dayofmonth/


UNIX_TIMESTAMP

Syntax:
UNIX_TIMESTAMP(), UNIX_TIMESTAMP(date)

If called with no argument, returns a Unix timestamp (seconds since
'1970-01-01 00:00:00' UTC) as an unsigned integer. If UNIX_TIMESTAMP()
is called with a date argument, it returns the value of the argument as
seconds since '1970-01-01 00:00:00' UTC. date may be a DATE string, a
DATETIME string, a TIMESTAMP, or a number in the format YYMMDD or
YYYYMMDD. The server interprets date as a value in the current time
zone and converts it to an internal value in UTC. Clients can set their
time zone as described in
https://mariadb.com/kb/en/time-zones/.

URL: https://mariadb.com/kb/en/unix_timestamp/


<

Syntax:
<

Less than:

URL: https://mariadb.com/kb/en/less-than/


MD5

Syntax:
MD5(str)

Calculates an MD5 128-bit checksum for the string. The value is
returned as a string of 32 hex digits, or NULL if the argument was
NULL. The return value can, for example, be used as a hash key. See the
notes at the beginning of this section about storing hash values
efficiently.

As of MySQL 5.5.3, the return value is a nonbinary string in the
connection character set. Before 5.5.3, the return value is a binary
string; see the notes at the beginning of this section about using the
value as a nonbinary string.

URL: https://mariadb.com/kb/en/md5/


<<

Syntax:
<<

Shifts a longlong (BIGINT) number to the left.

URL: https://mariadb.com/kb/en/shift-left/


GEOMETRYN

GeometryN(gc,N)

Returns the N-th geometry in the GeometryCollection value gc.
Geometries are numbered beginning with 1.

URL: https://mariadb.com/kb/en/geometryn/


ALTER DATABASE

Syntax:
ALTER {DATABASE | SCHEMA} [db_name]
alter_specification ...
ALTER {DATABASE | SCHEMA} db_name
UPGRADE DATA DIRECTORY NAME

alter_specification:
[DEFAULT] CHARACTER SET [=] charset_name
| [DEFAULT] COLLATE [=] collation_name

ALTER DATABASE enables you to change the overall characteristics of a
database. These characteristics are stored in the db.opt file in the
database directory. To use ALTER DATABASE, you need the ALTER privilege
on the database. ALTER SCHEMA is a synonym for ALTER DATABASE.

The database name can be omitted from the first syntax, in which case
the statement applies to the default database.

National Language Characteristics

The CHARACTER SET clause changes the default database character set.
The COLLATE clause changes the default database collation.
https://mariadb.com/kb/en/data-types-character-sets-and-collations/, discusses
character set and collation names.

You can see what character sets and collations are available using,
respectively, the SHOW CHARACTER SET and SHOW COLLATION statements. See
[HELP SHOW CHARACTER SET], and [HELP SHOW COLLATION], for more
information.

If you change the default character set or collation for a database,
stored routines that use the database defaults must be dropped and
recreated so that they use the new defaults. (In a stored routine,
variables with character data types use the database defaults if the
character set or collation are not specified explicitly. See [HELP
CREATE PROCEDURE].)

Upgrading from Versions Older than MySQL 5.1

The syntax that includes the UPGRADE DATA DIRECTORY NAME clause updates
the name of the directory associated with the database to use the
encoding implemented in MySQL 5.1 for mapping database names to
database directory names (see
https://mariadb.com/kb/en/identifier-to-file-name-mapping/). This
clause is for use under these conditions:

o It is intended when upgrading MySQL to 5.1 or later from older
versions.

o It is intended to update a database directory name to the current
encoding format if the name contains special characters that need
encoding.

o The statement is used by mysqlcheck (as invoked by mysql_upgrade).

For example, if a database in MySQL 5.0 has the name a-b-c, the name
contains instances of the - (dash) character. In MySQL 5.0, the
database directory is also named a-b-c, which is not necessarily safe
for all file systems. In MySQL 5.1 and later, the same database name is
encoded as a@002db@002dc to produce a file system-neutral directory
name.

When a MySQL installation is upgraded to MySQL 5.1 or later from an
older version,the server displays a name such as a-b-c (which is in the
old format) as #mysql50#a-b-c, and you must refer to the name using the
#mysql50# prefix. Use UPGRADE DATA DIRECTORY NAME in this case to
explicitly tell the server to re-encode the database directory name to
the current encoding format:

ALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME;

After executing this statement, you can refer to the database as a-b-c
without the special #mysql50# prefix.

URL: https://mariadb.com/kb/en/alter-database/


CREATE FUNCTION

The CREATE FUNCTION statement is used to create stored functions and
user-defined functions (UDFs):

o For information about creating stored functions, see [HELP CREATE
PROCEDURE].

o For information about creating user-defined functions, see [HELP
CREATE FUNCTION UDF].

URL: https://mariadb.com/kb/en/create-function/


CREATE INDEX

Syntax:
CREATE [ONLINE|OFFLINE] [UNIQUE|FULLTEXT|SPATIAL] INDEX index_name
[index_type]
ON tbl_name (index_col_name,...)
[index_option] ...

index_col_name:
col_name [(length)] [ASC | DESC]

index_type:
USING {BTREE | HASH}

index_option:
KEY_BLOCK_SIZE [=] value
| index_type
| WITH PARSER parser_name
| COMMENT 'string'


CREATE INDEX is mapped to an ALTER TABLE statement to create indexes.
See [HELP ALTER TABLE]. CREATE INDEX cannot be used to create a PRIMARY
KEY; use ALTER TABLE instead. For more information about indexes, see
https://mariadb.com/kb/en/optimization-and-indexes/.

URL: https://mariadb.com/kb/en/create-index/


SQRT

Syntax:
SQRT(X)

Returns the square root of a nonnegative number X.

URL: https://mariadb.com/kb/en/sqrt/


LOG10

Syntax:
LOG10(X)

Returns the base-10 logarithm of X.

URL: https://mariadb.com/kb/en/log10/


IS NOT

Syntax:
IS NOT boolean_value

Tests a value against a boolean value, where boolean_value can be TRUE,
FALSE, or UNKNOWN.

URL: https://mariadb.com/kb/en/is-not/


NOT BETWEEN

Syntax:
expr NOT BETWEEN min AND max

This is the same as NOT (expr BETWEEN min AND max).

URL: https://mariadb.com/kb/en/not-between/


YEARWEEK

Syntax:
YEARWEEK(date), YEARWEEK(date,mode)

Returns year and week for a date. The mode argument works exactly like
the mode argument to WEEK(). The year in the result may be different
from the year in the date argument for the first and the last week of
the year.

URL: https://mariadb.com/kb/en/yearweek/


BIT_OR

Syntax:
BIT_OR(expr)

Returns the bitwise OR of all bits in expr. The calculation is
performed with 64-bit (BIGINT) precision.

URL: https://mariadb.com/kb/en/bit_or/


MBRINTERSECTS

MBRIntersects(g1,g2)

Returns 1 or 0 to indicate whether the Minimum Bounding Rectangles of
the two geometries g1 and g2 intersect.

URL: https://mariadb.com/kb/en/mbrintersects/


MPOLYFROMTEXT

MPolyFromText(wkt[,srid]), MultiPolygonFromText(wkt[,srid])

Constructs a MULTIPOLYGON value using its WKT representation and SRID.

URL: https://mariadb.com/kb/en/mpolyfromtext/


DECLARE VARIABLE

Syntax:
DECLARE var_name [, var_name] ... type [DEFAULT value]

This statement declares local variables within stored programs. To
provide a default value for a variable, include a DEFAULT clause. The
value can be specified as an expression; it need not be a constant. If
the DEFAULT clause is missing, the initial value is NULL.

Local variables are treated like stored routine parameters with respect
to data type and overflow checking. See [HELP CREATE PROCEDURE].

Variable declarations must appear before cursor or handler
declarations.

Local variable names are not case sensitive. Permissible characters and
quoting rules are the same as for other identifiers, as described in
https://mariadb.com/kb/en/identifier-names/.

The scope of a local variable is the BEGIN ... END block within which
it is declared. The variable can be referred to in blocks nested within
the declaring block, except those blocks that declare a variable with
the same name.

URL: https://mariadb.com/kb/en/declare-variable/


GRANT

Syntax:
GRANT
priv_type [(column_list)]
[, priv_type [(column_list)]] ...
ON [object_type] priv_level
TO user_specification [, user_specification] ...
[REQUIRE {NONE | ssl_option [[AND] ssl_option] ...}]
[WITH with_option ...]

GRANT PROXY ON user_specification
TO user_specification [, user_specification] ...
[WITH GRANT OPTION]

object_type:
TABLE
| FUNCTION
| PROCEDURE

priv_level:
*
| *.*
| db_name.*
| db_name.tbl_name
| tbl_name
| db_name.routine_name

user_specification:
user
[
IDENTIFIED BY [PASSWORD] 'password'
| IDENTIFIED WITH auth_plugin [AS 'auth_string']
]

ssl_option:
SSL
| X509
| CIPHER 'cipher'
| ISSUER 'issuer'
| SUBJECT 'subject'

with_option:
GRANT OPTION
| MAX_QUERIES_PER_HOUR count
| MAX_UPDATES_PER_HOUR count
| MAX_CONNECTIONS_PER_HOUR count
| MAX_USER_CONNECTIONS count

The GRANT statement grants privileges to MySQL user accounts. GRANT
also serves to specify other account characteristics such as use of
secure connections and limits on access to server resources. To use
GRANT, you must have the GRANT OPTION privilege, and you must have the
privileges that you are granting.

Normally, a database administrator first uses CREATE USER to create an
account, then GRANT to define its privileges and characteristics. For
example:

CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY 'mypass';
GRANT ALL ON db1.* TO 'jeffrey'@'localhost';
GRANT SELECT ON db2.invoice TO 'jeffrey'@'localhost';
GRANT USAGE ON *.* TO 'jeffrey'@'localhost' WITH MAX_QUERIES_PER_HOUR 90;

However, if an account named in a GRANT statement does not already
exist, GRANT may create it under the conditions described later in the
discussion of the NO_AUTO_CREATE_USER SQL mode.

The REVOKE statement is related to GRANT and enables administrators to
remove account privileges. See [HELP REVOKE].

When successfully executed from the mysql program, GRANT responds with
Query OK, 0 rows affected. To determine what privileges result from the
operation, use SHOW GRANTS. See [HELP SHOW GRANTS].

URL: https://mariadb.com/kb/en/grant/


STARTPOINT

StartPoint(ls)

Returns the Point that is the start point of the LineString value ls.

URL: https://mariadb.com/kb/en/startpoint/


XOR

Syntax:
XOR

Logical XOR. Returns NULL if either operand is NULL. For non-NULL
operands, evaluates to 1 if an odd number of operands is nonzero,
otherwise 0 is returned.

URL: https://mariadb.com/kb/en/xor/


CRC32

Syntax:
CRC32(expr)

Computes a cyclic redundancy check value and returns a 32-bit unsigned
value. The result is NULL if the argument is NULL. The argument is
expected to be a string and (if possible) is treated as one if it is
not.

URL: https://mariadb.com/kb/en/crc32/


INSERT FUNCTION

Syntax:
INSERT(str,pos,len,newstr)

Returns the string str, with the substring beginning at position pos
and len characters long replaced by the string newstr. Returns the
original string if pos is not within the length of the string. Replaces
the rest of the string from position pos if len is not within the
length of the rest of the string. Returns NULL if any argument is NULL.

URL: https://mariadb.com/kb/en/insert-function/


SHOW PRIVILEGES

Syntax:
SHOW PRIVILEGES

SHOW PRIVILEGES shows the list of system privileges that the MySQL
server supports. The exact list of privileges depends on the version of
your server.

URL: https://mariadb.com/kb/en/show-privileges/


SHOW GRANTS

Syntax:
SHOW GRANTS [FOR user]

This statement lists the GRANT statement or statements that must be
issued to duplicate the privileges that are granted to a MySQL user
account. The account is named using the same format as for the GRANT
statement; for example, 'jeffrey'@'localhost'. If you specify only the
user name part of the account name, a host name part of '%' is used.
For additional information about specifying account names, see [HELP
GRANT].

MariaDB> SHOW GRANTS FOR 'root'@'localhost';
+---------------------------------------------------------------------+
| Grants for root@localhost |
+---------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION |
+---------------------------------------------------------------------+

To list the privileges granted to the account that you are using to
connect to the server, you can use any of the following statements:

SHOW GRANTS;
SHOW GRANTS FOR CURRENT_USER;
SHOW GRANTS FOR CURRENT_USER();


If SHOW GRANTS FOR CURRENT_USER (or any of the equivalent syntaxes) is
used in DEFINER context, such as within a stored procedure that is
defined with SQL SECURITY DEFINER), the grants displayed are those of
the definer and not the invoker.

URL: https://mariadb.com/kb/en/show-grants/


CHARACTER_LENGTH

Syntax:
CHARACTER_LENGTH(str)

CHARACTER_LENGTH() is a synonym for CHAR_LENGTH().

URL: https://mariadb.com/kb/en/character_length/


HELP_VERSION

This help information was generated from the MySQL 5.5 Reference Manual
on: 2012-08-25 (revision: 31914)

This information applies to MySQL 5.5 through 5.5.29.


PROCEDURE ANALYSE

Syntax:
ANALYSE([max_elements[,max_memory]])

ANALYSE() examines the result from a query and returns an analysis of
the results that suggests optimal data types for each column that may
help reduce table sizes. To obtain this analysis, append PROCEDURE
ANALYSE to the end of a SELECT statement:

SELECT ... FROM ... WHERE ... PROCEDURE ANALYSE([max_elements,[max_memory]])

For example:

SELECT col1, col2 FROM table1 PROCEDURE ANALYSE(10, 2000);

The results show some statistics for the values returned by the query,
and propose an optimal data type for the columns. This can be helpful
for checking your existing tables, or after importing new data. You may
need to try different settings for the arguments so that PROCEDURE
ANALYSE() does not suggest the ENUM data type when it is not
appropriate.

The arguments are optional and are used as follows:

o max_elements (default 256) is the maximum number of distinct values
that ANALYSE() notices per column. This is used by ANALYSE() to check
whether the optimal data type should be of type ENUM; if there are
more than max_elements distinct values, then ENUM is not a suggested
type.

o max_memory (default 8192) is the maximum amount of memory that
ANALYSE() should allocate per column while trying to find all
distinct values.

URL: https://mariadb.com/kb/en/procedure-analyse/


TIMESTAMP FUNCTION

Syntax:
TIMESTAMP(expr), TIMESTAMP(expr1,expr2)

With a single argument, this function returns the date or datetime
expression expr as a datetime value. With two arguments, it adds the
time expression expr2 to the date or datetime expression expr1 and
returns the result as a datetime value.

URL: https://mariadb.com/kb/en/timestamp-function/


MBREQUAL

MBREqual(g1,g2)

Returns 1 or 0 to indicate whether the Minimum Bounding Rectangles of
the two geometries g1 and g2 are the same.

URL: https://mariadb.com/kb/en/mbrequal/


DROP DATABASE

Syntax:
DROP {DATABASE | SCHEMA} [IF EXISTS] db_name

DROP DATABASE drops all tables in the database and deletes the
database. Be very careful with this statement! To use DROP DATABASE,
you need the DROP privilege on the database. DROP SCHEMA is a synonym
for DROP DATABASE.

*Important*: When a database is dropped, user privileges on the
database are not automatically dropped. See [HELP GRANT].

IF EXISTS is used to prevent an error from occurring if the database
does not exist.

URL: https://mariadb.com/kb/en/drop-database/


MONTHNAME

Syntax:
MONTHNAME(date)

Returns the full name of the month for date. The language used for the
name is controlled by the value of the lc_time_names system variable
(https://mariadb.com/kb/en/server-locale/).

URL: https://mariadb.com/kb/en/monthname/


NUMGEOMETRIES

NumGeometries(gc)

Returns the number of geometries in the GeometryCollection value gc.

URL: https://mariadb.com/kb/en/numgeometries/



SET GLOBAL SQL_SLAVE_SKIP_COUNTER

Syntax:
SET GLOBAL sql_slave_skip_counter = N

This statement skips the next N events from the master. This is useful
for recovering from replication stops caused by a statement.

This statement is valid only when the slave threads are not running.
Otherwise, it produces an error.

URL: https://mariadb.com/kb/en/set-global-sql_slave_skip_counter/


OVERLAPS

Overlaps(g1,g2)

Returns 1 or 0 to indicate whether g1 spatially overlaps g2. The term
spatially overlaps is used if two geometries intersect and their
intersection results in a geometry of the same dimension but not equal
to either of the given geometries.

URL: https://mariadb.com/kb/en/overlaps/


ASTEXT

AsText(g), AsWKT(g)

Converts a value in internal geometry format to its WKT representation
and returns the string result.

URL: https://mariadb.com/kb/en/astext/


DISJOINT

Disjoint(g1,g2)

Returns 1 or 0 to indicate whether g1 is spatially disjoint from (does
not intersect) g2.

URL: https://mariadb.com/kb/en/disjoint/


KILL

Syntax:
KILL [CONNECTION | QUERY] thread_id

Each connection to mysqld runs in a separate thread. You can see which
threads are running with the SHOW PROCESSLIST statement and kill a
thread with the KILL thread_id statement.

KILL permits an optional CONNECTION or QUERY modifier:

o KILL CONNECTION is the same as KILL with no modifier: It terminates
the connection associated with the given thread_id.

o KILL QUERY terminates the statement that the connection is currently
executing, but leaves the connection itself intact.

If you have the PROCESS privilege, you can see all threads. If you have
the SUPER privilege, you can kill all threads and statements.
Otherwise, you can see and kill only your own threads and statements.

You can also use the mysqladmin processlist and mysqladmin kill
commands to examine and kill threads.

*Note*: You cannot use KILL with the Embedded MySQL Server library
because the embedded server merely runs inside the threads of the host
application. It does not create any connection threads of its own.

URL: https://mariadb.com/kb/en/data-manipulation-kill-connection-query/


LONGTEXT

LONGTEXT [CHARACTER SET charset_name] [COLLATE collation_name]

A TEXT column with a maximum length of 4,294,967,295 or 4GB (232 - 1)
characters. The effective maximum length is less if the value contains
multi-byte characters. The effective maximum length of LONGTEXT columns
also depends on the configured maximum packet size in the client/server
protocol and available memory. Each LONGTEXT value is stored using a
4-byte length prefix that indicates the number of bytes in the value.

URL: https://mariadb.com/kb/en/longtext/


%

Syntax:
N % M, N MOD M

Modulo operation. Returns the remainder of N divided by M. For more
information, see the description for the MOD() function in
https://mariadb.com/kb/en/mod/.

URL: https://mariadb.com/kb/en/modulo-operator/


DAYOFYEAR

Syntax:
DAYOFYEAR(date)

Returns the day of the year for date, in the range 1 to 366.

URL: https://mariadb.com/kb/en/dayofyear/


SUBDATE

Syntax:
SUBDATE(date,INTERVAL expr unit), SUBDATE(expr,days)

When invoked with the INTERVAL form of the second argument, SUBDATE()
is a synonym for DATE_SUB(). For information on the INTERVAL unit
argument, see the discussion for DATE_ADD().

MariaDB> SELECT DATE_SUB('2008-01-02', INTERVAL 31 DAY);
-> '2007-12-02'
MariaDB> SELECT SUBDATE('2008-01-02', INTERVAL 31 DAY);
-> '2007-12-02'

The second form enables the use of an integer value for days. In such
cases, it is interpreted as the number of days to be subtracted from
the date or datetime expression expr.

MariaDB> SELECT SUBDATE('2008-01-02 12:00:00', 31);
-> '2007-12-02 12:00:00'

URL: https://mariadb.com/kb/en/subdate/


CHARSET

Syntax:
CHARSET(str)

Returns the character set of the string argument.

URL: https://mariadb.com/kb/en/charset/


LOCATE

Syntax:
LOCATE(substr,str), LOCATE(substr,str,pos)

The first syntax returns the position of the first occurrence of
substring substr in string str. The second syntax returns the position

of the first occurrence of substring substr in string str, starting at
position pos. Returns 0 if substr is not in str.

URL: https://mariadb.com/kb/en/locate/


FLOAT

FLOAT[(M,D)] [UNSIGNED] [ZEROFILL]

A small (single-precision) floating-point number. Permissible values
are -3.402823466E+38 to -1.175494351E-38, 0, and 1.175494351E-38 to
3.402823466E+38. These are the theoretical limits, based on the IEEE
standard. The actual range might be slightly smaller depending on your
hardware or operating system.

M is the total number of digits and D is the number of digits following
the decimal point. If M and D are omitted, values are stored to the
limits permitted by the hardware. A single-precision floating-point
number is accurate to approximately 7 decimal places.

UNSIGNED, if specified, disallows negative values.

Using FLOAT might give you some unexpected problems because all
calculations in MySQL are done with double precision. See
https://mariadb.com/kb/en/floating-point-accuracy/.

URL: https://mariadb.com/kb/en/float/


SEC_TO_TIME

Syntax:
SEC_TO_TIME(seconds)

Returns the seconds argument, converted to hours, minutes, and seconds,
as a TIME value. The range of the result is constrained to that of the
TIME data type. A warning occurs if the argument corresponds to a value
outside that range.

URL: https://mariadb.com/kb/en/sec_to_time/


SIGN

Syntax:
SIGN(X)

Returns the sign of the argument as -1, 0, or 1, depending on whether X
is negative, zero, or positive.

URL: https://mariadb.com/kb/en/sign/


SHOW DATABASES

Syntax:
SHOW {DATABASES | SCHEMAS}
[LIKE 'pattern' | WHERE expr]

SHOW DATABASES lists the databases on the MySQL server host. SHOW
SCHEMAS is a synonym for SHOW DATABASES. The LIKE clause, if present,
indicates which database names to match. The WHERE clause can be given
to select rows using more general conditions, as discussed in
https://mariadb.com/kb/en/extended-show/.

You see only those databases for which you have some kind of privilege,
unless you have the global SHOW DATABASES privilege. You can also get
this list using the mysqlshow command.

If the server was started with the --skip-show-database option, you
cannot use this statement at all unless you have the SHOW DATABASES
privilege.

URL: https://mariadb.com/kb/en/show-databases/


ELT

Syntax:
ELT(N,str1,str2,str3,...)

Returns str1 if N = 1, str2 if N = 2, and so on. Returns NULL if N is
less than 1 or greater than the number of arguments. ELT() is the
complement of FIELD().

URL: https://mariadb.com/kb/en/elt/.html


VAR_POP

Syntax:
VAR_POP(expr)

Returns the population standard variance of expr. It considers rows as
the whole population, not as a sample, so it has the number of rows as
the denominator. You can also use VARIANCE(), which is equivalent but
is not standard SQL.

VAR_POP() returns NULL if there were no matching rows.

URL: https://mariadb.com/kb/en/var_pop/


CREATE DATABASE

Syntax:
CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name
[create_specification] ...

create_specification:
[DEFAULT] CHARACTER SET [=] charset_name
| [DEFAULT] COLLATE [=] collation_name

CREATE DATABASE creates a database with the given name. To use this
statement, you need the CREATE privilege for the database. CREATE
SCHEMA is a synonym for CREATE DATABASE.

URL: https://mariadb.com/kb/en/create-database/


RPAD

Syntax:
RPAD(str,len,padstr)

Returns the string str, right-padded with the string padstr to a length
of len characters. If str is longer than len, the return value is
shortened to len characters.

URL: https://mariadb.com/kb/en/rpad/


RAND

Syntax:
RAND(), RAND(N)

Returns a random floating-point value v in the range 0 <= v < 1.0. If a
constant integer argument N is specified, it is used as the seed value,
which produces a repeatable sequence of column values. In the following
example, note that the sequences of values produced by RAND(3) is the
same both places where it occurs.

URL: https://mariadb.com/kb/en/rand/


SET DATA TYPE

SET('value1','value2',...) [CHARACTER SET charset_name] [COLLATE
collation_name]

A set. A string object that can have zero or more values, each of which
must be chosen from the list of values 'value1', 'value2', ... A SET
column can have a maximum of 64 members. SET values are represented
internally as integers.

URL: https://mariadb.com/kb/en/set-data-type/


FLUSH QUERY CACHE

You can defragment the query cache to better utilize its memory with
the FLUSH QUERY CACHE statement. The statement does not remove any
queries from the cache.

The RESET QUERY CACHE statement removes all query results from the
query cache. The FLUSH TABLES statement also does this.

URL: https://mariadb.com/kb/en/flush-query-cache/


LEFT

Syntax:
LEFT(str,len)

Returns the leftmost len characters from the string str, or NULL if any
argument is NULL.

URL: https://mariadb.com/kb/en/left/


TIME_FORMAT

Syntax:
TIME_FORMAT(time,format)

This is used like the DATE_FORMAT() function, but the format string may
contain format specifiers only for hours, minutes, seconds, and
microseconds. Other specifiers produce a NULL value or 0.

URL: https://mariadb.com/kb/en/time_format/


MULTIPOLYGON

MultiPolygon(poly1,poly2,...)

Constructs a MultiPolygon value from a set of Polygon or WKB Polygon
arguments.

URL: https://mariadb.com/kb/en/multipolygon/


BETWEEN AND

Syntax:
expr BETWEEN min AND max

If expr is greater than or equal to min and expr is less than or equal
to max, BETWEEN returns 1, otherwise it returns 0. This is equivalent
to the expression (min <= expr AND expr <= max) if all the arguments
are of the same type. Otherwise type conversion takes place according
to the rules described in
https://mariadb.com/kb/en/type-conversion/, but
applied to all the three arguments.

URL: https://mariadb.com/kb/en/between-and/


START TRANSACTION

Syntax:
START TRANSACTION [WITH CONSISTENT SNAPSHOT]
BEGIN [WORK]
COMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]
ROLLBACK [WORK] [AND [NO] CHAIN] [[NO] RELEASE]
SET autocommit = {0 | 1}

These statements provide control over use of transactions:

o START TRANSACTION or BEGIN start a new transaction.

o COMMIT commits the current transaction, making its changes permanent.

o ROLLBACK rolls back the current transaction, canceling its changes.


o SET autocommit disables or enables the default autocommit mode for
the current session.

By default, MySQL runs with autocommit mode enabled. This means that as
soon as you execute a statement that updates (modifies) a table, MySQL
stores the update on disk to make it permanent. The change cannot be
rolled back.

To disable autocommit mode implicitly for a single series of
statements, use the START TRANSACTION statement:

START TRANSACTION;
SELECT @A:=SUM(salary) FROM table1 WHERE type=1;
UPDATE table2 SET summary=@A WHERE type=1;
COMMIT;

With START TRANSACTION, autocommit remains disabled until you end the
transaction with COMMIT or ROLLBACK. The autocommit mode then reverts
to its previous state.

You can also begin a transaction like this:

START TRANSACTION WITH CONSISTENT SNAPSHOT;

The WITH CONSISTENT SNAPSHOT option starts a consistent read for
storage engines that are capable of it. This applies only to InnoDB.
The effect is the same as issuing a START TRANSACTION followed by a
SELECT from any InnoDB table. See
http://dev.mysql.com/doc/refman/5.5/en/innodb-consistent-read.html. The
WITH CONSISTENT SNAPSHOT option does not change the current transaction
isolation level, so it provides a consistent snapshot only if the
current isolation level is one that permits consistent read (REPEATABLE
READ or SERIALIZABLE).

*Important*: Many APIs used for writing MySQL client applications (such
as JDBC) provide their own methods for starting transactions that can
(and sometimes should) be used instead of sending a START TRANSACTION
statement from the client. See
http://dev.mysql.com/doc/refman/5.5/en/connectors-apis.html, or the
documentation for your API, for more information.

To disable autocommit mode explicitly, use the following statement:

SET autocommit=0;

After disabling autocommit mode by setting the autocommit variable to
zero, changes to transaction-safe tables (such as those for InnoDB) are not made permanent immediately. You must use COMMIT to
store your changes to disk or ROLLBACK to ignore the changes.

autocommit is a session variable and must be set for each session. To
disable autocommit mode for each new connection, see the description of
the autocommit system variable at
https://mariadb.com/kb/en/server-system-variables/.

BEGIN and BEGIN WORK are supported as aliases of START TRANSACTION for
initiating a transaction. START TRANSACTION is standard SQL syntax and
is the recommended way to start an ad-hoc transaction.

The BEGIN statement differs from the use of the BEGIN keyword that
starts a BEGIN ... END compound statement. The latter does not begin a
transaction. See [HELP BEGIN END].

*Note*: Within all stored programs (stored procedures and functions,
triggers, and events), the parser treats BEGIN [WORK] as the beginning
of a BEGIN ... END block. Begin a transaction in this context with
START TRANSACTION instead.

The optional WORK keyword is supported for COMMIT and ROLLBACK, as are
the CHAIN and RELEASE clauses. CHAIN and RELEASE can be used for
additional control over transaction completion. The value of the
completion_type system variable determines the default completion
behavior. See
https://mariadb.com/kb/en/server-system-variables/.

The AND CHAIN clause causes a new transaction to begin as soon as the
current one ends, and the new transaction has the same isolation level
as the just-terminated transaction. The RELEASE clause causes the
server to disconnect the current client session after terminating the
current transaction. Including the NO keyword suppresses CHAIN or
RELEASE completion, which can be useful if the completion_type system
variable is set to cause chaining or release completion by default.

URL: https://mariadb.com/kb/en/start-transaction/


SHOW SLAVE HOSTS

Syntax:
SHOW SLAVE HOSTS

Displays a list of replication slaves currently registered with the
master. (Before MySQL 5.5.3, only slaves started with the
--report-host=host_name option are visible in this list.)


The list is displayed on any server (not just the master server). The
output looks like this:

MariaDB> SHOW SLAVE HOSTS;
+------------+-----------+------+-----------+
| Server_id | Host | Port | Master_id |
+------------+-----------+------+-----------+
| 192168010 | iconnect2 | 3306 | 192168011 |
| 1921680101 | athena | 3306 | 192168011 |
+------------+-----------+------+-----------+

o Server_id: The unique server ID of the slave server, as configured in
the server's option file, or on the command line with
--server-id=value.

o Host: The host name of the slave server, as configured in the
server's option file, or on the command line with
--report-host=host_name. Note that this can differ from the machine
name as configured in the operating system.

o Port: The port the slave server is listening on.

In MySQL 5.5.23 and later, a zero in this column means that the slave
port (--report-port) was not set. Prior to MySQL 5.5.23, 3306 was

used as the default in such cases (Bug #13333431).

o Master_id: The unique server ID of the master server that the slave
server is replicating from.

Some MySQL versions report another variable, Rpl_recovery_rank. This
variable was never used, and was removed in MySQL 5.5.3. (Bug #13963)

URL: https://mariadb.com/kb/en/show-slave-hosts/


GEOMFROMWKB

GeomFromWKB(wkb[,srid]), GeometryFromWKB(wkb[,srid])

Constructs a geometry value of any type using its WKB representation
and SRID.

URL: https://mariadb.com/kb/en/geomfromwkb/


EXTERIORRING

ExteriorRing(poly)

Returns the exterior ring of the Polygon value poly as a LineString.

URL: https://mariadb.com/kb/en/exteriorring/


BIT_LENGTH

Syntax:
BIT_LENGTH(str)

Returns the length of the string str in bits.

URL: https://mariadb.com/kb/en/bit_length/


||

Syntax:
OR, ||

Logical OR. When both operands are non-NULL, the result is 1 if any
operand is nonzero, and 0 otherwise. With a NULL operand, the result is
1 if the other operand is nonzero, and NULL otherwise. If both operands
are NULL, the result is NULL.

URL: https://mariadb.com/kb/en/or/


FORMAT

Syntax:
FORMAT(X,D[,locale])

Formats the number X to a format like '#,###,###.##', rounded to D
decimal places, and returns the result as a string. If D is 0, the
result has no decimal point or fractional part.

The optional third parameter enables a locale to be specified to be
used for the result number's decimal point, thousands separator, and
grouping between separators. Permissible locale values are the same as
the legal values for the lc_time_names system variable (see
https://mariadb.com/kb/en/server-locale/). If no
locale is specified, the default is 'en_US'.

URL: https://mariadb.com/kb/en/format/


OLD_PASSWORD

Syntax:
OLD_PASSWORD(str)

OLD_PASSWORD() was added when the implementation of PASSWORD() was
changed in MySQL 4.1 to improve security. OLD_PASSWORD() returns the
value of the pre-4.1 implementation of PASSWORD() as a string, and is
intended to permit you to reset passwords for any pre-4.1 clients that
need to connect to your version 5.5 MySQL server without locking them
out. See http://dev.mysql.com/doc/refman/5.1/en/password-hashing.html.

As of MySQL 5.5.3, the return value is a nonbinary string in the
connection character set. Before 5.5.3, the return value is a binary
string.

URL: https://mariadb.com/kb/en/old_password/


EXTRACTVALUE

Syntax:
ExtractValue(xml_frag, xpath_expr)

ExtractValue() takes two string arguments, a fragment of XML markup
xml_frag and an XPath expression xpath_expr (also known as a locator);
it returns the text (CDATA) of the first text node which is a child of
the elements or elements matched by the XPath expression. In MySQL 5.5,
the XPath expression can contain at most 127 characters. (This
limitation is lifted in MySQL 5.6.)

Using this function is the equivalent of performing a match using the
xpath_expr after appending /text(). In other words,
ExtractValue('Sakila', '/a/b') and
ExtractValue('Sakila', '/a/b/text()') produce the same
result.

If multiple matches are found, the content of the first child text node
of each matching element is returned (in the order matched) as a
single, space-delimited string.

If no matching text node is found for the expression (including the
implicit /text())---for whatever reason, as long as xpath_expr is
valid, and xml_frag consists of elements which are properly nested and
closed---an empty string is returned. No distinction is made between a
match on an empty element and no match at all. This is by design.

If you need to determine whether no matching element was found in
xml_frag or such an element was found but contained no child text
nodes, you should test the result of an expression that uses the XPath
count() function. For example, both of these statements return an empty
string, as shown here:

MariaDB> SELECT ExtractValue('', '/a/b');
+-------------------------------------+
| ExtractValue('', '/a/b') |
+-------------------------------------+
| |
+-------------------------------------+
1 row in set (0.00 sec)

MariaDB> SELECT ExtractValue('', '/a/b');
+-------------------------------------+
| ExtractValue('', '/a/b') |
+-------------------------------------+
| |
+-------------------------------------+
1 row in set (0.00 sec)

However, you can determine whether there was actually a matching
element using the following:

MariaDB> SELECT ExtractValue('', 'count(/a/b)');
+-------------------------------------+
| ExtractValue('', 'count(/a/b)') |
+-------------------------------------+
| 1 |
+-------------------------------------+
1 row in set (0.00 sec)

MariaDB> SELECT ExtractValue('', 'count(/a/b)');
+-------------------------------------+
| ExtractValue('', 'count(/a/b)') |
+-------------------------------------+
| 0 |
+-------------------------------------+
1 row in set (0.01 sec)

*Important*: ExtractValue() returns only CDATA, and does not return any
tags that might be contained within a matching tag, nor any of their
content (see the result returned as val1 in the following example).

URL: https://mariadb.com/kb/en/extractvalue/


SHOW STATUS

Syntax:
SHOW [GLOBAL | SESSION] STATUS
[LIKE 'pattern' | WHERE expr]

SHOW STATUS provides server status information. This information also
can be obtained using the mysqladmin extended-status command. The LIKE
clause, if present, indicates which variable names to match. The WHERE
clause can be given to select rows using more general conditions, as
discussed in https://mariadb.com/kb/en/extended-show/.
This statement does not require any privilege. It requires only the
ability to connect to the server.
With a LIKE clause, the statement displays only rows for those
variables with names that match the pattern:

MariaDB> SHOW STATUS LIKE 'Key%';
+--------------------+----------+
| Variable_name | Value |
+--------------------+----------+
| Key_blocks_used | 14955 |
| Key_read_requests | 96854827 |
| Key_reads | 162040 |
| Key_write_requests | 7589728 |
| Key_writes | 3813196 |
+--------------------+----------+

With the GLOBAL modifier, SHOW STATUS displays the status values for
all connections to MySQL. With SESSION, it displays the status values
for the current connection. If no modifier is present, the default is
SESSION. LOCAL is a synonym for SESSION.

Some status variables have only a global value. For these, you get the
same value for both GLOBAL and SESSION. The scope for each status
variable is listed at
https://mariadb.com/kb/en/server-status-variables/.

Each invocation of the SHOW STATUS statement uses an internal temporary
table and increments the global Created_tmp_tables value.

URL: https://mariadb.com/kb/en/show-status/


ENCRYPT

Syntax:
ENCRYPT(str[,salt])

Encrypts str using the Unix crypt() system call and returns a binary
string. The salt argument must be a string with at least two characters
or the result will be NULL. If no salt argument is given, a random
value is used.

URL: https://mariadb.com/kb/en/encrypt/


EXTRACT

Syntax:
EXTRACT(unit FROM date)

The EXTRACT() function uses the same kinds of unit specifiers as
DATE_ADD() or DATE_SUB(), but extracts parts from the date rather than
performing date arithmetic.

URL: https://mariadb.com/kb/en/extract/


SHOW OPEN TABLES

Syntax:
SHOW OPEN TABLES [{FROM | IN} db_name]
[LIKE 'pattern' | WHERE expr]

SHOW OPEN TABLES lists the non-TEMPORARY tables that are currently open
in the table cache. See
http://dev.mysql.com/doc/refman/5.5/en/table-cache.html. The FROM
clause, if present, restricts the tables shown to those present in the
db_name database. The LIKE clause, if present, indicates which table
names to match. The WHERE clause can be given to select rows using more
general conditions, as discussed in
https://mariadb.com/kb/en/extended-show/.

URL: https://mariadb.com/kb/en/show-open-tables/


ASSIGN-VALUE

Syntax:
:=

Assignment operator. Causes the user variable on the left hand side of
the operator to take on the value to its right. The value on the right
hand side may be a literal value, another variable storing a value, or
any legal expression that yields a scalar value, including the result
of a query (provided that this value is a scalar value). You can
perform multiple assignments in the same SET statement. You can perform
multiple assignments in the same statement-

Unlike =, the := operator is never interpreted as a comparison
operator. This means you can use := in any valid SQL statement (not
just in SET statements) to assign a value to a variable.

URL: https://mariadb.com/kb/en/assignment-operator/


DATE

DATE

A date. The supported range is '1000-01-01' to '9999-12-31'. MySQL
displays DATE values in 'YYYY-MM-DD' format, but permits assignment of
values to DATE columns using either strings or numbers.

URL: https://mariadb.com/kb/en/date/


CONV

Syntax:
CONV(N,from_base,to_base)

Converts numbers between different number bases. Returns a string
representation of the number N, converted from base from_base to base
to_base. Returns NULL if any argument is NULL. The argument N is
interpreted as an integer, but may be specified as an integer or a
string. The minimum base is 2 and the maximum base is 36. If to_base is
a negative number, N is regarded as a signed number. Otherwise, N is
treated as unsigned. CONV() works with 64-bit precision.

URL: https://mariadb.com/kb/en/conv/


LOAD XML

Syntax:
LOAD XML [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name'
[REPLACE | IGNORE]
INTO TABLE [db_name.]tbl_name
[CHARACTER SET charset_name]
[ROWS IDENTIFIED BY '']
[IGNORE number {LINES | ROWS}]
[(column_or_user_var,...)]
[SET col_name = expr,...]

The LOAD XML statement reads data from an XML file into a table. The
file_name must be given as a literal string. The tagname in the
optional ROWS IDENTIFIED BY clause must also be given as a literal
string, and must be surrounded by angle brackets (< and >).

LOAD XML acts as the complement of running the mysql client in XML
output mode (that is, starting the client with the --xml option). To
write data from a table to an XML file, use a command such as the
following one from the system shell:

shell> mysql --xml -e 'SELECT * FROM mytable' > file.xml

To read the file back into a table, use LOAD XML INFILE. By default,
the element is considered to be the equivalent of a database
table row; this can be changed using the ROWS IDENTIFIED BY clause.

This statement supports three different XML formats:

o Column names as attributes and column values as attribute values:



o Column names as tags and column values as the content of these tags:


value1
value2


o Column names are the name attributes of tags, and values are
the contents of these tags:


value1
value2


This is the format used by other MySQL tools, such as mysqldump.

All 3 formats can be used in the same XML file; the import routine
automatically detects the format for each row and interprets it
correctly. Tags are matched based on the tag or attribute name and the
column name.

The following clauses work essentially the same way for LOAD XML as
they do for LOAD DATA:

o LOW_PRIORITY or CONCURRENT

o LOCAL

o REPLACE or IGNORE

o CHARACTER SET

o (column_or_user_var,...)

o SET

See [HELP LOAD DATA], for more information about these clauses.

The IGNORE number LINES or IGNORE number ROWS clause causes the first
number rows in the XML file to be skipped. It is analogous to the LOAD
DATA statement's IGNORE ... LINES clause.

URL: https://mariadb.com/kb/en/load-xml/


SET

Syntax:
SET variable_assignment [, variable_assignment] ...

variable_assignment:
user_var_name = expr
| [GLOBAL | SESSION] system_var_name = expr
| [@@global. | @@session. | @@]system_var_name = expr

The SET statement assigns values to different types of variables that
affect the operation of the server or your client. Older versions of
MySQL employed SET OPTION, but this syntax is deprecated in favor of
SET without OPTION.

URL: https://mariadb.com/kb/en/set/


BIGINT

BIGINT[(M)] [UNSIGNED] [ZEROFILL]

A large integer. The signed range is -9223372036854775808 to
9223372036854775807. The unsigned range is 0 to 18446744073709551615.

SERIAL is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE.

URL: https://mariadb.com/kb/en/bigint/


CHAR_LENGTH

Syntax:
CHAR_LENGTH(str)

Returns the length of the string str, measured in characters. A
multi-byte character counts as a single character. This means that for
a string containing five 2-byte characters, LENGTH() returns 10,
whereas CHAR_LENGTH() returns 5.

URL: https://mariadb.com/kb/en/char_length/


CURTIME

Syntax:
CURTIME()

Returns the current time as a value in 'HH:MM:SS' or HHMMSS.uuuuuu
format, depending on whether the function is used in a string or
numeric context. The value is expressed in the current time zone.

URL: https://mariadb.com/kb/en/curtime/


DO

Syntax:
DO expr [, expr] ...

DO executes the expressions but does not return any results. In most
respects, DO is shorthand for SELECT expr, ..., but has the advantage
that it is slightly faster when you do not care about the result.

DO is useful primarily with functions that have side effects, such as
RELEASE_LOCK().

URL: https://mariadb.com/kb/en/do/


ITERATE

Syntax:
ITERATE label

ITERATE can appear only within LOOP, REPEAT, and WHILE statements.
ITERATE means "start the loop again."

URL: https://mariadb.com/kb/en/iterate/


MPOLYFROMWKB

MPolyFromWKB(wkb[,srid]), MultiPolygonFromWKB(wkb[,srid])

Constructs a MULTIPOLYGON value using its WKB representation and SRID.

URL: https://mariadb.com/kb/en/mpolyfromwkb/


SHOW BINLOG EVENTS

Syntax:
SHOW BINLOG EVENTS
[IN 'log_name'] [FROM pos] [LIMIT [offset,] row_count]

Shows the events in the binary log. If you do not specify 'log_name',
the first binary log is displayed.

URL: https://mariadb.com/kb/en/show-binlog-events/


UCASE

Syntax:
UCASE(str)

UCASE() is a synonym for UPPER().

URL: https://mariadb.com/kb/en/ucase/


GET_LOCK

Syntax:
GET_LOCK(str,timeout)

Tries to obtain a lock with a name given by the string str, using a
timeout of timeout seconds. Returns 1 if the lock was obtained
successfully, 0 if the attempt timed out (for example, because another
client has previously locked the name), or NULL if an error occurred
(such as running out of memory or the thread was killed with mysqladmin
kill). If you have a lock obtained with GET_LOCK(), it is released when
you execute RELEASE_LOCK(), execute a new GET_LOCK(), or your
connection terminates (either normally or abnormally). Locks obtained
with GET_LOCK() do not interact with transactions. That is, committing
a transaction does 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, GET_LOCK() blocks 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 db_name.str or app_name.str.

URL: https://mariadb.com/kb/en/get_lock/


RESET

Syntax:
RESET reset_option [, reset_option] ...

The RESET statement is used to clear the state of various server
operations. You must have the RELOAD privilege to execute RESET.

RESET acts as a stronger version of the FLUSH statement. See [HELP
FLUSH].

The RESET statement causes an implicit commit. See
https://mariadb.com/kb/en/sql-statements-that-cause-an-implicit-commit/.

URL: https://mariadb.com/kb/en/reset/


HELP STATEMENT

Syntax:
HELP 'search_string'

The HELP statement returns online information from the MySQL Reference
manual. Its proper operation requires that the help tables in the mysql
database be initialized with help topic information.

The HELP statement searches the help tables for the given search string
and displays the result of the search. The search string is not case
sensitive.

URL: https://mariadb.com/kb/en/help-command/


<=>

Syntax:
<=>

NULL-safe equal. This operator performs an equality comparison like the
= operator, but returns 1 rather than NULL if both operands are NULL,
and 0 rather than NULL if one operand is NULL.

URL: https://mariadb.com/kb/en/null-safe-equal/


DECODE

Syntax:
DECODE(crypt_str,pass_str)

Decrypts the encrypted string crypt_str using pass_str as the password.
crypt_str should be a string returned from ENCODE().

URL: https://mariadb.com/kb/en/decode/


OPTIMIZE TABLE

Syntax:
OPTIMIZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE
tbl_name [, tbl_name] ...

OPTIMIZE TABLE should be used if you have deleted a large part of a
table or if you have made many changes to a table with variable-length
rows (tables that have VARCHAR, VARBINARY, BLOB, or TEXT columns).
Deleted rows are maintained in a linked list and subsequent INSERT
operations reuse old row positions. You can use OPTIMIZE TABLE to
reclaim the unused space and to defragment the data file. After
extensive changes to a table, this statement may also improve
performance of statements that use the table, sometimes significantly.

This statement requires SELECT and INSERT privileges for the table.

OPTIMIZE TABLE is supported for partitioned tables, and you can use
ALTER TABLE ... OPTIMIZE PARTITION to optimize one or more partitions;
for more information, see [HELP ALTER TABLE], and
http://dev.mysql.com/doc/refman/5.5/en/partitioning-maintenance.html.

URL: https://mariadb.com/kb/en/optimize-table/


TINYTEXT

TINYTEXT [CHARACTER SET charset_name] [COLLATE collation_name]

A TEXT column with a maximum length of 255 (28 - 1) characters. The
effective maximum length is less if the value contains multi-byte
characters. Each TINYTEXT value is stored using a 1-byte length prefix
that indicates the number of bytes in the value.

URL: https://mariadb.com/kb/en/tinytext/


MOD

Syntax:
MOD(N,M), N % M, N MOD M

Modulo operation. Returns the remainder of N divided by M.

URL: https://mariadb.com/kb/en/mod/


DEFAULT

Syntax:
DEFAULT(col_name)

Returns the default value for a table column. An error results if the
column has no default value.

URL: https://mariadb.com/kb/en/default/


BOOLEAN

BOOL, BOOLEAN

These types are synonyms for TINYINT(1). A value of zero is considered
false. Nonzero values are considered true:

MariaDB> SELECT IF(0, 'true', 'false');
+------------------------+
| IF(0, 'true', 'false') |
+------------------------+
| false |
+------------------------+

MariaDB> SELECT IF(1, 'true', 'false');
+------------------------+
| IF(1, 'true', 'false') |
+------------------------+
| true |
+------------------------+

MariaDB> SELECT IF(2, 'true', 'false');
+------------------------+
| IF(2, 'true', 'false') |
+------------------------+
| true |
+------------------------+

However, the values TRUE and FALSE are merely aliases for 1 and 0,
respectively, as shown here:

MariaDB> SELECT IF(0 = FALSE, 'true', 'false');
+--------------------------------+
| IF(0 = FALSE, 'true', 'false') |
+--------------------------------+
| true |
+--------------------------------+

MariaDB> SELECT IF(1 = TRUE, 'true', 'false');
+-------------------------------+
| IF(1 = TRUE, 'true', 'false') |
+-------------------------------+
| true |
+-------------------------------+

MariaDB> SELECT IF(2 = TRUE, 'true', 'false');
+-------------------------------+
| IF(2 = TRUE, 'true', 'false') |
+-------------------------------+
| false |
+-------------------------------+

MariaDB> SELECT IF(2 = FALSE, 'true', 'false');
+--------------------------------+
| IF(2 = FALSE, 'true', 'false') |
+--------------------------------+
| false |
+--------------------------------+

The last two statements display the results shown because 2 is equal to
neither 1 nor 0.

URL: https://mariadb.com/kb/en/boolean/


RENAME TABLE

Syntax:
RENAME TABLE tbl_name TO new_tbl_name
[, tbl_name2 TO new_tbl_name2] ...

This statement renames one or more tables.

The rename operation is done atomically, which means that no other
session can access any of the tables while the rename is running. For
example, if you have an existing table old_table, you can create
another table new_table that has the same structure but is empty, and
then replace the existing table with the empty one as follows (assuming
that backup_table does not already exist):

URL: https://mariadb.com/kb/en/rename-table/


HELP_DATE

This help information was generated from the MySQL 5.5 Reference Manual
on: 2012-08-25


GEOMCOLLFROMWKB

GeomCollFromWKB(wkb[,srid]), GeometryCollectionFromWKB(wkb[,srid])

Constructs a GEOMETRYCOLLECTION value using its WKB representation and
SRID.

URL: https://mariadb.com/kb/en/geomcollfromwkb/


MLINEFROMTEXT

MLineFromText(wkt[,srid]), MultiLineStringFromText(wkt[,srid])

Constructs a MULTILINESTRING value using its WKT representation and
SRID.

URL: https://mariadb.com/kb/en/mlinefromtext/


HANDLER

Syntax:
HANDLER tbl_name OPEN [ [AS] alias]

HANDLER tbl_name READ index_name { = | <= | >= | < | > } (value1,value2,...)
[ WHERE where_condition ] [LIMIT ... ]
HANDLER tbl_name READ index_name { FIRST | NEXT | PREV | LAST }
[ WHERE where_condition ] [LIMIT ... ]
HANDLER tbl_name READ { FIRST | NEXT }
[ WHERE where_condition ] [LIMIT ... ]

HANDLER tbl_name CLOSE

The HANDLER statement provides direct access to table storage engine
interfaces. It is available for MyISAM and InnoDB tables.

URL: https://mariadb.com/kb/en/handler-commands/


COUNT

Syntax:
COUNT(expr)

Returns a count of the number of non-NULL values of expr in the rows
retrieved by a SELECT statement. The result is a BIGINT value.

COUNT() returns 0 if there were no matching rows.

URL: https://mariadb.com/kb/en/count/


INSERT

Syntax:
INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]
[INTO] tbl_name [(col_name,...)]
{VALUES | VALUE} ({expr | DEFAULT},...),(...),...
[ ON DUPLICATE KEY UPDATE
col_name=expr
[, col_name=expr] ... ]

Or:

INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]
[INTO] tbl_name
SET col_name={expr | DEFAULT}, ...
[ ON DUPLICATE KEY UPDATE
col_name=expr
[, col_name=expr] ... ]

Or:

INSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]
[INTO] tbl_name [(col_name,...)]
SELECT ...
[ ON DUPLICATE KEY UPDATE
col_name=expr
[, col_name=expr] ... ]

INSERT inserts new rows into an existing table. The INSERT ... VALUES
and INSERT ... SET forms of the statement insert rows based on
explicitly specified values. The INSERT ... SELECT form inserts rows
selected from another table or tables. INSERT ... SELECT is discussed
further in [HELP INSERT SELECT].

URL: https://mariadb.com/kb/en/insert/


COMPRESS

Syntax:
COMPRESS(string_to_compress)


Compresses a string and returns the result as a binary string. This
function requires MySQL to have been compiled with a compression
library such as zlib. Otherwise, the return value is always NULL. The
compressed string can be uncompressed with UNCOMPRESS().

URL: https://mariadb.com/kb/en/compress/


ENDPOINT

EndPoint(ls)

Returns the Point that is the endpoint of the LineString value ls.

URL: https://mariadb.com/kb/en/endpoint/


CACHE INDEX

Syntax:
CACHE INDEX
tbl_index_list [, tbl_index_list] ...
[PARTITION (partition_list | ALL)]
IN key_cache_name

tbl_index_list:
tbl_name [[INDEX|KEY] (index_name[, index_name] ...)]

partition_list:
partition_name[, partition_name][, ...]

The CACHE INDEX statement assigns table indexes to a specific key
cache. It is used only for MyISAM tables. After the indexes have been
assigned, they can be preloaded into the cache if desired with LOAD
INDEX INTO CACHE.

The following statement assigns indexes from the tables t1, t2, and t3
to the key cache named hot_cache:

MariaDB> CACHE INDEX t1, t2, t3 IN hot_cache;
+---------+--------------------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+---------+--------------------+----------+----------+
| test.t1 | assign_to_keycache | status | OK |
| test.t2 | assign_to_keycache | status | OK |
| test.t3 | assign_to_keycache | status | OK |
+---------+--------------------+----------+----------+

URL: https://mariadb.com/kb/en/cache-index/


DES_DECRYPT

Syntax:
DES_DECRYPT(crypt_str[,key_str])

Decrypts a string encrypted with DES_ENCRYPT(). If an error occurs,
this function returns NULL.

This function works only if MySQL has been configured with SSL support.
See https://mariadb.com/kb/en/ssl-connections/.

If no key_str argument is given, DES_DECRYPT() examines the first byte
of the encrypted string to determine the DES key number that was used
to encrypt the original string, and then reads the key from the DES key
file to decrypt the message. For this to work, the user must have the
SUPER privilege. The key file can be specified with the --des-key-file
server option.

If you pass this function a key_str argument, that string is used as
the key for decrypting the message.

If the crypt_str argument does not appear to be an encrypted string,
MySQL returns the given crypt_str.

URL: https://mariadb.com/kb/en/des_decrypt/


TIMESTAMP

TIMESTAMP

A timestamp. The range is '1970-01-01 00:00:01' UTC to '2038-01-19
03:14:07' UTC. TIMESTAMP values are stored as the number of seconds
since the epoch ('1970-01-01 00:00:00' UTC). A TIMESTAMP cannot
represent the value '1970-01-01 00:00:00' because that is equivalent to
0 seconds from the epoch and the value 0 is reserved for representing
'0000-00-00 00:00:00', the "zero" TIMESTAMP value.

Unless specified otherwise, the first TIMESTAMP column in a table is
defined to be automatically set to the date and time of the most recent
modification if not explicitly assigned a value. This makes TIMESTAMP
useful for recording the timestamp of an INSERT or UPDATE operation.
You can also set any TIMESTAMP column to the current date and time by
assigning it a NULL value, unless it has been defined with the NULL
attribute to permit NULL values. The automatic initialization and
updating to the current date and time can be specified using DEFAULT
CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP clauses, as described
in
https://mariadb.com/kb/en/timestamp/.

*Note*: The TIMESTAMP format that was used prior to MySQL 4.1 is not
supported in MySQL 5.5; see MySQL 3.23, 4.0, 4.1 Reference Manual for
information regarding the old format.

URL: https://mariadb.com/kb/en/timestamp/


*

Syntax:
*

Multiplication:

URL: https://mariadb.com/kb/en/multiplication-operator/


CREATE FUNCTION UDF

Syntax:
CREATE [AGGREGATE] FUNCTION function_name RETURNS {STRING|INTEGER|REAL|DECIMAL}
SONAME shared_library_name

A user-defined function (UDF) is a way to extend MySQL with a new
function that works like a native (built-in) MySQL function such as
ABS() or CONCAT().

function_name is the name that should be used in SQL statements to
invoke the function. The RETURNS clause indicates the type of the
function's return value. DECIMAL is a legal value after RETURNS, but
currently DECIMAL functions return string values and should be written
like STRING functions.

shared_library_name is the basename of the shared object file that
contains the code that implements the function. The file must be
located in the plugin directory. This directory is given by the value
of the plugin_dir system variable. For more information, see
http://dev.mysql.com/doc/refman/5.5/en/udf-compiling.html.

To create a function, you must have the INSERT privilege for the mysql
database. This is necessary because CREATE FUNCTION adds a row to the
mysql.func system table that records the function's name, type, and
shared library name. If you do not have this table, you should run the
mysql_upgrade command to create it. See
https://mariadb.com/kb/en/mysql_upgrade/.

URL: https://mariadb.com/kb/en/create-function-udf/


MAX

Syntax:
MAX([DISTINCT] expr)

Returns the maximum value of expr. MAX() may take a string argument; in
such cases, it returns the maximum string value. See
https://mariadb.com/kb/en/max/. The DISTINCT
keyword can be used to find the maximum of the distinct values of expr,
however, this produces the same result as omitting DISTINCT.

MAX() returns NULL if there were no matching rows.

URL: https://mariadb.com/kb/en/max/


GEOMETRYCOLLECTION

GeometryCollection(g1,g2,...)

Constructs a GeometryCollection.

URL: https://mariadb.com/kb/en/geometrycollection/


MBR DEFINITION

Its MBR (Minimum Bounding Rectangle), or Envelope. This is the bounding
geometry, formed by the minimum and maximum (X,Y) coordinates:

URL: https://mariadb.com/kb/en/mbr-definition/


SPACE

Syntax:
SPACE(N)

Returns a string consisting of N space characters.

URL: https://mariadb.com/kb/en/space/


NOT LIKE

Syntax:
expr NOT LIKE pat [ESCAPE 'escape_char']

This is the same as NOT (expr LIKE pat [ESCAPE 'escape_char']).

URL: https://mariadb.com/kb/en/not-like/


POLYFROMWKB

PolyFromWKB(wkb[,srid]), PolygonFromWKB(wkb[,srid])

Constructs a POLYGON value using its WKB representation and SRID.

URL: https://mariadb.com/kb/en/polyfromwkb/


ABS

Syntax:
ABS(X)

Returns the absolute value of X.

URL: https://mariadb.com/kb/en/abs/


CREATE EVENT

Syntax:
CREATE
[DEFINER = { user | CURRENT_USER }]
EVENT
[IF NOT EXISTS]
event_name
ON SCHEDULE schedule
[ON COMPLETION [NOT] PRESERVE]
[ENABLE | DISABLE | DISABLE ON SLAVE]
[COMMENT 'comment']
DO event_body;

schedule:
AT timestamp [+ INTERVAL interval] ...
| EVERY interval
[STARTS timestamp [+ INTERVAL interval] ...]
[ENDS timestamp [+ INTERVAL interval] ...]

interval:
quantity {YEAR | QUARTER | MONTH | DAY | HOUR | MINUTE |
WEEK | SECOND | YEAR_MONTH | DAY_HOUR | DAY_MINUTE |
DAY_SECOND | HOUR_MINUTE | HOUR_SECOND | MINUTE_SECOND}

This statement creates and schedules a new event. The event will not
run unless the Event Scheduler is enabled. For information about
checking Event Scheduler status and enabling it if necessary, see
https://mariadb.com/kb/en/events/.

CREATE EVENT requires the EVENT privilege for the schema in which the
event is to be created. It might also require the SUPER privilege,
depending on the DEFINER value, as described later in this section.

The minimum requirements for a valid CREATE EVENT statement are as
follows:

o The keywords CREATE EVENT plus an event name, which uniquely
identifies the event in a database schema.

o An ON SCHEDULE clause, which determines when and how often the event
executes.

o A DO clause, which contains the SQL statement to be executed by an
event.

This is an example of a minimal CREATE EVENT statement:

CREATE EVENT myevent
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
DO
UPDATE myschema.mytable SET mycol = mycol + 1;

The previous statement creates an event named myevent. This event
executes once---one hour following its creation---by running an SQL
statement that increments the value of the myschema.mytable table's
mycol column by 1.

The event_name must be a valid MySQL identifier with a maximum length
of 64 characters. Event names are not case sensitive, so you cannot
have two events named myevent and MyEvent in the same schema. In
general, the rules governing event names are the same as those for
names of stored routines. See
https://mariadb.com/kb/en/identifier-names/.

An event is associated with a schema. If no schema is indicated as part
of event_name, the default (current) schema is assumed. To create an
event in a specific schema, qualify the event name with a schema using
schema_name.event_name syntax.

URL: https://mariadb.com/kb/en/create-event/


MATCH AGAINST

Syntax:
MATCH (col1,col2,...) AGAINST (expr [search_modifier])

MySQL has support for full-text indexing and searching:

o A full-text index in MySQL is an index of type FULLTEXT.

o Full-text indexes can be used only with MyISAM tables, and can be
created only for CHAR, VARCHAR, or TEXT columns.

o A FULLTEXT index definition can be given in the CREATE TABLE
statement when a table is created, or added later using ALTER TABLE
or CREATE INDEX.

o For large data sets, it is much faster to load your data into a table
that has no FULLTEXT index and then create the index after that, than
to load data into a table that has an existing FULLTEXT index.

Full-text searching is performed using MATCH() ... AGAINST syntax.
MATCH() takes a comma-separated list that names the columns to be
searched. AGAINST takes a string to search for, and an optional
modifier that indicates what type of search to perform. The search
string must be a literal string, not a variable or a column name. There
are three types of full-text searches:

o A natural language search interprets the search string as a phrase in
natural human language (a phrase in free text). There are no special
operators. The stopword list applies. In addition, words that are
present in 50% or more of the rows are considered common and do not
match.

Full-text searches are natural language searches if the IN NATURAL
LANGUAGE MODE modifier is given or if no modifier is given. For more
information, see
https://mariadb.com/kb/en/fulltext-index-overview#in-natural-language-mode
.

o A boolean search interprets the search string using the rules of a
special query language. The string contains the words to search for.
It can also contain operators that specify requirements such that a
word must be present or absent in matching rows, or that it should be
weighted higher or lower than usual. Common words such as "some" or
"then" are stopwords and do not match if present in the search
string. The IN BOOLEAN MODE modifier specifies a boolean search. For
more information, see
https://mariadb.com/kb/en/fulltext-index-overview#in-boolean-mode.

o A query expansion search is a modification of a natural language
search. The search string is used to perform a natural language
search. Then words from the most relevant rows returned by the search
are added to the search string and the search is done again. The
query returns the rows from the second search. The IN NATURAL
LANGUAGE MODE WITH QUERY EXPANSION or WITH QUERY EXPANSION modifier
specifies a query expansion search. For more information, see
https://mariadb.com/kb/en/fulltext-index-overview#with-query-expansion.

URL: https://mariadb.com/kb/en/match-against/


DROP INDEX

Syntax:
DROP [ONLINE|OFFLINE] INDEX index_name ON tbl_name

DROP INDEX drops the index named index_name from the table tbl_name.
This statement is mapped to an ALTER TABLE statement to drop the index.
See [HELP ALTER TABLE].

To drop a primary key, the index name is always PRIMARY, which must be
specified as a quoted identifier because PRIMARY is a reserved word:

DROP INDEX `PRIMARY` ON t;

URL: https://mariadb.com/kb/en/drop-index/


EXECUTE STATEMENT

Syntax:
EXECUTE stmt_name
[USING @var_name [, @var_name] ...]

After preparing a statement with PREPARE, you execute it with an
EXECUTE statement that refers to the prepared statement name. If the
prepared statement contains any parameter markers, you must supply a
USING clause that lists user variables containing the values to be
bound to the parameters. Parameter values can be supplied only by user
variables, and the USING clause must name exactly as many variables as
the number of parameter markers in the statement.

You can execute a given prepared statement multiple times, passing
different variables to it or setting the variables to different values
before each execution.

URL: https://mariadb.com/kb/en/execute-statement/


CASE STATEMENT

Syntax:
CASE case_value
WHEN when_value THEN statement_list
[WHEN when_value THEN statement_list] ...
[ELSE statement_list]
END CASE

Or:

CASE
WHEN search_condition THEN statement_list
[WHEN search_condition THEN statement_list] ...
[ELSE statement_list]
END CASE

The CASE statement for stored programs implements a complex conditional
construct.

*Note*: There is also a CASE expression, which differs from the CASE
statement described here. See
https://mariadb.com/kb/en/case-operator/. The
CASE statement cannot have an ELSE NULL clause, and it is terminated
with END CASE instead of END.

For the first syntax, case_value is an expression. This value is
compared to the when_value expression in each WHEN clause until one of
them is equal. When an equal when_value is found, the corresponding
THEN clause statement_list executes. If no when_value is equal, the
ELSE clause statement_list executes, if there is one.

This syntax cannot be used to test for equality with NULL because NULL
= NULL is false. See
https://mariadb.com/kb/en/null-values/.

For the second syntax, each WHEN clause search_condition expression is
evaluated until one is true, at which point its corresponding THEN
clause statement_list executes. If no search_condition is equal, the
ELSE clause statement_list executes, if there is one.

If no when_value or search_condition matches the value tested and the
CASE statement contains no ELSE clause, a Case not found for CASE
statement error results.

Each statement_list consists of one or more SQL statements; an empty
statement_list is not permitted.

To handle situations where no value is matched by any WHEN clause, use
an ELSE containing an empty BEGIN ... END block, as shown in this
example. (The indentation used here in the ELSE clause is for purposes
of clarity only, and is not otherwise significant.)

DELIMITER |

CREATE PROCEDURE p()
BEGIN
DECLARE v INT DEFAULT 1;

CASE v
WHEN 2 THEN SELECT v;
WHEN 3 THEN SELECT 0;
ELSE
BEGIN
END;
END CASE;
END;
|

URL: https://mariadb.com/kb/en/case-statement/


IS NOT NULL

Syntax:
IS NOT NULL

Tests whether a value is not NULL.

URL: https://mariadb.com/kb/en/is-not-null/


UPDATE

Syntax:
Single-table syntax:

UPDATE [LOW_PRIORITY] [IGNORE] table_reference
SET col_name1={expr1|DEFAULT} [, col_name2={expr2|DEFAULT}] ...
[WHERE where_condition]
[ORDER BY ...]
[LIMIT row_count]

Multiple-table syntax:

UPDATE [LOW_PRIORITY] [IGNORE] table_references
SET col_name1={expr1|DEFAULT} [, col_name2={expr2|DEFAULT}] ...
[WHERE where_condition]

For the single-table syntax, the UPDATE statement updates columns of
existing rows in the named table with new values. The SET clause
indicates which columns to modify and the values they should be given.
Each value can be given as an expression, or the keyword DEFAULT to set
a column explicitly to its default value. The WHERE clause, if given,
specifies the conditions that identify which rows to update. With no
WHERE clause, all rows are updated. If the ORDER BY clause is
specified, the rows are updated in the order that is specified. The
LIMIT clause places a limit on the number of rows that can be updated.

For the multiple-table syntax, UPDATE updates rows in each table named
in table_references that satisfy the conditions. In this case, ORDER BY
and LIMIT cannot be used.

where_condition is an expression that evaluates to true for each row to
be updated. For expression syntax, see
http://dev.mysql.com/doc/refman/5.5/en/expressions.html.

table_references and where_condition are is specified as described in
https://mariadb.com/kb/en/select/.

You need the UPDATE privilege only for columns referenced in an UPDATE
that are actually updated. You need only the SELECT privilege for any
columns that are read but not modified.

The UPDATE statement supports the following modifiers:

o With the LOW_PRIORITY keyword, execution of the UPDATE is delayed
until no other clients are reading from the table. This affects only
storage engines that use only table-level locking (such as MyISAM,
MEMORY, and MERGE).

o With the IGNORE keyword, the update statement does not abort even if
errors occur during the update. Rows for which duplicate-key
conflicts occur are not updated. Rows for which columns are updated
to values that would cause data conversion errors are updated to the
closest valid values instead.

URL: https://mariadb.com/kb/en/update/


SHOW PROFILES

Syntax:
SHOW PROFILES

The SHOW PROFILES statement, together with SHOW PROFILE, displays
profiling information that indicates resource usage for statements
executed during the course of the current session. For more
information, see [HELP SHOW PROFILE].

URL: https://mariadb.com/kb/en/show-profiles/


<=

Syntax:
<=

Less than or equal:

URL: https://mariadb.com/kb/en/less-than-or-equal/


LCASE

Syntax:
LCASE(str)

LCASE() is a synonym for LOWER().

URL: https://mariadb.com/kb/en/lcase/


CURRENT_USER

Syntax:
CURRENT_USER, 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
utf8 character set.

The value of CURRENT_USER() can differ from the value of USER().

URL: https://mariadb.com/kb/en/current_user/


POINT

Point(x,y)

Constructs a Point using its coordinates.

URL: https://mariadb.com/kb/en/point/


CREATE USER

Syntax:
CREATE USER user_specification
[, user_specification] ...

user_specification:
user
[
IDENTIFIED BY [PASSWORD] 'password'
| IDENTIFIED WITH auth_plugin [AS 'auth_string']
]

The CREATE USER statement creates new MySQL accounts. To use it, you
must have the global CREATE USER privilege or the INSERT privilege for
the mysql database. For each account, CREATE USER creates a new row in
the mysql.user table and assigns the account no privileges. An error
occurs if the account already exists.

Each account name uses the format described in
https://mariadb.com/kb/en/create-user#account-names. For example:

CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY 'mypass';

If you specify only the user name part of the account name, a host name
part of '%' is used.

The user specification may indicate how the user should authenticate
when connecting to the server:

o To enable the user to connect with no password (which is insecure),
include no IDENTIFIED BY clause:

CREATE USER 'jeffrey'@'localhost';

In this case, the account uses built-in authentication and clients
must provide no password.

o To assign a password, use IDENTIFIED BY with the literal plaintext
password value:

CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY 'mypass';

The account uses built-in authentication and clients must match the
given password.

o To avoid specifying the plaintext password if you know its hash value
(the value that PASSWORD() would return for the password), specify
the hash value preceded by the keyword PASSWORD:

CREATE USER 'jeffrey'@'localhost'
IDENTIFIED BY PASSWORD '*90E462C37378CED12064BB3388827D2BA3A9B689';

The account uses built-in authentication and clients must match the
given password.

o To authenticate the account using a specific authentication plugin,
use IDENTIFIED WITH, where auth_plugin is the plugin name. It can be
an unquoted name or a quoted string literal. 'auth_string' is an
optional quoted string literal to pass to the plugin. The plugin
interprets the meaning of the string, so its format is plugin
specific. Consult the documentation for a given plugin for
information about the authentication string values it accepts.

CREATE USER 'jeffrey'@'localhost'
IDENTIFIED WITH my_auth_plugin;

For connections that use this account, the server invokes the named
plugin and clients must provide credentials as required for the
authentication method that the plugin implements. If the server
cannot find the plugin, either at account-creation time or connect
time, an error occurs. IDENTIFIED WITH can be used as of MySQL 5.5.7.

The IDENTIFIED BY and IDENTIFIED WITH clauses are mutually exclusive,
so at most one of them can be specified for a given user.

For additional information about setting passwords, see
https://mariadb.com/kb/en/create-user/.

URL: https://mariadb.com/kb/en/create-user/



BOUNDARY

Boundary(g)

Returns a geometry that is the closure of the combinatorial boundary of
the geometry value g.

URL: https://mariadb.com/kb/en/boundary/


BLOB DATA TYPE

A BLOB is a binary large object that can hold a variable amount of
data. The four BLOB types are TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB.
These differ only in the maximum length of the values they can hold.
The four TEXT types are TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT. These
correspond to the four BLOB types and have the same maximum lengths and
storage requirements. See
https://mariadb.com/kb/en/data-type-storage-requirements/.


URL: https://mariadb.com/kb/en/sql_language-data_types-blob/


BINARY

BINARY(M)

The BINARY type is similar to the CHAR type, but stores binary byte
strings rather than nonbinary character strings. M represents the
column length in bytes.

URL: https://mariadb.com/kb/en/binary/


ISNULL

Syntax:
ISNULL(expr)

If expr is NULL, ISNULL() returns 1, otherwise it returns 0.

URL: https://mariadb.com/kb/en/isnull/


REVERSE

Syntax:
REVERSE(str)

Returns the string str with the order of the characters reversed.

URL: https://mariadb.com/kb/en/reverse/


=

=

Equal:

URL: https://mariadb.com/kb/en/equal/


LEAST

Syntax:
LEAST(value1,value2,...)

With two or more arguments, returns the smallest (minimum-valued)
argument. The arguments are compared using the following rules:

o If any argument is NULL, the result is NULL. No comparison is needed.

o If the return value is used in an INTEGER context or all arguments
are integer-valued, they are compared as integers.

o If the return value is used in a REAL context or all arguments are
real-valued, they are compared as reals.

o If the arguments comprise a mix of numbers and strings, they are
compared as numbers.

o If any argument is a nonbinary (character) string, the arguments are
compared as nonbinary strings.

o In all other cases, the arguments are compared as binary strings.

URL: https://mariadb.com/kb/en/least/


SHOW ERRORS

Syntax:
SHOW ERRORS [LIMIT [offset,] row_count]
SHOW COUNT(*) ERRORS

This statement is similar to SHOW WARNINGS, except that it displays
information only for errors, rather than for errors, warnings, and
notes.

The LIMIT clause has the same syntax as for the SELECT statement. See
https://mariadb.com/kb/en/select/.

The SHOW COUNT(*) ERRORS statement displays the number of errors. You
can also retrieve this number from the error_count variable:

SHOW COUNT(*) ERRORS;
SELECT @@error_count;

SHOW ERRORS and error_count apply only to errors, not warnings or
notes. In other respects, they are similar to SHOW WARNINGS and
warning_count. In particular, SHOW ERRORS cannot display information
for more than max_error_count messages, and error_count can exceed the
value of max_error_count if the number of errors exceeds
max_error_count.

URL: https://mariadb.com/kb/en/show-errors/


SHOW FUNCTION CODE

Syntax:
SHOW FUNCTION CODE func_name

This statement is similar to SHOW PROCEDURE CODE but for stored
functions. See [HELP SHOW PROCEDURE CODE].

URL: https://mariadb.com/kb/en/show-function-code/



IFNULL

Syntax:
IFNULL(expr1,expr2)

If expr1 is not NULL, IFNULL() returns expr1; otherwise it returns
expr2. IFNULL() returns a numeric or string value, depending on the
context in which it is used.

URL: https://mariadb.com/kb/en/ifnull/


SHA2

Syntax:
SHA2(str, hash_length)

Calculates the SHA-2 family of hash functions (SHA-224, SHA-256,
SHA-384, and SHA-512). The first argument is the cleartext string to be
hashed. The second argument indicates the desired bit length of the
result, which must have a value of 224, 256, 384, 512, or 0 (which is
equivalent to 256). If either argument is NULL or the hash length is
not one of the permitted values, the return value is NULL. Otherwise,
the function result is a hash value containing the desired number of
bits. See the notes at the beginning of this section about storing hash
values efficiently.

As of MySQL 5.5.6, the return value is a nonbinary string in the
connection character set. Before 5.5.6, the return value is a binary
string; see the notes at the beginning of this section about using the
value as a nonbinary string.

URL: https://mariadb.com/kb/en/sha2/


MEDIUMBLOB

MEDIUMBLOB

A BLOB column with a maximum length of 16,777,215 (224 - 1) bytes. Each
MEDIUMBLOB value is stored using a 3-byte length prefix that indicates
the number of bytes in the value.

URL: https://mariadb.com/kb/en/mediumblob/


FROM_UNIXTIME

Syntax:
FROM_UNIXTIME(unix_timestamp), FROM_UNIXTIME(unix_timestamp,format)

Returns a representation of the unix_timestamp argument as a value in
'YYYY-MM-DD HH:MM:SS' or YYYYMMDDHHMMSS.uuuuuu format, depending on
whether the function is used in a string or numeric context. The value
is expressed in the current time zone. unix_timestamp is an internal
timestamp value such as is produced by the UNIX_TIMESTAMP() function.

If format is given, the result is formatted according to the format
string, which is used the same way as listed in the entry for the
DATE_FORMAT() function.

URL: https://mariadb.com/kb/en/from_unixtime/


UPPER

Syntax:
UPPER(str)

Returns the string str with all characters changed to uppercase
according to the current character set mapping. The default is latin1
(cp1252 West European).

MariaDB> SELECT UPPER('Hej');
-> 'HEJ'

See the description of LOWER() for information that also applies to
UPPER(), such as information about how to perform lettercase conversion
of binary strings (BINARY, VARBINARY, BLOB) for which these functions
are ineffective.

URL: https://mariadb.com/kb/en/upper/


TIMESTAMPDIFF

Syntax:
TIMESTAMPDIFF(unit,datetime_expr1,datetime_expr2)

Returns datetime_expr2 - datetime_expr1, where datetime_expr1 and
datetime_expr2 are date or datetime expressions. One expression may be
a date and the other a datetime; a date value is treated as a datetime
having the time part '00:00:00' where necessary. The unit for the
result (an integer) is given by the unit argument. The legal values for
unit are the same as those listed in the description of the
TIMESTAMPADD() function.

URL: https://mariadb.com/kb/en/timestampdiff/


TO_SECONDS

Syntax:
TO_SECONDS(expr)

Given a date or datetime expr, returns a the number of seconds since
the year 0. If expr is not a valid date or datetime value, returns
NULL.

URL: https://mariadb.com/kb/en/to_seconds/


SPATIAL

For MyISAM tables, MySQL can create spatial indexes using syntax
similar to that for creating regular indexes, but extended with the
SPATIAL keyword. Currently, columns in spatial indexes must be declared
NOT NULL. The following examples demonstrate how to create spatial
indexes:

o With CREATE TABLE:

CREATE TABLE geom (g GEOMETRY NOT NULL, SPATIAL INDEX(g)) ENGINE=MyISAM;

o With ALTER TABLE:

ALTER TABLE geom ADD SPATIAL INDEX(g);

o With CREATE INDEX:

CREATE SPATIAL INDEX sp_index ON geom (g);

For MyISAM tables, SPATIAL INDEX creates an R-tree index. For storage
engines that support nonspatial indexing of spatial columns, the engine
creates a B-tree index. A B-tree index on spatial values will be useful
for exact-value lookups, but not for range scans.

For more information on indexing spatial columns, see [HELP CREATE
INDEX].

To drop spatial indexes, use ALTER TABLE or DROP INDEX:

o With ALTER TABLE:

ALTER TABLE geom DROP INDEX g;

o With DROP INDEX:

DROP INDEX sp_index ON geom;

Example: Suppose that a table geom contains more than 32,000
geometries, which are stored in the column g of type GEOMETRY. The
table also has an AUTO_INCREMENT column fid for storing object ID
values.

URL: https://mariadb.com/kb/en/spatial/


ADDTIME

Syntax:
ADDTIME(expr1,expr2)

ADDTIME() adds expr2 to expr1 and returns the result. expr1 is a time
or datetime expression, and expr2 is a time expression.

URL: https://mariadb.com/kb/en/addtime/


SHOW MASTER STATUS

Syntax:
SHOW MASTER STATUS

This statement provides status information about the binary log files
of the master. It requires either the SUPER or REPLICATION CLIENT
privilege.

Example:

MariaDB> SHOW MASTER STATUS;
+---------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+---------------+----------+--------------+------------------+
| mysql-bin.003 | 73 | test | manual,mysql |
+---------------+----------+--------------+------------------+

URL: https://mariadb.com/kb/en/show-master-status/


CASE OPERATOR

Syntax:
CASE value WHEN [compare_value] THEN result [WHEN [compare_value] THEN
result ...] [ELSE result] END

CASE WHEN [condition] THEN result [WHEN [condition] THEN result ...]
[ELSE result] END

The first version returns the result where value=compare_value. The
second version returns the result for the first condition that is true.
If there was no matching result value, the result after ELSE is
returned, or NULL if there is no ELSE part.

URL: https://mariadb.com/kb/en/case-operator/


LINEFROMTEXT

LineFromText(wkt[,srid]), LineStringFromText(wkt[,srid])

Constructs a LINESTRING value using its WKT representation and SRID.

URL: https://mariadb.com/kb/en/linefromtext/


USE

Syntax:
USE db_name

The USE db_name statement tells MySQL to use the db_name database as
the default (current) database for subsequent statements. The database
remains the default until the end of the session or another USE
statement is issued:

USE db1;
SELECT COUNT(*) FROM mytable; # selects from db1.mytable
USE db2;
SELECT COUNT(*) FROM mytable; # selects from db2.mytable

URL: https://mariadb.com/kb/en/use/


REPLACE FUNCTION

Syntax:
REPLACE(str,from_str,to_str)

Returns the string str with all occurrences of the string from_str
replaced by the string to_str. REPLACE() performs a case-sensitive
match when searching for from_str.

URL: https://mariadb.com/kb/en/replace-function/


TIMEDIFF

Syntax:
TIMEDIFF(expr1,expr2)

TIMEDIFF() returns expr1 - expr2 expressed as a time value. expr1 and
expr2 are time or date-and-time expressions, but both must be of the
same type.

The result returned by TIMEDIFF() is limited to the range allowed for
TIME values. Alternatively, you can use either of the functions
TIMESTAMPDIFF() and UNIX_TIMESTAMP(), both of which return integers.

URL: https://mariadb.com/kb/en/timediff/


STOP SLAVE

Syntax:
STOP SLAVE [thread_types]

thread_types:
[thread_type [, thread_type] ... ]

thread_type: IO_THREAD | SQL_THREAD

Stops the slave threads. STOP SLAVE requires the SUPER privilege.
Recommended best practice is to execute STOP SLAVE on the slave before

stopping the slave server (see
http://dev.mysql.com/doc/refman/5.5/en/server-shutdown.html, for more
information).

When using the row-based logging format: You should execute STOP SLAVE
on the slave prior to shutting down the slave server if you are
replicating any tables that use a nontransactional storage engine (see
the Note later in this section). In MySQL 5.5.9 and later, you can also
use STOP SLAVE SQL_THREAD for this purpose.

Like START SLAVE, this statement may be used with the IO_THREAD and
SQL_THREAD options to name the thread or threads to be stopped.

*Note*: In MySQL 5.5, STOP SLAVE waits until the current replication
event group affecting one or more non-transactional tables has finished
executing (if there is any such replication group), or until the user
issues a KILL QUERY or KILL CONNECTION statement. (Bug #319, Bug
#38205)

URL: https://mariadb.com/kb/en/stop-slave/


CLOSE

Syntax:
CLOSE cursor_name

This statement closes a previously opened cursor. For an example, see
https://mariadb.com/kb/en/cursor-overview/.

An error occurs if the cursor is not open.

If not closed explicitly, a cursor is closed at the end of the BEGIN
... END block in which it was declared.

URL: https://mariadb.com/kb/en/close/


NULLIF

Syntax:
NULLIF(expr1,expr2)

Returns NULL if expr1 = expr2 is true, otherwise returns expr1. This is
the same as CASE WHEN expr1 = expr2 THEN NULL ELSE expr1 END.

URL: https://mariadb.com/kb/en/nullif/


ROUND

Syntax:
ROUND(X), ROUND(X,D)

Rounds the argument X to D decimal places. The rounding algorithm
depends on the data type of X. D defaults to 0 if not specified. D can
be negative to cause D digits left of the decimal point of the value X
to become zero.

URL: https://mariadb.com/kb/en/round/


DELETE

Syntax:
Single-table syntax:

DELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM tbl_name
[WHERE where_condition]
[ORDER BY ...]
[LIMIT row_count]

Multiple-table syntax:

DELETE [LOW_PRIORITY] [QUICK] [IGNORE]
tbl_name[.*] [, tbl_name[.*]] ...
FROM table_references
[WHERE where_condition]

Or:

DELETE [LOW_PRIORITY] [QUICK] [IGNORE]
FROM tbl_name[.*] [, tbl_name[.*]] ...
USING table_references
[WHERE where_condition]

For the single-table syntax, the DELETE statement deletes rows from
tbl_name and returns a count of the number of deleted rows. This count
can be obtained by calling the ROW_COUNT() function (see
https://mariadb.com/kb/en/information-functions-row_count/). The
WHERE clause, if given, specifies the conditions that identify which
rows to delete. With no WHERE clause, all rows are deleted. If the
ORDER BY clause is specified, the rows are deleted in the order that is
specified. The LIMIT clause places a limit on the number of rows that
can be deleted.

For the multiple-table syntax, DELETE deletes from each tbl_name the
rows that satisfy the conditions. In this case, ORDER BY and LIMIT
cannot be used.

where_condition is an expression that evaluates to true for each row to
be deleted. It is specified as described in
https://mariadb.com/kb/en/select/.

Currently, you cannot delete from a table and select from the same
table in a subquery.

You need the DELETE privilege on a table to delete rows from it. You
need only the SELECT privilege for any columns that are only read, such
as those named in the WHERE clause.

As stated, a DELETE statement with no WHERE clause deletes all rows. A
faster way to do this, when you do not need to know the number of
deleted rows, is to use TRUNCATE TABLE. However, within a transaction
or if you have a lock on the table, TRUNCATE TABLE cannot be used
whereas DELETE can. See [HELP TRUNCATE TABLE], and [HELP LOCK].

URL: https://mariadb.com/kb/en/delete/


CONNECTION_ID

Syntax:
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.

URL: https://mariadb.com/kb/en/connection_id/


SLEEP

Syntax:
SLEEP(duration)

Sleeps (pauses) for the number of seconds given by the duration
argument, then returns 0. If SLEEP() is interrupted, it returns 1. The
duration may have a fractional part given in microseconds.

URL: https://mariadb.com/kb/en/sleep/



LINESTRING

LineString(pt1,pt2,...)

Constructs a LineString value from a number of Point or WKB Point
arguments. If the number of arguments is less than two, the return
value is NULL.

URL: https://mariadb.com/kb/en/linestring/


UUID

Syntax:
UUID()

Returns a Universal Unique Identifier (UUID) generated according to
"DCE 1.1: Remote Procedure Call" (Appendix A) CAE (Common Applications
Environment) Specifications published by The Open Group in October 1997
(Document Number C706,
http://www.opengroup.org/public/pubs/catalog/c706.htm).

A UUID is designed as a number that is globally unique in space and
time. Two calls to UUID() are expected to generate two different
values, even if these calls are performed on two separate computers
that are not connected to each other.

A UUID is a 128-bit number represented by a utf8 string of five
hexadecimal numbers in aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee format:

o The first three numbers are generated from a timestamp.

o The fourth number preserves temporal uniqueness in case the timestamp
value loses monotonicity (for example, due to daylight saving time).

o The fifth number is an IEEE 802 node number that provides spatial
uniqueness. A random number is substituted if the latter is not
available (for example, because the host computer has no Ethernet
card, or we do not know how to find the hardware address of an
interface on your operating system). In this case, spatial uniqueness
cannot be guaranteed. Nevertheless, a collision should have very low
probability.

Currently, the MAC address of an interface is taken into account only
on FreeBSD and Linux. On other operating systems, MySQL uses a
randomly generated 48-bit number.

URL: https://mariadb.com/kb/en/uuid/


MID

Syntax:
MID(str,pos,len)

MID(str,pos,len) is a synonym for SUBSTRING(str,pos,len).

URL: https://mariadb.com/kb/en/mid/


DAY

Syntax:

DAY(date)

DAY() is a synonym for DAYOFMONTH().

URL: https://mariadb.com/kb/en/day/


MINUTE

Syntax:
MINUTE(time)

Returns the minute for time, in the range 0 to 59.

URL: https://mariadb.com/kb/en/minute/


POLYGON

Polygon(ls1,ls2,...)

Constructs a Polygon value from a number of LineString or WKB
LineString arguments. If any argument does not represent a LinearRing
(that is, not a closed and simple LineString), the return value is
NULL.

URL: https://mariadb.com/kb/en/polygon/


SHOW BINARY LOGS

Syntax:
SHOW BINARY LOGS
SHOW MASTER LOGS

Lists the binary log files on the server. This statement is used as
part of the procedure described in [HELP PURGE BINARY LOGS], that shows
how to determine which logs can be purged.

MariaDB> SHOW BINARY LOGS;
+---------------+-----------+
| Log_name | File_size |
+---------------+-----------+
| binlog.000015 | 724935 |
| binlog.000016 | 733481 |
+---------------+-----------+

URL: https://mariadb.com/kb/en/show-binary-logs/


RESET SLAVE

Syntax:
RESET SLAVE [ALL]

RESET SLAVE makes the slave forget its replication position in the
master's binary log. This statement is meant to be used for a clean
start: It deletes the master.info and relay-log.info files, all the
relay log files, and starts a new relay log file. To use RESET SLAVE,
the slave replication threads must be stopped (use STOP SLAVE if
necessary).

*Note*: All relay log files are deleted, even if they have not been
completely executed by the slave SQL thread. (This is a condition
likely to exist on a replication slave if you have issued a STOP SLAVE
statement or if the slave is highly loaded.)

In MySQL 5.5 (unlike the case in MySQL 5.1 and earlier), RESET SLAVE
does not change any replication connection parameters such as master
host, master port, master user, or master password, which are retained
in memory. This means that START SLAVE can be issued without requiring
a CHANGE MASTER TO statement following RESET SLAVE.

In MySQL 5.5.16 and later, you can use RESET SLAVE ALL to reset these
connection parameters (Bug #11809016). Connection parameters are also
reset if the slave mysqld is shut down.

If the slave SQL thread was in the middle of replicating temporary
tables when it was stopped, and RESET SLAVE is issued, these replicated
temporary tables are deleted on the slave.

URL: https://mariadb.com/kb/en/reset-slave-connection_name/


UPDATEXML

Syntax:
UpdateXML(xml_target, xpath_expr, new_xml)

This function replaces a single portion of a given fragment of XML
markup xml_target with a new XML fragment new_xml, and then returns the
changed XML. The portion of xml_target that is replaced matches an
XPath expression xpath_expr supplied by the user. In MySQL 5.5, the
XPath expression can contain at most 127 characters. (This limitation
is lifted in MySQL 5.6.)

If no expression matching xpath_expr is found, or if multiple matches
are found, the function returns the original xml_target XML fragment.
All three arguments should be strings.

URL: https://mariadb.com/kb/en/updatexml/


LOCK

Syntax:
LOCK TABLES
tbl_name [[AS] alias] lock_type
[, tbl_name [[AS] alias] lock_type] ...

lock_type:
READ [LOCAL]
| [LOW_PRIORITY] WRITE

UNLOCK TABLES

MySQL enables client sessions to acquire table locks explicitly for the
purpose of cooperating with other sessions for access to tables, or to
prevent other sessions from modifying tables during periods when a
session requires exclusive access to them. A session can acquire or
release locks only for itself. One session cannot acquire locks for
another session or release locks held by another session.

Locks may be used to emulate transactions or to get more speed when
updating tables. This is explained in more detail later in this
section.

LOCK TABLES explicitly acquires table locks for the current client
session. Table locks can be acquired for base tables or views. You must
have the LOCK TABLES privilege, and the SELECT privilege for each
object to be locked.

For view locking, LOCK TABLES adds all base tables used in the view to
the set of tables to be locked and locks them automatically. If you
lock a table explicitly with LOCK TABLES, any tables used in triggers
are also locked implicitly, as described in
https://mariadb.com/kb/en/triggers-and-implicit-locks/.

UNLOCK TABLES explicitly releases any table locks held by the current
session. LOCK TABLES implicitly releases any table locks held by the
current session before acquiring new locks.

Another use for UNLOCK TABLES is to release the global read lock
acquired with the FLUSH TABLES WITH READ LOCK statement, which enables
you to lock all tables in all databases. See [HELP FLUSH]. (This is a
very convenient way to get backups if you have a file system such as
Veritas that can take snapshots in time.)

URL: https://mariadb.com/kb/en/transactions-lock/


PREPARE

Syntax:
PREPARE stmt_name FROM preparable_stmt

The PREPARE statement prepares a statement and assigns it a name,
stmt_name, by which to refer to the statement later. Statement names
are not case sensitive. preparable_stmt is either a string literal or a
user variable that contains the text of the statement. The text must
represent a single SQL statement, not multiple statements. Within the
statement, "?" characters can be used as parameter markers to indicate
where data values are to be bound to the query later when you execute
it. The "?" characters should not be enclosed within quotation marks,
even if you intend to bind them to string values. Parameter markers can
be used only where data values should appear, not for SQL keywords,
identifiers, and so forth.

If a prepared statement with the given name already exists, it is
deallocated implicitly before the new statement is prepared. This means
that if the new statement contains an error and cannot be prepared, an
error is returned and no statement with the given name exists.

A prepared statement is executed with EXECUTE and released with
DEALLOCATE PREPARE.

The scope of a prepared statement is the session within which it is
created. Other sessions cannot see it.

URL: https://mariadb.com/kb/en/prepare-statement/


DROP FUNCTION UDF

Syntax:
DROP FUNCTION function_name

This statement drops the user-defined function (UDF) named
function_name.

To drop a function, you must have the DELETE privilege for the mysql
database. This is because DROP FUNCTION removes a row from the
mysql.func system table that records the function's name, type, and
shared library name.

URL: https://mariadb.com/kb/en/drop-function-udf/


SHOW PLUGINS

Syntax:
SHOW PLUGINS

SHOW PLUGINS displays information about server plugins. Plugin
information is also available in the INFORMATION_SCHEMA.PLUGINS table.
See https://mariadb.com/kb/en/information_schemaplugins-table/.

Example of SHOW PLUGINS output:

MariaDB> SHOW PLUGINSG
*************************** 1. row ***************************
Name: binlog
Status: ACTIVE
Type: STORAGE ENGINE
Library: NULL
License: GPL
*************************** 2. row ***************************
Name: CSV
Status: ACTIVE
Type: STORAGE ENGINE
Library: NULL
License: GPL
*************************** 3. row ***************************
Name: MEMORY
Status: ACTIVE
Type: STORAGE ENGINE
Library: NULL
License: GPL
*************************** 4. row ***************************
Name: MyISAM
Status: ACTIVE
Type: STORAGE ENGINE
Library: NULL
License: GPL
...

URL: https://mariadb.com/kb/en/show-plugins/


WEEK

Syntax:
WEEK(date[,mode])

This function returns the week number for date. The two-argument form
of WEEK() enables you to specify whether the week starts on Sunday or
Monday and whether the return value should be in the range from 0 to 53
or from 1 to 53. If the mode argument is omitted, the value of the
default_week_format system variable is used. See
https://mariadb.com/kb/en/server-system-variables/.

URL: https://mariadb.com/kb/en/week/


WITHIN

Within(g1,g2)

Returns 1 or 0 to indicate whether g1 is spatially within g2. This
tests the opposite relationship as Contains().

URL: https://mariadb.com/kb/en/within/


DROP VIEW

Syntax:
DROP VIEW [IF EXISTS]
view_name [, view_name] ...
[RESTRICT | CASCADE]

DROP VIEW removes one or more views. You must have the DROP privilege
for each view. If any of the views named in the argument list do not
exist, MySQL returns an error indicating by name which nonexisting
views it was unable to drop, but it also drops all of the views in the
list that do exist.

The IF EXISTS clause prevents an error from occurring for views that
don't exist. When this clause is given, a NOTE is generated for each
nonexistent view. See [HELP SHOW WARNINGS].

RESTRICT and CASCADE, if given, are parsed and ignored.

URL: https://mariadb.com/kb/en/drop-view/


^

Syntax:
^

Bitwise XOR:

URL: https://mariadb.com/kb/en/bitwise-xor/


IF STATEMENT

Syntax:
IF search_condition THEN statement_list
[ELSEIF search_condition THEN statement_list] ...
[ELSE statement_list]
END IF

The IF statement for stored programs implements a basic conditional
construct.

*Note*: There is also an IF() function, which differs from the IF
statement described here. See
https://mariadb.com/kb/en/if-function/. The
IF statement can have THEN, ELSE, and ELSEIF clauses, and it is
terminated with END IF.

If the search_condition evaluates to true, the corresponding THEN or
ELSEIF clause statement_list executes. If no search_condition matches,
the ELSE clause statement_list executes.

Each statement_list consists of one or more SQL statements; an empty
statement_list is not permitted.

URL: https://mariadb.com/kb/en/if-statement/


REGEXP

Syntax:
expr REGEXP pat, expr RLIKE pat

Performs a pattern match of a string expression expr against a pattern
pat. The pattern can be an extended regular expression. The syntax for
regular expressions is discussed in
https://mariadb.com/kb/en/regexp/. Returns 1 if expr
matches pat; otherwise it returns 0. If either expr or pat is NULL, the
result is NULL. RLIKE is a synonym for REGEXP, provided for mSQL
compatibility.

The pattern need not be a literal string. For example, it can be
specified as a string expression or table column.

*Note*: Because MySQL uses the C escape syntax in strings (for example,
"
" to represent the newline character), you must double any "" that
you use in your REGEXP strings.

REGEXP is not case sensitive, except when used with binary strings.

URL: https://mariadb.com/kb/en/regexp/


MASTER_POS_WAIT

Syntax:
MASTER_POS_WAIT(log_name,log_pos[,timeout])

This function is useful for control of master/slave synchronization. It
blocks until the slave has read and applied all updates up to the
specified position in the master log. The return value is the number of
log events the slave had to wait for to advance to the specified
position. The function returns NULL if the slave SQL thread is not
started, the slave's master information is not initialized, the
arguments are incorrect, or an error occurs. It returns -1 if the
timeout has been exceeded. If the slave SQL thread stops while
MASTER_POS_WAIT() is waiting, the function returns NULL. If the slave
is past the specified position, the function returns immediately.

If a timeout value is specified, MASTER_POS_WAIT() stops waiting when
timeout seconds have elapsed. timeout must be greater than 0; a zero or
negative timeout means no timeout.

URL: https://mariadb.com/kb/en/master_pos_wait/


SHOW TRIGGERS

Syntax:
SHOW TRIGGERS [{FROM | IN} db_name]
[LIKE 'pattern' | WHERE expr]

SHOW TRIGGERS lists the triggers currently defined for tables in a
database (the default database unless a FROM clause is given). This
statement returns results only for databases and tables for which you
have the TRIGGER privilege. The LIKE clause, if present, indicates
which table names to match and causes the statement to display triggers
for those tables. The WHERE clause can be given to select rows using
more general conditions, as discussed in
https://mariadb.com/kb/en/extended-show/.


For the trigger ins_sum as defined in
https://mariadb.com/kb/en/triggers/, the output of
this statement is as shown here:

MariaDB> SHOW TRIGGERS LIKE 'acc%'\G
*************************** 1. row ***************************
Trigger: ins_sum
Event: INSERT
Table: account
Statement: SET @sum = @sum + NEW.amount
Timing: BEFORE
Created: NULL
sql_mode:
Definer: myname@localhost
character_set_client: latin1
collation_connection: latin1_swedish_ci
Database Collation: latin1_swedish_ci

character_set_client is the session value of the character_set_client
system variable when the trigger was created. collation_connection is
the session value of the collation_connection system variable when the
trigger was created. Database Collation is the collation of the
database with which the trigger is associated.

URL: https://mariadb.com/kb/en/show-triggers/


TINYINT

TINYINT[(M)] [UNSIGNED] [ZEROFILL]

A very small integer. The signed range is -128 to 127. The unsigned
range is 0 to 255.

URL: https://mariadb.com/kb/en/tinyint/


MONTH

Syntax:
MONTH(date)

Returns the month for date, in the range 1 to 12 for January to
December, or 0 for dates such as '0000-00-00' or '2008-00-00' that have
a zero month part.

URL: https://mariadb.com/kb/en/month/


CREATE TRIGGER

Syntax:
CREATE
[DEFINER = { user | CURRENT_USER }]
TRIGGER trigger_name trigger_time trigger_event
ON tbl_name FOR EACH ROW trigger_body


This statement creates a new trigger. A trigger is a named database
object that is associated with a table, and that activates when a
particular event occurs for the table. The trigger becomes associated
with the table named tbl_name, which must refer to a permanent table.
You cannot associate a trigger with a TEMPORARY table or a view.

CREATE TRIGGER requires the TRIGGER privilege for the table associated
with the trigger. The statement might also require the SUPER privilege,
depending on the DEFINER value, as described later in this section. If
binary logging is enabled, CREATE TRIGGER might require the SUPER
privilege, as described in
https://mariadb.com/kb/en/binary-logging-of-stored-routines/.

The DEFINER clause determines the security context to be used when
checking access privileges at trigger activation time. See later in
this section for more information.

trigger_time is the trigger action time. It can be BEFORE or AFTER to
indicate that the trigger activates before or after each row to be
modified.

trigger_event indicates the kind of statement that activates the
trigger. The trigger_event can be one of the following:

o INSERT: The trigger is activated whenever a new row is inserted into
the table; for example, through INSERT, LOAD DATA, and REPLACE
statements.

o UPDATE: The trigger is activated whenever a row is modified; for
example, through UPDATE statements.

o DELETE: The trigger is activated whenever a row is deleted from the
table; for example, through DELETE and REPLACE statements. However,
DROP TABLE and TRUNCATE TABLE statements on the table do not activate
this trigger, because they do not use DELETE. Dropping a partition
does not activate DELETE triggers, either. See [HELP TRUNCATE TABLE].


URL: https://mariadb.com/kb/en/create-trigger/


SHOW COLUMNS

Syntax:
SHOW [FULL] COLUMNS {FROM | IN} tbl_name [{FROM | IN} db_name]
[LIKE 'pattern' | WHERE expr]

SHOW COLUMNS displays information about the columns in a given table.
It also works for views. The LIKE clause, if present, indicates which
column names to match. The WHERE clause can be given to select rows
using more general conditions, as discussed in
https://mariadb.com/kb/en/extended-show/.

SHOW COLUMNS displays information only for those columns for which you
have some privilege.

MariaDB> SHOW COLUMNS FROM City;
+------------+----------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+----------+------+-----+---------+----------------+
| Id | int(11) | NO | PRI | NULL | auto_increment |
| Name | char(35) | NO | | | |
| Country | char(3) | NO | UNI | | |
| District | char(20) | YES | MUL | | |
| Population | int(11) | NO | | 0 | |
+------------+----------+------+-----+---------+----------------+
5 rows in set (0.00 sec)

If the data types differ from what you expect them to be based on a
CREATE TABLE statement, note that MySQL sometimes changes data types
when you create or alter a table. The conditions under which this
occurs are described in
https://mariadb.com/kb/en/silent-column-changes/.

The FULL keyword causes the output to include the column collation and
comments, as well as the privileges you have for each column.

You can use db_name.tbl_name as an alternative to the tbl_name FROM
db_name syntax. In other words, these two statements are equivalent:

MariaDB> SHOW COLUMNS FROM mytable FROM mydb;
MariaDB> SHOW COLUMNS FROM mydb.mytable;

SHOW COLUMNS displays the following values for each table column:

Field indicates the column name.

Type indicates the column data type.

Collation indicates the collation for nonbinary string columns, or NULL
for other columns. This value is displayed only if you use the FULL
keyword.

The Null field contains YES if NULL values can be stored in the column,
NO if not.

The Key field indicates whether the column is indexed:

o If Key is empty, the column either is not indexed or is indexed only
as a secondary column in a multiple-column, nonunique index.

o If Key is PRI, the column is a PRIMARY KEY or is one of the columns
in a multiple-column PRIMARY KEY.

o If Key is UNI, the column is the first column of a UNIQUE index. (A
UNIQUE index permits multiple NULL values, but you can tell whether
the column permits NULL by checking the Null field.)

o If Key is MUL, the column is the first column of a nonunique index in
which multiple occurrences of a given value are permitted within the
column.

If more than one of the Key values applies to a given column of a
table, Key displays the one with the highest priority, in the order
PRI, UNI, MUL.

A UNIQUE index may be displayed as PRI if it cannot contain NULL values
and there is no PRIMARY KEY in the table. A UNIQUE index may display as
MUL if several columns form a composite UNIQUE index; although the
combination of the columns is unique, each column can still hold
multiple occurrences of a given value.

The Default field indicates the default value that is assigned to the
column. This is NULL if the column has an explicit default of NULL, or
if the column definition has no DEFAULT clause.

The Extra field contains any additional information that is available
about a given column. The value is nonempty in these cases:
auto_increment for columns that have the AUTO_INCREMENT attribute; on
update CURRENT_TIMESTAMP for TIMESTAMP columns that have the ON UPDATE
CURRENT_TIMESTAMP attribute.

Privileges indicates the privileges you have for the column. This value
is displayed only if you use the FULL keyword.

Comment indicates any comment the column has. This value is displayed
only if you use the FULL keyword.

SHOW FIELDS is a synonym for SHOW COLUMNS. You can also list a table's
columns with the mysqlshow db_name tbl_name command.

The DESCRIBE statement provides information similar to SHOW COLUMNS.
See [HELP DESCRIBE].

The SHOW CREATE TABLE, SHOW TABLE STATUS, and SHOW INDEX statements
also provide information about tables. See [HELP SHOW].

URL: https://mariadb.com/kb/en/show-columns/


LOWER

Syntax:
LOWER(str)

Returns the string str with all characters changed to lowercase
according to the current character set mapping. The default is latin1
(cp1252 West European).

MariaDB> SELECT LOWER('QUADRATICALLY');
-> 'quadratically'

LOWER() (and UPPER()) are ineffective when applied to binary strings
(BINARY, VARBINARY, BLOB). To perform lettercase conversion, convert
the string to a nonbinary string:

MariaDB> SET @str = BINARY 'New York';
MariaDB> SELECT LOWER(@str), LOWER(CONVERT(@str USING latin1));
+-------------+-----------------------------------+
| LOWER(@str) | LOWER(CONVERT(@str USING latin1)) |
+-------------+-----------------------------------+
| New York | new york |
+-------------+-----------------------------------+

URL: https://mariadb.com/kb/en/lower/


INTEGER

INTEGER[(M)] [UNSIGNED] [ZEROFILL]

This type is a synonym for INT.

URL: https://mariadb.com/kb/en/sql_language-data_types-int


OPEN

Syntax:
OPEN cursor_name

This statement opens a previously declared cursor. For an example, see
https://mariadb.com/kb/en/cursor-overview/.

URL: https://mariadb.com/kb/en/open/


SHOW CREATE PROCEDURE

Syntax:
SHOW CREATE PROCEDURE proc_name

This statement is a MySQL extension. It returns the exact string that
can be used to re-create the named stored procedure. A similar
statement, SHOW CREATE FUNCTION, displays information about stored
functions (see [HELP SHOW CREATE FUNCTION]).

Both statements require that you be the owner of the routine or have
SELECT access to the mysql.proc table. If you do not have privileges
for the routine itself, the value displayed for the Create Procedure or
Create Function field will be NULL.

URL: https://mariadb.com/kb/en/show-create-procedure/


SHOW CREATE TRIGGER

Syntax:
SHOW CREATE TRIGGER trigger_name

This statement shows a CREATE TRIGGER statement that creates the given
trigger.

URL: https://mariadb.com/kb/en/show-create-trigger/


DATETIME

DATETIME

A date and time combination. The supported range is '1000-01-01
00:00:00' to '9999-12-31 23:59:59'. MySQL displays DATETIME values in
'YYYY-MM-DD HH:MM:SS' format, but permits assignment of values to
DATETIME columns using either strings or numbers.

URL: https://mariadb.com/kb/en/datetime/


CHAR FUNCTION

Syntax:
CHAR(N,... [USING charset_name])

CHAR() interprets each argument N as an integer and returns a string
consisting of the characters given by the code values of those
integers. NULL values are skipped.
By default, CHAR() returns a binary string. To produce a string in a
given character set, use the optional USING clause:

MariaDB> SELECT CHARSET(CHAR(0x65)), CHARSET(CHAR(0x65 USING utf8));
+---------------------+--------------------------------+
| CHARSET(CHAR(0x65)) | CHARSET(CHAR(0x65 USING utf8)) |
+---------------------+--------------------------------+
| binary | utf8 |
+---------------------+--------------------------------+

If USING is given and the result string is illegal for the given
character set, a warning is issued. Also, if strict SQL mode is
enabled, the result from CHAR() becomes NULL.

URL: https://mariadb.com/kb/en/char-function/


GEOMETRY HIERARCHY

Geometry is the base class. It is an abstract class. The instantiable
subclasses of Geometry are restricted to zero-, one-, and
two-dimensional geometric objects that exist in two-dimensional
coordinate space. All instantiable geometry classes are defined so that
valid instances of a geometry class are topologically closed (that is,
all defined geometries include their boundary).


The base Geometry class has subclasses for Point, Curve, Surface, and
GeometryCollection:

o Point represents zero-dimensional objects.

o Curve represents one-dimensional objects, and has subclass
LineString, with sub-subclasses Line and LinearRing.

o Surface is designed for two-dimensional objects and has subclass
Polygon.

o GeometryCollection has specialized zero-, one-, and two-dimensional
collection classes named MultiPoint, MultiLineString, and
MultiPolygon for modeling geometries corresponding to collections of
Points, LineStrings, and Polygons, respectively. MultiCurve and
MultiSurface are introduced as abstract superclasses that generalize
the collection interfaces to handle Curves and Surfaces.

Geometry, Curve, Surface, MultiCurve, and MultiSurface are defined as
noninstantiable classes. They define a common set of methods for their
subclasses and are included for extensibility.

Point, LineString, Polygon, GeometryCollection, MultiPoint,
MultiLineString, and MultiPolygon are instantiable classes.

URL: https://mariadb.com/kb/en/geometry-hierarchy/


CONCAT

Syntax:
CONCAT(str1,str2,...)

Returns the string that results from concatenating the arguments. May
have one or more arguments. If all arguments are nonbinary strings, the
result is a nonbinary string. If the arguments include any binary
strings, the result is a binary string. A numeric argument is converted
to its equivalent string form. This is a nonbinary string as of MySQL
5.5.3. Before 5.5.3, it is a binary string; to to avoid that and
produce a nonbinary string, you can use an explicit type cast, as in
this example:

SELECT CONCAT(CAST(int_col AS CHAR), char_col);

CONCAT() returns NULL if any argument is NULL.

URL: https://mariadb.com/kb/en/concat/


VAR_SAMP

Syntax:
VAR_SAMP(expr)

Returns the sample variance of expr. That is, the denominator is the
number of rows minus one.

VAR_SAMP() returns NULL if there were no matching rows.

URL: https://mariadb.com/kb/en/var_samp/


SHOW AUTHORS

Syntax:
SHOW AUTHORS

The SHOW AUTHORS statement displays information about the people who
work on MySQL. For each author, it displays Name, Location, and Comment
values.

URL: https://mariadb.com/kb/en/show-authors/


DROP SERVER

Syntax:
DROP SERVER [ IF EXISTS ] server_name

Drops the server definition for the server named server_name. The
corresponding row within the mysql.servers table will be deleted. This
statement requires the SUPER privilege.

Dropping a server for a table does not affect any FEDERATED tables that
used this connection information when they were created. See [HELP
CREATE SERVER].

URL: https://mariadb.com/kb/en/drop-server/


VARIANCE

Syntax:
VARIANCE(expr)

Returns the population standard variance of expr. This is an extension
to standard SQL. The standard SQL function VAR_POP() can be used
instead.

VARIANCE() returns NULL if there were no matching rows.

URL: https://mariadb.com/kb/en/variance/


SHOW CONTRIBUTORS

Syntax:
SHOW CONTRIBUTORS

The SHOW CONTRIBUTORS statement displays information about the people
who contribute to MySQL source or to causes that we support. For each
contributor, it displays Name, Location, and Comment values.

URL: https://mariadb.com/kb/en/show-contributors/


CURRENT_TIMESTAMP

Syntax:
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP()

CURRENT_TIMESTAMP and CURRENT_TIMESTAMP() are synonyms for NOW().

URL: https://mariadb.com/kb/en/current_timestamp/


SRID

SRID(g)

Returns an integer indicating the Spatial Reference System ID for the
geometry value g.

In MySQL, the SRID value is just an integer associated with the
geometry value. All calculations are done assuming Euclidean (planar)
geometry.

URL: https://mariadb.com/kb/en/srid/


CONTAINS

Contains(g1,g2)

Returns 1 or 0 to indicate whether g1 completely contains g2. This
tests the opposite relationship as Within().

URL: https://mariadb.com/kb/en/contains/


REPLACE

Syntax:
REPLACE [LOW_PRIORITY | DELAYED]
[INTO] tbl_name [(col_name,...)]
{VALUES | VALUE} ({expr | DEFAULT},...),(...),...

Or:

REPLACE [LOW_PRIORITY | DELAYED]
[INTO] tbl_name
SET col_name={expr | DEFAULT}, ...

Or:

REPLACE [LOW_PRIORITY | DELAYED]
[INTO] tbl_name [(col_name,...)]
SELECT ...

REPLACE works exactly like INSERT, except that if an old row in the
table has the same value as a new row for a PRIMARY KEY or a UNIQUE
index, the old row is deleted before the new row is inserted. See [HELP
INSERT].

REPLACE is a MySQL extension to the SQL standard. It either inserts, or
deletes and inserts. For another MySQL extension to standard SQL---that
either inserts or updates---see
https://mariadb.com/kb/en/insert-on-duplicate-key-update/.

Note that unless the table has a PRIMARY KEY or UNIQUE index, using a
REPLACE statement makes no sense. It becomes equivalent to INSERT,
because there is no index to be used to determine whether a new row
duplicates another.

Values for all columns are taken from the values specified in the
REPLACE statement. Any missing columns are set to their default values,
just as happens for INSERT. You cannot refer to values from the current
row and use them in the new row. If you use an assignment such as SET
col_name = col_name + 1, the reference to the column name on the right
hand side is treated as DEFAULT(col_name), so the assignment is
equivalent to SET col_name = DEFAULT(col_name) + 1.

To use REPLACE, you must have both the INSERT and DELETE privileges for
the table.

URL: https://mariadb.com/kb/en/replace/


HEX

Syntax:
HEX(str), HEX(N)

For a string argument str, HEX() returns a hexadecimal string
representation of str where each character in str is converted to two
hexadecimal digits. The inverse of this operation is performed by the
UNHEX() function.

For a numeric argument N, HEX() returns a hexadecimal string
representation of the value of N treated as a longlong (BIGINT) number.
This is equivalent to CONV(N,10,16). The inverse of this operation is
performed by CONV(HEX(N),16,10).

URL: https://mariadb.com/kb/en/hex/


JOIN

MySQL supports the following JOIN syntaxes for the table_references
part of SELECT statements and multiple-table DELETE and UPDATE
statements:

table_references:
table_reference [, table_reference] ...

table_reference:
table_factor
| join_table

table_factor:
tbl_name [[AS] alias] [index_hint_list]
| table_subquery [AS] alias
| ( table_references )
| { OJ table_reference LEFT OUTER JOIN table_reference
ON conditional_expr }

join_table:
table_reference [INNER | CROSS] JOIN table_factor [join_condition]
| table_reference STRAIGHT_JOIN table_factor
| table_reference STRAIGHT_JOIN table_factor ON conditional_expr
| table_reference {LEFT|RIGHT} [OUTER] JOIN table_reference join_condition
| table_reference NATURAL [{LEFT|RIGHT} [OUTER]] JOIN table_factor

join_condition:
ON conditional_expr
| USING (column_list)

index_hint_list:
index_hint [, index_hint] ...

index_hint:
USE {INDEX|KEY}
[FOR {JOIN|ORDER BY|GROUP BY}] ([index_list])
| IGNORE {INDEX|KEY}
[FOR {JOIN|ORDER BY|GROUP BY}] (index_list)
| FORCE {INDEX|KEY}
[FOR {JOIN|ORDER BY|GROUP BY}] (index_list)

index_list:
index_name [, index_name] ...

A table reference is also known as a join expression.

The syntax of table_factor is extended in comparison with the SQL
Standard. The latter accepts only table_reference, not a list of them
inside a pair of parentheses.

This is a conservative extension if we consider each comma in a list of
table_reference items as equivalent to an inner join. For example:

SELECT * FROM t1 LEFT JOIN (t2, t3, t4)
ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)

is equivalent to:

SELECT * FROM t1 LEFT JOIN (t2 CROSS JOIN t3 CROSS JOIN t4)
ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)

In MySQL, JOIN, CROSS JOIN, and INNER JOIN are syntactic equivalents
(they can replace each other). In standard SQL, they are not
equivalent. INNER JOIN is used with an ON clause, CROSS JOIN is used
otherwise.

In general, parentheses can be ignored in join expressions containing
only inner join operations.

Index hints can be specified to affect how the MySQL optimizer makes
use of indexes. For more information, see
https://mariadb.com/kb/en/how-to-force-query-plans/.

URL: https://mariadb.com/kb/en/join-syntax/


MIN

Syntax:
MIN([DISTINCT] expr)

Returns the minimum value of expr. MIN() may take a string argument; in
such cases, it returns the minimum string value.
The DISTINCT keyword can be used to find the minimum of the distinct values
of expr, however, this produces the same result as omitting DISTINCT.

MIN() returns NULL if there were no matching rows.

URL: https://mariadb.com/kb/en/min/


2.route:list