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

Add dolt_commit error check when autocommit is off #1074

Merged
merged 5 commits into from Dec 13, 2020

Conversation

VinaiRachakonda
Copy link
Contributor

@VinaiRachakonda VinaiRachakonda commented Dec 4, 2020

Fails loudly when autocommit is off for dolt_commit.

@VinaiRachakonda VinaiRachakonda changed the title [WIP] add error check Add dolt_commit error check when autocommit is off Dec 4, 2020
@VinaiRachakonda VinaiRachakonda linked an issue Dec 4, 2020 that may be closed by this pull request
Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

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

Not quite the right way to solve this.

It's OK for the error message to mention @@autocommit, but the business logic shouldn't depend on that detail.

bats/sql-server.bats Outdated Show resolved Hide resolved
go/libraries/doltcore/sqle/dfunctions/dolt_commit.go Outdated Show resolved Hide resolved
go/libraries/doltcore/sqle/dfunctions/dolt_commit.go Outdated Show resolved Hide resolved
go/libraries/doltcore/sqle/dfunctions/dolt_commit.go Outdated Show resolved Hide resolved
[[ "$output" =~ "one_pk" ]] || false

# check that dolt_commit works properly when autocommit is on
run dolt sql -q "SELECT DOLT_COMMIT('-a', '-m', 'Commit1')"
Copy link
Member

Choose a reason for hiding this comment

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

Also should have a test of the negative case, where there are no staged changes / no changes to stage. With and without -a.

@VinaiRachakonda VinaiRachakonda merged commit c443e76 into master Dec 13, 2020
@VinaiRachakonda VinaiRachakonda deleted the vinai/check-autocommit-dolt-commit branch December 13, 2020 17:56
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.

Throw error in DOLT_COMMIT if autocommit is not true
2 participants