Skip to content

evalengine: Support all built-in MySQL functions #9647

@vmg

Description

@vmg

The last major shortcoming of the evaluation engine are the many built-in SQL functions that ship with MySQL and which we currently do not support. Since adding support for these functions is an arduous, iterative project, this tracking issue intends to act as an authoritative list of the progress we've made bringing these functions over.

Comparison Operators

  • > Greater than operator
  • >= Greater than or equal operator
  • < Less than operator
  • <>, != Not equal operator
  • <= Less than or equal operator
  • <=> NULL-safe equal to operator
  • = Equal operator
  • BETWEEN ... AND ... Whether a value is within a range of values
  • COALESCE() Return the first non-NULL argument
  • GREATEST() Return the largest argument
  • IN() Whether a value is within a set of values
  • INTERVAL() Return the index of the argument that is less than the first argument
  • IS Test a value against a boolean
  • IS NOT Test a value against a boolean
  • IS NOT NULL NOT NULL value test
  • IS NULL NULL value test
  • ISNULL() Test whether the argument is NULL
  • LEAST() Return the smallest argument
  • LIKE Simple pattern matching
  • NOT BETWEEN ... AND ... Whether a value is not within a range of values
  • NOT IN() Whether a value is not within a set of values
  • NOT LIKE Negation of simple pattern matching
  • STRCMP() Compare two strings

Logical Operators

Assignment Operators

  • := Assign a value
  • = Assign a value (as part of a SET statement, or as part of the SET clause in an UPDATE statement)

Flow Control Functions

Numeric Functions and Operators

  • %, MOD Modulo operator
  • * Multiplication operator
  • + Addition operator
  • - Minus operator
  • - Change the sign of the argument
  • / Division operator
  • ABS() Return the absolute value
  • ACOS() Return the arc cosine
  • ASIN() Return the arc sine
  • ATAN() Return the arc tangent
  • ATAN2(), ATAN() Return the arc tangent of the two arguments
  • CEIL() Return the smallest integer value not less than the argument
  • CEILING() Return the smallest integer value not less than the argument
  • CONV() Convert numbers between different number bases
  • COS() Return the cosine
  • COT() Return the cotangent
  • CRC32() Compute a cyclic redundancy check value
  • DEGREES() Convert radians to degrees
  • DIV Integer division
  • EXP() Raise to the power of
  • FLOOR() Return the largest integer value not greater than the argument
  • LN() Return the natural logarithm of the argument
  • LOG() Return the natural logarithm of the first argument
  • LOG10() Return the base-10 logarithm of the argument
  • LOG2() Return the base-2 logarithm of the argument
  • MOD() Return the remainder
  • PI() Return the value of pi
  • POW() Return the argument raised to the specified power
  • POWER() Return the argument raised to the specified power
  • RADIANS() Return argument converted to radians
  • RAND() Return a random floating-point value
  • ROUND() Round the argument
  • SIGN() Return the sign of the argument
  • SIN() Return the sine of the argument
  • SQRT() Return the square root of the argument
  • TAN() Return the tangent of the argument
  • TRUNCATE() Truncate to specified number of decimal places

Date and Time Functions

String Functions and Operators

  • ASCII() Return numeric value of left-most character
  • BIN() Return a string containing binary representation of a number
  • BIT_LENGTH() Return length of argument in bits
  • CHAR() Return the character for each integer passed
  • CHAR_LENGTH() Return number of characters in argument
  • CHARACTER_LENGTH() Synonym for CHAR_LENGTH()
  • CONCAT() Return concatenated string
  • CONCAT_WS() Return concatenate with separator
  • ELT() Return string at index number
  • EXPORT_SET() Return a string such that for every bit set in the value bits, you get an on string and for every unset bit, you get an off string
  • FIELD() Index (position) of first argument in subsequent arguments
  • FIND_IN_SET() Index (position) of first argument within second argument
  • FORMAT() Return a number formatted to specified number of decimal places
  • FROM_BASE64() Decode base64 encoded string and return result
  • HEX() Hexadecimal representation of decimal or string value
  • INSERT() Insert substring at specified position up to specified number of characters
  • INSTR() Return the index of the first occurrence of substring
  • LCASE() Synonym for LOWER()
  • LEFT() Return the leftmost number of characters as specified
  • LENGTH() Return the length of a string in bytes
  • LIKE Simple pattern matching
  • LOAD_FILE() Load the named file
  • LOCATE() Return the position of the first occurrence of substring
  • LOWER() Return the argument in lowercase
  • LPAD() Return the string argument, left-padded with the specified string
  • LTRIM() Remove leading spaces
  • MAKE_SET() Return a set of comma-separated strings that have the corresponding bit in bits set
  • MATCH() Perform full-text search
  • MID() Return a substring starting from the specified position
  • NOT LIKE Negation of simple pattern matching
  • NOT REGEXP Negation of REGEXP
  • OCT() Return a string containing octal representation of a number
  • OCTET_LENGTH() Synonym for LENGTH()
  • ORD() Return character code for leftmost character of the argument
  • POSITION() Synonym for LOCATE()
  • QUOTE() Escape the argument for use in an SQL statement #13849
  • REGEXP Whether string matches regular expression
  • REGEXP_INSTR() Starting index of substring matching regular expression
  • REGEXP_LIKE() Whether string matches regular expression
  • REGEXP_REPLACE() Replace substrings matching regular expression
  • REGEXP_SUBSTR() Return substring matching regular expression
  • REPEAT() Repeat a string the specified number of times
  • REPLACE() Replace occurrences of a specified string
  • REVERSE() Reverse the characters in a string
  • RIGHT() Return the specified rightmost number of characters
  • RLIKE Whether string matches regular expression
  • RPAD() Append string the specified number of times
  • RTRIM() Remove trailing spaces
  • SOUNDEX() Return a soundex string
  • SOUNDS LIKE Compare sounds
  • SPACE() Return a string of the specified number of spaces
  • STRCMP() Compare two strings
  • SUBSTR() Return the substring as specified
  • SUBSTRING() Return the substring as specified
  • SUBSTRING_INDEX() Return a substring from a string before the specified number of occurrences of the delimiter
  • TO_BASE64() Return the argument converted to a base-64 string
  • TRIM() Remove leading and trailing spaces
  • UCASE() Synonym for UPPER()
  • UNHEX() Return a string containing hex representation of a number
  • UPPER() Convert to uppercase
  • WEIGHT_STRING() Return the weight string for a string

