mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
We should prohobit concurent read of inserting file in SP
because it can couse problem with Query cache (BUG#14767) mysql-test/r/query_cache_notembedded.result: BUG#14767 test suite. mysql-test/t/query_cache_notembedded.test: BUG#14767 test suite. sql/sql_insert.cc: Query cache invalidation table we was inserting in just after unlocking table added to avoid the race condition as we had with SP. sql/sql_parse.cc: Query cache invalidation table we was inserting in just after unlocking table added to avoid the race condition as we had with SP. sql/sql_yacc.yy: We should prohibit concurent read of unserting file in SP because it can cause problem with query cache.
This commit is contained in:
@ -314,4 +314,34 @@ drop procedure f2;
|
||||
drop procedure f3;
|
||||
drop procedure f4;
|
||||
drop table t1;
|
||||
reset query cache;
|
||||
drop function if exists f1;
|
||||
create table t1 (id int);
|
||||
create function f1 ()
|
||||
returns int
|
||||
begin
|
||||
declare i_var int;
|
||||
set i_var = sleep(3);
|
||||
insert into t1 values(3);
|
||||
set i_var = sleep(3);
|
||||
return 0;
|
||||
end;|
|
||||
select f1();
|
||||
select sleep(4);
|
||||
sleep(4)
|
||||
0
|
||||
select * from t1;
|
||||
id
|
||||
3
|
||||
f1()
|
||||
0
|
||||
select * from t1;
|
||||
id
|
||||
3
|
||||
reset query cache;
|
||||
select * from t1;
|
||||
id
|
||||
3
|
||||
drop table t1;
|
||||
drop function f1;
|
||||
set GLOBAL query_cache_size=0;
|
||||
|
@ -180,5 +180,45 @@ drop procedure f3;
|
||||
drop procedure f4;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# bug#14767: INSERT in SF + concurrent SELECT with query cache
|
||||
#
|
||||
reset query cache;
|
||||
--disable_warnings
|
||||
drop function if exists f1;
|
||||
--enable_warnings
|
||||
create table t1 (id int);
|
||||
delimiter |;
|
||||
create function f1 ()
|
||||
returns int
|
||||
begin
|
||||
declare i_var int;
|
||||
set i_var = sleep(3);
|
||||
insert into t1 values(3);
|
||||
set i_var = sleep(3);
|
||||
return 0;
|
||||
end;|
|
||||
delimiter ;|
|
||||
|
||||
connect (con1,localhost,root,,);
|
||||
connect (con2,localhost,root,,);
|
||||
|
||||
connection con1;
|
||||
send select f1();
|
||||
connection con2;
|
||||
select sleep(4);
|
||||
select * from t1;
|
||||
connection con1;
|
||||
reap;
|
||||
connection con2;
|
||||
# This gives wrong result i.e. 't' table seems to be empty
|
||||
select * from t1;
|
||||
reset query cache;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
drop function f1;
|
||||
disconnect con1;
|
||||
disconnect con2;
|
||||
connection default;
|
||||
|
||||
set GLOBAL query_cache_size=0;
|
||||
|
Reference in New Issue
Block a user