diff options
author | Ashish Agarwal <ashish.y.agarwal@oracle.com> | 2012-07-02 15:20:23 +0530 |
---|---|---|
committer | Ashish Agarwal <ashish.y.agarwal@oracle.com> | 2012-07-02 15:20:23 +0530 |
commit | 5f313125d428e0aaf9a27884a60c436566d63b5e (patch) | |
tree | 60685ad5b460059e89d5d2ae84b815fa28d43fa4 /storage | |
parent | 59b4c55b511ea7b1253fb2cf32c6459fbd6835a2 (diff) | |
download | mariadb-git-5f313125d428e0aaf9a27884a60c436566d63b5e.tar.gz |
BUG#13555854: CHECK AND REPAIR TABLE SHOULD BE MORE ROBUST [1]
ISSUE: Incorrect key file. Key file is corrupted,
Reading incorrect key information (keyseg)
from index file. Key definition in .MYI
and .FRM file differs. Starting pointer
to read the keyseg information is changed
to a value greater than the pack_reclength.
Memcpy tries to read keyseg information from
unallocated memory which causes the crash.
SOLUTION: One more check added to compare the
the key definition in .MYI and .FRM
file. If the definition differ, server
produces an error.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/myisam/ha_myisam.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 34532d39443..72a29cd8130 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -516,7 +516,8 @@ int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo, t1_keysegs[j].language != t2_keysegs[j].language) || t1_keysegs_j__type != t2_keysegs[j].type || t1_keysegs[j].null_bit != t2_keysegs[j].null_bit || - t1_keysegs[j].length != t2_keysegs[j].length) + t1_keysegs[j].length != t2_keysegs[j].length || + t1_keysegs[j].start != t2_keysegs[j].start) { DBUG_PRINT("error", ("Key segment %d (key %d) has different " "definition", j, i)); |