Cast Functions

  • CAST() Cast a value as a certain type
  • CONVERT() Cast a value as a certain type

Bit Functions and Operators

  • & Bitwise AND
  • >> Right shift
  • << Left shift
  • ^ Bitwise XOR
  • BIT_COUNT() Return the number of bits that are set
  • | Bitwise OR
  • ~ Bitwise inversion

JSON

  • -> Return value from JSON column after evaluating path; equivalent to JSON_EXTRACT().
  • ->> Return value from JSON column after evaluating path and unquoting the result; equivalent to JSON_UNQUOTE(JSON_EXTRACT()).
  • JSON_ARRAY() Create JSON array
  • JSON_ARRAY_APPEND() Append data to JSON document
  • JSON_ARRAY_INSERT() Insert into JSON array
  • JSON_CONTAINS() Whether JSON document contains specific object at path
  • JSON_CONTAINS_PATH() Whether JSON document contains any data at path
  • JSON_DEPTH() Maximum depth of JSON document
  • JSON_EXTRACT() Return data from JSON document
  • JSON_INSERT() Insert data into JSON document
  • JSON_KEYS() Array of keys from JSON document
  • JSON_LENGTH() Number of elements in JSON document
  • JSON_MERGE() Merge JSON documents, preserving duplicate keys. Deprecated synonym for JSON_MERGE_PRESERVE()
  • JSON_MERGE_PATCH() Merge JSON documents, replacing values of duplicate keys
  • JSON_MERGE_PRESERVE() Merge JSON documents, preserving duplicate keys
  • JSON_OBJECT() Create JSON object
  • JSON_OVERLAPS() Compares two JSON documents, returns TRUE (1) if these have any key-value pairs or array elements in common, otherwise FALSE (0)
  • JSON_PRETTY() Print a JSON document in human-readable format
  • JSON_QUOTE() Quote JSON document
  • JSON_REMOVE() Remove data from JSON document
  • JSON_REPLACE() Replace values in JSON document
  • JSON_SCHEMA_VALID() Validate JSON document against JSON schema; returns TRUE/1 if document validates against schema, or FALSE/0 if it does not
  • JSON_SCHEMA_VALIDATION_REPORT() Validate JSON document against JSON schema; returns report in JSON format on outcome on validation including success or failure and reasons for failure 8.0.17
  • JSON_SEARCH() Path to value within JSON document
  • JSON_SET() Insert data into JSON document
  • JSON_STORAGE_FREE() Freed space within binary representation of JSON column value following partial update
  • JSON_STORAGE_SIZE() Space used for storage of binary representation of a JSON document
  • JSON_TABLE() Return data from a JSON expression as a relational table
  • JSON_TYPE() Type of JSON value
  • JSON_UNQUOTE() Unquote JSON value
  • JSON_VALID() Whether JSON value is valid
  • JSON_VALUE() Extract value from JSON document at location pointed to by path provided; return this value as VARCHAR(512) or specified type
  • MEMBER OF() Returns true (1) if first operand matches any element of JSON array passed as second operand, otherwise returns false (0)

XML Functions

Encryption and Compression Functions

Miscellaneous Functions

  • ANY_VALUE() Suppress ONLY_FULL_GROUP_BY value rejection
  • BIN_TO_UUID() Convert binary UUID to string
  • DEFAULT() Return the default value for a table column
  • GROUPING() Distinguish super-aggregate ROLLUP rows from regular rows
  • INET_ATON() Return the numeric value of an IP address
  • INET_NTOA() Return the IP address from a numeric value
  • INET6_ATON() Return the numeric value of an IPv6 address
  • INET6_NTOA() Return the IPv6 address from a numeric value
  • IS_IPV4() Whether argument is an IPv4 address
  • IS_IPV4_COMPAT() Whether argument is an IPv4-compatible address
  • IS_IPV4_MAPPED() Whether argument is an IPv4-mapped address
  • IS_IPV6() Whether argument is an IPv6 address
  • IS_UUID() Whether argument is a valid UUID
  • MASTER_POS_WAIT() Block until the replica has read and applied all updates up to the specified position
  • NAME_CONST() Cause the column to have the given name
  • SLEEP() Sleep for a number of seconds
  • SOURCE_POS_WAIT() Block until the replica has read and applied all updates up to the specified position
  • UUID() Return a Universal Unique Identifier (UUID)
  • UUID_SHORT() Return an integer-valued universal identifier
  • UUID_TO_BIN() Convert string UUID to binary
  • VALUES() Define the values to be used during an INSERT

Metadata

Metadata

Assignees

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions