Bug#11527 - Setting myisam_repair_threads to >1 leads to corruption
A wrong cast led to numeric overflow for data files greater than 4GB. The parallel repair assumed end of file after reading the amount of data that the file was bigger than 4GB. It truncated the data file and noted the number of records it found so far in the index file header as the number of rows in the table. Removing the cast fixed the problem. I added some cosmetic changes too. The normal repair worked because it uses a different function to read from the data file. mysys/mf_iocache.c: Bug#11527 - Setting myisam_repair_threads to >1 leads to corruption The pure fix was to remove a cast from a file offset difference. Supplemented this with warnings in function comments, a change from == to <= to be slightly more safe, a renaming from "read_len" to "left_length" to make the partial code duplication between _my_b_read() and _my_b_read_r() more obvious and easier to compare the functions, removed another unnecessary (but harmless) cast, and fixed coding sytle around the "left_length" changes.
Showing
Please register or sign in to comment