Skip to content

problem with renaming as "e1" or "e2" in from-clause #399

Closed
@Meffi42

Description

@Meffi42

I have a from-clause where I rename relations as "e1, e2, ..." - this seems problematic,
e.g., "e2" is recognized as a float:

list( sqlparse.parse("select * from Eats e1, Eats e2")[0] )[6].value
'Eats'
list( sqlparse.parse("select * from Eats e1, Eats e2")[0] )[8].value
'e1, Eats'

list( sqlparse.parse("select * from Eats e1, Eats e2")[0] )[10].value
'e2'
list( sqlparse.parse("select * from Eats e1, Eats e2")[0] )[10].ttype
Token.Literal.Number.Float

Using different identifiers, such as "a" or "b" works:

list( sqlparse.parse("select * from Eats a, Eats b")[0] )[6].value
'Eats a, Eats b'

type( list( sqlparse.parse("select * from Eats a, Eats b")[0] )[6] )
<class 'sqlparse.sql.IdentifierList'>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions