summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <iggy@amd64.(none)>2007-06-21 12:52:20 -0400
committerunknown <iggy@amd64.(none)>2007-06-21 12:52:20 -0400
commit2e8357b4a7ad33ca2e9b16e31fb940ae7d3e5a7b (patch)
treecdd67f4b72db4c76ed318460b653b00d231eb6e8
parente0e739b628588d5856ab634654347edae21880dd (diff)
parentc3e4b61c4eb9e2bae1137ed4c503c6f8bb33dc5d (diff)
downloadmariadb-git-2e8357b4a7ad33ca2e9b16e31fb940ae7d3e5a7b.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into amd64.(none):/src/bug27029/my50-bug27029 myisam/sort.c: Auto merged
-rw-r--r--myisam/sort.c5
-rw-r--r--mysql-test/suite/large_tests/README.TXT13
-rw-r--r--mysql-test/suite/large_tests/r/alter_table.result37
-rw-r--r--mysql-test/suite/large_tests/t/alter_table.test47
4 files changed, 100 insertions, 2 deletions
diff --git a/myisam/sort.c b/myisam/sort.c
index f918283503e..f48161b7c8e 100644
--- a/myisam/sort.c
+++ b/myisam/sort.c
@@ -138,8 +138,9 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
while (memavl >= MIN_SORT_MEMORY)
{
- if ((my_off_t) (records+1)*(sort_length+sizeof(char*)) <=
- (my_off_t) memavl)
+ if ((records < UINT_MAX32) &&
+ ((my_off_t) (records + 1) *
+ (sort_length + sizeof(char*)) <= (my_off_t) memavl))
keys= records+1;
else
do
diff --git a/mysql-test/suite/large_tests/README.TXT b/mysql-test/suite/large_tests/README.TXT
new file mode 100644
index 00000000000..51cd4e41a40
--- /dev/null
+++ b/mysql-test/suite/large_tests/README.TXT
@@ -0,0 +1,13 @@
+large_test suite
+================
+
+Iggy Galarza 07/20/07
+---------------------
+
+This test suite should include any test that requires:
+1. Longer than the default timeout to complete.
+2. A considerable amount of disk space.
+
+These tests can be completed with the following command:
+
+mysql-test-run.pl --suite=large_tests --big-test --suite-timeout=6360 --testcase-timeout=795
diff --git a/mysql-test/suite/large_tests/r/alter_table.result b/mysql-test/suite/large_tests/r/alter_table.result
new file mode 100644
index 00000000000..921711e9812
--- /dev/null
+++ b/mysql-test/suite/large_tests/r/alter_table.result
@@ -0,0 +1,37 @@
+drop table if exists t1;
+create table `t1` (`c1` tinyint unsigned not null, key `c1` (`c1`))
+engine=myisam default charset=utf8;
+alter table `t1` disable keys;
+insert into t1 values (1),(2),(3),(4);
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1 limit 2147483647;
+alter table t1 enable keys;
+drop table t1;
diff --git a/mysql-test/suite/large_tests/t/alter_table.test b/mysql-test/suite/large_tests/t/alter_table.test
new file mode 100644
index 00000000000..61f0b34d904
--- /dev/null
+++ b/mysql-test/suite/large_tests/t/alter_table.test
@@ -0,0 +1,47 @@
+# The test for bug#27029 requires about 8 hours and 20 minutes on my
+# fastest machine. This test requires at least 60 GB of disk space.
+--source include/big_test.inc
+
+#
+# Bug#27029 alter table ... enable keys crashes mysqld on large table
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+create table `t1` (`c1` tinyint unsigned not null, key `c1` (`c1`))
+engine=myisam default charset=utf8;
+alter table `t1` disable keys;
+insert into t1 values (1),(2),(3),(4);
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1 limit 2147483647; #Insert 4294967295 rows.
+alter table t1 enable keys;
+drop table t1;