diff options
author | unknown <kaa@polly.(none)> | 2007-10-11 14:28:12 +0400 |
---|---|---|
committer | unknown <kaa@polly.(none)> | 2007-10-11 14:28:12 +0400 |
commit | 1c7b80dff98a1afdc82981e3466874596a8927d1 (patch) | |
tree | 8dd2eb20a23ac075a6d02358dc9bb587f5940b00 /mysql-test/r/repair.result | |
parent | 7a2bb241bd0a80303385ef251ccb422c99c33a0b (diff) | |
download | mariadb-git-1c7b80dff98a1afdc82981e3466874596a8927d1.tar.gz |
Fix for bug #31174: "Repair" command on MyISAM crashes with small
myisam_sort_buffer_size.
An incorrect length of the sort buffer was used when calculating the
maximum number of keys. When myisam_sort_buffer_size is small enough,
this could result in the number of keys < number of
BUFFPEK structures which in turn led to use of uninitialized BUFFPEKs.
Fixed by correcting the buffer length calculation.
myisam/sort.c:
Use a correct buffer length when calculating the maximum number of keys.
Assert that for each BUFFPEK structure there is at least one
corresponding key. Otherwise we would fail earlier and not reach
merge_buffers().
mysql-test/r/repair.result:
Added a test case for bug #31174.
mysql-test/t/repair.test:
Added a test case for bug #31174.
Diffstat (limited to 'mysql-test/r/repair.result')
-rw-r--r-- | mysql-test/r/repair.result | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/r/repair.result b/mysql-test/r/repair.result index 355a8c25434..80b716131b9 100644 --- a/mysql-test/r/repair.result +++ b/mysql-test/r/repair.result @@ -83,3 +83,30 @@ test.t1 repair status OK SET myisam_repair_threads=@@global.myisam_repair_threads; SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size; DROP TABLE t1; +CREATE TABLE t1(a CHAR(255), KEY(a)); +SET myisam_sort_buffer_size=4196; +INSERT INTO t1 VALUES +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'); +SET myisam_repair_threads=2; +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +SET myisam_repair_threads=@@global.myisam_repair_threads; +SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size; +DROP TABLE t1; +End of 4.1 tests |