• unknown's avatar
    Fix for segmentation fault when updating a record having a small · d1167206
    unknown authored
    BLOB whose size didn't change. Fix for probably impossible problem
    in Recovery.
    
    
    mysql-test/r/maria.result:
      result for new test
    mysql-test/t/maria.test:
      testcase for a bug (used to segfault)
    storage/maria/ma_blockrec.c:
      When writing a record, we put BLOBs into the head part if there is
      room for them. "Is there room" was first decided by
      !(tmp_data + length > end_of_data) (line 1894)
      but then was tested again as
      *blob_lengths < (ulong)(end_of_data - data). We see that in case of
      equality, the first condition was true but the second was not,
      so it was inconsistent and crashed later.
    storage/maria/ma_recovery.c:
      When wondering if recovery should update the state (like state.records):
      if table was closed, its is_of_horizon was set to X, then
      table was reopened and a REDO was written. If this REDO had LSN
      X (as horizon is just a lower bound of the LSN of the next record),
      we have to apply it. In practice this equality probably could not
      happen because of LOGREC_FILE_ID would be written before the REDO.
    d1167206
maria.result 67.8 KB