mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 22:12:30 +01:00
c964c0b2cf
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.
12 lines
384 B
Text
12 lines
384 B
Text
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;
|