Details
-
Bug
-
Status: Stalled (View Workflow)
-
Critical
-
Resolution: Unresolved
-
10.6
Description
Testcase to reproduce:
master
create database d1;
|
use d1;
|
|
create table t1 (id int ,PRIMARY KEY (id) ); |
create table t2 (id int ,PRIMARY KEY (id) ); |
|
insert into t1 (id) values (1),(2),(3),(4); |
insert into t2 (id) values (1),(2),(3),(4); |
Replica
set autocommit = 0; |
explain update t2 set id = (select id from t1);
|
Master;
set autocommit = 0; |
explain update t2 set id = (select id from t1);
|
Replica:
MariaDB [d1]> select * from t1;
|
+----+
|
| id |
|
+----+
|
| 1 | |
| 2 | |
| 3 | |
| 4 | |
+----+
|
4 rows in set (0.000 sec) |
After commit , it works
MariaDB [d1]> commit;
|
Query OK, 0 rows affected (0.000 sec) |
|
MariaDB [d1]> select * from t1;
|
+----+
|
| id |
|
+----+
|
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
+----+
|
5 rows in set (0.000 sec) |
It seems related to default isolation level REPEATABLE READ.
With isolation level READ COMITTED it works,
but explain should not locks slave threads.
Attachments
Issue Links
- duplicates
-
MDEV-34032 EXPLAIN <DML statement> counts as write in QUERY_RESPONSE_TIME
- Stalled
- relates to
-
MDEV-32902 Autocommit=0 Retains Locks for Read-Only Statements
- Confirmed