• unknown's avatar
    Bug#33222 - myisam-table drops rows when column is added · c3bf7021
    unknown authored
               and a char-field > 128 exists
    
    CHECK TABLE (non-QUICK) and any form of repair table did wrongly rate
    records as corrupted under the following conditions:
    1. The table has dynamic row format and
    2. it has a CHAR like column > 127 bytes (but not VARCHAR)
       (for multi-byte character sets this could be less than 127
       characters) and
    3. it has records with > 127 bytes significant length in that column
       (a byte beyond byte position 127 must be non-space).
    Affected were the statements CHECK TABLE, REPAIR TABLE, OPTIMIZE TABLE,
    ALTER TABLE. CHECK TABLE reported and marked the table as crashed if any
    record was present that fulfilled condition 3. The other statements
    deleted these records.
    
    The problem was a signed/unsigned compare in MyISAM code. A
    char to uchar change became necessary after the big byte to uchar
    change.
    
    
    mysql-test/r/myisam.result:
      Bug#33222 - myisam-table drops rows when column is added
                 and a char-field > 128 exists
      Added test result.
    mysql-test/t/myisam.test:
      Bug#33222 - myisam-table drops rows when column is added
                 and a char-field > 128 exists
      Added test.
    storage/myisam/mi_dynrec.c:
      Bug#33222 - myisam-table drops rows when column is added
                 and a char-field > 128 exists
      char -> uchar became necessary after big byte -> uchar change.
      Fixed some small coding style violations near the changes.
    c3bf7021
mi_dynrec.c 55.4 KB