Open OliverKillane opened 3 months ago
Failing on constraints referring to an enum's value.
Go to this repo, and cargo test
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.
Might be already fixed by https://github.com/duckdb/duckdb/pull/12370 ?
Issue
Failing on constraints referring to an enum's value.
Reproduce
Go to this repo, and
cargo test
Incorrect causes: