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

fix: handle transaction sql with comments at the beginning #163

Merged
merged 1 commit into from
Sep 27, 2022

Conversation

karenc-bq
Copy link
Contributor

@karenc-bq karenc-bq commented Sep 26, 2022

Summary

Fix some bugs around code detecting whether the session is in a transaction
#160

Github Actions are failing due to a flaky test, the fix for that test is in #164

Description

  • handle transaction SQL statements with comments at the beginning, e.g. \*comment*\ begin;
  • set transaction status in setAutoCommit

Additional Reviewers

@congoamz
@joyc-bq
@davecramer
@alecc-bq

() -> this.pluginService.getCurrentConnection().setAutoCommit(autoCommit),
() -> {
this.pluginService.getCurrentConnection().setAutoCommit(autoCommit);
this.pluginManagerService.setInTransaction(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be setInTransaction(!autoCommit)? We could be setting autoCommit to true, in which case we wouldn't be in a transaction

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, thanks

@karenc-bq karenc-bq changed the title fix: handle transaction sql with comments at the beginning and set transaction status in setAutoCommit fix: handle transaction sql with comments at the beginning Sep 27, 2022
@davecramer
Copy link
Contributor

Thanks, looks good

@karenc-bq karenc-bq merged commit 5c32431 into dev Sep 27, 2022
karenc-bq added a commit that referenced this pull request Sep 28, 2022
- handle transaction SQL statements with comments at the beginning, e.g. `\*comment*\ begin;`
- set transaction status in `setAutoCommit`
@hsuamz hsuamz deleted the transaction_status branch October 3, 2022 22: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.

3 participants