Skip to content

Use physical columns instead of logical columns with simple indicies

cznic requested to merge dbrower:issue187 into master

Created by: dbrower

@cznic How does this look? I think I figured out how the table columns work. Also I'm willing to squash the commits or make separate PRs for each issue.

The distinction between physical and logical columns appears when a table has dropped columns. Two places were referencing the logical column (cols) instead of physical column (cols0) by accident. First, when initializing the index array for a table, and second when finding a simple index to use in a SELECT query.

Fixing the latter item uncovered a latent bug where dropped columns are returned from selects with a WHERE clause using an index. However dropped columns are removed during full table scans. A copy of dropped column removal code was added the path used by index query plans. I think that is the right place, so row0() returns reads of a physical row and row returns reads of a logical row. This mirrors the other usage of the 0 suffix.

Fixes #187 (closed) and #188 (closed).

Merge request reports