If a SQLite table is created in SQLite, and contains a single row with an integer primary key value of 0, that row cannot be seen via the DuckDB SQLite scanner. If the row contains only values < 0, DuckDB will hang trying to read the rows.
To Reproduce
Create database and table in SQLite
$ sqlite test.db
sqlite> CREATE TABLE tbl (a INTEGER PRIMARY KEY, b INTEGER);
sqlite> INSERT INTO tbl (a) VALUES (0);
Read from DuckDB
duckdb
D ATTACH 'test.db' (TYPE SQLITE);
D SELECT * FROM test.tbl;
- No rows will be returned.
- If any positive values (e.g. `1`) are present, all rows are returned
- If only negative values (e.g. `-1`) are present, the `SELECT` will hang
- If table is created in DuckDB, there is no problem (which database is used for inserts is irrelevant)
### OS:
Linux x64
### SQLite Version:
3.39.4, 3.40.1
### DuckDB Version:
0.7.1, v0.7.2-dev1138
### DuckDB Client:
CLI, Python
### Full Name:
David Reinharth
### Affiliation:
Amazon
### Have you tried this on the latest `master` branch?
- [X] I agree
### Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?
- [X] I agree
What happens?
If a SQLite table is created in SQLite, and contains a single row with an integer primary key value of
0
, that row cannot be seen via the DuckDB SQLite scanner. If the row contains only values < 0, DuckDB will hang trying to read the rows.To Reproduce
D ATTACH 'test.db' (TYPE SQLITE); D SELECT * FROM test.tbl;