Bug #116765 | Incorrect Operator Precedence of BETWEEN and Comparators in MySQL 8.4 | ||
---|---|---|---|
Submitted: | 25 Nov 2024 2:18 | Modified: | 25 Nov 2024 11:23 |
Reporter: | Team QueryHouse | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 8.0 | OS: | Any (22.04) |
Assigned to: | CPU Architecture: | Any | |
Tags: | between, comparison, operator precedence |
[25 Nov 2024 2:18]
Team QueryHouse
[25 Nov 2024 11:23]
MySQL Verification Team
HI Team QueryHouse, Thank you for your bug report. We have managed to reproduce your findings : mysql> SELECT c0, (c0 BETWEEN 15 AND c0 <= 0) FROM t0; +------+-----------------------------+ | c0 | (c0 BETWEEN 15 AND c0 <= 0) | +------+-----------------------------+ | 1 | 1 | | 5 | 1 | | 15 | 0 | | 20 | 0 | +------+-----------------------------+ 4 rows in set (0.00 sec) mysql> SELECT c0, c0 BETWEEN 15 AND c0 <= 0 FROM t0; +------+---------------------------+ | c0 | c0 BETWEEN 15 AND c0 <= 0 | +------+---------------------------+ | 1 | 1 | | 5 | 1 | | 15 | 0 | | 20 | 0 | +------+---------------------------+ 4 rows in set (0.00 sec) We agree that this goes against our own documentation and SQL Standard. This is now a verified bug for version 8.0 and all higher versions.