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

Moving transaction initialization before query analysis #1013

Merged
merged 8 commits into from
May 16, 2022

Conversation

fulghum
Copy link
Contributor

@fulghum fulghum commented May 16, 2022

Moves transaction creation ahead of query analysis, so that queries can be executed with the latest committed state from other transactions.

Fixes: dolthub/dolt#3402

// don't need to do anything here to clear implicit transaction state.
//
// TODO: This logic would probably read more clearly if we could just ask the session/ctx if the
// current transaction is automatically created or explicitly created by the caller.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I considered adding something to Session or Transaction's interface to show whether the current transaction is automatically created by the system (i.e. autocommit) or is explicitly requested by the client, but wanted to keep this fix as small as possible. I think the code that needs to use GetIgnoreAutoCommit would read a little clearer with that refactor, so happy to follow up with that if you think it's worth it.

@fulghum fulghum requested a review from zachmu May 16, 2022 19:52
@fulghum fulghum marked this pull request as ready for review May 16, 2022 19:52
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.

LGTM!

enginetest/transaction_queries.go Outdated Show resolved Hide resolved
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.

sql-client can't find knex-created table until show tables called
2 participants