mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
chore: add DuckDB version info function.
This commit is contained in:
@@ -132,7 +132,20 @@ MariaDB `MEDIUMTEXT`, `LONGTEXT`, `TEXT`, `TINYTEXT` all map to DuckDB `VARCHAR`
|
||||
|
||||
---
|
||||
|
||||
## 5. DuckDB API Differences (AliSQL fork vs upstream v1.5.2)
|
||||
## 5. Table Partitioning
|
||||
|
||||
MariaDB table partitioning is not supported for `ENGINE=DuckDB`. The handlerton declares `HTON_NO_PARTITION`, so the server rejects both partitioned table creation and conversion of an existing DuckDB table:
|
||||
|
||||
```sql
|
||||
CREATE TABLE t (id INT) ENGINE=DuckDB PARTITION BY HASH(id);
|
||||
ALTER TABLE t PARTITION BY HASH(id);
|
||||
```
|
||||
|
||||
Both statements fail with `ER_PARTITION_MERGE_ERROR` (`Engine cannot be used in partitioned tables`) before MariaDB creates partition child handlers or starts the `ALGORITHM=COPY` protocol.
|
||||
|
||||
---
|
||||
|
||||
## 6. DuckDB API Differences (AliSQL fork vs upstream v1.5.2)
|
||||
|
||||
The AliSQL fork of DuckDB has custom extensions to the API that do not exist in upstream DuckDB:
|
||||
|
||||
@@ -145,7 +158,7 @@ The AliSQL fork of DuckDB has custom extensions to the API that do not exist in
|
||||
|
||||
---
|
||||
|
||||
## 6. DuckDB Extensions
|
||||
## 7. DuckDB Extensions
|
||||
|
||||
Loaded via `cmake/duckdb_extensions.cmake`:
|
||||
|
||||
@@ -159,7 +172,7 @@ Build flags in `cmake/duckdb.cmake`: `EXTENSION_STATIC_BUILD=1`, `DUCKDB_EXTENSI
|
||||
|
||||
---
|
||||
|
||||
## 7. ABI Compatibility
|
||||
## 8. ABI Compatibility
|
||||
|
||||
DuckDB is built as a static library (`libduckdb_bundle.a`) via `ExternalProject_Add` in `cmake/duckdb.cmake`.
|
||||
|
||||
@@ -171,7 +184,7 @@ DuckDB is built as a static library (`libduckdb_bundle.a`) via `ExternalProject_
|
||||
|
||||
---
|
||||
|
||||
## 8. Potential Future Incompatibilities
|
||||
## 9. Potential Future Incompatibilities
|
||||
|
||||
These have not been triggered yet but are likely to cause issues when more complex queries are pushed down:
|
||||
|
||||
|
||||
@@ -1578,7 +1578,16 @@ static struct st_mysql_sys_var *duckdb_system_variables[]= {
|
||||
MYSQL_SYSVAR(explain_output), MYSQL_SYSVAR(disabled_optimizers),
|
||||
MYSQL_SYSVAR(cross_engine_ryow), NULL};
|
||||
|
||||
static int show_duckdb_version(MYSQL_THD, struct st_mysql_show_var *var,
|
||||
void *, system_status_var *, enum_var_type)
|
||||
{
|
||||
var->type= SHOW_CHAR;
|
||||
var->value= const_cast<char *>(duckdb::DuckDB::LibraryVersion());
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct st_mysql_show_var duckdb_status_variables[]= {
|
||||
{"Duckdb_version", (char *) show_duckdb_version, SHOW_SIMPLE_FUNC},
|
||||
{"Duckdb_rows_insert", (char *) &srv_duckdb_status.duckdb_rows_insert,
|
||||
SHOW_LONGLONG},
|
||||
{"Duckdb_rows_update", (char *) &srv_duckdb_status.duckdb_rows_update,
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
CREATE TABLE t1(id INT PRIMARY KEY, v VARCHAR(255)) ENGINE=duckdb;
|
||||
CREATE TABLE t2(id INT PRIMARY KEY, v VARCHAR(255)) ENGINE=duckdb;
|
||||
CREATE TABLE t3(id INT PRIMARY KEY, v VARCHAR(255)) ENGINE=innodb;
|
||||
SHOW STATUS LIKE 'Duckdb_version';
|
||||
Variable_name Value
|
||||
Duckdb_version v1.5.5
|
||||
#
|
||||
# 1) INSERT: rows_insert increments per row (dml_in_batch=OFF)
|
||||
#
|
||||
|
||||
@@ -24,6 +24,8 @@ CREATE TABLE t3(id INT PRIMARY KEY, v VARCHAR(255)) ENGINE=innodb;
|
||||
# Save baseline commit count (CREATE TABLEs cause autocommits)
|
||||
--let $base_commit = query_get_value(SHOW STATUS LIKE 'Duckdb_commit', Value, 1)
|
||||
|
||||
SHOW STATUS LIKE 'Duckdb_version';
|
||||
|
||||
--echo #
|
||||
--echo # 1) INSERT: rows_insert increments per row (dml_in_batch=OFF)
|
||||
--echo #
|
||||
|
||||
Reference in New Issue
Block a user