Bug #113768 return error with cast
Submitted: 26 Jan 2024 2:40 Modified: 26 Jan 2024 8:52
Reporter: Alice Alice Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:8.0.35 OS:Linux
Assigned to: CPU Architecture:Any
Tags: regression

[26 Jan 2024 2:40] Alice Alice
Description:
execute query will return error when I used the cast,but It will returned corrected result in 8.0.22
mysql> create table tb(a bigint);
Query OK, 0 rows affected (0.02 sec)

mysql> insert into tb values(9223372036854775807),(-9223372036854775808);
Query OK, 2 rows affected (0.00 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql> SELECT 1 FROM tb A WHERE (A.a, A.a) NOT IN  ((CAST(9223372036854775807 AS REAL),CAST(110 AS SIGNED INTEGER)),(CAST(92 AS REAL),CAST(NULL AS SIGNED INTEGER)));
ERROR 1690 (22003): BIGINT value is out of range in 'cast(9223372036854775807 as double)'
mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.35    |
+-----------+
1 row in set (0.00 sec)

How to repeat:
create table tb(a bigint);
insert into tb values(9223372036854775807),(-9223372036854775808);
SELECT 1 FROM tb A WHERE (A.a, A.a) NOT IN  ((CAST(9223372036854775807 AS REAL),CAST(110 AS SIGNED INTEGER)),(CAST(92 AS REAL),CAST(NULL AS SIGNED INTEGER)));
[26 Jan 2024 8:52] MySQL Verification Team
Hello Alice Alice,

Thank you for the report and feedback.

regards,
Umesh