System.Data.SQLite
View Ticket
Not logged in
Ticket UUID: 50774d9ef9bdf66e0037293a82adb1ca9e9a71e6
Title: Select with in-criteria produces duplicate results
Status: Closed Type: Code_Defect
Severity: Important Priority: Medium
Subsystem: Native_Assembly Resolution: External_Bug
Last Modified: 2017-04-24 15:39:29
Version Found In: 1.0.105.0
User Comments:
anonymous added on 2017-04-22 16:18:31:
I have a simple table:
CREATE TABLE Category (
    Id   INTEGER       PRIMARY KEY
                       NOT NULL,
    Name VARCHAR (255) NOT NULL
);

with 2 entries:
Id    Name
1     C3
2     C4

The following statement:
SELECT Id FROM Category WHERE ID IN (1,2,1,2)

produces 3 (!) rows: 1,2,2

Here is my code:

var connection = new SQLiteConnection("Data Source=C:\\TestDb.db3");
connection.Open();
using (SQLiteCommand command = new SQLiteCommand("SELECT Id FROM Category WHERE ID IN (1,2,1,2)", connection))
{

  var reader = command.ExecuteReader();
  while (reader.Read())
  {
    int id = reader.GetInt32(0);

  }
}

In version 1.0.103.0, it returned only 2 rows

mistachkin added on 2017-04-24 15:39:29:
Fixed upstream, per ticket [https://sqlite.org/src/info/61fe9745].