Bug #116163 | COALESCE(BIT), IF(BIT) return a wrong result | ||
---|---|---|---|
Submitted: | 19 Sep 14:08 | Modified: | 19 Sep 14:50 |
Reporter: | Guilhem Bichot | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S2 (Serious) |
Version: | 9.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[19 Sep 14:08]
Guilhem Bichot
[19 Sep 14:31]
MySQL Verification Team
Hello Guilhem, Thank you for the report and test case. regards, Umesh
[19 Sep 14:50]
Guilhem Bichot
IF() is also affected, if using a BIT(32) column (observed no problem with BIT(8)). Example: CREATE TABLE t1 (c0 bit(32)); insert into t1 values(0x00AABBCC); select hex(c0), c0, coalesce(c0), coalesce(c0,c0), ifnull(c0,c0), if(1=1,c0,c0) from t1; +---------+------------+----------------------------+----------------------------------+------------------------------+------------------------------+ | hex(c0) | c0 | coalesce(c0) | coalesce(c0,c0) | ifnull(c0,c0) | if(1=1,c0,c0) | +---------+------------+----------------------------+----------------------------------+------------------------------+------------------------------+ | AABBCC | 0x00AABBCC | 0x3131313839313936 | 0x3131313839313936 | 0x3131313839313936 | 0x00C2AAC2BBC38C | +---------+------------+----------------------------+----------------------------------+------------------------------+------------------------------+ The last column, IF(), should return the value of c0 but it does not (and it's differently from wrong from the wrong value of COALESCE).