duckdb / sqlite_scanner

DuckDB extension to read and write to SQLite databases
MIT License
189 stars 19 forks source link

sqlite_schema_entry.hpp:23:36: error: ‘duckdb::optional_ptr<duckdb::CatalogEntry> duckdb::SQLiteSchemaEntry::CreateIndex(duckdb::ClientContext&, duckdb::CreateIndexInfo&, duckdb::TableCatalogEntry&)’ marked ‘override’, but does not override #96

Closed ciupicri closed 1 month ago

ciupicri commented 1 month ago

What happens?

[ 72%] Built target sqlite_lib
[ 72%] Building CXX object extension/sqlite_scanner/src/storage/CMakeFiles/sqlite_ext_storage.dir/sqlite_catalog.cpp.o
In file included from /…/src/storage/sqlite_catalog.cpp:5:
/…/src/include/storage/sqlite_schema_entry.hpp:23:36: error: ‘duckdb::optional_ptr<duckdb::CatalogEntry> duckdb::SQLiteSchemaEntry::CreateIndex(duckdb::ClientContext&, duckdb::CreateIndexInfo&, duckdb::TableCatalogEntry&)’ marked ‘override’, but does not override
   23 |         optional_ptr<CatalogEntry> CreateIndex(ClientContext &context, CreateIndexInfo &info,
      |                                    ^~~~~~~~~~~
/…/src/include/storage/sqlite_schema_entry.hpp:35:14: error: ‘void duckdb::SQLiteSchemaEntry::Alter(duckdb::ClientContext&, duckdb::AlterInfo&)’ marked ‘override’, but does not override
   35 |         void Alter(ClientContext &context, AlterInfo &info) override;
      |              ^~~~~
In file included from /…/duckdb/src/include/duckdb/common/common.hpp:12,
                 from /…/duckdb/src/include/duckdb/catalog/catalog_entry.hpp:11,
                 from /…/duckdb/src/include/duckdb/catalog/catalog.hpp:11,
                 from /…/src/include/storage/sqlite_catalog.hpp:11,
                 from /…/src/storage/sqlite_catalog.cpp:1:
/…/duckdb/src/include/duckdb/common/helper.hpp: In instantiation of ‘typename duckdb::TemplatedUniqueIf<DATA_TYPE, true>::templated_unique_single_t duckdb::make_uniq(ARGS&& ...) [with DATA_TYPE = SQLiteSchemaEntry; ARGS = {SQLiteCatalog&, CreateSchemaInfo&}; typename TemplatedUniqueIf<DATA_TYPE, true>::templated_unique_single_t = unique_ptr<SQLiteSchemaEntry>]’:
/…/src/storage/sqlite_catalog.cpp:23:44:   required from here
   23 |         main_schema = make_uniq<SQLiteSchemaEntry>(*this, info);
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/…/duckdb/src/include/duckdb/common/helper.hpp:65:72: error: invalid new-expression of abstract class type ‘duckdb::SQLiteSchemaEntry’
   65 |     return unique_ptr<DATA_TYPE, std::default_delete<DATA_TYPE>, true>(new DATA_TYPE(std::forward<ARGS>(args)...));
      |                                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/…/src/include/storage/sqlite_schema_entry.hpp:16:7: note:   because the following virtual functions are pure within ‘duckdb::SQLiteSchemaEntry’:
   16 | class SQLiteSchemaEntry : public SchemaCatalogEntry {
      |       ^~~~~~~~~~~~~~~~~
In file included from /…/duckdb/src/include/duckdb/main/client_context.hpp:11,
                 from /…/duckdb/src/include/duckdb/main/relation.hpp:19,
                 from /…/duckdb/src/include/duckdb/main/connection.hpp:19,
                 from /…/duckdb/src/include/duckdb.hpp:11,
                 from /…/src/include/sqlite_utils.hpp:11,
                 from /…/src/include/sqlite_db.hpp:11,
                 from /…/src/include/storage/sqlite_catalog.hpp:13:
/…/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp:61:44: note:     ‘virtual duckdb::optional_ptr<duckdb::CatalogEntry> duckdb::SchemaCatalogEntry::CreateIndex(duckdb::CatalogTransaction, duckdb::CreateIndexInfo&, duckdb::TableCatalogEntry&)’
   61 |         virtual optional_ptr<CatalogEntry> CreateIndex(CatalogTransaction transaction, CreateIndexInfo &info,
      |                                            ^~~~~~~~~~~
/…/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp:95:22: note:     ‘virtual void duckdb::SchemaCatalogEntry::Alter(duckdb::CatalogTransaction, duckdb::AlterInfo&)’
   95 |         virtual void Alter(CatalogTransaction transaction, AlterInfo &info) = 0;
      |                      ^~~~~
gmake[3]: *** [extension/sqlite_scanner/src/storage/CMakeFiles/sqlite_ext_storage.dir/build.make:76: extension/sqlite_scanner/src/storage/CMakeFiles/sqlite_ext_storage.dir/sqlite_catalog.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:7955: extension/sqlite_scanner/src/storage/CMakeFiles/sqlite_ext_storage.dir/all] Error 2
gmake[1]: *** [Makefile:136: all] Error 2
gmake[1]: Leaving directory '/…/build/release'
make: *** [Makefile:73: release] Error 2

To Reproduce

Compile duckdb version 7ca1d378437718e86d9f2788e5b165bac532e63c with:

env BUILD_PYTHON=1 BUILD_ODBC=1 BUILD_HTTPFS=1 BUILD_AUTOCOMPLETE=1 BUILD_ICU=1 BUILD_FTS=1 BUILD_JSON=1 GEN=ninja make -j8

Clone sqlite_scanner version d355dd0b072653590e1d8c0d83501f4b20358694, symlink to the previous duckdb repository then compile with:

env BUILD_PYTHON=1 BUILD_ODBC=1 BUILD_HTTPFS=1 BUILD_AUTOCOMPLETE=1 BUILD_ICU=1 BUILD_FTS=1 BUILD_JSON=1 make

I'm using __gcc-c++-14.1.1-1.fc40.x86_64__

OS:

Linux x64 (Fedora 40)

SQLite Version:

3.45.1-2.fc40.x86_64

DuckDB Version:

7ca1d378437718e86d9f2788e5b165bac532e63c

DuckDB Client:

7ca1d378437718e86d9f2788e5b165bac532e63c

Full Name:

-

Affiliation:

-

Have you tried this on the latest main branch?

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

ciupicri commented 1 month ago

It seems to be fixed in duckdb version 1419336e2bc6a71860fb05220927f339375ea8f8 and sqlite_scanner version 50b7870be099186f195bc72bac5e9e11247ee2f9

carlopi commented 1 month ago

I'd say this is the same as https://github.com/duckdb/duckdb/issues/12212, basically not all pair DuckDB and sqlite are valid.

Two pairing that are guaranteed to work at a given moment in git history are:

carlopi commented 1 month ago

Thanks for raising, documentation / wording can be improved, but it's fundamentally not supported in general.