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

Implements ANALYZE stmt #75

Merged
merged 4 commits into from
Mar 9, 2020
Merged

Implements ANALYZE stmt #75

merged 4 commits into from
Mar 9, 2020

Conversation

SUMUKHA-PK
Copy link
Collaborator

This PR completes the implementation of ANALYZE stmt (https://sqlite.org/lang_analyze.html) and is a part of #66

@SUMUKHA-PK SUMUKHA-PK requested a review from tsatke March 9, 2020 16:32
@github-actions
Copy link

github-actions bot commented Mar 9, 2020

⚠ staticcheck Failed

internal/parser/simple_parser_rules.go:783:2: this value of ok is never used (SA4006)
internal/parser/simple_parser_rules.go:797:2: this value of ok is never used (SA4006)
internal/parser/simple_parser_rules.go:804:2: this value of ok is never used (SA4006)

Checks Document

stmt.Analyze = next
p.consumeToken()

// optionalLookahead is used again because, ANALYZE alone is a valid string
Copy link
Contributor

Choose a reason for hiding this comment

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

why again?

Suggested change
// optionalLookahead is used again because, ANALYZE alone is a valid string
// optionalLookahead is used, because ANALYZE alone is a valid statement

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Previous rule had it too. Will change

Comment on lines 783 to 784
next, _ = p.optionalLookahead(r)
if next.Type() == token.EOF {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
next, _ = p.optionalLookahead(r)
if next.Type() == token.EOF {
next, ok = p.optionalLookahead(r)
if !ok || next.Type() == token.EOF {

Comment on lines 797 to 798
period, _ := p.optionalLookahead(r)
if period.Type() == token.EOF {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
period, _ := p.optionalLookahead(r)
if period.Type() == token.EOF {
period, ok := p.optionalLookahead(r)
if !ok || period.Type() == token.EOF {

@tsatke tsatke merged commit cc899b3 into master Mar 9, 2020
@tsatke tsatke deleted the analyze-stmt branch March 9, 2020 17:14
@tsatke tsatke mentioned this pull request Mar 10, 2020
59 tasks
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.

2 participants