[MDEV-21921] Make transaction_isolation into a system variable Created: 2020-03-11 Updated: 2023-09-06 Resolved: 2023-04-12 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Configuration, Variables |
| Fix Version/s: | 11.1.1 |
| Type: | Task | Priority: | Major |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Daniel Black |
| Resolution: | Fixed | Votes: | 3 |
| Labels: | beginner-friendly, gsoc22 | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Description |
|
In MariaDB, we have a confusing problem where:
Therefore, we have two different names for the same thing in different contexts. This is needlessly confusing, and it complicates the documentation. MySQL 5.7 solved this problem by making transaction_isolation into a system variable: https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_transaction_isolation Same has been done to transaction_read_only option: |
| Comments |
| Comment by Sergei Golubchik [ 2020-03-27 ] | ||||||||||
|
tx_isolation is a strange name, I agree with GeoffMontee, better to create @@transaction_isolation sysvar, like MySQL did. We can mark tx_isolation deprecated and remove it eventually. | ||||||||||
| Comment by Sergei Golubchik [ 2020-05-05 ] | ||||||||||
|
ralf.gebhardt@mariadb.com, no, I would consider it backward compatibility | ||||||||||
| Comment by Diego Dupin [ 2022-02-15 ] | ||||||||||
|
btw, mysql java driver set transaction_isolation when creating connection, making java connector incompatible with MariaDB:
mysql ODBC use it as well, but only to retrieve isolation level: https://github.com/mysql/mysql-connector-odbc/blob/7f85d3d3e59c30c754570b1a1b47df4b5737e6e2/test/my_tran.c | ||||||||||
| Comment by Junqi Xie [ 2023-02-12 ] | ||||||||||
|
Hi all! This is my first attempt to create a patch to MariaDB community. https://github.com/MariaDB/server/pull/2491 To implement this feature, I mostly backport the code from MySQL 5.7 branch, noted here. It adds 2 new system variables (transaction_isolation and transaction_read_only) which references the same field as the original variables (tx_isolation and tx_read_only). The original variables are marked as deprecated, and users will get a warning when setting the original variables. To avoid "surprises" to mariadb developers, I kept the internal representation of these variables. In other words, the change is only visible from a user's perspective. I also updated all the variables referenced in the tests for consistency. @serg @nikitamalyavin What do you think about this approach and the PR? Thanks in advance. | ||||||||||
| Comment by Daniel Black [ 2023-04-12 ] | ||||||||||
|
Thank you very much Junqi Xie | ||||||||||
| Comment by Ian Gilfillan [ 2023-04-12 ] | ||||||||||
|
Thanks junqi_xie for documenting the changes. Note that I reverted and will rework the SET TRANSACTION changes at https://mariadb.com/kb/en/set-transaction/+revision/125221/125173/, as the Knowledge Base is for all maintained versions, currently 10.3+, and the new instructions you specified will not work on releases prior to 11.1 |