Skip to content

Wrong result of select @@session.tx_read_only #5478

@shenli

Description

@shenli

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
mysql> select @@session.tx_read_only;
+------------------------+
| @@session.tx_read_only |
+------------------------+
|                      0 |
+------------------------+
1 row in set (0.00 sec)

mysql> set session transaction read only;
Query OK, 0 rows affected (0.00 sec)

mysql> select @@session.tx_read_only;
+------------------------+
| @@session.tx_read_only |
+------------------------+
|                      1 |
+------------------------+
1 row in set (0.00 sec)

mysql> 
  1. What did you expect to see?
    @@session.tx_read_only should be 1 after executing set session transaction read only;

  2. What did you see instead?
    @@session.tx_read_only still be 0

  3. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
    All tidb-server versions could reproduce this issue.

Metadata

Metadata

Assignees

Labels

type/bugThe issue is confirmed as a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions