Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
34f4099
Port AliSQL DuckDB engine basics to MariaDB part 2
drrtuy Feb 22, 2026
2416e4d
fix(dml,duckdb): Set table->write_set bitmap in rnd_next to convert t…
drrtuy Feb 22, 2026
31e62e9
feat(dml): direct UPDATE and DELETE support
drrtuy Feb 28, 2026
ac02354
feat(duckdb): migrate DuckDB-specific variables.
drrtuy Feb 28, 2026
a25bbd2
feat(DDL): Various DDL fixes, e.g. RENAME TABLE and ALTER TABLE engin…
drrtuy Mar 1, 2026
8e4316e
fix(dml): various type-related fixes for batch processing + initial M…
drrtuy Mar 1, 2026
fedcf04
fix(ddl): various ALTER fixes for duckdb.
drrtuy Mar 7, 2026
7757681
chore(mtr): disable.def to streamline MTR tests verification.
drrtuy Mar 7, 2026
c6fa229
chore(duckdb): use upstream DuckDB 1.2.1
drrtuy Mar 7, 2026
732e2c9
feat(duckdb): switch to upstream DuckDB 1.2.1.
drrtuy Mar 8, 2026
77834dc
fix(duckdb): LENGTH() over VARCHAR canonical name is strlen that brea…
drrtuy Mar 8, 2026
8064f34
chore(duckdb): update to upstream duckdb 1.3.2.
drrtuy Mar 14, 2026
07e0c43
chore(packaging): initial version of DEB and RPM packaging for DuckDB…
drrtuy Mar 14, 2026
e4b5892
chore(duckdb): use duckdb fork with patches applied.
drrtuy Mar 15, 2026
ea9d564
chore(duckdb): Add drrtuy/duckdb (mdb-v.1.3.2) as nested submodule
drrtuy Mar 15, 2026
9a84811
chore(build): fix paths to server modules.
drrtuy Mar 15, 2026
b4a85a5
fix(): use original query b/c query printer does not use DuckDB-suppo…
drrtuy Mar 16, 2026
c57f845
chore(deb): deb packaging utilities.
drrtuy Mar 17, 2026
e72782c
fix(): a number of review fixes.
drrtuy Mar 18, 2026
a893a05
chore(): remove dead yet code.
drrtuy Mar 19, 2026
bbb54a5
chore(): MariaDB Foundation copyright stanza.
drrtuy Mar 19, 2026
ea26665
chore(license): add extra GPL v2 license text.
drrtuy Mar 25, 2026
a2e5582
chore(): README
drrtuy Mar 27, 2026
641743a
chore(license): add extra GPL v2 license text.
drrtuy Mar 25, 2026
9858982
feat(collations): support collate stanzas for CREATE TABLE.
drrtuy Mar 26, 2026
0806d8f
feat(collations): fixes for collations tests.
drrtuy Mar 27, 2026
1cf07f1
fix(test): fixes 1 hour off issue caused by DST and a number of colla…
drrtuy Mar 29, 2026
ccb2345
feat(CEJ): in-memory CEJ algo.
drrtuy Apr 1, 2026
b0c0751
feat(): UNION SELECT_LEX pushdown.
drrtuy Apr 1, 2026
4f8f129
fix(ddl,tests): specialize CREATE TABLE error.
drrtuy Apr 1, 2026
9039d53
chore(): use upstream DuckDB.
drrtuy Apr 1, 2026
7f16343
feat(cte): r-/CTE with CEJ support.
drrtuy Apr 1, 2026
97a3ad6
chore(): compilation fixes for MDB 11.4
drrtuy Apr 3, 2026
92a1304
chore(mtr): use deterministic charset in tests.
drrtuy Apr 3, 2026
c6e35b3
fix(mtr): MTR passes with CS MDB 11.4
drrtuy Apr 3, 2026
3877bc1
chore(mtr): take default utf8mb4 collation difference difference b/w …
drrtuy Apr 4, 2026
489fb8b
chore(build): add -Werror option.
drrtuy Apr 4, 2026
0c1ac40
chore(): various compilation warnings fixes.
drrtuy Apr 4, 2026
93cd438
chore(build): ninja build error fix.
drrtuy Apr 4, 2026
dccccef
chore(build): Debug build fixes.
drrtuy Apr 4, 2026
2169034
chore(deb): packaging fixes.
drrtuy Apr 5, 2026
37ea03d
cleaner build output
LaGrunge Apr 5, 2026
752ace6
run_mtr.sh: MTR runnner
LaGrunge Apr 5, 2026
0ee00ee
fix(mtr): make 11 tests extern compatible
LaGrunge Apr 5, 2026
0326139
fix(run_mtr.sh): fix noextern mode
LaGrunge Apr 5, 2026
f9abca2
feat(tests): fuzzy search for menu
LaGrunge Apr 5, 2026
db8f551
fix(mtr): disabled warnings and fixed timezone in two MTR tests.
drrtuy Apr 8, 2026
20e646a
fix(mtr): add missing test includes and fix charset for disabled tests
LaGrunge Apr 14, 2026
2733543
feat(errors): add DuckDB-specific error codes with codegen
LaGrunge Apr 14, 2026
42e99f3
fix(mtr): enable truncate_and_maintenance and duckdb_set_operation tests
LaGrunge Apr 14, 2026
8f5792b
fix(mtr): enable duckdb_monitor test
LaGrunge Apr 14, 2026
c43c4eb
fix(monitor): count rows in direct_delete/update, adapt monitor test
LaGrunge Apr 14, 2026
8690e5f
fix(mtr): enable duckdb_db_table_strconvert test
LaGrunge Apr 14, 2026
ff83c84
Merge pull request #2 from drrtuy/better1
drrtuy Apr 14, 2026
41959e6
Initial Claude.md
LaGrunge Apr 14, 2026
cbd59be
fix(build): adapt to MariaDB 11.4 API changes
LaGrunge Apr 14, 2026
52f8320
Revert "fix(build): adapt to MariaDB 11.4 API changes"
drrtuy Apr 15, 2026
ebb6d68
chore(build): fix custom command target dependencies.
drrtuy Apr 15, 2026
83b43c3
chore(mtr): added an explicit database to the tests so that MDB does …
drrtuy Apr 15, 2026
2c8b969
chore(): README path update and conf file development leftovers cleanup.
drrtuy Apr 19, 2026
c928b6c
docs: add detailed analysis and work plan for 31 disabled tests
LaGrunge Apr 14, 2026
4fbda0b
fix(errors): use ER_DUCKDB_TABLE_STRUCT_INVALID for ALTER structural
LaGrunge Apr 14, 2026
ac238c9
fix(mtr): update rename_duckdb_table result for new error codes
LaGrunge Apr 14, 2026
de56472
docs: update disabled tests plan — 17/47 enabled, item 3 done
LaGrunge Apr 14, 2026
b6b1066
fix(ddl): reject ALTER TABLE on tables without PK when require_primar…
LaGrunge Apr 14, 2026
1a2db4f
fix(mtr): enable create_table_constraint test
LaGrunge Apr 14, 2026
5388866
fix(mtr): add test cleanup to restore database charset after tests
LaGrunge Apr 14, 2026
96de594
docs: update plan — 19/47 enabled, add DuckDB upstream upgrade item
LaGrunge Apr 14, 2026
07e708d
feat(upstream): upgrade DuckDB submodule v1.3.2 → v1.5.2
LaGrunge Apr 14, 2026
c7f1c9b
docs: update plan — DuckDB v1.5.2 done, add compound ALTER regression
LaGrunge Apr 14, 2026
1761f62
fix(ddl): execute compound ALTER operations separately for DuckDB v1.5
LaGrunge Apr 14, 2026
667999f
fix(config): propagate appender_allocator_flush_threshold to DuckDB v1.5
LaGrunge Apr 14, 2026
1a65c21
feat(pushdown): add MariaDB SQL compatibility macros and WITH ROLLUP …
LaGrunge Apr 14, 2026
3b080be
feat(pushdown): add more MariaDB SQL compatibility macros
LaGrunge Apr 14, 2026
e65f2ee
fix(decimal): map DECIMAL(>38) to DOUBLE, default use_double_for_deci…
LaGrunge Apr 14, 2026
1cbee60
fix(mtr): add have_duckdb.inc and max_allowed_packet to feature_duckd…
LaGrunge Apr 14, 2026
0158ce8
feat(udf): register native DuckDB scalar function overloads for Maria…
LaGrunge Apr 14, 2026
af85291
feat(compat): improve bin/oct for string args, add hex(numeric), loca…
LaGrunge Apr 14, 2026
33cff77
feat(compat): port full hex/oct/bin from AliSQL, add locate C++ UDF
LaGrunge Apr 14, 2026
d1973fb
feat(compat): add mid() UDF, CONVERT→CAST rewrite in pushdown
LaGrunge Apr 14, 2026
872b6d9
feat(pushdown): add CROSS JOIN, REGEXP, NOT REGEXP rewrites + mid UDF
LaGrunge Apr 14, 2026
529c890
feat(compat): implement regexp_instr, regexp_replace, regexp_substr,
LaGrunge Apr 14, 2026
15fd9e2
feat(compat): add strcmp, substring_index, to_base64 macros, RLIKE
LaGrunge Apr 14, 2026
a6649b1
feat(compat): override length(VARCHAR) and ascii(VARCHAR) for MariaDB
LaGrunge Apr 14, 2026
4725234
feat(compat): addtime/subtime C++ UDFs, convert_tz macro, LIMIT and
LaGrunge Apr 14, 2026
cdca05b
feat(compat): curdate/curtime macros, STRAIGHT_JOIN/index hints/LIMIT
LaGrunge Apr 14, 2026
cadef8b
feat(compat): CURRENT_TIME(N)/CURRENT_DATE()/CURRENT_TIMESTAMP() rewr…
LaGrunge Apr 14, 2026
4078135
fix(rebase issues): Some tests are broken now, a big thanx
LaGrunge Apr 16, 2026
26bbf60
fix(mtr): trim couple tests to pass on U24.04.
drrtuy Apr 21, 2026
55a6ac2
chore(build): install build dependencies in build.sh.
drrtuy Apr 21, 2026
a174928
chore(): docs updates based on the recent changes.
drrtuy Apr 21, 2026
433ae89
fix(build): now DuckDB core extensions are statically linked instead …
drrtuy May 4, 2026
4928b46
fix(pushdown): skip-list of all escaped strings to avoid SQL expressi…
drrtuy May 13, 2026
19b7c8b
fix(pushdown): fix for STRAIGHT_JOIN, various JOIN re-write cases and…
drrtuy May 13, 2026
bf703f9
chore(build) preparation for code refactoring.
drrtuy May 24, 2026
a541453
chore(build): refactor code breaking it into separate modules.
drrtuy May 24, 2026
ca6a30e
feat(runtime): fiber runtime based on ASM borrowed from libmariadb + …
drrtuy May 25, 2026
15fd76b
feat(cej): MDB tables scan now uses mysql_execute_command to to lever…
drrtuy May 26, 2026
2b59dea
fix(cej): WHERE predicate now does not contain alias or table name in…
drrtuy May 27, 2026
e663297
fix(cej): escape column names, remove bin objects from the repo, add …
drrtuy Jun 1, 2026
eff6113
chore(test): fix flacky cross_join_where test.
drrtuy Jun 2, 2026
fc00787
chore(): avoid compilation error for the fiber test TU.
drrtuy Jun 4, 2026
1639aeb
fix(build):thread local maps with default TLS model got broken with M…
drrtuy Jun 4, 2026
612480e
chore(): update documentation.
drrtuy Jun 5, 2026
fe39d73
Merge https://github.com/drrtuy/duckdb-engine into 11.4
vuvova Jun 6, 2026
ac9ae6a
Merge https://github.com/mariadb/duckdb-engine into 11.4
vuvova Jun 6, 2026
a699575
add submodule, most-merge fixes
vuvova Jun 6, 2026
2b941ae
don't modify server's error messages
vuvova Jun 7, 2026
2be1c96
Expose static symbols leveraged in DuckDB to stringify WHERE conditio…
drrtuy Jun 2, 2026
a9dd99f
improve ExternalProject
vuvova Jun 7, 2026
d010dca
class != struct
vuvova Jun 7, 2026
36ba420
correct duckdb engine maturity for a first release
vuvova Jun 7, 2026
71cafa8
duckdb-engine rpm/deb fixes
vuvova Jun 7, 2026
cc40fe5
change duckdb_query_udf to run_in_duckdb function plugin
vuvova Jun 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ sql/yy_mariadb.yy
sql/yy_oracle.cc
sql/yy_oracle.hh
sql/yy_oracle.yy
storage/duckdb/duckdb-build
storage/heap/hp_test1
storage/heap/hp_test2
storage/maria/aria_chk
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@
[submodule "storage/columnstore/columnstore"]
path = storage/columnstore/columnstore
url = https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
[submodule "storage/duckdb/third_parties/duckdb"]
path = storage/duckdb/third_parties/duckdb
url = https://github.com/duckdb/duckdb.git
1 change: 0 additions & 1 deletion cmake/cpack_rpm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ INCLUDE(check_linker_flag)
SET(CPACK_GENERATOR "RPM")
SET(CPACK_RPM_PACKAGE_DEBUG 1)
SET(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)

