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

more double negation fixes #1812

Merged
merged 2 commits into from
Jul 25, 2015
Merged

more double negation fixes #1812

merged 2 commits into from
Jul 25, 2015

Conversation

tbg
Copy link
Member

@tbg tbg commented Jul 25, 2015

fixes, e.g., parsing of 1e-/test/-5.

very much related to #1810.

@tbg tbg added the PTAL label Jul 25, 2015
@tbg tbg mentioned this pull request Jul 25, 2015
tbg added 2 commits July 25, 2015 11:27
@tamird
Copy link
Contributor

tamird commented Jul 25, 2015

LGTM
On Jul 25, 2015 11:20 AM, "Tobias Schottdorf" [email protected]
wrote:

fixes, e.g., parsing of 1e-/test/-5.

very much related to #1810

#1810.

You can view, comment on, or merge this pull request online at:

#1812
Commit Summary

  • insert spaces between binary operators as well
  • slightly enhance TestParse2

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#1812.

tbg added a commit that referenced this pull request Jul 25, 2015
@tbg tbg merged commit a27b0a3 into cockroachdb:master Jul 25, 2015
@tbg tbg removed the PTAL label Jul 25, 2015
@tbg tbg deleted the sign_fixes branch July 25, 2015 16:36
@petermattis
Copy link
Collaborator

LGTM

{"SELECT -\n-5",
`SELECT - -5`},
`SELECT - - 5`},
{"SELECT 1e-\n-1",
Copy link
Contributor

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).

Copy link
Member Author

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.

Copy link
Collaborator

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.

Copy link
Member Author

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.

Copy link
Collaborator

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.

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

Successfully merging this pull request may close these issues.

4 participants