Home >Database >Mysql Tutorial >What will MySQL return if we provide a value greater than 255 as a parameter to the MySQL CHAR() function?
#MySQL converts arguments to the CHAR() function that are greater than 255 into multiple result bytes. For example, CHAR(260) is equivalent to CHAR(0,1,0,4). It will be clearer with the following statement -
mysql> Select HEX(CHAR(256)),HEX(CHAR(1,0)); +----------------+----------------+ | HEX(CHAR(256)) | HEX(CHAR(1,0)) | +----------------+----------------+ | 0100 | 0100 | +----------------+----------------+ 1 row in set (0.00 sec)
The above result set shows that CHAR(256) is equivalent to CHAR(1,0).
The above is the detailed content of What will MySQL return if we provide a value greater than 255 as a parameter to the MySQL CHAR() function?. For more information, please follow other related articles on the PHP Chinese website!