SET(CPACK_RPM_COMPONENT_INSTALL ON)

Expand Down
6 changes: 6 additions & 0 deletions debian/autobake-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ then
fi
fi

# Enable DuckDB storage engine plugin packaging
if grep -q "$architecture" storage/duckdb/debian/control
then
cat storage/duckdb/debian/mariadb-plugin-duckdb.install >> debian/mariadb-server.install
fi
Comment thread
vuvova marked this conversation as resolved.
Comment thread
vuvova marked this conversation as resolved.

if [ -n "${AUTOBAKE_PREP_CONTROL_RULES_ONLY:-}" ]
then
exit 0
Expand Down
30 changes: 15 additions & 15 deletions sql/sql_select.cc
Original file line number Diff line number Diff line change
Expand Up @@ -254,19 +254,19 @@ static int join_ft_read_first(JOIN_TAB *tab);
static int join_ft_read_next(READ_RECORD *info);
int join_read_always_key_or_null(JOIN_TAB *tab);
int join_read_next_same_or_null(READ_RECORD *info);
static COND *make_cond_for_table(THD *thd, Item *cond,table_map table,
table_map used_table,
int join_tab_idx_arg,
bool exclude_expensive_cond,
bool retain_ref_cond);
static COND *make_cond_for_table_from_pred(THD *thd, Item *root_cond,
Item *cond,
table_map tables,
table_map used_table,
int join_tab_idx_arg,
bool exclude_expensive_cond,
bool retain_ref_cond,
bool is_top_and_level);
COND *make_cond_for_table(THD *thd, Item *cond,table_map table,
table_map used_table,
int join_tab_idx_arg,
bool exclude_expensive_cond,
bool retain_ref_cond);
COND *make_cond_for_table_from_pred(THD *thd, Item *root_cond,
Item *cond,
table_map tables,
table_map used_table,
int join_tab_idx_arg,
bool exclude_expensive_cond,
bool retain_ref_cond,
bool is_top_and_level);

