content_image/790825.jpg
• D  -> F  conversion is done such that F  is the nearest native binary number to the input decimal string D . 

These properties imply that F  -> D  -> F  conversions are lossless unless F  is -inf , +inf , or NaN . The latter values are not supported because the SQL standard defines them as invalid values for FLOAT  or DOUBLE . 

For D  -> F  -> D  conversions, a sufficient condition for losslessness is that D  uses 15 or fewer digits of precision, is not a denormal value, -inf , +inf , or NaN . In some cases, the conversion is lossless even if D has more than 15 digits of precision, but this is not always the case. 

Implicit conversion of a numeric or temporal value to string produces a value that has a character set and collation determined by the character_set_connection  and collation_connection  system variables. (These variables commonly are set with SET NAMES . For information about connection character sets, see Section 10.4, “Connection Character Sets and Collations” .) 

This means that such a conversion results in a character (nonbinary) string (a CHAR , VARCHAR , or LONGTEXT  value), except in the case that the connection character set is set to binary . In that case, the conversion result is a binary string (a BINARY , VARBINARY , or LONGBLOB  value). 

For integer expressions, the preceding remarks about expression evaluation  apply somewhat differently for expression assignment ; for example, in a statement such as this: 

CREATE TABLE t SELECT integer_expr ; 

In this case, the table in the column resulting from the expression has type INT  or BIGINT  depending on the length of the integer expression. If the maximum length of the expression does not fit in an INT , BIGINT  is used instead. The length is taken from the max_length  value of the SELECT  result set metadata (see C API Basic Data Structures). This means that you can force a BIGINT  rather than INT  by use of a sufficiently long expression: 

## 12.4 Operators 

CREATE TABLE t SELECT 000000000000000000000; 

<img src='content_image/790825.jpg'>

