1. 02 Nov, 2020 5 commits
    • Nikita Malyavin's avatar
      MDEV-22608 ASAN use-after-poison in TABLE::check_period_overlaps · d9e00770
      Nikita Malyavin authored
      The bug was fixed by MDEV-22599 bugfix, which changed `Field::cmp` call
      to `Field::cmp_prefix` in `TABLE::check_period_overlaps`.
      
      The trick is that `Field_bit::cmp` apparently calls `Field_bit::cmp_key`,
      which condiders an argument an actual pointer to data, which isn't correct
      for `Field_bit`, since it stores data by `bit_ptr`. which is in the
      beginning of the record, and using `ptr` is incorrect (we use it through
      `ptr_in_record` call)
      d9e00770
    • Nikita Malyavin's avatar
      MDEV-22639 Assertion failed in ha_check_overlaps upon multi-table update · afca9768
      Nikita Malyavin authored
      After Sergei's cleanup this assertion is not actual anymore -- we can't
      predict if the handler was used for lookup, especially in multi-update
      scenario.
      
      `position(old_data)` is made earlier in `ha_check_overlaps`, therefore it
      is guaranteed that we compare right refs.
      afca9768
    • Nikita Malyavin's avatar
      MDEV-22714 Assertion failed upon multi-update on table WITHOUT OVERLAPS · d543363f
      Nikita Malyavin authored
      The problem here was that ha_check_overlaps internally uses ha_index_read,
      which in case of fail overwrites table->status. Even though the handlers
      are different, they share a common table, so the value is anyway spoiled.
      This is bad, and table->status is badly designed and overweighted by
      functionality, but nothing can be done with it, since the code related to
      this logic is ancient and it's impossible to extract it with normal effort.
      
      So let's just save and restore the value in ha_update_row before and after
      the checks.
      
      Other operations like INSERT and simple UPDATE are not in risk, since they
      don't use this table->status approach.
      DELETE does not do any unique checks, so it's also safe.
      d543363f
    • Nikita Malyavin's avatar
      Add DBUG_ASSERT in Field::ptr_in_record · 30894fe9
      Nikita Malyavin authored
      1. Subtracting table->record[0] from record is UB (non-contiguous buffers)
      2. It is very popular to use move_field_offset, which changes Field::ptr,
      but leaves table->record[0] unchanged. This makes a ptr_in_record result
      incorrect, since it relies on table->record[0] value.
      The check ensures the result is within the queried record boundaries.
      30894fe9
    • Elena Stepanova's avatar
      95fcd567
  2. 01 Nov, 2020 1 commit
  3. 31 Oct, 2020 1 commit
  4. 30 Oct, 2020 16 commits
  5. 29 Oct, 2020 17 commits