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 for #57598 (ROLLBACK should be no-op...) #60338
fix for #57598 (ROLLBACK should be no-op...) #60338
Conversation
This is an automated comment for commit fbc8a19 with description of existing statuses. It's updated for the latest CI running ❌ Click here to open a full report in a separate page
Successful checks
|
Tried to search for information/docs on how to proceed as the results of the tests mostly seem unrelated to my changes done (e.g. "DB::Exception: io_uring is not supported by this system:" is a nerror message for quite a lot of the failed tests). Since I was not successful in finding hints regarding these problems any hint will be greatly appreciated. |
The main problem is:
I've changed it to "Imrovement". |
It looks like it was also mislabeled as "New Feature" |
@@ -6,8 +6,8 @@ drop table if exists mt2; | |||
create table mt1 (n Int64) engine=MergeTree order by n; | |||
create table mt2 (n Int64) engine=MergeTree order by n; | |||
|
|||
commit; -- { serverError INVALID_TRANSACTION } -- no transaction | |||
rollback; -- { serverError INVALID_TRANSACTION } | |||
commit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should apply only to the MySQL compatibility. I don't think this change is correct. We can ask @tavplubix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the strict version (and for rollback
as well)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that this way it breaks MySQL tools as cited in #57598 so that Clickhouse can't be used as a drop in replacement for MySQL.
I share your opinion that the strict version makes sense but this denies easy usage in such scenarios.
Is there a way to get the information that the query is coming from MySQL port from the session context? If so this behaviour could be set only for such queries. Woudl that be a satisfying solution for you @tavplubix ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it makes sense, see Context::getClientInfo()
and ClientInfo::Interface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it makes sense, see
Context::getClientInfo()
andClientInfo::Interface
Thank you for your indications. I have changed the code based on ClientInfo::Interface to show this behaviour only for MySQL interfaces. I reverted back the test and created a new one for the MySQL client to verify the new behaviour.
Is there anything else I need to do to make this pull request mergeable?
CI seems ok as the 6 tests that did not work are no related to my changes.
Thank you!
Change to verify proper behaviour for ROLLBACK should be no-op when no active tranaction is running (MySQL compatibility) ClickHouse#57598
…ion active bahaviour Adapted transaction test queries to changed beahviour
As changes in Txn handling for COMMIT and ROLLBACK should only be honoured for MySQL client mode the test was reverted back
…for MySQL clients anymore
…for MySQL clients anymore
…for MySQL clients anymore
757f995
to
4f9702a
Compare
Change to verify proper behaviour for ROLLBACK should be no-op when no active tranaction is running (MySQL compatibility) #57598
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Issue #57598 mentions a variant behaviour regarding transaction handling. An issued COMMIT/ROLLBACK when no transaction is active is reported as an error contrary to MySQL behaviour.
This leads to breaking the MySQL compatibility layer as some tools rely on the MySQL way to handle transactions.
Changes were tested in an environment where Clickhouse was used as a MySQL replacement.