-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
store transaction isolation level in upper case #12099
Conversation
Signed-off-by: Harshit Gangal <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
If a new flag is being introduced:
If a workflow is added or modified:
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
utils.AssertContains(t, conn, "select @@transaction_isolation, connection_id()", `REPEATABLE-READ`) | ||
|
||
// setting to different value. | ||
utils.Exec(t, conn, "set @@transaction_isolation = 'read-committed'") | ||
utils.AssertMatches(t, conn, "select @@transaction_isolation", `[[VARCHAR("read-committed")]]`) | ||
utils.Exec(t, conn, "set @@transaction_isolation = 'READ-COMMITTED'") |
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.
we want to store them with upper case and return them with uppercase, but we want to allow for both cases for input, right?
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.
currently, we do not change the case when set <system_variable>
is used and store it as-is.
This is only for the case when set transaction isolation level <value>
is provided we have the option as we convert the statement to set @@session.transaction_isolation = <value>
Do you suggest that I make that change as well, to store the user-provided value in upper case for set <system_varable>
?
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.
Do we use the stored value for printing things, not the constants defined in sql.y?
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.
Changed as discussed offline.
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.
Apart from the ongoing discussion, everything else LGTM!
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
type StorageCase int | ||
|
||
const ( | ||
SCSame StorageCase = iota |
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.
nitpick: Couldn't we skip the SC
and just use sysvars.AlwaysUpper
,sysvars.AlwaysLower
and sysvars.FromUser
? really not important, if you want to merge, go ahead :)
* add support for transaction isolation level and make it vitess aware setting (#11673) * feat: add support for tx_isolation and make it vitess aware setting Signed-off-by: Harshit Gangal <[email protected]> * feat: rewrite tx_isolation and transaction_isolation in select query Signed-off-by: Harshit Gangal <[email protected]> * feat: added support for set session transaction isolation level <value> Signed-off-by: Harshit Gangal <[email protected]> * feat: add nextTxScope for transaction variables Signed-off-by: Harshit Gangal <[email protected]> * refactor: use constants over magic literals Signed-off-by: Harshit Gangal <[email protected]> * kept old support for next transaction scope transaction system variables Signed-off-by: Harshit Gangal <[email protected]> * test: added e2e test Signed-off-by: Harshit Gangal <[email protected]> Signed-off-by: Harshit Gangal <[email protected]> * Fix: return allowed transaction isolation level value on select query (#11804) * test: added e2e test Signed-off-by: Harshit Gangal <[email protected]> * test: added unit test Signed-off-by: Harshit Gangal <[email protected]> * fix: transaction_isolation to return connection default when not set Signed-off-by: Harshit Gangal <[email protected]> * test: addressed review comments Signed-off-by: Harshit Gangal <[email protected]> Signed-off-by: Harshit Gangal <[email protected]> * feat: support transaction isolation through reserved connection (#11987) Signed-off-by: Harshit Gangal <[email protected]> Signed-off-by: Harshit Gangal <[email protected]> * store transaction isolation level in upper case (#12099) * store transaction isolation level in upper case Signed-off-by: Harshit Gangal <[email protected]> * store system variables in the case as provided in StorageCase type Signed-off-by: Harshit Gangal <[email protected]> Signed-off-by: Harshit Gangal <[email protected]> Signed-off-by: Harshit Gangal <[email protected]>
Description
This is a follow-up PR from #11987 for comment #11987 (comment). The only possible solution was to store it as upper case as how MySQL returns the value for the
transaction_isolation
system variable.Related Issue(s)
Checklist
Deployment Notes