diff options
author | unknown <monty@mashka.mysql.fi> | 2003-01-07 16:53:10 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2003-01-07 16:53:10 +0200 |
commit | b3b66f640841e459e18a3d4300766b56f0cf3bc8 (patch) | |
tree | 568a37c17ae407938ff1ec3cae7005605d52e7c6 /sql-bench/test-alter-table.sh | |
parent | e3c7f4d85ec4caf59fc408cf5643e5dc64e9a3d4 (diff) | |
download | mariadb-git-b3b66f640841e459e18a3d4300766b56f0cf3bc8.tar.gz |
Portability fixes
Fixed test suite for HPUX 10.20 and MacOSX
Build-tools/Do-compile:
Added timeout to mysqladmin shutdown commands
Kill old running mysqld started by earlier runs
Removed run time warning from LD_LIBRARY_PATH
client/mysqladmin.c:
Return 1 if pid file isn't deleted on shutdown.
Fix error message if pid file is not deleted
client/mysqltest.c:
Always allow --debug flag
(Makes it easier to run mysql-test-run)
mysql-test/mysql-test-run.sh:
A lot of safety fixes.
This fixes some problems with test suite for HPUX 10.20 and MacOSX
sql-bench/bench-init.pl.sh:
Allow tests to change time limit.
sql-bench/crash-me.sh:
Indentation cleanups
Added DROP for a created table
sql-bench/test-alter-table.sh:
Added default time limit
Changed test to be estimated to get down run time.
Fixed that add_multi_col is detected
sql-bench/test-insert.sh:
Comment cleanup
sql/mysql_priv.h:
Removed not needed prototype.
sql/mysqld.cc:
Removed DBUG warnings
Removed default argument for clean_up() and made it static.
More comments.
Ignore SIGHUP during shutdown
sql/net_pkg.cc:
More comments
sql/slave.cc:
Added DBUG_PRINT messages
Diffstat (limited to 'sql-bench/test-alter-table.sh')
-rw-r--r-- | sql-bench/test-alter-table.sh | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/sql-bench/test-alter-table.sh b/sql-bench/test-alter-table.sh index cc6453188de..f338792e9ef 100644 --- a/sql-bench/test-alter-table.sh +++ b/sql-bench/test-alter-table.sh @@ -27,6 +27,7 @@ $opt_start_field_count=8; # start with this many fields $opt_loop_count=20; # How many tests to do $opt_row_count=1000; # Rows in the table $opt_field_count=1000; # Add until this many fields. +$opt_time_limit=10*60; # Don't wait more than 10 min for some tests chomp($pwd = `pwd`); $pwd = "." if ($pwd eq ''); require "$pwd/bench-init.pl" || die "Can't read Configuration file: $!\n"; @@ -113,10 +114,9 @@ if ($opt_fast) } else { - $add=1 if (!$limits{'alter_add_multi_col'}); + $add=1 if (!$limits->{'alter_add_multi_col'}); } - $count=0; while ($field_count < $opt_field_count) { @@ -131,19 +131,43 @@ while ($field_count < $opt_field_count) $tmp="" if (!$multi_add); # Adabas } do_query($dbh,"ALTER TABLE bench " . substr($fields,1)); + $end_time=new Benchmark; + last if ($estimated=predict_query_time($loop_time,$end_time,\$count,$count, + $opt_field_count/$add+1)); } $end_time=new Benchmark; -print "Time for alter_table_add ($count): " . +if ($estimated) +{ print "Estimated time"; } +else +{ print "Time"; } +print " for alter_table_add ($count): " . timestr(timediff($end_time, $loop_time),"all") . "\n\n"; +# +# If estimated, fix table to have known number of fields +# +if ($estimated && $field_count < $opt_field_count) +{ + $fields=""; + $tmp="ADD "; + while ($field_count < $opt_field_count) + { + $field_count++; + $fields.=",$tmp i${field_count} integer"; + $tmp="" if (!$multi_add); # Adabas + } + do_query($dbh,"ALTER TABLE bench " . substr($fields,1)); +} + #### #### Test adding and deleting index on the first $opt_start_fields #### $loop_time=new Benchmark; -for ($i=1; $i < $opt_start_field_count ; $i++) +$count= 0; +for ($i=1; $i <= $opt_start_field_count ; $i++) { $dbh->do("CREATE INDEX bench_ind$i ON bench (i${i})") || die $DBI::errstr; } @@ -153,7 +177,7 @@ print "Time for create_index ($opt_start_field_count): " . timestr(timediff($end_time, $loop_time),"all") . "\n\n"; $loop_time=new Benchmark; -for ($i=1; $i < $opt_start_field_count ; $i++) +for ($i=1; $i <= $opt_start_field_count ; $i++) { $dbh->do($server->drop_index("bench","bench_ind$i")) || die $DBI::errstr; } @@ -182,10 +206,17 @@ while ($field_count > $opt_start_field_count) } $dbh->do("ALTER TABLE bench " . substr($fields,1) . $server->{'drop_attr'}) || die $DBI::errstr; + $end_time=new Benchmark; + last if ($estimated=predict_query_time($loop_time,$end_time,\$count,$count, + $opt_field_count/$add+1)); } $end_time=new Benchmark; -print "Time for alter_table_drop ($count): " . +if ($estimated) +{ print "Estimated time"; } +else +{ print "Time"; } +print " for alter_table_drop ($count): " . timestr(timediff($end_time, $loop_time),"all") . "\n\n"; skip_dropcol: |