/ View Ticket
Login
Ticket Hash: 41866dc37389d88f7f696669e91b10892d41fc24
Title: MIN() malfunctions for UNIQUE column
Status: Closed Type: Code_Defect
Severity: Critical Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2019-08-02 19:40:53
Version Found In: 3.29.0
User Comments:
mrigger added on 2019-08-02 16:11:33: (text/x-fossil-wiki)
Consider the following test case:

<pre>
CREATE TABLE t0(c0 UNIQUE, c1);
INSERT INTO t0(c0, c1) VALUES (NULL, 1);
SELECT MIN(t0.c0), t0.c1 FROM t0; -- expected: NULL | 1, actual: NULL | NULL
</pre>

Unexpectedly, a fabricated NULL value for the bare column c1 is returned. Removing the UNIQUE constraint on c0 does not trigger this bug. This also works as expected for other aggregate functions, such as MAX().

dan added on 2019-08-02 19:40:53: (text/x-fossil-wiki)
Fixed by [faaaae49].