duckdb icon indicating copy to clipboard operation
duckdb copied to clipboard

[Verification] add `verify_generated_columns`

Open Tishj opened this issue 3 years ago • 0 comments

This PR aims to aid in finding issues caused by the addition of generated columns.

Generated columns caused the storage index and the column index to become disjointed.

// The storage_oid is used to index columns that are physically stored, excluding generated columns.
// a INTEGER, b BOOLEAN, c GENERATED ALWAYS AS a, d VARCHAR
// 0          1          -                        2

Since this only becomes apparent when generated columns are involved, this causes numerous issues that are hard to spot. So when verify_generated_columns is enabled (currently tied to enable_verification) every CREATE TABLE statement will add a generated column on index 0.

This is not really meant to be merged in the state it's in, but it is meant to be used. Running the test runner (unittest) on this branch highlights a lot of issues caused by this change.

EDIT: Maybe scrap this, there's possibly a better and much more effective solution to this

Tishj avatar Sep 15 '22 13:09 Tishj