static Item* part_of_refkey(TABLE *form,Field *field);
static bool test_if_cheaper_ordering(bool in_join_optimizer,
Expand Down Expand Up @@ -26377,7 +26377,7 @@ bool test_if_ref(Item *root_cond, Item_field *left_item,Item *right_item)
make_cond_for_info_schema() uses similar algorithm as well.
*/

static Item *
Item *
make_cond_for_table(THD *thd, Item *cond, table_map tables,
table_map used_table,
int join_tab_idx_arg,
Expand All @@ -26391,7 +26391,7 @@ make_cond_for_table(THD *thd, Item *cond, table_map tables,
}


static Item *
Item *
make_cond_for_table_from_pred(THD *thd, Item *root_cond, Item *cond,
table_map tables, table_map used_table,
int join_tab_idx_arg,
Expand Down
14 changes: 14 additions & 0 deletions sql/sql_select.h
Original file line number Diff line number Diff line change
Expand Up @@ -2285,6 +2285,20 @@ void free_underlaid_joins(THD *thd, SELECT_LEX *select);
bool mysql_explain_union(THD *thd, SELECT_LEX_UNIT *unit,
select_result *result);

COND *make_cond_for_table(THD *thd, Item *cond, table_map tables,
table_map used_table,
int join_tab_idx_arg,
bool exclude_expensive_cond,
bool retain_ref_cond);
COND *make_cond_for_table_from_pred(THD *thd, Item *root_cond,
Item *cond,
table_map tables,
table_map used_table,
int join_tab_idx_arg,
bool exclude_expensive_cond,
bool retain_ref_cond,
bool is_top_and_level);

/*
General routine to change field->ptr of a NULL-terminated array of Field
objects. Useful when needed to call val_int, val_str or similar and the
Expand Down
77 changes: 77 additions & 0 deletions storage/duckdb/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## What This Is

DuckDB storage engine plugin for MariaDB. Creates tables with `ENGINE=DuckDB` that store data in DuckDB's columnar format and execute analytical queries through DuckDB's vectorized engine. Lives under `storage/duckdb/` in the MariaDB server tree.

## Build

```bash
# Build + install + start MariaDB (most common during development)
./build.sh -S -t Debug

# CI mode (build only, no install)
./build.sh -c -t Debug

# Build with packages
./build.sh -p -t RelWithDebInfo
```

The build directory is created as a sibling: `../DuckdbBuildOf_<source_dir_name>/`. DuckDB itself is built from source at `third_parties/duckdb/` via `ExternalProject_Add` and merged into a single `libduckdb_bundle.a`.

## Tests (MTR)

Tests use MariaDB's MTR (MySQL Test Runner) framework. Test files live in `mysql-test/duckdb/t/` with expected results in `mysql-test/duckdb/r/`.

```bash
# Run a single test
./run_mtr.sh create_table_column

# Run and record new expected output
./run_mtr.sh -r create_table_column

# Run all tests
./run_mtr.sh -a

# Run against an externally running MariaDB
./run_mtr.sh -e create_table_column

# Run all against extern server
./run_mtr.sh -a -e
```

## Architecture

All engine code is in the `myduck` namespace (except `ha_duckdb` which is in global scope per MariaDB handler convention).

### Key components

- **`ha_duckdb`** (`ha_duckdb.cc/h`) — MariaDB `handler` subclass. Entry point for all storage engine operations (open, close, read, write, DDL). Implements row-at-a-time interface for MariaDB, translating to DuckDB batch operations.

- **`DuckdbManager`** (`duckdb_manager.cc/h`) — Singleton owning the `duckdb::DuckDB` instance. Created once at plugin init, creates connections for each thread. Database file stored as `duckdb.db` in MariaDB data directory.

- **`DuckdbThdContext`** (`duckdb_context.cc/h`) — Per-thread context holding a `duckdb::Connection`, transaction state, and appenders. Attached to MariaDB's THD. Manages BEGIN/COMMIT/ROLLBACK lifecycle and session variable propagation (timezone, optimizer flags, collation).

- **DDL/DML Convertors** (`ddl_convertor.cc/h`, `dml_convertor.cc/h`) — Translate MariaDB SQL structures (TABLE, Field, Alter_info) into DuckDB-compatible SQL strings. Handle identifier quoting differences (MariaDB backticks → DuckDB double quotes) and type mapping.

- **`DeltaAppender`** (`delta_appender.cc/h`) — Batched write path. Accumulates INSERT/UPDATE/DELETE rows using DuckDB's Appender API into a temporary buffer table, then flushes as a single DuckDB DML statement at commit time. `DeltaAppenders` manages per-table appender instances.

- **Select handler / Query pushdown** (`ha_duckdb_pushdown.cc/h`) — Implements MariaDB's `select_handler` interface to push entire SELECT queries down to DuckDB. Registered via `hton->create_select` and `hton->create_unit`. Supports pure-DuckDB queries and cross-engine joins.

- **Cross-engine scan** (`cross_engine_scan.cc/h`) — Enables DuckDB to read from non-DuckDB tables (e.g. InnoDB) during cross-engine joins. Registers a `_mdb_scan` table function and a replacement scan callback in DuckDB. Uses a thread-local registry of external tables.

- **Type mapping** (`duckdb_types.cc/h`) — Converts between MariaDB field types and DuckDB types. `store_duckdb_field_in_mysql_format()` reads DuckDB values back into MariaDB row format.

### SQL generation conventions

All generated SQL must use **double quotes** for identifiers (DuckDB follows SQL standard), not backticks. The `SELECT_LEX::print()` output from MariaDB uses backticks and must be post-processed. See `docs/mariadb-duckdb-incompatibilities.md` for known function name rewrites and type mapping issues.

### DuckDB source and patches

DuckDB source is at `third_parties/duckdb/` (git submodule). No patches are applied — all compatibility is handled at runtime via `duckdb_mysql_compat.cc`. The build produces a static library; `_GLIBCXX_DEBUG` is explicitly undefined in CMakeLists.txt to avoid ABI mismatch with MariaDB's debug build.

### Configuration

`duckdb.cnf` — MariaDB config snippet that loads `ha_duckdb.so`. Installed to `/etc/my.cnf.d/`.
66 changes: 66 additions & 0 deletions storage/duckdb/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
IF("NO" STREQUAL "${PLUGIN_DUCKDB}")
return()
ENDIF()
Comment thread
vuvova marked this conversation as resolved.
Comment thread
vuvova marked this conversation as resolved.

IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
MESSAGE_ONCE(duckdb "DuckDB: not Linux, skipping")
return()
ENDIF()

IF(NOT (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR
CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64"))
MESSAGE_ONCE(duckdb "DuckDB: not x86_64 or aarch64, skipping")
return()
ENDIF()
Comment thread
vuvova marked this conversation as resolved.

# Check C++17 compiler support
MY_CHECK_CXX_COMPILER_FLAG("-std=c++17")
IF(NOT have_CXX__std_c__17)
MESSAGE_ONCE(duckdb "DuckDB: C++ compiler does not support -std=c++17, skipping")
RETURN()
ENDIF()

# libduckdb_bundle.a is built without debug STL wrappers.
# Mismatched _GLIBCXX_DEBUG changes sizeof(std::vector) → SIGSEGV.
SET(CMAKE_CXX_FLAGS_DEBUG
"${CMAKE_CXX_FLAGS_DEBUG} -U_GLIBCXX_DEBUG -U_GLIBCXX_ASSERTIONS")

INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/duckdb.cmake)
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/duckdb_target_setup.cmake)

# Provide MariaDB server include paths to sub-libraries.
# MYSQL_ADD_PLUGIN normally does this, but it runs after ADD_SUBDIRECTORY.
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/sql
${CMAKE_BINARY_DIR}/include
${PCRE_INCLUDE_DIRS}
${SSL_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS})

# Build sub-libraries.
ADD_SUBDIRECTORY(common)
ADD_SUBDIRECTORY(convertor)
ADD_SUBDIRECTORY(runtime)

# Plugin sources (handler layer + UDFs whose extern "C" symbols must be
# in the final .so for dlsym() loading).
SET(DUCKDB_PLUGIN_SOURCES
ha_duckdb.cc
ha_duckdb_pushdown.cc
duckdb_udf.cc
)

MYSQL_ADD_PLUGIN(duckdb ${DUCKDB_PLUGIN_SOURCES}
STORAGE_ENGINE
MODULE_ONLY
LINK_LIBRARIES duckdb_runtime duckdb_convertor duckdb_common ${DUCKDB_LIBRARY}
)

IF(TARGET duckdb)
duckdb_setup_target(duckdb)
TARGET_INCLUDE_DIRECTORIES(duckdb PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/common
${CMAKE_CURRENT_SOURCE_DIR}/convertor
${CMAKE_CURRENT_SOURCE_DIR}/runtime
)
ENDIF()
Loading