Commit 19b15bfe authored by unknown's avatar unknown

Updated benchmarks

Portability fixes.
Fixed bug in mysqlbinlog when detecting binary log version


client/mysqlbinlog.cc:
  Fixed bug when detecting binary log version
configure.in:
  Portability fix for HPUX
mysql-test/mysql-test-run.sh:
  Portability fix
sql-bench/bench-init.pl.sh:
  Updated benchmarks
sql-bench/run-all-tests.sh:
  Updated benchmarks
sql-bench/server-cfg.sh:
  Updated benchmarks
sql-bench/test-ATIS.sh:
  Updated benchmarks
sql-bench/test-connect.sh:
  Updated benchmarks
parent 1c7328c8
......@@ -20,7 +20,7 @@
#include <time.h>
#include "log_event.h"
#define PROBE_HEADER_LEN (4+EVENT_LEN_OFFSET)
#define PROBE_HEADER_LEN (4+EVENT_LEN_OFFSET+4)
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_LOCAL_FILES)
......@@ -102,7 +102,7 @@ static void die(const char* fmt, ...)
static void print_version()
{
printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE);
printf("%s Ver 1.7 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE);
}
......
......@@ -819,8 +819,8 @@ case $SYSTEM_TYPE in
;;
*hpux10.20*)
echo "Enabling snprintf workaround for hpux 10.20"
CFLAGS="$CFLAGS -DHAVE_BROKEN_SNPRINTF -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX"
CXXFLAGS="$CXXFLAGS -DHAVE_BROKEN_SNPRINTF -D_INCLUDE_LONGLONG -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX"
CFLAGS="$CFLAGS -DHAVE_BROKEN_SNPRINTF -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX -DSIGNAL_WITH_VIO_CLOSE"
CXXFLAGS="$CXXFLAGS -DHAVE_BROKEN_SNPRINTF -D_INCLUDE_LONGLONG -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX -DSIGNAL_WITH_VIO_CLOSE"
if test "$with_named_thread" = "no"
then
echo "Using --with-named-thread=-lpthread"
......
......@@ -30,7 +30,7 @@ which ()
do
for dir in $PATH
do
if test -e $dir/$file
if test -f $dir/$file
then
echo "$dir/$file"
continue 2
......@@ -49,7 +49,7 @@ sleep_until_file_deleted ()
loop=$SLEEP_TIME_FOR_DELETE
while (test $loop -gt 0)
do
if [ ! -e $file ]
if [ ! -r $file ]
then
sleep $SLEEP_TIME_AFTER_RESTART
return
......@@ -65,7 +65,7 @@ sleep_until_file_exists ()
org_time=$2
while (test $loop -gt 0)
do
if [ -e $file ]
if [ -r $file ]
then
return
fi
......@@ -317,15 +317,15 @@ MANAGER_PID_FILE="$MYRUN_DIR/manager.pid"
MASTER_MYDDIR="$MYSQL_TEST_DIR/var/master-data"
MASTER_MYSOCK="$MYSQL_TMP_DIR/master.sock"
MASTER_MYPID="$MYRUN_DIR/mysqld.pid"
MASTER_MYLOG="$MYSQL_TEST_DIR/var/log/mysqld.log"
MASTER_MYERR="$MYSQL_TEST_DIR/var/log/mysqld.err"
MASTER_MYPID="$MYRUN_DIR/master.pid"
MASTER_MYLOG="$MYSQL_TEST_DIR/var/log/master.log"
MASTER_MYERR="$MYSQL_TEST_DIR/var/log/master.err"
SLAVE_MYDDIR="$MYSQL_TEST_DIR/var/slave-data"
SLAVE_MYSOCK="$MYSQL_TMP_DIR/slave.sock"
SLAVE_MYPID="$MYRUN_DIR/mysqld-slave.pid"
SLAVE_MYLOG="$MYSQL_TEST_DIR/var/log/mysqld-slave.log"
SLAVE_MYERR="$MYSQL_TEST_DIR/var/log/mysqld-slave.err"
SLAVE_MYPID="$MYRUN_DIR/slave.pid"
SLAVE_MYLOG="$MYSQL_TEST_DIR/var/log/slave.log"
SLAVE_MYERR="$MYSQL_TEST_DIR/var/log/slave.err"
SMALL_SERVER="-O key_buffer_size=1M -O sort_buffer=256K -O max_heap_table_size=1M"
......
......@@ -44,6 +44,8 @@ $opt_server="mysql"; $opt_dir="output";
$opt_host="localhost";$opt_database="test";
$opt_machine=""; $opt_suffix="";
$opt_create_options=undef;
$opt_optimization="None";
$opt_hw="";
$opt_threads=5;
$opt_time_limit=10*60; # Don't wait more than 10 min for some tests
......@@ -51,9 +53,9 @@ $opt_time_limit=10*60; # Don't wait more than 10 min for some tests
$log_prog_args=join(" ", skip_arguments(\@ARGV,"comments","cmp","server",
"user", "host", "database", "password",
"use-old-results","skip-test",
"optimization","hw",
"machine", "dir", "suffix", "log"));
GetOptions("skip-test=s","comments=s","cmp=s","server=s","user=s","host=s","database=s","password=s","loop-count=i","row-count=i","skip-create","skip-delete","verbose","fast-insert","lock-tables","debug","fast","force","field-count=i","regions=i","groups=i","time-limit=i","log","use-old-results","machine=s","dir=s","suffix=s","help","odbc","small-test","small-tables","small-key-tables","stage=i","threads=i","random","old-headers","die-on-errors","create-options=s","hires","tcpip","silent",
"socket=s") || usage();
GetOptions("skip-test=s","comments=s","cmp=s","server=s","user=s","host=s","database=s","password=s","loop-count=i","row-count=i","skip-create","skip-delete","verbose","fast-insert","lock-tables","debug","fast","force","field-count=i","regions=i","groups=i","time-limit=i","log","use-old-results","machine=s","dir=s","suffix=s","help","odbc","small-test","small-tables","small-key-tables","stage=i","threads=i","random","old-headers","die-on-errors","create-options=s","hires","tcpip","silent","optimization=s","hw=s","socket=s") || usage();
usage() if ($opt_help);
$server=get_server($opt_server,$opt_host,$opt_database,$opt_odbc,
......@@ -585,6 +587,13 @@ All benchmarks takes the following options:
--verbose
This is a test specific option that is only used when debugging a test.
Print more information about what is going on.
--optimization='some comments'
Add coments about optimization of DBMS, which was done before the test.
--hw='some comments'
Add coments about hardware used for this test.
EOF
exit(0);
}
......
......@@ -109,7 +109,9 @@ print "Running tests on: $machine\n";
print "Arguments: $log_prog_args\n";
print "Comments: $opt_comments\n";
print "Limits from: $opt_cmp\n";
print "Server version: $server_version\n\n";
print "Server version: $server_version\n";
print "Optimization: $opt_optimization\n";
print "Hardware: $opt_hw\n\n";
$estimated=$warning=$got_warning=0;
......@@ -285,10 +287,6 @@ sub read_headers
{
$log_prog_args=$1;
}
elsif (/^Comments.*:\s+(.*)$/)
{
$opt_comments=$1;
}
elsif (/^Limits.*:\s+(.*)$/)
{
$opt_cmp=$1;
......@@ -297,6 +295,14 @@ sub read_headers
{
$server_version=$1;
}
elsif (/^Optimiz.*:\s+(.*)$/)
{
$opt_optimization=$1;
}
elsif (/^Hardwar.*:\s+(.*)$/)
{
$opt_hw=$1;
}
}
close(TMP);
}
......@@ -2248,7 +2248,6 @@ sub fix_for_insert
#############################################################################
# Configuration for Sybase
#############################################################################
package db_sybase;
sub new
......@@ -2259,10 +2258,10 @@ sub new
bless $self;
$self->{'cmp_name'} = "sybase";
$self->{'data_source'} = "DBI:ODBC:$database";
$self->{'data_source'} = "DBI:Sybase:database=$database";
if (defined($host) && $host ne "")
{
$self->{'data_source'} .= ":$host";
$self->{'data_source'} .= ";hostname=$host";
}
$self->{'limits'} = \%limits;
$self->{'smds'} = \%smds;
......@@ -2327,7 +2326,19 @@ sub new
sub version
{
my ($self)=@_;
return "Sybase enterprise 11.5 NT"; #DBI/ODBC can't return the server version
my ($dbh,$sth,$version,@row);
$dbh=$self->connect();
$sth = $dbh->prepare('SELECT @@version') or die $DBI::errstr;
$version="Sybase (unknown)";
if ($sth->execute && (@row = $sth->fetchrow_array))
{
$version=$row[0];
}
$sth->finish;
$dbh->disconnect;
return $version;
}
sub connect
......@@ -2335,7 +2346,7 @@ sub connect
my ($self)=@_;
my ($dbh);
$dbh=DBI->connect($self->{'data_source'}, $main::opt_user,
$main::opt_password,{ PrintError => 0}) ||
$main::opt_password,{ PrintError => 0 , AutoCommit => 1}) ||
die "Got error: '$DBI::errstr' when connecting to " . $self->{'data_source'} ." with user: '$main::opt_user' password: '$main::opt_password'\n";
return $dbh;
}
......@@ -2428,7 +2439,9 @@ sub fix_for_insert
#
# optimize the tables ....
#
# WARNING (from walrus)! This sub will work only from DBD:sybase
# driver. Because if we use ODBC we don't know actual database name
# (but DSN name only)
sub vacuum
{
my ($self,$full_vacuum,$dbh_ref)=@_;
......@@ -2440,7 +2453,25 @@ sub vacuum
}
$dbh=$$dbh_ref;
$loop_time=new Benchmark;
$dbh->do("analyze table ?? compute statistics") || die "Got error: $DBI::errstr when executing 'vacuum'\n";
my (@tables,$sth,$current_table,$current_base);
$dbh->do("dump tran $database with truncate_only");
$sth=$dbh->prepare("sp_tables" ) or die "prepere";
$sth->execute() or die "execute";
while (@row = $sth->fetchrow_array()) {
$current_table = $row[2];
$current_base = $row[0];
next if ($current_table =~ /^sys/);
push(@tables,$current_table) if ($database == $current_base);
}
$sth->finish();
foreach $table (@tables) {
# print "$table: \n";
$dbh->do("update statistics $table") or print "Oops!";
}
# $dbh->do("analyze table ?? compute statistics") || die "Got error: $DBI::errstr when executing 'vacuum'\n";
$end_time=new Benchmark;
print "Time for book-keeping (1): " .
Benchmark::timestr(Benchmark::timediff($end_time, $loop_time),"all") . "\n\n";
......@@ -2448,6 +2479,8 @@ sub vacuum
}
#############################################################################
# Definitions for Adabas
#############################################################################
......@@ -2935,7 +2968,6 @@ sub new
$smds{'q15'} = 'd';
$smds{'q16'} = 'a';
$smds{'q17'} = 'c';
return $self;
}
......@@ -2984,23 +3016,35 @@ sub connect
sub create
{
my($self,$table_name,$fields,$index,$options) = @_;
my($query,@queries);
my($query,@queries,@indexes);
$query="create table $table_name (";
foreach $field (@$fields)
{
$field =~ s/ decimal/ double(10,2)/i;
$field =~ s/ big_decimal/ double(10,2)/i;
$field =~ s/ date/ int/i; # Because of tcp ?
$field =~ s/ tinyint\(.*\)/ smallint/i;
$field =~ s/ smallint\(.*\)/ smallint/i;
$field =~ s/ mediumint/ integer/i;
$field =~ s/ float\(.*\)/ float/i;
# $field =~ s/ date/ int/i; # Because of tcp ?
$query.= $field . ',';
}
foreach $index (@$index)
{
$query.= $index . ',';
if ( $index =~ /\bINDEX\b/i )
{
my @fields = split(' ',$index);
my $query="CREATE INDEX $fields[1] ON $table_name $fields[2]";
push(@indexes,$query);
} else {
$query.= $index . ',';
}
}
substr($query,-1)=")"; # Remove last ',';
$query.=" $options" if (defined($options));
push(@queries,$query);
push(@queries,$query,@indexes);
return @queries;
}
......@@ -3360,13 +3404,13 @@ sub version
my ($self)=@_;
my ($dbh,$sth,$version,@row);
$dbh=$self->connect();
# $dbh=$self->connect();
#
# Pick up SQLGetInfo option SQL_DBMS_VER (18)
#
#$version = $dbh->func(18, GetInfo);
$version="FrontBase 2.1";
$dbh->disconnect;
$version="FrontBase 3.3";
# $dbh->disconnect;
return $version;
}
......@@ -3401,7 +3445,7 @@ sub connect
sub create
{
my($self,$table_name,$fields,$index,$options) = @_;
my($query,@queries);
my($query,@queries,@indexes,@keys);
$query="create table $table_name (";
foreach $field (@$fields)
......@@ -3419,18 +3463,18 @@ sub create
}
foreach $ind (@$index)
{
my @index;
if ( $ind =~ /\bKEY\b/i ){
# my @index;
if ( $ind =~ /(\bKEY\b)|(\bUNIQUE\b)/i ){
push(@keys,"ALTER TABLE $table_name ADD $ind");
}else{
my @fields = split(' ',$index);
my @fields = split(' ',$ind);
my $query="CREATE INDEX $fields[1] ON $table_name $fields[2]";
push(@index,$query);
push(@indexes,$query);
}
}
substr($query,-1)=")"; # Remove last ',';
$query.=" $options" if (defined($options));
push(@queries,$query);
push(@queries,$query,@keys,@indexes);
return @queries;
}
......
......@@ -224,7 +224,7 @@ print "Retrieving data\n";
"SELECT airport.country_name,state.state_name,city.city_name,airport_service.direction FROM airport_service,state,airport,city WHERE airport_service.city_code=city.city_code AND airport_service.airport_code=airport.airport_code AND state.state_code=airport.state_code AND state.state_code=city.state_code AND airport.state_code=city.state_code AND airport.country_name=city.country_name AND airport.country_name=state.country_name AND city.time_zone_code=airport.time_zone_code GROUP BY airport.country_name,state.state_name,city.city_name,airport_service.direction ORDER BY state_name DESC",11,$limits->{'group_functions'},
"SELECT airport.country_name,state.state_name,city.city_name,airport_service.direction FROM airport_service,state,airport,city WHERE airport_service.city_code=city.city_code AND airport_service.airport_code=airport.airport_code AND state.state_code=airport.state_code AND state.state_code=city.state_code AND airport.state_code=city.state_code AND airport.country_name=city.country_name AND airport.country_name=state.country_name AND city.time_zone_code=airport.time_zone_code GROUP BY airport.country_name,state.state_name,city.city_name,airport_service.direction ORDER BY state_name",11,$limits->{'group_functions'},
"SELECT from_airport,to_airport,fare.fare_class,night,one_way_cost,rnd_trip_cost,class_days FROM compound_class,fare WHERE compound_class.fare_class=fare.fare_class AND one_way_cost <= 825 AND one_way_cost >= 280 AND from_airport='SFO' AND to_airport='DFW' GROUP BY from_airport,to_airport,fare.fare_class,night,one_way_cost,rnd_trip_cost,class_days ORDER BY one_way_cost",10,$limits->{'group_functions'},
"select engines,category,cruising_speed,from_airport,to_airport FROM aircraft,flight WHERE category='JET' AND ENGINES >= 1 AND aircraft.aircraft_code=flight.aircraft_code AND to_airport NOT LIKE from_airport AND stops>0 GROUP BY engines,category,cruising_speed,from_airport,to_airport ORDER BY engines DESC",29,$limits->{'group_functions'} && $limits->{'like_with_column'},
"select engines,category,cruising_speed,from_airport,to_airport FROM aircraft,flight WHERE category='JET' AND engines >= 1 AND aircraft.aircraft_code=flight.aircraft_code AND to_airport NOT LIKE from_airport AND stops>0 GROUP BY engines,category,cruising_speed,from_airport,to_airport ORDER BY engines DESC",29,$limits->{'group_functions'} && $limits->{'like_with_column'},
);
@Q=(\@Q1,\@Q2,\@Q21,\@Q3,\@Q4);
......
......@@ -311,7 +311,7 @@ $sth = $dbh->do("drop table bench1" . $server->{'drop_attr'})
or do
{
# Fix for Access 2000
die $dbh->errstr if (!$dbh->abort_if_fatal_error());
die $dbh->errstr if (!$server->abort_if_fatal_error());
};
if ($opt_fast && defined($server->{vacuum}))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment