1. 26 Feb, 2021 5 commits
  2. 25 Feb, 2021 9 commits
  3. 24 Feb, 2021 13 commits
    • Daniel Black's avatar
      MDEV-23510: arm64 lf_hash alignment of pointers · e0ba68ba
      Daniel Black authored
      Like the 10.2 version 1635686b,
      except C++ on internal functions for my_assume_aligned.
      
      volatile != atomic.
      
      volatile has no memory barrier schemantics, its for mmaped IO
      so lets allow some optimizer gains and stop pretending it helps
      with memory atomicity.
      
      The MDEV lists a SEGV an assumption is made that an address was
      partially read. As C packs structs strictly in order and on arm64 the
      cache line size is 128 bits. A pointer (link - 64 bits), followed
      by a hashnr (uint32 - 32 bits), leaves the following key (uchar *
      64 bits), neither naturally aligned to any pointer and worse, split
      across a cache line which is the processors view of an atomic
      reservation of memory.
      
      lf_dynarray_lvalue is assumed to return a 64 bit aligned address.
      
      As a solution move the 32bit hashnr to the end so we don't get the
      *key pointer split across two cache lines.
      
      Tested by: Krunal Bauskar
      Reviewer: Marko Mäkelä
      e0ba68ba
    • Daniel Black's avatar
      MDEV-23510: arm64 lf_hash alignment of pointers · 1635686b
      Daniel Black authored
      volatile != atomic.
      
      volatile has no memory barrier schemantics, its for mmaped IO
      so lets allow some optimizer gains and stop pretending it helps
      with memory atomicity.
      
      The MDEV lists a SEGV an assumption is made that an address was
      partially read. As C packs structs strictly in order and on arm64 the
      cache line size is 128 bits. A pointer (link - 64 bits), followed
      by a hashnr (uint32 - 32 bits), leaves the following key (uchar *
      64 bits), neither naturally aligned to any pointer and worse, split
      across a cache line which is the processors view of an atomic
      reservation of memory.
      
      lf_dynarray_lvalue is assumed to return a 64 bit aligned address.
      
      As a solution move the 32bit hashnr to the end so we don't get the
      *key pointer split across two cache lines.
      
      Tested by: Krunal Bauskar
      Reviewer: Marko Mäkelä
      1635686b
    • Igor Babaev's avatar
      MDEV-24910 Crash with SELECT that uses table value constructor as a subselect · bf6484e7
      Igor Babaev authored
      This bug caused crashes of the server when processing queries with table
      value constructors (TVC) that contained subqueries and were used itself as
      subselects. For such TVCs the following transformation is applied at the
      prepare stage:
        VALUES (v1), ... (vn) => SELECT * FROM (VALUES (v1), ... (vn)) tvc_x.
      This transformation allows to reduce the problem of evaluation of TVCs used
      as subselects to the problem of evaluation of regular subselects.
      The transformation is implemented in the wrap_tvc(). The code the function
      to mimic the behaviour of the parser when processing the result of the
      transformation. However this imitation was not free of some flaws. First
      the function called the method exclude() that completely destroyed the
      select tree structures below the transformed TVC. Second the function
      used the procedure mysql_new_select to create st_select_lex nodes for
      both wrapping select of the transformation and TVC. This also led to
      constructing of invalid select tree structures.
      The patch actually re-engineers the code of wrap_tvc().
      
      Approved by Oleksandr Byelkin <sanja@mariadb.com>
      bf6484e7
    • Jan Lindström's avatar
      MDEV-24964 : Heap-buffer-overflow on wsrep_schema.cc ::remove_fragments · d1eeb4b8
      Jan Lindström authored
      Problem was that we used heap allocated key using too small
      array. Fixed by using dynamic memory allocation using actual
      needed size.
      d1eeb4b8
    • Marko Mäkelä's avatar
      MDEV-24884 fixup: Remove a bogus assertion · 74281fe1
      Marko Mäkelä authored
      rw_lock::upgrade_trylock(): If the compare-and-swap fails,
      only assert that we are still holding the U lock and that
      no conflicting lock exists. If the upgrade to X would fail due
      to some thread holding an S latch, we will terminate the loop.
      74281fe1
    • Marko Mäkelä's avatar
      MDEV-24951 Assertion m.first->second.valid(trx->undo_no) failed · 5c9229b9
      Marko Mäkelä authored
      trx_t::commit_in_memory(): Invoke mod_tables.clear().
      
      trx_free_at_shutdown(): Invoke mod_tables.clear() for transactions
      that are discarded on shutdown.
      
      Everywhere else, assert mod_tables.empty() on freed transaction objects.
      5c9229b9
    • Marko Mäkelä's avatar
      MDEV-20612 fixup: Reduce hash table lookups · 21987e59
      Marko Mäkelä authored
      Let us calculate the hash table cell address while we are calculating
      the latch address, to avoid repeated computations of the address.
      The latch address can be derived from the cell address with a simple
      bitmask operation.
      21987e59
    • Jan Lindström's avatar
      MDEV-24967 : Signal 11 on ha_innodb.cc::bg_wsrep_kill_trx line 18611 · f2428b9c
      Jan Lindström authored
      Null poiter reference in case where bf_thd has no trx .e.g. when
      we have MDL-conflict.
      f2428b9c
    • Jan Lindström's avatar
      MDEV-24967 : Signal 11 on ha_innodb.cc::bg_wsrep_kill_trx line 18611 · cea03285
      Jan Lindström authored
      Null poiter reference in case where bf_thd has no trx .e.g. when
      we have MDL-conflict.
      cea03285
    • Sergei Petrunia's avatar
      MDEV-24953: 10.5.9 crashes with large IN() list · f83e2ecc
      Sergei Petrunia authored
      The problem was in and_all_keys(), the code of MDEV-9759 which calculates
      the new tree weight:
      
      First, it didn't take into account the case when
      
      (next->next_key_part=tmp) == NULL
      
      and dereferenced a NULL pointer when getting tmp->weight.
      
      Second, "if (param->alloced_sel_args > SEL_ARG::MAX_SEL_ARGS) break"
      could leave the loop with incorrect value of weight.
      
      Fixed by introducing SEL_ARG::update_weight_locally() and calling it
      at the end of the function. This allows to avoid caring about all the
      above cases.
      f83e2ecc
    • Daniel Black's avatar
      MDEV-20857: perf schema conflict name filename_hash · 2628fa2d
      Daniel Black authored
      filename_hash is a function from libiberty.a from the system
      but also an expored name in the perf schema static library.
      
      We'll use a different name.
      2628fa2d
    • Marko Mäkelä's avatar
      Merge 10.5 into 10.6 · 7953bae2
      Marko Mäkelä authored
      7953bae2
    • Marko Mäkelä's avatar
      Merge 10.4 into 10.5 · f1590615
      Marko Mäkelä authored
      f1590615
  4. 23 Feb, 2021 11 commits
  5. 22 Feb, 2021 2 commits
    • Sergei Golubchik's avatar
      34fcd726
    • Monty's avatar
      MDEV-24929 Server crash in thr_multi_unlock or in get_schema_tables_result · 640f4231
      Monty authored
      This was caused by two different bugs:
      1) Information_schema tables where not locked by lock_tables, but
         get_lock_data() was not filtering these out. This caused a crash when
         mysql_unlock_some_tables() tried to unlock tables early, including
         not locked information schema tables.
      
      Fixed by not locking SYSTEM_TMP_TABLES
      
      2) In some cases the optimizer will notice that we do not need to read
         the information_schema tables at all. In this case
         join_tab->read_record is not set, which caused a crash in
         get_schema_tables_result()
      
      Fixed by ignoring const tables in get_schema_tables_result()
      640f4231