Bug #118521 | cast(double as char) result is incorrect | ||
---|---|---|---|
Submitted: | 25 Jun 2:54 | Modified: | 17 Jul 12:12 |
Reporter: | haizhen xue | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | OS: | Any | |
Assigned to: | CPU Architecture: | Any |
[25 Jun 2:54]
haizhen xue
[25 Jun 3:02]
haizhen xue
mysql> SELECT double_col FROM t where (double_col) NOT IN (NULL); Empty set (0.00 sec) mysql> SELECT double_col FROM t where (double_col,double_col) NOT IN ((NULL,NULL)); Empty set (0.00 sec) mysql> SELECT double_col FROM t where (double_col) IN (NULL); Empty set (0.00 sec) mysql> SELECT double_col FROM t where (double_col,double_col) IN ((NULL,NULL)); Empty set (0.00 sec) is result ok?
[17 Jul 12:12]
MySQL Verification Team
Hello Haizhen Xue, Thank you for the bug report. IMHO this is not a bug. Regarding NULL: Please go through the document available at https://dev.mysql.com/doc/refman/8.4/en/working-with-null.html The NULL value can be surprising until you get used to it. Conceptually, NULL means “a missing unknown value” and it is treated somewhat differently from other values. To test for NULL, use the IS NULL and IS NOT NULL operators, as shown in the doc. Regarding CAST(DOUBLE AS CHAR): You are trying to insert different value in double data type i.e. -2.2250738585072014e-308. Hence the results are varying. For more info, please see here https://dev.mysql.com/doc/refman/8.4/en/floating-point-types.html You can also try CAST('-2.2250738585072014e-308' AS CHAR) Regards, Ashwini Patil