summaryrefslogtreecommitdiff
path: root/sql-bench/test-alter-table.sh
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2001-11-08 15:54:22 +0200
committermonty@hundin.mysql.fi <>2001-11-08 15:54:22 +0200
commit0fb61f0e2b9b81135558f3c7852f91a744ebd60f (patch)
treef041c20e4bea9553dbfec4de709b72029a800b95 /sql-bench/test-alter-table.sh
parent11f34156e52575fd0b8a042085dbf02638d1c727 (diff)
downloadmariadb-git-0fb61f0e2b9b81135558f3c7852f91a744ebd60f.tar.gz
--fast now does all insert/update loops in one transactions
Diffstat (limited to 'sql-bench/test-alter-table.sh')
-rw-r--r--sql-bench/test-alter-table.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/sql-bench/test-alter-table.sh b/sql-bench/test-alter-table.sh
index 276c4863d8c..af0f630d938 100644
--- a/sql-bench/test-alter-table.sh
+++ b/sql-bench/test-alter-table.sh
@@ -74,11 +74,25 @@ do_many($dbh,$server->create("bench",\@fields,\@index));
print "Insert data into the table\n";
$loop_time=new Benchmark;
+
+if ($opt_fast && defined($server->{transactions}))
+{
+ $dbh->{AutoCommit} = 0;
+ print "Transactions enabled\n" if ($opt_debug);
+}
+
for ($i=0 ; $i < $opt_row_count ; $i++)
{
$query="insert into bench values ( " . ("$i," x ($opt_start_field_count-1)) . "$i)";
$dbh->do($query) or die $DBI::errstr;
}
+
+if ($opt_fast && defined($server->{transactions}))
+{
+ $dbh->commit;
+ $dbh->{AutoCommit} = 1;
+}
+
$end_time=new Benchmark;
print "Time for insert ($opt_row_count)",