diff options
author | unknown <igor@rurik.mysql.com> | 2003-11-25 13:06:46 -0800 |
---|---|---|
committer | unknown <igor@rurik.mysql.com> | 2003-11-25 13:06:46 -0800 |
commit | 75fa6a6a40ebd2a18bad6a00385b5fc81ddda078 (patch) | |
tree | 0e78213cc1a67671719a66491414a72cd790ffa3 /tests/fork_big2.pl | |
parent | e7d6db538609361106888bedeac54fbd899646de (diff) | |
download | mariadb-git-75fa6a6a40ebd2a18bad6a00385b5fc81ddda078.tar.gz |
fork_big2.pl:
Added resize key cache test.
tests/fork_big2.pl:
Added resize key cache test.
Diffstat (limited to 'tests/fork_big2.pl')
-rw-r--r-- | tests/fork_big2.pl | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/tests/fork_big2.pl b/tests/fork_big2.pl index b552b95ba6b..a1c55ac4c11 100644 --- a/tests/fork_big2.pl +++ b/tests/fork_big2.pl @@ -23,14 +23,15 @@ $opt_select_count=$opt_join_count=0; $opt_update=1;$opt_delete=0;
$opt_flush=$opt_check=$opt_repair=$opt_alter=0;
$opt_join_range=100;
+$opt_resize_interval=0; $opt_time=0; $opt_host=$opt_user=$opt_password=""; $opt_db="test"; +$opt_verbose=$opt_debug=$opt_lock_tables=$opt_fast_insert=$opt_fast=$opt_skip_in=$opt_force=undef; # Ignore warnings from these GetOptions("host=s","db=s","user=s","password=s","loop-count=i","skip-create","skip-in","skip-drop",
"verbose","fast-insert","lock-tables","debug","fast","force","thread-factor=i",
"insert=i", "select=i", "join=i", "select-count=i", "join-count=i", "update=i", "delete=i",
- "flush=i", "check=i", "repair=i", "alter=i", "max-join_range=i", "time=i") || die "Aborted"; -$opt_verbose=$opt_debug=$opt_lock_tables=$opt_fast_insert=$opt_fast=$opt_skip_in=$opt_force=undef; # Ignore warnings from these + "flush=i", "check=i", "repair=i", "alter=i", "resize-interval=i", "max-join_range=i", "time=i") || die "Aborted"; print "Test of multiple connections that test the following things:\n"; print "insert, select, delete, update, alter, check, repair and flush\n"; @@ -158,6 +159,11 @@ for ($i=0 ; $i < $opt_alter ; $i ++) test_alter() if (($pid=fork()) == 0); $work{$pid}="alter";
}
$threads+=$i;
+if ($opt_resize_interval != 0) +{ + test_resize() if (($pid=fork()) == 0); $work{$pid}="resize"; + $threads+=1; +} print "Started $threads threads\n"; @@ -590,6 +596,32 @@ sub test_flush exit(0); } +# +# Do a resize key cache every periodically +# + +sub test_resize +{ + my ($dbh, $key_buffer_size); + + $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host", + $opt_user, $opt_password, + { PrintError => 0}) || die $DBI::errstr; + + $count=0; + $key_buffer_size=1024*64; + while (!test_if_abort($dbh)) + { + sleep($opt_resize_interval); + $dbh->do("set global key_buffer_size=$key_buffer_size") || + die "Got error on resize key cache $DBI::errstr\n"; + $key_buffer_size+=1024*16; + $count++; + } + $dbh->disconnect; $dbh=0; + print "Test_resize: Executed $count times resize key cache\n"; + exit(0); +} # # Test all tables in a database |