Skip to content
/ server Public
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
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/duckdb"]
path = storage/duckdb/duckdb
url = git@github.com:drrtuy/duckdb-engine.git
15 changes: 15 additions & 0 deletions debian/autobake-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,21 @@ then
fi
fi

# DuckDB is explicitly disabled in the native Debian build. Enable it
# now when build is triggered by autobake-deb.sh (MariaDB.org) and when the
# build is not running on Gitlab-CI.
if [[ ! $GITLAB_CI ]] && [[ -d storage/duckdb/duckdb/debian ]]
then
sed '/-DPLUGIN_DUCKDB=NO/d' -i debian/rules
# Take the files and part of control from DuckDB directory
if [[ ! -f debian/mariadb-plugin-duckdb.install ]]
then
cp -v storage/duckdb/duckdb/debian/mariadb-plugin-duckdb.* debian/
echo >> debian/control
cat storage/duckdb/duckdb/debian/control >> debian/control
fi
fi

if [ -n "${AUTOBAKE_PREP_CONTROL_RULES_ONLY:-}" ]
then
exit 0
Expand Down
11 changes: 11 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -1414,3 +1414,14 @@ Description: MariaDB database regression test suite - data files
ease of use.
.
This package has the architecture independent data files for the test suite.

Package: mariadb-plugin-duckdb
Architecture: amd64 arm64
Depends:
mariadb-server (= ${server:Version}),
${misc:Depends},
${shlibs:Depends},
Description: DuckDB storage engine for MariaDB server
The DuckDB storage engine embeds DuckDB as an analytical engine inside
MariaDB server, enabling OLAP queries on DuckDB-managed tables.
This package contains the DuckDB plugin for MariaDB server.
4 changes: 4 additions & 0 deletions debian/mariadb-plugin-duckdb.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
etc/mysql/mariadb.conf.d/duckdb.cnf
usr/lib/mysql/plugin/ha_duckdb.so
usr/share/mariadb/duckdb/install.sql
usr/share/mariadb/duckdb/uninstall.sql
9 changes: 9 additions & 0 deletions debian/mariadb-plugin-duckdb.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -e

if mariadb-admin ping --silent 2>/dev/null; then
mariadb < /usr/share/mariadb/duckdb/install.sql || true
fi

#DEBHELPER#
9 changes: 9 additions & 0 deletions debian/mariadb-plugin-duckdb.prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -e

if mariadb-admin ping --silent 2>/dev/null; then
mariadb < /usr/share/mariadb/duckdb/uninstall.sql || true
fi

#DEBHELPER#
1 change: 1 addition & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ endif
-DCONC_DEFAULT_CHARSET=utf8mb4 \
-DPLUGIN_AWS_KEY_MANAGEMENT=NO \
-DPLUGIN_COLUMNSTORE=NO \
-DPLUGIN_DUCKDB=NO \
-DIGNORE_AIO_CHECK=ON \
-DWITH_URING=ON \
-DWITH_LIBAIO=ON \
Expand Down
28 changes: 28 additions & 0 deletions storage/duckdb/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
IF(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/duckdb/CMakeLists.txt)
return()
ENDIF()

IF(WIN32)
return()
ENDIF()

IF(NOT (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR
CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64" OR
CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64"))
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")

add_subdirectory(duckdb)

IF(TARGET duckdb)
# MTR discovers plugins at storage/<name>/, not storage/<name>/<submodule>/
SET_TARGET_PROPERTIES(duckdb PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
INSTALL_MYSQL_TEST("${CMAKE_CURRENT_SOURCE_DIR}/duckdb/mysql-test/"
"plugin/duckdb")
ENDIF()
1 change: 1 addition & 0 deletions storage/duckdb/duckdb
Submodule duckdb added at a2e558
Loading