Bug #103194 | Prepare execution result is wrong | ||
---|---|---|---|
Submitted: | 2 Apr 2021 8:02 | Modified: | 2 Apr 2021 15:32 |
Reporter: | Guo Wenxuan | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S2 (Serious) |
Version: | 8.0.23 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[2 Apr 2021 8:02]
Guo Wenxuan
[2 Apr 2021 9:13]
MySQL Verification Team
Thank you for the bug report.
[2 Apr 2021 15:32]
Roy Lyseng
This is not a bug. On first execution, the statement is automatically reprepared so that col1 is compared to an integer. On second execution, the parameter is interpreted as an integer, and "mysql" is then interpreted as zero. You can avoid this kind of anomaly by using consistent types for parameters when executing prepared statements.