Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure symbols are not reused across plan nodes
This fixes an aliasing issue that causes queries to return incorrect results. It happens because symbol allocator can produce non-globally unique names when columns in the table share the same prefix and have the form xxx_nnn. E.g., CREATE TABLE t AS SELECT * FROM (VALUES (1,2)) t (foo_1, foo_2_4); SELECT foo_1, foo_2_4 from t; Incorrect plan: - Output[foo_1, foo_2_4] => [foo:bigint, foo:bigint] foo_1 := foo foo_2_4 := foo - Exchange[GATHER] => foo:bigint - TableScan[t, original constraint=true] => [foo:bigint] foo := <column foo_1> Expected plan: - Output[foo_1, foo_2_4] => [foo:bigint, foo_2:bigint] foo_1 := foo foo_2_4 := foo_2 - Exchange[GATHER] => foo:bigint, foo_2:bigint - TableScan[t, original constraint=true] => [foo:bigint, foo_2:bigint] foo := <column foo_1> foo_2 := <column foo_2_4>
- Loading branch information