I found a few funny issues with floating point literals using exponential notation. My understanding is that in SQL the decimal point and fractional part of the mantissa are optiona, so 1.0e2 and 1.e2 and 1e2 are all legal floating point values. However, I get a parse error at the 'e' in all except the first (1.0e2) case.
Example: select foo from bar where foo > 1e2
Encountered "e2" at line 1, column 34.
Was expecting one of:
<EOF>
"GROUP" ...
"LIMIT" ...
"ORDER" ...
"OFFSET" ...
"HAVING" ...
";" ...
"*" ...
"/" ...
"+" ...
"-" ...
"AND" ...
"OR" ...
"UNION" ...
Worse yet: "select 1e2 from foo" is parsed as "SELECT 1 AS e2 FROM foo" if I log the PlainSelect during visit(PlainSelect), eg it becomes an alias.
thanks,
Patrick
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
using: 0.4.3
I found a few funny issues with floating point literals using exponential notation. My understanding is that in SQL the decimal point and fractional part of the mantissa are optiona, so 1.0e2 and 1.e2 and 1e2 are all legal floating point values. However, I get a parse error at the 'e' in all except the first (1.0e2) case.
Example: select foo from bar where foo > 1e2
Encountered "e2" at line 1, column 34.
Was expecting one of:
<EOF>
"GROUP" ...
"LIMIT" ...
"ORDER" ...
"OFFSET" ...
"HAVING" ...
";" ...
"*" ...
"/" ...
"+" ...
"-" ...
"AND" ...
"OR" ...
"UNION" ...
Worse yet: "select 1e2 from foo" is parsed as "SELECT 1 AS e2 FROM foo" if I log the PlainSelect during visit(PlainSelect), eg it becomes an alias.
thanks,
Patrick
I will have a look at this this week.
Could you try 0.4.4?
OK, this is working as expected now.
Thanks for the quick response!
Patrick