Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALTER TABLE results in an assertion failure "Assertion `expr.return_type == vector.type' failed" #624

Closed
mrigger opened this issue May 5, 2020 · 1 comment

Comments

@mrigger
Copy link
Contributor

mrigger commented May 5, 2020

Consider the following statements:

CREATE TABLE t0(c0 INT, c1 VARCHAR);
INSERT INTO t0(c1) VALUES(NULL);
ALTER TABLE t0 ALTER c1 TYPE TIMESTAMP;

Unexpectedly, the ALTER TABLE results in an assertion failure:

/duckdb/src/execution/expression_executor.cpp:87: void duckdb::ExpressionExecutor::Verify(duckdb::Expression&, duckdb::Vector&, duckdb::idx_t): Assertion `expr.return_type == vector.type' failed.

I found this based on commit 289b2ea.

@Mytherin
Copy link
Collaborator

Mytherin commented May 5, 2020

Thanks, fixed! This was a silly mistake: the vector that was scanned got the type of the first column of the table (INTEGER) rather than the type of the actual column that was changed (VARCHAR), which resulted in a type mismatch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants