mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into mockturtle.local:/home/dlenev/src/mysql-5.0-bg20390-2 sql/sql_select.cc: Auto merged
This commit is contained in:
@@ -102,16 +102,36 @@ connection con1;
|
||||
commit;
|
||||
|
||||
# table scan
|
||||
#
|
||||
# Note that there are two distinct execution paths in which we unlock
|
||||
# non-matching rows inspected during table scan - one that is used in
|
||||
# case of filesort and one that used in rest of cases. Below we cover
|
||||
# the latter (Bug #20390 "SELECT FOR UPDATE does not release locks of
|
||||
# untouched rows in full table scans").
|
||||
connection con1;
|
||||
begin;
|
||||
select * from t1 where y = 'one' or y = 'three' order by x for update;
|
||||
# We can't use "order by x" here as it will cause filesort
|
||||
--replace_column 1 # 2 # 3 #
|
||||
select * from t1 where y = 'one' or y = 'three' for update;
|
||||
|
||||
connection con2;
|
||||
begin;
|
||||
# Have to check with pk access here since scans take locks on
|
||||
# all rows and then release them in chunks
|
||||
# Bug #20390 SELECT FOR UPDATE does not release locks of untouched rows in full table scans
|
||||
#select * from t1 where x = 2 for update;
|
||||
select * from t1 where x = 2 for update;
|
||||
--error 1205
|
||||
select * from t1 where x = 1 for update;
|
||||
rollback;
|
||||
|
||||
connection con1;
|
||||
commit;
|
||||
|
||||
# And now the test for case with filesort
|
||||
begin;
|
||||
select * from t1 where y = 'one' or y = 'three' order by x for update;
|
||||
connection con2;
|
||||
begin;
|
||||
select * from t1 where x = 2 for update;
|
||||
--error 1205
|
||||
select * from t1 where x = 1 for update;
|
||||
rollback;
|
||||
@@ -157,15 +177,32 @@ commit;
|
||||
# table scan
|
||||
connection con1;
|
||||
begin;
|
||||
select * from t1 where y = 'one' or y = 'three' order by x lock in share mode;
|
||||
# We can't use "order by x" here as it will cause filesort
|
||||
--replace_column 1 # 2 # 3 #
|
||||
select * from t1 where y = 'one' or y = 'three' lock in share mode;
|
||||
|
||||
connection con2;
|
||||
begin;
|
||||
select * from t1 where y = 'one' lock in share mode;
|
||||
# Have to check with pk access here since scans take locks on
|
||||
# all rows and then release them in chunks
|
||||
# Bug #20390 SELECT FOR UPDATE does not release locks of untouched rows in full table scans
|
||||
#select * from t1 where x = 2 for update;
|
||||
select * from t1 where x = 2 for update;
|
||||
--error 1205
|
||||
select * from t1 where x = 1 for update;
|
||||
rollback;
|
||||
|
||||
connection con1;
|
||||
commit;
|
||||
|
||||
# And the same test for case with filesort
|
||||
connection con1;
|
||||
begin;
|
||||
select * from t1 where y = 'one' or y = 'three' order by x lock in share mode;
|
||||
|
||||
connection con2;
|
||||
begin;
|
||||
select * from t1 where y = 'one' lock in share mode;
|
||||
select * from t1 where x = 2 for update;
|
||||
--error 1205
|
||||
select * from t1 where x = 1 for update;
|
||||
rollback;
|
||||
|
||||
Reference in New Issue
Block a user