BUG: duckdb::data_t* duckdb::Allocator::AllocateData(duckdb::idx_t): Assertion `size > 0' failed
OliverKillane opened this issue · 1 comments
OliverKillane commented
Issue
Failing on constraints referring to an enum's value.
Reproduce
Go to this repo, and cargo test
#[cfg(test)]
mod tests {
use duckdb::{params, Connection};
#[test]
fn incorrect_behaviour() {
let conn = Connection::open_in_memory().unwrap();
conn.execute_batch(
"
CREATE TYPE MyEnum AS ENUM ('A');
CREATE TABLE purchases (
currency MyEnum NOT NULL,
CHECK (
currency = 'A'
)
);
",
)
.unwrap();
conn.execute(
"
INSERT INTO purchases (currency) VALUES ('A'::MyEnum)
",
params![],
)
.unwrap();
}
#[test]
fn correct_behaviour() {
let conn = Connection::open_in_memory().unwrap();
conn.execute_batch(
"
CREATE TYPE MyEnum AS ENUM ('A');
CREATE TABLE purchases (
currency MyEnum NOT NULL,
);
",
)
.unwrap();
conn.execute(
"
INSERT INTO purchases (currency) VALUES ('A'::MyEnum)
",
params![],
)
.unwrap();
}
}
Incorrect causes:
duckdb_allocator_size_0_assert-55c63b607dff2947: duckdb/src/common/allocator.cpp:122: duckdb::data_t* duckdb::Allocator::AllocateData(duckdb::idx_t): Assertion `size > 0' failed.
carlopi commented
Might be already fixed by duckdb/duckdb#12370 ?