Bug #115408 | Inconsistent Query Results in MySQL | ||
---|---|---|---|
Submitted: | 23 Jun 2024 3:51 | Modified: | 26 Jun 2024 10:27 |
Reporter: | Wenqian Deng | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 8.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[23 Jun 2024 3:51]
Wenqian Deng
[25 Jun 2024 9:46]
MySQL Verification Team
Hi Mr. Deng, Thank you for your bug report. However, this is not a bug. When you write SIGNED it implies INT. That is a difference in the output of the queries. Not a bug.
[25 Jun 2024 10:47]
MySQL Verification Team
HI Mr. Deng, One more comment. You wrote : ------------------------- : Error: BIGINT value is out of range in '(-(3751869525204584190) * -(1267392877799265691))' Modify the SQL query by replacing table_0.c_0 with CAST(table_0.c_1 * table_0.c_2 AS SIGNED): ------------------------- We do not see how are : '(-(3751869525204584190) * -(1267392877799265691)) identical with CAST(table_0.c_1 * table_0.c_2 AS SIGNED):
[26 Jun 2024 1:16]
Wenqian Deng
Hi, the value of table_0.c_0 is identical with CAST(table_0.c_1 * table_0.c_2 AS SIGNED). (-(3751869525204584190) * -(1267392877799265691)) in the error message is a random constant in SELECT.
[26 Jun 2024 1:33]
Wenqian Deng
According to the document, SIGNED [INTEGER] Produces a signed BIGINT value.
[26 Jun 2024 10:16]
MySQL Verification Team
Hi, According to the document, SIGNED is just the attribute to the defined integer type. Hence, our previous question still remains .......
[26 Jun 2024 10:17]
MySQL Verification Team
Hi, To expand on our question ..... SMALLINT * INT makes INT , not BIGINT.
[26 Jun 2024 10:27]
Wenqian Deng
Thank you for the correction. Perhaps the statement in the documentation is somewhat confusing for users. Additionally, if I change all columns in the table to BIGINT type (as I think this might ensure type consistency), the issue persists. see: https://dbfiddle.uk/zybl9_Bj
[26 Jun 2024 10:29]
MySQL Verification Team
Hi Mr. Deng, The problem definitely has to persist. Namely, -(3751869525204584190) * -(1267392877799265691) is far beyond the range of the 64-bit signed integer. Not a bug.