List:Commits« Previous MessageNext Message »
From:Ignacio Galarza Date:June 11 2007 7:03pm
Subject:bk commit into 5.0 tree (iggy:1.2485) BUG#27029
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of iggy. When iggy does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-06-11 15:03:24-04:00, iggy@amd64.(none) +3 -0
  Bug#27029 alter table ... enable keys crashes mysqld on large table
  - When creating an index for the sort, the number of rows plus 1 is used 
  to allocate a buffer.  In this test case, the number of rows 4294967295 
  is the max value of an unsigned integer, so when 1 was added to it, a 
  buffer of size 0 was allocated causing the crash. 

  myisam/sort.c@stripped, 2007-06-11 15:03:22-04:00, iggy@amd64.(none) +3 -2
    Bug#27029 alter table ... enable keys crashes mysqld on large table
    - Check to make sure the value of records is < UINT_MAX32 to avoid a 
    false positive on the remaining condition.

  mysql-test/r/alter_table-bigger.result@stripped, 2007-06-11 15:03:22-04:00, iggy@amd64.(none) +37 -0
    Bug#27029 alter table ... enable keys crashes mysqld on large table
    - New test case.  This test case should be run alone due to the 
    time and disk space required.

  mysql-test/r/alter_table-bigger.result@stripped, 2007-06-11 15:03:22-04:00, iggy@amd64.(none) +0 -0

  mysql-test/t/alter_table-bigger.test@stripped, 2007-06-11 15:03:22-04:00, iggy@amd64.(none) +47 -0
    Bug#27029 alter table ... enable keys crashes mysqld on large table
    - New results.  This test case should be run alone due to the time 
    and disk space required.

  mysql-test/t/alter_table-bigger.test@stripped, 2007-06-11 15:03:22-04:00, iggy@amd64.(none) +0 -0

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	iggy
# Host:	amd64.(none)
# Root:	/src/bug27029/my50-bug27029

--- 1.61/myisam/sort.c	2007-05-04 19:04:07 -04:00
+++ 1.62/myisam/sort.c	2007-06-11 15:03:22 -04:00
@@ -138,8 +138,9 @@ int _create_index_by_sort(MI_SORT_PARAM 
 
   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
--- New file ---
+++ mysql-test/r/alter_table-bigger.result	07/06/11 15:03:22
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;

--- New file ---
+++ mysql-test/t/alter_table-bigger.test	07/06/11 15:03:22
# 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;

Thread
bk commit into 5.0 tree (iggy:1.2485) BUG#27029Ignacio Galarza11 Jun