Skip to content

FROM not rejected in column position #166

Closed
@aidanhs

Description

@aidanhs

Parsing SELECT FROM abc succeeds with:

AST: [                                                                         
    Query(                                                                     
        Query {                                                                
            ctes: [],                                                          
            body: Select(                                                      
                Select {                                                       
                    distinct: false,                                           
                    projection: [                                              
                        ExprWithAlias {                                        
                            expr: Identifier(                                  
                                "FROM",                                        
                            ),                                                 
                            alias: "issues",                                   
                        },                                                     
                    ],                                                         
                    from: [],                                                  
                    selection: None,                                           
                    group_by: [],                                              
                    having: None,                                              
                },                                                             
            ),                                                                 
            order_by: [],                                                                                                                                     
            limit: None,                                                       
            offset: None,                                                      
            fetch: None,                                                       
        },                                                                     
    ),                                                                         
]

It seems suprising that parsing accepted FROM as a column identifier! The SQL engines I've quickly tried out (sqlite locally, a handful of online validators) all seem to indicate that it's invalid - maybe it should be rejected?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions