Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
10.11.5
-
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
Description
I just tried to update from 10.11.4 to 10.11.5 today. Only hours later did we notice this major, peculiar bug:
CREATE TABLE at (
|
account_id bigint(20) unsigned NOT NULL auto_increment,
|
max_legs smallint NOT NULL default -1,
|
PRIMARY KEY account_id (account_id)
|
) ENGINE=innodb DEFAULT CHARSET=utf8mb4;
|
|
CREATE TABLE conf (
|
conf_id bigint(20) unsigned NOT NULL auto_increment,
|
master_id bigint(20) unsigned NOT NULL DEFAULT 0,
|
legs_current smallint unsigned NOT NULL DEFAULT 0,
|
PRIMARY KEY (conf_id),
|
KEY master_id (master_id)
|
) ENGINE=Innodb DEFAULT CHARSET=utf8mb4;
|
|
INSERT INTO at VALUES(NULL, -1);
|
|
10.11.4:
|
SELECT at.max_legs, SUM(conf.legs_current) AS legs
|
FROM conf
|
INNER JOIN at ON conf.master_id = at.account_id
|
WHERE conf.master_id=1;
|
+----------+------+
|
| max_legs | legs |
|
+----------+------+
|
| -1 | NULL |
|
+----------+------+
|
1 row in set (0.000 sec)
|
|
10.11.5
|
SELECT at.max_legs, SUM(conf.legs_current) AS legs
|
FROM conf
|
INNER JOIN at ON conf.master_id = at.account_id
|
WHERE conf.master_id=1;
|
+----------+------+
|
| max_legs | legs |
|
+----------+------+
|
| NULL | NULL |
|
+----------+------+
|
1 row in set (0.001 sec)
|
The important thing to understand is that the conf table has no entries in it (thus the NULL legs count). It still used to always return the max_legs value from the at table. Now it seems like the INNER JOIN completely fails and returns nothing. This is a breaking change one would never expect in a minor version update. Therefore it is a bug.
Attachments
Issue Links
- is caused by
-
MDEV-6768 Wrong result with aggregate with join with no result set
- Closed