Bug #106241 BIT column serialized incorrectly for aggregate function
| Submitted: | 22 Jan 2022 0:37 | Modified: | 16 Aug 2022 21:23 |
|---|---|---|---|
| Reporter: | Bradley Grainger (OCA) | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: DML | Severity: | S2 (Serious) |
| Version: | 8.0.28 | OS: | Any |
| Assigned to: | CPU Architecture: | Any |
[22 Jan 2022 0:37]
Bradley Grainger
[22 Jan 2022 0:38]
Bradley Grainger
Packet capture with MySQL Server 8.0.28
Attachment: dump28.pcap (application/octet-stream, text), 1.64 KiB.
[22 Jan 2022 0:38]
Bradley Grainger
Packet capture with MySQL Server 8.0.27, to show previous behaviour
Attachment: dump27.pcap (application/octet-stream, text), 1.64 KiB.
[22 Jan 2022 0:39]
Bradley Grainger
Incorrect results shown in MySQL Workbench
Attachment: workbench.png (image/png, text), 12.91 KiB.
[22 Jan 2022 0:54]
Bradley Grainger
Here is the debug output from mysql --column-type-info MySQL 8.0.27 mysql> SELECT MAX(data) FROM bits; Field 1: `MAX(data)` Catalog: `def` Database: `` Table: `` Org_table: `` Type: BIT Collation: binary (63) Length: 32 Max_length: 1 Decimals: 0 Flags: UNSIGNED BINARY +----------------------+ | MAX(data) | +----------------------+ | 0x31 | +----------------------+ 1 row in set (0.00 sec) MySQL 8.0.28 mysql> SELECT MAX(data) FROM bits; Field 1: `MAX(data)` Catalog: `def` Database: `` Table: `` Org_table: `` Type: BIT Collation: binary (63) Length: 32 Max_length: 4 Decimals: 0 Flags: UNSIGNED BINARY +----------------------+ | MAX(data) | +----------------------+ | 0x00000001 | +----------------------+ 1 row in set (0.00 sec) You can see that the column type info is all the same, but the data itself has changed.
[22 Jan 2022 1:05]
Bradley Grainger
It's possible that this regression was introduced by the fix for bug #100859.
[22 Jan 2022 7:50]
MySQL Verification Team
Hello Bradley, Thank you for the report and test case. regards, Umesh
[16 Aug 2022 21:23]
Christine Cole
Posted by developer: Fixed as of the upcoming MySQL 8.0.31 release, and here's the proposed changelog entry from the documentation team: An aggregate query on a BIT field returned a value that was formatted as a bit string, but also had the BINARY flag added automatically. New validation now checks for and skips setting the BINARY flag for BIT results. Thank you for the bug report.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.042 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.