SQL reference (MySQL and MariaDB dialects)

Functions that are not supported yet

The well-known MySQL and MariaDB functions and function-like syntax that Raft DB does not run, and the functions it accepts but does not act on.

This page lists functions that exist in MySQL 8/9 or MariaDB 11 and that Raft DB's front-end does not implement. The list was made by looking for each name in the code of the front-end and in the results of the coverage runs against the MySQL and MariaDB manuals. It names the well-known functions; it is not a complete list of everything the two servers have. A call to one of them gives error 1305 (FUNCTION name is unknown).

Not supported yet#

GroupFunctions
Encryption and compressionAES_ENCRYPT, AES_DECRYPT, COMPRESS, UNCOMPRESS, UNCOMPRESSED_LENGTH, RANDOM_BYTES, PASSWORD, OLD_PASSWORD, ENCRYPT, ENCODE, DECODE, DES_ENCRYPT, DES_DECRYPT, CRC32C (MariaDB)
Hash lengthsSHA2(str, n) for n other than 256 (and 0) gives NULL
JSONJSON_TABLE, JSON_OBJECTAGG, JSON_PRETTY, JSON_STORAGE_SIZE, JSON_STORAGE_FREE, JSON_SCHEMA_VALID, JSON_SCHEMA_VALIDATION_REPORT, JSON_DETAILED (MariaDB)
AggregatesGROUPING(), CUBE, MEDIAN, PERCENTILE_CONT, PERCENTILE_DISC (MariaDB), LISTAGG; COUNT, SUM and the others take one expression (a list of expressions is refused, except in GROUP_CONCAT); window functions over GROUP_CONCAT, STD*, VAR*, BIT_*, and window frames in GROUPS mode
UUID and addressesUUID_TO_BIN, BIN_TO_UUID, IS_UUID, INET6_ATON, INET6_NTOA, SYS_GUID
StringsLOAD_FILE, FORMAT_BYTES, FORMAT_PICO_TIME, SFORMAT (MariaDB), CHAR(... USING charset), POSITION(substr IN str) (the standard form; use LOCATE or INSTR), SOUNDS LIKE, LIKE ... ESCAPE
Dates and timesGET_FORMAT, WEEK(date, mode) and YEARWEEK(date, mode) with a mode other than 0 (the argument is ignored), microseconds in MICROSECOND() and %f (always 0), CONVERT_TZ (returns its argument unchanged), the compound INTERVAL units (DAY_HOUR, YEAR_MONTH, ...) and compound EXTRACT units, TIMESTAMP(expr, time) (the second argument is ignored), NEXT_DAY, TO_DATE, TO_CHAR, TO_NUMBER (Oracle names)
InformationBENCHMARK, CURRENT_ROLE, LAST_INSERT_ID(expr) (the argument is ignored), NAME_CONST, GTID_SUBSET, GTID_SUBTRACT, WAIT_FOR_EXECUTED_GTID_SET, MASTER_POS_WAIT, SOURCE_POS_WAIT, ICU_VERSION
LocksIS_FREE_LOCK, IS_USED_LOCK, RELEASE_ALL_LOCKS; GET_LOCK, RELEASE_LOCK are accepted and lock nothing
Spatial (GIS)ST_Buffer, ST_Union, ST_Intersection, ST_Difference, ST_SymDifference, ST_ConvexHull, ST_Simplify, ST_Transform, ST_Touches, ST_Crosses, ST_Overlaps, GeoJSON and geohash functions, ST_Distance_Sphere (error 1235); geodetic results for SRID 4326
XMLEXTRACTVALUE, UPDATEXML
Full-textMATCH (...) AGAINST (...) (FULLTEXT keys are refused)
Dynamic columns (MariaDB)the bytes of a dynamic column blob are Raft DB's own: HEX() of one and blobs made by a real MariaDB differ
Oracle mode (MariaDB)NVL, NVL2, DECODE_ORACLE, LNNVL, ROWNUM, SYS_GUID, SET sql_mode = ORACLE effects
OtherREGEXP flags (?i), named groups and the match_type argument; user-defined (loadable) functions CREATE FUNCTION ... SONAME; CAST(x AS YEAR)

Accepted but without effect#

These run, return a value, and do not do what the server does:

FunctionWhat Raft DB does
SLEEP(n)returns 0 at once, does not wait
GET_LOCK(name, timeout), RELEASE_LOCK(name)return 1, lock nothing
CONVERT_TZ(dt, from, to)returns dt
RAND(seed)the seed is ignored
FORMAT(x, d, locale)the locale is ignored
WEEK(d, mode), YEARWEEK(d, mode)the mode is ignored (mode 0)
TIMESTAMP(d, t)t is ignored
BINARY exprno effect, the comparison stays case-insensitive
CONVERT(expr USING cs)returns expr
CAST(expr AS type CHARACTER SET cs)the character set is ignored
ANY_VALUE(x)returns x

Differences that are not missing functions#

  • Time functions use UTC and whole seconds.
  • The case-insensitive comparison of text cannot be changed to a binary or accent-sensitive one.
  • TRIM(BOTH 'xy' FROM s) removes any of the characters listed, not only the whole string xy.
  • CAST(-5 AS UNSIGNED) is 0 (MySQL wraps around).

How to ask for one#

A function that an application you run needs and that is on this list is not available today. A function is checked against MySQL and MariaDB before it is added.

See also#