mirror of
https://github.com/MariaDB/server.git
synced 2025-05-04 06:05:05 +03:00

The problem is that since MyISAM's concurrent_insert is on by default some concurrent SELECT statements might not see changes made by INSERT statements in other connections, even if the INSERT statement has returned. The solution is to disable concurrent_insert so that INSERT statements returns after the data is actually visible to other statements.
13 lines
384 B
Plaintext
13 lines
384 B
Plaintext
set @old_concurrent_insert= @@global.concurrent_insert;
|
|
set @@global.concurrent_insert= 0;
|
|
drop table if exists t1;
|
|
create table t1 (kill_id int);
|
|
insert into t1 values(connection_id());
|
|
flush tables with read lock;
|
|
select ((@id := kill_id) - kill_id) from t1;
|
|
((@id := kill_id) - kill_id)
|
|
0
|
|
kill connection @id;
|
|
drop table t1;
|
|
set @@global.concurrent_insert= @old_concurrent_insert;
|