gluesql / gluesql

GlueSQL is quite sticky. It attaches to anywhere.

Home Page:https://gluesql.org/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Plan] Unchecked field in check_table_factor in evaluable.rs

ding-young opened this issue · comments

Currently, check_table_factor only checks whether table alias exists in given context.

let alias = match table_factor {
        TableFactor::Table { name, alias, .. } => alias
            .as_ref()
            .map(|TableAlias { name, .. }| name)
            .unwrap_or_else(|| name),
        TableFactor::Derived { alias, .. }
        | TableFactor::Series { alias, .. }
        | TableFactor::Dictionary { alias, .. } => &alias.name,
    };

    context
        .map(|context| context.contains_alias(alias))
        .unwrap_or(false)

However, we can also add evaluablity check for subquery in TableFactor::Derived and size(expr) in TableFactor::Series.