mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 21:42:35 +01:00
#3166 test of hot index + concurrent inserts refs[t:3166]
git-svn-id: file:///svn/mysql/tests/mysql-test@27007 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
2e9c9b620e
commit
e9f13e6d5f
3 changed files with 54 additions and 2 deletions
|
@ -26,10 +26,16 @@ send create index i_a on s(a);
|
|||
connection conn1;
|
||||
set tokudb_write_lock_wait=1;
|
||||
set tokudb_read_lock_wait=1;
|
||||
delete from s where a=1;
|
||||
let $a = 10000;
|
||||
while ($a) {
|
||||
eval delete from s where a=$a;
|
||||
dec $a;
|
||||
}
|
||||
|
||||
connection default;
|
||||
reap;
|
||||
select count(*) from s;
|
||||
select count(*) from s use index(i_a);
|
||||
disconnect conn1;
|
||||
|
||||
#cleanup
|
||||
|
|
42
mysql-test/suite/tokudb.hotindex/t/hotindex-insert-0.test
Normal file
42
mysql-test/suite/tokudb.hotindex/t/hotindex-insert-0.test
Normal file
|
@ -0,0 +1,42 @@
|
|||
# test that deletes work when hot indexing is on
|
||||
|
||||
set storage_engine='tokudb';
|
||||
|
||||
--echo # Establish connection conn1 (user = root)
|
||||
connect (conn1,localhost,root,,);
|
||||
|
||||
connection default;
|
||||
|
||||
# create table s
|
||||
--disable_warnings
|
||||
drop table if exists s;
|
||||
--enable_warnings
|
||||
create table s (a int, b int);
|
||||
|
||||
# populate table s
|
||||
let $a = 10000;
|
||||
while ($a) {
|
||||
eval insert into s values ($a,0),($a,1),($a,2),($a,3),($a,4),($a,5),($a,6),($a,7),($a,8),($a,9);
|
||||
dec $a;
|
||||
}
|
||||
|
||||
set tokudb_create_index_online=1;
|
||||
send create index i_a on s(a);
|
||||
|
||||
connection conn1;
|
||||
set tokudb_write_lock_wait=1;
|
||||
set tokudb_read_lock_wait=1;
|
||||
let $b=10000;
|
||||
while ($b) {
|
||||
eval insert into s values (1000000000,$b);
|
||||
dec $b;
|
||||
}
|
||||
|
||||
connection default;
|
||||
reap;
|
||||
select count(*) from s;
|
||||
select count(*) from s use index(i_a);
|
||||
disconnect conn1;
|
||||
|
||||
#cleanup
|
||||
drop table s;
|
|
@ -26,7 +26,11 @@ send create index i_a on s(a);
|
|||
connection conn1;
|
||||
set tokudb_write_lock_wait=1;
|
||||
set tokudb_read_lock_wait=1;
|
||||
update s set a=20000 where a=1;
|
||||
let $a = 10000;
|
||||
while ($a) {
|
||||
eval update s set a=20000+$a where a=$a;
|
||||
dec $a;
|
||||
}
|
||||
|
||||
connection default;
|
||||
reap;
|
||||
|
|
Loading…
Reference in a new issue