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

implicit commit on ddl statements #2818

Merged
merged 12 commits into from
Jan 22, 2025
Merged

implicit commit on ddl statements #2818

merged 12 commits into from
Jan 22, 2025

Conversation

jycor
Copy link
Contributor

@jycor jycor commented Jan 16, 2025

Certain queries ignore autocommit, and will implicitly commit the transaction.

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, see notes

enginetest/queries/transaction_queries.go Outdated Show resolved Hide resolved
@@ -232,6 +232,7 @@ func (b *Builder) buildSubquery(inScope *scope, stmt ast.Statement, subQuery str
case *ast.Show:
return b.buildShow(inScope, n)
case *ast.DDL:
b.qFlags.Set(sql.QFlagDDL)
Copy link
Member

Choose a reason for hiding this comment

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

This is a good start but incomplete. There are other DDL operations that aren't captured by this node, notably ALTER TABLE

Copy link
Member

Choose a reason for hiding this comment

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

Should add more tests for other statement types

Copy link
Contributor Author

@jycor jycor Jan 22, 2025

Choose a reason for hiding this comment

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

Included QFlagAlterTable and added tests for create index, create database, create procedure, create event, alter table

@jycor jycor merged commit c5d0e52 into main Jan 22, 2025
8 checks passed
@jycor jycor deleted the james/implicit branch January 22, 2025 10:03
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