You are viewing the archived documentation of TiDB, which no longer receives updates. It is recommended that you use the latest LTS version of the TiDB database.
Cast Functions and Operators
Cast functions and operators enable conversion of values from one data type to another. TiDB supports all of the cast functions and operators available in MySQL 5.7.
TiDB and MySQL display inconsistent results for SELECT CAST(MeN AS CHAR) (or its equivalent form SELECT CONVERT(MeM, CHAR)), where MeN represents a double-precision floating-point number in scientific notation. MySQL displays the complete numeric value when -15 <= N <= 14 and the scientific notation when N < -15 or N > 14. However, TiDB always displays the complete numeric value. For example, MySQL displays the result of SELECT CAST(3.1415e15 AS CHAR) as 3.1415e15, while TiDB displays the result as 3141500000000000.