summaryrefslogtreecommitdiff
path: root/sql-bench/test-alter-table.sh
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-11-08 15:54:22 +0200
committerunknown <monty@hundin.mysql.fi>2001-11-08 15:54:22 +0200
commit40bfbe0bfaaa1bedf9dd7ff5fdcb836eb102911d (patch)
treef041c20e4bea9553dbfec4de709b72029a800b95 /sql-bench/test-alter-table.sh
parent897e7453d6c669f7460a242a81b874bd0302007b (diff)
downloadmariadb-git-40bfbe0bfaaa1bedf9dd7ff5fdcb836eb102911d.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)",