duckdb-node
duckdb-node copied to clipboard
Prepared statements fail with arrowIPCAll
const duckdb = require("duckdb");
const db = new duckdb.Database(":memory:");
const con = db.connect();
const stmt = con.prepare("SELECT ?::INTEGER AS fortytwo");
stmt.arrowIPCAll(42, function (err, res) {
if (err) {
console.warn(err);
} else {
console.log(res);
}
});
crashes with
Assertion failed: (chunk.ColumnCount() == 2), function Callback, file statement.cpp, line 387.
DuckDB 1.0.0.
Happens in https://github.com/duckdb/duckdb-node/blob/874c0dddc152017174bf56fe69e5a4232ebcd0f5/src/statement.cpp#L387
possible fix would be to move the to_arrow_ipc query wrapping from Connection.prototype.arrowIPCAll to Statement.prototype.arrowIPCAll