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

Added IF EXISTS for DROP DATABASE command, #4659 #4698

Merged
merged 1 commit into from
Nov 7, 2015

Conversation

ch33hau
Copy link
Contributor

@ch33hau ch33hau commented Nov 6, 2015

Hi,

Can I create a pull request for this issue? #4659

Thanks

@@ -369,6 +369,8 @@ func (q *QueryExecutor) executeDropDatabaseStatement(stmt *influxql.DropDatabase
dbi, err := q.MetaStore.Database(stmt.Name)
if err != nil {
return &influxql.Result{Err: err}
} else if dbi == nil && stmt.IfExists {
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor, but I think better style would be:

} else if dbi == nil {
    if stmt.IfExists {
        return &influxql.Result{}
    }
    return &influxql.Result{Err: ErrDatabaseNotFound(stmt.Name)}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @otoolep , Thanks for your suggestion, I have updated it.

@otoolep
Copy link
Contributor

otoolep commented Nov 6, 2015

Thanks @ch33hau -- looks great. I have some small feedback before we merge.

@dgnorton @corylanou -- can I get a second review?

@corylanou
Copy link
Contributor

Looks good. +1

otoolep added a commit that referenced this pull request Nov 7, 2015
Added IF EXISTS for DROP DATABASE command, #4659
@otoolep otoolep merged commit 905437c into influxdata:master Nov 7, 2015
@ch33hau
Copy link
Contributor Author

ch33hau commented Nov 7, 2015

Thanks @otoolep @corylanou =)

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