SQLite Forum

Extra values outputted, with Partial Index and DISTINCT constraints applied
Login
For query:

```SQL
CREATE TABLE person ( pid INT) ;
CREATE UNIQUE INDEX idx ON person ( pid ) WHERE pid == 1;
INSERT INTO person VALUES (1), (10), (10);
SELECT DISTINCT pid FROM person;
SELECT DISTINCT pid FROM person where pid = 10;
```


The expected answer should be: 
1  10  (from the first SELECT)
10  (from the second SELECT) 

However, the actual output is: 
1  10  (from the first SELECT)
10 10 (from the second SELECT) 

An extra 10 is outputted from the second SELECT stmt, with the constraint DISTINCT being applied. 

Removing the CREATE UNIQUE INDEX statement seems to fix the problem.