summaryrefslogtreecommitdiff
path: root/sql-bench
diff options
context:
space:
mode:
authorunknown <monty@tik.mysql.com>2000-11-13 23:55:10 +0200
committerunknown <monty@tik.mysql.com>2000-11-13 23:55:10 +0200
commitf3d2341f1f30384d92b285c1e421d8c599ee2b79 (patch)
tree6689cb755cdb6ba0fb4cc6fbb215d75b175228d2 /sql-bench
parent675d31ee9a14d636d838400c670d0a1c2b964c9a (diff)
downloadmariadb-git-f3d2341f1f30384d92b285c1e421d8c599ee2b79.tar.gz
Bug fixes, TRUNCATE, safer passwords on command line and connect timeout
Docs/manual.texi: Update of safe_mysqld, TRUNCATE and changes for 3.23.28 client/mysql.cc: Added --timeout client/mysqladmin.c: Safer password handling client/mysqldump.c: Safer password handling client/mysqlimport.c: Safer password handling client/mysqlshow.c: Safer password handling configure.in: Fixes for Darwin and added test of poll include/my_pthread.h: Fixes for darwin include/violite.h: Added test for polling libmysql/libmysql.c: connect timeout libmysql/violite.c: connect timeout mysys/hash.c: Fix when delting from empty table scripts/safe_mysqld.sh: Added --open-files, --core-file-size and --timezone sql-bench/bench-init.pl.sh: Function print_time sql-bench/crash-me.sh: Added test of truncate sql-bench/test-insert.sh: More "estimated" tests sql-bench/test-select.sh: More "estimated" tests sql/filesort.cc: Removed allocation of extra memory sql/ha_berkeley.cc: Better estimation of number of rows sql/item_create.cc: Truncate sql/item_create.h: Truncate sql/item_strfunc.cc: Removed usage of MY_FAE sql/lex.h: Truncate sql/lock.cc: Fixed possible loop bug sql/log.cc: Removed usage of FILE:s sql/mysqld.cc: Print of more server variables sql/sql_class.h: Changed FILE -> File sql/sql_insert.cc: Fixed bug in temptable handling sql/sql_lex.h: Cleanup sql/sql_load.cc: Removed usage of MY_FAE sql/sql_parse.cc: Cleanup + TRUNCATE sql/sql_select.cc: Cleanup + fix for INSERT ... SELECT sql/sql_yacc.yy: TRUNCATE sql/violite.c: Merge with client/violite.c strings/strstr-sparc.s: Fixed wrong register usage
Diffstat (limited to 'sql-bench')
-rwxr-xr-xsql-bench/bench-init.pl.sh9
-rwxr-xr-xsql-bench/crash-me.sh7
-rwxr-xr-xsql-bench/test-insert.sh8
-rwxr-xr-xsql-bench/test-select.sh65
4 files changed, 59 insertions, 30 deletions
diff --git a/sql-bench/bench-init.pl.sh b/sql-bench/bench-init.pl.sh
index 3f650885c21..ae847c1a28f 100755
--- a/sql-bench/bench-init.pl.sh
+++ b/sql-bench/bench-init.pl.sh
@@ -339,6 +339,15 @@ sub end_benchmark
exit 0;
}
+sub print_time
+{
+ my ($estimated)=@_;
+ if ($estimated)
+ { print "Estimated time"; }
+ else
+ { print "Time"; }
+}
+
#
# Create a filename part for the machine that can be used for log file.
#
diff --git a/sql-bench/crash-me.sh b/sql-bench/crash-me.sh
index 6bb3eab63f9..5c993e842bc 100755
--- a/sql-bench/crash-me.sh
+++ b/sql-bench/crash-me.sh
@@ -39,7 +39,7 @@
# "3-byte int" or "same as xxx".
-$version="1.50";
+$version="1.51";
use DBI;
use Getopt::Long;
@@ -289,6 +289,11 @@ report("rename table","rename_table",
$dbh->do("drop table crash_q1");
$dbh->do("drop table crash_q");
+report("truncate table","truncate_table",
+ "create table crash_q (a integer, b integer,c CHAR(10))",
+ "truncate table crash_q",
+ "drop table crash_q1");
+
if ($dbh->do("create table crash_q (a integer, b integer,c CHAR(10))") &&
$dbh->do("create table crash_q1 (a integer, b integer,c CHAR(10) not null)"))
{
diff --git a/sql-bench/test-insert.sh b/sql-bench/test-insert.sh
index 36a2b7761d5..13bcfb2f6a9 100755
--- a/sql-bench/test-insert.sh
+++ b/sql-bench/test-insert.sh
@@ -498,6 +498,7 @@ if ($limits->{'group_functions'})
$loop_time=new Benchmark;
$count=1;
+ $estimated=0;
for ($tests=0 ; $tests < $small_loop_count ; $tests++)
{
$sth=$dbh->prepare($query="select count(*) from bench1") or die $DBI::errstr;
@@ -573,9 +574,12 @@ if ($limits->{'group_functions'})
print "Warning: '$query' returned wrong number of rows\n";
}
}
+ $end_time=new Benchmark;
+ last if ($estimated=predict_query_time($loop_time,$end_time,\$count,$tests,
+ $small_loop_count));
}
- $end_time=new Benchmark;
- print "Time for select_group ($count): " .
+ print_time($estimated);
+ print " for select_group ($count): " .
timestr(timediff($end_time, $loop_time),"all") . "\n";
$loop_time=new Benchmark;
diff --git a/sql-bench/test-select.sh b/sql-bench/test-select.sh
index 10b36e4be60..32059d6ac8a 100755
--- a/sql-bench/test-select.sh
+++ b/sql-bench/test-select.sh
@@ -205,10 +205,7 @@ for ($i=0 ; $i < $opt_small_loop_count ; $i++)
$opt_small_loop_count));
}
-if ($estimated)
-{ print "Estimated time"; }
-else
-{ print "Time"; }
+print_time($estimated);
print " for select_range ($count:$rows): " .
timestr(timediff($end_time, $loop_time),"all") . "\n";
@@ -243,10 +240,7 @@ if ($limits->{'group_functions'})
last if ($estimated=predict_query_time($loop_time,$end_time,\$count,
$tests+1, $opt_loop_count));
}
- if ($estimated)
- { print "Estimated time"; }
- else
- { print "Time"; }
+ print_time($estimated);
print " for min_max_on_key ($count): " .
timestr(timediff($end_time, $loop_time),"all") . "\n";
@@ -267,10 +261,7 @@ if ($limits->{'group_functions'})
last if ($estimated=predict_query_time($loop_time,$end_time,\$count,
$tests+1, $opt_loop_count));
}
- if ($estimated)
- { print "Estimated time"; }
- else
- { print "Time"; }
+ print_time($estimated);
print " for count_on_key ($count): " .
timestr(timediff($end_time, $loop_time),"all") . "\n\n";
@@ -289,54 +280,74 @@ if ($limits->{'group_functions'})
{
print "Testing count(distinct) on the table\n";
$loop_time=new Benchmark;
- $rows=0;
+ $rows=$estimated=$count=0;
for ($i=0 ; $i < $opt_medium_loop_count ; $i++)
{
+ $count+=2;
$rows+=fetch_all_rows($dbh,"select count(distinct region) from bench1");
$rows+=fetch_all_rows($dbh,"select count(distinct grp) from bench1");
+ $end_time=new Benchmark;
+ last if ($estimated=predict_query_time($loop_time,$end_time,\$count,$i+1,
+ $opt_medium_loop_count));
}
- $end_time=new Benchmark;
- print "Time for count_distinct ($i:$rows): " .
+ print_time($estimated);
+ print " for count_distinct ($count:$rows): " .
timestr(timediff($end_time, $loop_time),"all") . "\n";
$loop_time=new Benchmark;
- $rows=0;
+ $rows=$estimated=$count=0;
for ($i=0 ; $i < $opt_medium_loop_count ; $i++)
{
+ $count++;
$rows+=fetch_all_rows($dbh,"select region,count(distinct idn) from bench1 group by region");
+ $end_time=new Benchmark;
+ last if ($estimated=predict_query_time($loop_time,$end_time,\$count,$i+1,
+ $opt_medium_loop_count));
}
- $end_time=new Benchmark;
- print "Time for count_distinct_group_on_key ($i:$rows): " .
+ print_time($estimated);
+ print " for count_distinct_group_on_key ($count:$rows): " .
timestr(timediff($end_time, $loop_time),"all") . "\n";
$loop_time=new Benchmark;
- $rows=0;
+ $rows=$estimated=$count=0;
for ($i=0 ; $i < $opt_medium_loop_count ; $i++)
{
+ $count++;
$rows+=fetch_all_rows($dbh,"select grp,count(distinct idn) from bench1 group by grp");
+ $end_time=new Benchmark;
+ last if ($estimated=predict_query_time($loop_time,$end_time,\$count,$i+1,
+ $opt_medium_loop_count));
}
- $end_time=new Benchmark;
- print "Time for count_distinct_group_on_key_parts ($i:$rows): " .
+ print_time($estimated);
+ print " for count_distinct_group_on_key_parts ($count:$rows): " .
timestr(timediff($end_time, $loop_time),"all") . "\n";
$loop_time=new Benchmark;
- $rows=0;
+ $rows=$estimated=$count=0;
for ($i=0 ; $i < $opt_medium_loop_count ; $i++)
{
+ $count++;
$rows+=fetch_all_rows($dbh,"select grp,count(distinct rev_idn) from bench1 group by grp");
+ $end_time=new Benchmark;
+ last if ($estimated=predict_query_time($loop_time,$end_time,\$count,$i+1,
+ $opt_medium_loop_count));
}
- $end_time=new Benchmark;
- print "Time for count_distinct_group ($i:$rows): " .
+ print_time($estimated);
+ print " for count_distinct_group ($count:$rows): " .
timestr(timediff($end_time, $loop_time),"all") . "\n";
$loop_time=new Benchmark;
- $rows=0;
+ $rows=$estimated=$count=0;
for ($i=0 ; $i < $opt_medium_loop_count ; $i++)
{
+ $count++;
$rows+=fetch_all_rows($dbh,"select idn,count(distinct region) from bench1 group by idn");
+ $end_time=new Benchmark;
+ last if ($estimated=predict_query_time($loop_time,$end_time,\$count,$i+1,
+ $opt_medium_loop_count));
}
- $end_time=new Benchmark;
- print "Time for count_distinct_big ($i:$rows): " .
+ print_time($estimated);
+ print " for count_distinct_big ($count:$rows): " .
timestr(timediff($end_time, $loop_time),"all") . "\n";
}