1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-31 22:22:30 +03:00

Bug#50591 bit(31) causes Duplicate entry '1-NULL' for key 'group_key'

The problem is that during temporary table creation uneven bits
are not taken into account for hidden fields. It leads to incorrect
calculation&allocation of null bytes size for table record. And
if grouped value is null we set wrong bit for this value(see end_update()).
Fixed by adding separate calculation of uneven bit for hidden fields.
This commit is contained in:
Sergey Glukhov
2010-02-16 13:13:49 +04:00
parent 780566d4c5
commit d2bdeb8cc4
3 changed files with 43 additions and 2 deletions

View File

@@ -785,4 +785,19 @@ t1 CREATE TABLE `t1` (
KEY `a` (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
#
# Bug#50591 bit(31) causes Duplicate entry '1-NULL' for key 'group_key'
#
CREATE TABLE t1(a INT, b BIT(7) NOT NULL);
INSERT INTO t1 VALUES (NULL, 0),(NULL, 0);
SELECT SUM(a) FROM t1 GROUP BY b, a;
SUM(a)
NULL
DROP TABLE t1;
CREATE TABLE t1(a INT, b BIT(7) NOT NULL, c BIT(8) NOT NULL);
INSERT INTO t1 VALUES (NULL, 0, 0),(NULL, 0, 0);
SELECT SUM(a) FROM t1 GROUP BY c, b, a;
SUM(a)
NULL
DROP TABLE t1;
End of 5.1 tests