1. 13 Nov, 2020 5 commits
    • Marko Mäkelä's avatar
      MDEV-23619: Merge 10.4 into 10.5 · ca331bdc
      Marko Mäkelä authored
      ca331bdc
    • Marko Mäkelä's avatar
      Merge 10.4 into 10.5 · d7a58248
      Marko Mäkelä authored
      d7a58248
    • Marko Mäkelä's avatar
      MDEV-23619: Merge 10.3 into 10.4 · b63dc3f3
      Marko Mäkelä authored
      b63dc3f3
    • Marko Mäkelä's avatar
      MDEV-23619: Merge 10.2 into 10.3 · 6fed6de9
      Marko Mäkelä authored
      6fed6de9
    • Igor Babaev's avatar
      MDEV-23619 MariaDB crash on WITH RECURSIVE UNION ALL (CTE) query · 190e8a4c
      Igor Babaev authored
      Due to a premature cleanup of the unit that specified a recursive CTE
      used in the second operand of union the server fell into an infinite
      loop in the reported test case. In other cases this premature cleanup
      could cause other problems.
      The bug is the result of a not quite correct fix for MDEV-17024. The
      unit that specifies a recursive CTE has to be cleaned only after the
      cleanup of the last external reference to this CTE. It means that
      cleanups of the unit triggered not by the cleanup of a external
      reference to the CTE must be blocked.
      Usage of local table chains in selects to get external references to
      recursive CTEs was not correct either because of possible merges of
      some selects.
      
      Also fixed a minor bug in st_select_lex::set_explain_type() that caused
      typing 'RECURSIVE UNION' instead of 'UNION' in EXPLAIN output for external
      references to a recursive CTE.
      190e8a4c
  2. 12 Nov, 2020 6 commits
    • Sujatha's avatar
      Merge branch '10.3' into 10.4 · b2029c03
      Sujatha authored
      b2029c03
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · 972dc6ee
      Marko Mäkelä authored
      972dc6ee
    • Sujatha's avatar
      Merge branch '10.2' into 10.3 · bafb011a
      Sujatha authored
      bafb011a
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 150f447a
      Marko Mäkelä authored
      150f447a
    • Sujatha's avatar
      MDEV-4633: multi_source.simple test fails sporadically · 984a06db
      Sujatha authored
      Analysis:
      ========
      Writes to 'rli->log_space_total' needs to be synchronized, otherwise both
      SQL_THREAD and IO_THREAD can try to modify the variable simultaneously
      resulting in incorrect rli->log_space_total.  In the current test scenario
      SQL_THREAD is trying to decrement 'rli->log_space_total' in 'purge_first_log'
      and IO_THREAD is trying to increment the 'rli->log_space_total' in
      'queue_event' simultaneously. Hence test occasionally fails with  result
      mismatch.
      
      Fix:
      ===
      Convert 'rli->log_space_total' variable to atomic type.
      984a06db
    • Marko Mäkelä's avatar
      MDEV-24196 WITH_UBSAN: member call on null pointer of log_phys_t · 97569d3c
      Marko Mäkelä authored
      MDEV-12353 deliberately tries to avoid memory alignment overhead in
      log_phys_t, storing the stream of log records bytes straight after
      a header object. But, offsetof() is not allowed on C++ data objects,
      and neither are attempts to emulate it by invoking a member function
      on a null pointer.
      
      log_phys_t::len: Remove. Make it part of the byte stream that
      immediately follow the object. Thanks to Eugene Kosov for this idea.
      
      log_phys_t::start(): The start address of the following byte stream.
      
      log_phys_t::len(): Compute len.
      
      log_phys_t::alloc_size(): Use a simple sizeof calculation.
      97569d3c
  3. 11 Nov, 2020 15 commits
    • Marko Mäkelä's avatar
      Merge mariadb-10.2.36 into 10.2 · dd33a70d
      Marko Mäkelä authored
      dd33a70d
    • Marko Mäkelä's avatar
      Merge mariadb-10.3.27 into 10.3 · 340feb01
      Marko Mäkelä authored
      340feb01
    • sjaakola's avatar
      MDEV-24119 MDL BF-BF Conflict caused by TRUNCATE TABLE · 2fbcddbe
      sjaakola authored
      A follow-up fix, for original fix for MDEV-21577, which did not handle well
      temporary tables.
      
      OPTIMIZE and REPAIR TABLE statements can take a list of tables as argument,
      and some of the tables may be temporary. Proper handling of temporary tables
      is to skip them and continue working on the real tables. The bad version, skipped all tables,
      if a single temporary table was in the argument list. And this resulted so that FK parent
      tables were not scnanned for the remaining real tables. Some mtr tests, using OPTIMIZE or REPAIR
      for temporary tables caused regressions bacause of this, e.g. galera.galera_optimize_analyze_multi
      
      The fix in this PR opens temporary and real tables first, and in the table handling loop skips
      temporary tables, FK parent scanning is done only for real tables.
      
      The test has new scenario for OPTIMIZE and REPAIR issued for two tables of which one is temporary table.
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      2fbcddbe
    • sjaakola's avatar
      MDEV-24119 MDL BF-BF Conflict caused by TRUNCATE TABLE · ad432ef4
      sjaakola authored
      This PR fixes same issue as MDEV-21577 for TRUNCATE TABLE.
      MDEV-21577 fixed TOI replication for OPTIMIZE, REPAIR and ALTER TABLE
      operating on FK child table. It was later found out that also TRUNCATE
      has similar problem and needs a fix.
      
      The actual fix is to do FK parent table lookup before TRUNCATE TOI
      isolation and append found FK parent table names in certification key
      list for the write set.
      
      PR contains also new test scenario in galera_ddl_fk_conflict test where
      FK child has two FK parent tables and there are two DML transactions operating
      on both parent tables.
      
      For development convenience, new TO isolation macro was added:
      WSREP_TO_ISOLATION_BEGIN_IF and WSREP_TO_ISOLATION_BEGIN_ALTER macro was changed
      to skip the goto statement.
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      ad432ef4
    • Marko Mäkelä's avatar
      Merge mariadb-10.5.8 into 10.5 · b4a5ad8d
      Marko Mäkelä authored
      b4a5ad8d
    • Marko Mäkelä's avatar
      Merge mariadb-10.4.17 into 10.4 · 99a97747
      Marko Mäkelä authored
      99a97747
    • Daniel Bartholomew's avatar
      bump the VERSION · fff469db
      Daniel Bartholomew authored
      fff469db
    • Daniel Bartholomew's avatar
      bump the VERSION · 940db6ab
      Daniel Bartholomew authored
      940db6ab
    • Daniel Bartholomew's avatar
      bump the VERSION · bafbfb55
      Daniel Bartholomew authored
      bafbfb55
    • Daniel Bartholomew's avatar
      bump the VERSION · 15550ed3
      Daniel Bartholomew authored
      15550ed3
    • Marko Mäkelä's avatar
      Cleanup: Remove dict_space_is_empty(), dict_space_get_id() · d6ee2858
      Marko Mäkelä authored
      As noted in commit 0b66d3f7,
      MariaDB does not support CREATE TABLESPACE for InnoDB.
      Hence, some code that was added in
      commit fec844ac
      and originally in
      mysql/mysql-server@c71dd213bd434c0579e454ab8880e6d3756b0fb0
      is unused in MariaDB and should be removed.
      d6ee2858
    • Marko Mäkelä's avatar
      MDEV-24156 trx_undo_left() fails to prevent overflow · 7b7e5922
      Marko Mäkelä authored
      trx_undo_left(): Return 0 in case of an overflow, instead of
      returning a negative number interpreted as a large positive number.
      Also, add debug assertions to check that the pointer is within
      the page area. This should allow us to catch bugs like
      MDEV-24096 easier in the future.
      7b7e5922
    • Marko Mäkelä's avatar
      MDEV-24182 ibuf_merge_or_delete_for_page() contains dead code · bd528b0c
      Marko Mäkelä authored
      The function ibuf_merge_or_delete_for_page() was always being
      invoked with update_ibuf_bitmap=true ever since
      commit cd623508
      fixed up something after MDEV-9566.
      
      Furthermore, the parameter page_size is never being passed as a
      null pointer, and therefore it should better be a reference to
      a constant object.
      bd528b0c
    • Marko Mäkelä's avatar
      MDEV-24190 Accessing INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION may... · e9b3d44c
      Marko Mäkelä authored
      MDEV-24190 Accessing INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION may break innodb_open_files logic
      
      If the function i_s_tablespaces_encryption_fill_table() was not able to
      report all content to the SQL layer, it would fail to decrement
      fil_system.freeze_space_list that it had incremented. This would
      prevent the not-frequently-used logic from working, potentially causing
      frequently used files to be closed and reopened whenever innodb_open_files
      is exceeded.
      
      This regression was caused by
      commit 45ed9dd9 (part of MDEV-23855).
      e9b3d44c
    • Daniele Sciascia's avatar
      Update wsrep-lib · 83f3d12f
      Daniele Sciascia authored
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      83f3d12f
  4. 10 Nov, 2020 8 commits
  5. 09 Nov, 2020 6 commits
    • Marko Mäkelä's avatar
      MDEV-24096 InnoDB assertion 'first_free <= srv_page_size - 8' · a0536d42
      Marko Mäkelä authored
      MDEV-23672 (commit 7eda5561)
      introduced a regression that can corrupt not only undo log pages,
      but anything that resides in the InnoDB buffer pool.
      
      trx_undo_left(): Add debug assertions for the assumptions.
      If the pointer is out of bounds, we will return a positive
      number, not a negative one. Thus, once a page overflow occurs,
      further overflow to adjacent pages will be allowed.
      This allows us to remove some more relaxed debug assertions
      from some callers.
      
      trx_undo_log_v_idx(): Correctly calculate the size limit.
      a0536d42
    • Sergei Golubchik's avatar
      Merge branch '10.2' into 10.3 · 212d92ad
      Sergei Golubchik authored
      212d92ad
    • Igor Babaev's avatar
      MDEV-23811: With large number of indexes optimizer chooses an inefficient plan · bea84aef
      Igor Babaev authored
      This bug could manifest itself for a query with WHERE condition containing
      top level OR formula such that each conjunct contained a single-range
      condition supported by the same index. One of these range conditions must
      be fully covered by another range condition that is used later in the OR
      formula. Additionally at least one of these condition should be ANDed with
      a sargable range condition supported by a different index.
      
      There were several attempts to fix related problems for OR conditions after
      the backport of range optimizer code from MySQL (commit
      0e19f3e3). Unfortunately the first of these
      fixes contained typo remained unnoticed until recently. This typo bug led
      to rejection of valid range accesses. This patch fixed this typo bug.
      The fix revealed another two bugs: one in a constructor for SEL_ARG,
      the other in the function tree_or(). Both are fixed in this patch.
      bea84aef
    • Monty's avatar
      Fixed failing maria.create test · 10b2d572
      Monty authored
      This comes from a wrong merge from 10.3
      10b2d572
    • Sergei Petrunia's avatar
      MDEV-24117: Memory management problem ...: Add a testcase · 1404f3be
      Sergei Petrunia authored
      Add a testcase.
      1404f3be
    • Sergei Petrunia's avatar
      MDEV-24117: Memory management problem in statistics state for ... IN · f81eef62
      Sergei Petrunia authored
      Part#1: Revert the patch that caused it:
      
      commit 291be494
      Author: Igor Babaev <igor@askmonty.org>
      Date:   Thu Sep 24 22:02:00 2020 -0700
      
          MDEV-23811: With large number of indexes optimizer chooses an inefficient plan
      f81eef62