summaryrefslogtreecommitdiff
path: root/sql-bench/test-insert.sh
diff options
context:
space:
mode:
authormonty@donna.mysql.com <>2000-08-17 01:20:21 +0300
committermonty@donna.mysql.com <>2000-08-17 01:20:21 +0300
commit29456f6e1c9c3fa0abf58022cfe6045509b9f7c3 (patch)
tree19c14783fd50a8c44254ce4a6529d9f226add65b /sql-bench/test-insert.sh
parent3eaa2494efe181bb28f1a1089b07020f06395950 (diff)
parentc5842d42f6f9881750ec8559781fa1bac8945bda (diff)
downloadmariadb-git-29456f6e1c9c3fa0abf58022cfe6045509b9f7c3.tar.gz
Merge
Diffstat (limited to 'sql-bench/test-insert.sh')
-rwxr-xr-xsql-bench/test-insert.sh21
1 files changed, 12 insertions, 9 deletions
diff --git a/sql-bench/test-insert.sh b/sql-bench/test-insert.sh
index 5cde7c25405..da70d99d87a 100755
--- a/sql-bench/test-insert.sh
+++ b/sql-bench/test-insert.sh
@@ -1,4 +1,4 @@
-#@PERL@
+#!@PERL@
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
#
# This library is free software; you can redistribute it and/or
@@ -215,16 +215,19 @@ if ($opt_fast && defined($server->{vacuum}))
#### insert $opt_loop_count records with duplicate id
####
-print "Testing insert of duplicates\n";
-$loop_time=new Benchmark;
-for ($i=0 ; $i < $opt_loop_count ; $i++)
+if ($limits->{'unique_index'})
{
- $tmpvar^= ((($tmpvar + 63) + $i)*3 % $opt_loop_count);
- $tmp=$tmpvar % ($total_rows);
- $tmpquery = "$query" . "$tmp" . ",1,2,'D')";
- if ($dbh->do($tmpquery))
+ print "Testing insert of duplicates\n";
+ $loop_time=new Benchmark;
+ for ($i=0 ; $i < $opt_loop_count ; $i++)
{
- die "Didn't get an error when inserting duplicate record $tmp\n";
+ $tmpvar^= ((($tmpvar + 63) + $i)*3 % $opt_loop_count);
+ $tmp=$tmpvar % ($total_rows);
+ $tmpquery = "$query" . "$tmp" . ",1,2,'D')";
+ if ($dbh->do($tmpquery))
+ {
+ die "Didn't get an error when inserting duplicate record $tmp\n";
+ }
}
}