Skip to content

Miscellaneous fixes #34

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

Merged
merged 6 commits into from
Jan 12, 2019
Merged

Miscellaneous fixes #34

merged 6 commits into from
Jan 12, 2019

Conversation

nickolay
Copy link
Contributor

These are a few unrelated fixes I came up with while reading through the code. See the commit messages for more details about each one.

I added tests where there wasn't sufficient coverage, except for timestamps where the code being fixed is effectively unused at this moment, since we don't have the code to handle TIMESTAMP '...' literals.

Remove `pub` from the "internal" ones. Remove ones that duplicate each
other completely.
1) Simplified the bit in parse_datatype()
2) Made sure it was covered by the test (the "public.year" bit)
2a) ...the rest of changes in the test are to fix incorrect variable
 names: c_name/c_lat/c_lng were copy-pasted from a previous test.
3) Removed the branch from parse_pg_cast, which duplicated what
parse_data_type already handled (added in the same commit even
andygrove@2007995 )
...it gets handled just as well by the infix parser.
(Add a test while we're at it.)
There's no Token::Period in such situation, so fractional part (from sec) was silently truncated.

Can't uncomment the test yet, because parse_timestamp() is effectively
unused: the code added to parse_value() in 5abd9e7
was wrong as it attempted to handle unquoted date/time literals. One
part of it was commented out earlier, the other can't work as far as I
can see, as it tries to parse a Number token - `([0-9]|\.)+` - as a
timestamp, so I removed it as well.
@nickolay
Copy link
Contributor Author

The CI failure is due to rust-lang/rust#57488...

Copy link
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. These changes look good. I will merge this weekend.

@coveralls
Copy link

coveralls commented Jan 12, 2019

Pull Request Test Coverage Report for Build 91

  • 37 of 47 (78.72%) changed or added relevant lines in 2 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.6%) to 82.147%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/sqlparser.rs 14 24 58.33%
Files with Coverage Reduction New Missed Lines %
src/sqlparser.rs 2 72.13%
Totals Coverage Status
Change from base Build 83: 0.6%
Covered Lines: 2181
Relevant Lines: 2655

💛 - Coveralls

@andygrove andygrove merged commit 25718b8 into apache:master Jan 12, 2019
@andygrove
Copy link
Member

Merged! Thanks @nickolay

@nickolay nickolay deleted the misc branch January 12, 2019 21:22
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.

3 participants