Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Meffi42 opened this issue Apr 2, 2018 · 2 comments
Closed

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

Meffi42 opened this issue Apr 2, 2018 · 2 comments
Labels
Milestone

Comments

@Meffi42
Copy link

Meffi42 commented Apr 2, 2018

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'>

@collerek
Copy link

Can confirm this is still valid, is this related to exponentials, or it's a bug?
@andialbrecht, any thoughts?

@andialbrecht
Copy link
Owner

Yes, it's a bug. And it's fixed now. Thanks for reporting and bringing this up again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants