duckdb / sqlite_scanner

DuckDB extension to read and write to SQLite databases

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failure to attach when SQLite tables are created without ROWID

sjaenick opened this issue · comments

What happens?

A SQLite DB file cannot be attached if it contains tables created without a row id.

To Reproduce

$ sqlite3 sqlite.db
SQLite version 3.40.0 2022-11-12 17:17:01
Enter ".help" for usage hints.
sqlite> create table tablename (id integer primary key) without rowid;
sqlite> insert into tablename values (1);
sqlite> .quit
$ ./build/release/duckdb -unsigned
v0.7.1-dev126 d34bcaf40b
Enter ".help" for usage hints.
D LOAD 'build/release/extension/sqlite_scanner/sqlite_scanner.duckdb_extension';
D CALL sqlite_attach('sqlite.db');
Error: Invalid Error: Failed to prepare query "SELECT MAX(ROWID) FROM "tablename"": no such column: ROWID

OS:

Linux

SQLite Version:

3.40.0

DuckDB Version:

v0.7.1-dev126 d34bcaf40b

DuckDB Client:

CLI

Full Name:

Sebastian Jaenicke

Affiliation:

Have you tried this on the latest master branch?

  • 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?

  • I agree
commented

Thanks for the report - should be fixed by #34