#!/usr/bin/env perl # Copyright (c) 2000, 2001, 2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc. # Use is subject to license terms. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; version 2 # of the License. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, # MA 02110-1335 USA # # Test of alter table # ##################### Standard benchmark inits ##############################
use Cwd;
use DBI;
use Benchmark;
$opt_start_field_count=8; # start with this many fields
$opt_loop_count=10000; # 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
if ($opt_small_test)
{
$opt_row_count/=10;
$opt_field_count/=10;
}
if (!$limits->{'alter_table'})
{
print("Some of the servers given with --cmp or --server doesn't support ALTER TABLE\nTest aborted\n\n");
$start_time=new Benchmark;
end_benchmark($start_time);
exit 0;
}
print "Testing of ALTER TABLE\n";
print "Testing with $opt_field_count columns and $opt_row_count rows in $opt_loop_count steps\n";
#### #### Create a table and fill it with data ####
$dbh = $server->connect();
@fields=();
@index=();
push(@fields,"i1 int not null"); for ($i=2 ; $i <= $opt_start_field_count ; $i++)
{
push(@fields,"i${i} int not null");
}
$field_count= $opt_start_field_count;
################################ END ################################### #### #### End of the test...Finally print time used to execute the #### whole test.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.