Commit 5f313125 authored by Ashish Agarwal's avatar Ashish Agarwal

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.
parent 59b4c55b
......@@ -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));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment