Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
grammaright committed Apr 17, 2024
1 parent 314fc52 commit e959880
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/array_extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ namespace duckdb

void ArrayExtension::Load(DuckDB &db)
{
std::cerr << "ArrayExtension::BF_Init()" << std::endl;

BF_Init();
BF_Attach();

std::cerr << "define funtions" << std::endl;

// BF_Detach();
// BF_Free();
// LoadInternal(*db.instance);
Expand All @@ -36,10 +40,12 @@ namespace duckdb
// auto copy_function = ArrayExtension::GetCopyFunction();
auto res = ArrayExtension::GetCopyFunction();

std::cerr << "Registering functions" << std::endl;

ExtensionUtil::RegisterFunction(*db.instance, table_function);
ExtensionUtil::RegisterFunction(*db.instance, res);

std::cout << "ArrayExtension::Load()" << std::endl;
std::cerr << "ArrayExtension::Load()" << std::endl;
}
std::string ArrayExtension::Name()
{
Expand All @@ -51,17 +57,17 @@ namespace duckdb

extern "C"
{
DUCKDB_EXTENSION_API void quack_init(duckdb::DatabaseInstance &db)
DUCKDB_EXTENSION_API void array_init(duckdb::DatabaseInstance &db)
{
std::cout << "quack_init()" << std::endl;
std::cout << "array_init()" << std::endl;

duckdb::DuckDB db_wrapper(db);
db_wrapper.LoadExtension<duckdb::ArrayExtension>();
}

DUCKDB_EXTENSION_API const char *quack_version()
DUCKDB_EXTENSION_API const char *array_version()
{
std::cout << "quack_version()" << std::endl;
std::cout << "array_version()" << std::endl;
return duckdb::DuckDB::LibraryVersion();
}
}
Expand Down
1 change: 1 addition & 0 deletions src/copy_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ namespace duckdb

void unpin()
{
BF_TouchBuf(key);
BF_UnpinBuf(key);
delete arrname_char;
}
Expand Down

0 comments on commit e959880

Please sign in to comment.