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

The default value for tidb_txn_mode is different with doc desc #48492

Closed
Defined2014 opened this issue Nov 9, 2023 · 1 comment · Fixed by #48500
Closed

The default value for tidb_txn_mode is different with doc desc #48492

Defined2014 opened this issue Nov 9, 2023 · 1 comment · Fixed by #48500
Labels
severity/moderate sig/sql-infra SIG: SQL Infra sig/transaction SIG:Transaction type/bug This issue is a bug.

Comments

@Defined2014
Copy link
Contributor

Defined2014 commented Nov 9, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

SELECT * FROM information_schema.variables_info WHERE variable_name = 'tidb_txn_mode';

2. What did you expect to see? (Required)

mysql> SELECT * FROM information_schema.variables_info WHERE variable_name = 'tidb_txn_mode';
+---------------+----------------+---------------+---------------+-----------+-----------+------------------------+---------+
| VARIABLE_NAME | VARIABLE_SCOPE | DEFAULT_VALUE | CURRENT_VALUE | MIN_VALUE | MAX_VALUE | POSSIBLE_VALUES        | IS_NOOP |
+---------------+----------------+---------------+---------------+-----------+-----------+------------------------+---------+
| tidb_txn_mode | SESSION,GLOBAL | pessimistic   | pessimistic   |      NULL |      NULL | pessimistic,optimistic | NO      |
+---------------+----------------+---------------+---------------+-----------+-----------+------------------------+---------+
1 row in set (0.01 sec)

3. What did you see instead (Required)

mysql> SELECT * FROM information_schema.variables_info WHERE variable_name = 'tidb_txn_mode';
+---------------+----------------+---------------+---------------+-----------+-----------+------------------------+---------+
| VARIABLE_NAME | VARIABLE_SCOPE | DEFAULT_VALUE | CURRENT_VALUE | MIN_VALUE | MAX_VALUE | POSSIBLE_VALUES        | IS_NOOP |
+---------------+----------------+---------------+---------------+-----------+-----------+------------------------+---------+
| tidb_txn_mode | SESSION,GLOBAL |               | pessimistic   |      NULL |      NULL | pessimistic,optimistic | NO      |
+---------------+----------------+---------------+---------------+-----------+-----------+------------------------+---------+
1 row in set (0.01 sec)

4. What is your TiDB version? (Required)

ref doc link https://docs.pingcap.com/tidb/stable/system-variables#tidb_txn_mode

@Defined2014 Defined2014 added the type/bug This issue is a bug. label Nov 9, 2023
@Defined2014 Defined2014 changed the title The default value for tidb_txn_mode is different with doc said. The default value for tidb_txn_mode is different with doc desc Nov 9, 2023
@lcwangchao lcwangchao added the sig/transaction SIG:Transaction label Nov 10, 2023
@Defined2014
Copy link
Contributor Author

The biggest problem is that when we do set tidb_txn_mode=default it becomes optimistic instead of pessimistic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/sql-infra SIG: SQL Infra sig/transaction SIG:Transaction type/bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants