Bug #105842 | joining on integer and varchar fields has unexpected behaviour | ||
---|---|---|---|
Submitted: | 8 Dec 2021 21:43 | Modified: | 9 Dec 2021 12:57 |
Reporter: | Robbert Nix | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 8.0.26 | OS: | Windows |
Assigned to: | CPU Architecture: | Any |
[8 Dec 2021 21:43]
Robbert Nix
[9 Dec 2021 7:49]
Huaisong Hui
https://dev.mysql.com/doc/refman/8.0/en/comparison-operators.html Strings are automatically converted to numbers and numbers to strings as necessary. root@localhost:hhs_test15:44:52>select '111'='111asdf' as res; +-----+ | res | +-----+ | 0 | +-----+ 1 row in set (0.00 sec) root@localhost:hhs_test15:45:01>select 111='111asdf' as res; +-----+ | res | +-----+ | 1 | +-----+ 1 row in set, 1 warning (0.00 sec) root@localhost:hhs_test15:45:06>select 111='11asdf' as res; +-----+ | res | +-----+ | 0 | +-----+ 1 row in set, 1 warning (0.00 sec)
[9 Dec 2021 12:57]
MySQL Verification Team
Hi, Thank you for your bug report. However, this is not a bug. In the cases like this, both strings and integers are converted to double values. This is fully described in our Reference Manual. Not a bug.