2887 Hakan Kuecuekyilmaz 2008-10-28
Fix for Bug#40135.
The test case was showing long run time on slower machines. I tested it on a idle 450MHz.
PPC machine and had a run time of ~ 5 minutes. It's perfectly possible to have a runtime >
15 minutes on busy machines.
Fixed by lowering the loop count to 100k. Also created a corresponding -big.test with loop
count of 1 million.
added:
mysql-test/suite/falcon/r/falcon_bug_30124-big.result
mysql-test/suite/falcon/t/falcon_bug_30124-big.test
modified:
mysql-test/suite/falcon/r/falcon_bug_30124.result
mysql-test/suite/falcon/t/falcon_bug_30124.test
2886 Hakan Kuecuekyilmaz 2008-10-28
Merged:
mysql-6.0 --> mysql-6.0-falcon --> mysql-6.0-falcon-team
modified:
.bzr-mysql/default.conf
storage/falcon/StorageVersion.h
=== added file 'mysql-test/suite/falcon/r/falcon_bug_30124-big.result'
--- a/mysql-test/suite/falcon/r/falcon_bug_30124-big.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/falcon/r/falcon_bug_30124-big.result 2008-10-28 19:32:35 +0000
@@ -0,0 +1,34 @@
+*** Bug #30124 ***
+SET @@storage_engine = 'Falcon';
+DROP TABLE IF EXISTS t1;
+DROP PROCEDURE IF EXISTS p1;
+SET @@autocommit=0;
+CREATE TABLE t1 (a int auto_increment PRIMARY KEY, b int);
+PREPARE stmt1 FROM 'INSERT INTO t1 (b) VALUES (?)';
+CREATE PROCEDURE p1()
+BEGIN
+SET @i = 0;
+SET @v = 0;
+WHILE @i < 1000000 DO
+SET @a = @v;
+EXECUTE stmt1 USING @a;
+SET @v = @v + 1;
+IF @v = 10 THEN
+SET @v = 0;
+END IF;
+SET @i = @i + 1;
+END WHILE;
+END;//
+CALL p1;
+COMMIT;
+SET @@autocommit = 1;
+UPDATE t1 SET b = 5 WHERE b = 3;
+SELECT count(*) FROM t1;
+count(*)
+1000000
+SELECT count(*) FROM t1 WHERE b = 5;
+count(*)
+200000
+DEALLOCATE PREPARE stmt1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
=== modified file 'mysql-test/suite/falcon/r/falcon_bug_30124.result'
--- a/mysql-test/suite/falcon/r/falcon_bug_30124.result 2007-09-20 15:44:25 +0000
+++ b/mysql-test/suite/falcon/r/falcon_bug_30124.result 2008-10-28 19:32:35 +0000
@@ -9,7 +9,7 @@ CREATE PROCEDURE p1()
BEGIN
SET @i = 0;
SET @v = 0;
-WHILE @i < 500000 DO
+WHILE @i < 100000 DO
SET @a = @v;
EXECUTE stmt1 USING @a;
SET @v = @v + 1;
@@ -25,10 +25,10 @@ SET @@autocommit = 1;
UPDATE t1 SET b = 5 WHERE b = 3;
SELECT count(*) FROM t1;
count(*)
-500000
+100000
SELECT count(*) FROM t1 WHERE b = 5;
count(*)
-100000
+20000
DEALLOCATE PREPARE stmt1;
DROP TABLE t1;
DROP PROCEDURE p1;
=== added file 'mysql-test/suite/falcon/t/falcon_bug_30124-big.test'
--- a/mysql-test/suite/falcon/t/falcon_bug_30124-big.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/falcon/t/falcon_bug_30124-big.test 2008-10-28 19:32:35 +0000
@@ -0,0 +1,73 @@
+--source include/have_falcon.inc
+--source include/big_test.inc
+
+#
+# Bug #30124: UPDATE has unacceptable performance
+#
+# This update should take just a few seconds.
+# It must unlock 900,000 records after updating only 100,000.
+# With the bug, it took 30 to 60 minutes.
+# It takes a while to build the file though.
+#
+--echo *** Bug #30124 ***
+
+# ----------------------------------------------------- #
+# --- Initialisation --- #
+# ----------------------------------------------------- #
+let $engine = 'Falcon';
+eval SET @@storage_engine = $engine;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP PROCEDURE IF EXISTS p1;
+--enable_warnings
+
+SET @@autocommit=0;
+
+CREATE TABLE t1 (a int auto_increment PRIMARY KEY, b int);
+
+PREPARE stmt1 FROM 'INSERT INTO t1 (b) VALUES (?)';
+
+DELIMITER //;
+CREATE PROCEDURE p1()
+BEGIN
+ SET @i = 0;
+ SET @v = 0;
+
+ WHILE @i < 1000000 DO
+ SET @a = @v;
+
+ EXECUTE stmt1 USING @a;
+
+ SET @v = @v + 1;
+ IF @v = 10 THEN
+ SET @v = 0;
+ END IF;
+
+ SET @i = @i + 1;
+ END WHILE;
+END;//
+DELIMITER ;//
+
+CALL p1;
+COMMIT;
+
+# ----------------------------------------------------- #
+# --- Test --- #
+# ----------------------------------------------------- #
+SET @@autocommit = 1;
+UPDATE t1 SET b = 5 WHERE b = 3;
+
+# ----------------------------------------------------- #
+# --- Check --- #
+# ----------------------------------------------------- #
+SELECT count(*) FROM t1;
+SELECT count(*) FROM t1 WHERE b = 5;
+
+
+# ----------------------------------------------------- #
+# --- Final cleanup --- #
+# ----------------------------------------------------- #
+DEALLOCATE PREPARE stmt1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
=== modified file 'mysql-test/suite/falcon/t/falcon_bug_30124.test'
--- a/mysql-test/suite/falcon/t/falcon_bug_30124.test 2007-09-29 04:30:42 +0000
+++ b/mysql-test/suite/falcon/t/falcon_bug_30124.test 2008-10-28 19:32:35 +0000
@@ -1,14 +1,15 @@
--source include/have_falcon.inc
+
#
# Bug #30124: UPDATE has unacceptable performance
#
-# This update should take just a few seconds.
-# It must unlock 900,000 records after updating only 100,000.
-# With the bug, it took 30 to 60 minutes.
-# It takes a while to build the file though.
+# This update should take just a few seconds.
+# It must unlock 900,000 records after updating only 100,000.
+# With the bug, it took 30 to 60 minutes.
+# It takes a while to build the file though.
#
-# Note: original test case is with loop count of 1 mio.
-# Lowered to 500k due to long run time.
+# Note: Original test case is with loop count of 1 mio.
+# Lowered to 100k due to long run time on slow machines.
--echo *** Bug #30124 ***
# ----------------------------------------------------- #
@@ -34,7 +35,7 @@ BEGIN
SET @i = 0;
SET @v = 0;
- WHILE @i < 500000 DO
+ WHILE @i < 100000 DO
SET @a = @v;
EXECUTE stmt1 USING @a;
| Thread |
|---|
| • bzr push into mysql-6.0-falcon-team branch (hky:2886 to 2887) Bug#40135 | Hakan Kuecuekyilmaz | 29 Oct |