-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
more double negation fixes #1812
Conversation
fixes, e.g., parsing of 1e-/*test*/-5. very much related to cockroachdb#1810.
LGTM
|
LGTM |
{"SELECT -\n-5", | ||
`SELECT - -5`}, | ||
`SELECT - - 5`}, | ||
{"SELECT 1e-\n-1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1e-
doesn't appear to be commonly accepted; both postgres and python require an exponent value (1e-0
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only tests the parser, if you tried to evaluate this it (hopefully) wouldn't work. Discarding this in the parser would require a lookahead. Since we've copied that from Postgres, better not to touch it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a bug in scanner.scanNumber()
. The postgres scanner has the following rules for scanning floating point numbers:
real ({integer}|{decimal})[Ee][-+]?{digit}+
realfail1 ({integer}|{decimal})[Ee]
realfail2 ({integer}|{decimal})[Ee][-+]
If the scanner sees -
or +
it should require the following character to be a digit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. Tracked anywhere? If not, I can go ahead and file it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not tracked yet as far as I know. File away.
fixes, e.g., parsing of 1e-/test/-5.
very much related to #1810.