1. 02 Aug, 2022 4 commits
  2. 31 Jul, 2022 9 commits
  3. 30 Jul, 2022 2 commits
  4. 28 Jul, 2022 7 commits
  5. 27 Jul, 2022 10 commits
    • Sergei Golubchik's avatar
      fix func_encrypt_nossl test to work as it was supposed to · 24174cfd
      Sergei Golubchik authored
      it is designed for no-ssl builds, since 5.5 it's only embedded
      24174cfd
    • Sergei Golubchik's avatar
      fe8b99dd
    • Marko Mäkelä's avatar
      Merge 10.6 into 10.7 · 742e1c72
      Marko Mäkelä authored
      742e1c72
    • Marko Mäkelä's avatar
      Merge 10.5 into 10.6 · 30914389
      Marko Mäkelä authored
      30914389
    • Marko Mäkelä's avatar
      Merge 10.4 into 10.5 · 098c0f26
      Marko Mäkelä authored
      098c0f26
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · e5c4f4e5
      Marko Mäkelä authored
      e5c4f4e5
    • Marko Mäkelä's avatar
      MDEV-28495 InnoDB corruption due to lack of file locking · 0ee1082b
      Marko Mäkelä authored
      Starting with commit da094188 (MDEV-24393),
      MariaDB will no longer acquire advisory file locks on InnoDB data
      files by default, because it would create a large number of
      entries in Linux /proc/locks.
      
      The motivation for acquiring the file locks is to prevent accidental
      concurrent startup of multiple server processes on the same data files.
      Such mistake still turns out to be relatively common, based on
      corruption bug reports from the community.
      
      To prevent corruption due to concurrent startup attempts, the
      Aria storage engine would unconditionally acquire an advisory lock
      on one of its log files.
      
      Solution: InnoDB will always lock its system tablespace files.
      (Ever since commit 685d958e
      the InnoDB log file will not necessarily be open while the
      server is running, because it can be accessed via memory-mapped I/O.)
      
      If more protection is desired, then the option --external-locking
      can be used.
      
      The mandatory advisory lock also fixes intermittent failures of
      some crash recovery tests. It turns out that when the mtr test harness
      kills and restarts the server, it will not actually ensure that the
      old process has terminated before starting the new one.
      0ee1082b
    • Oleksandr Byelkin's avatar
      Merge branch '10.3' into 10.4 · 3bb36e94
      Oleksandr Byelkin authored
      3bb36e94
    • Marko Mäkelä's avatar
      MDEV-28950: Add a test case · 772e3f61
      Marko Mäkelä authored
      After reverting commit commit 39f45f6f
      all combinations of this test would crash the server.
      772e3f61
    • Igor Babaev's avatar
      MDEV-29139 Crash when using ANY predicand with redundant subquery in GROUP BY clause · bd935a41
      Igor Babaev authored
      This bug could cause a crash of the server when executing queries containing
      ANY/ALL predicands with redundant subqueries in GROUP BY clauses.
      These subqueries are eliminated by remove_redundant_subquery_clause()
      together with elimination of GROUP BY list containing these subqueries.
      However the references to the elements of the GROUP BY remained in the
      JOIN::all_fields list of the right operand of of the ALL/ANY predicand.
      Later these references confused make_aggr_tables_info() when forming
      proper execution structures after ALL/ANY predicands had been replaced
      with expressions containing MIN/MAX set functions.
      The patch just removes these references from JOIN::all_fields list used
      by the subquery of the ALL/ANY predicand when its GROUP BY clause is
      eliminated.
      
      Approved by Oleksandr Byelkin <sanja@mariadb.com>
      bd935a41
  6. 26 Jul, 2022 8 commits
    • Brandon Nesterenko's avatar
      MDEV-20122: Deprecate MASTER_USE_GTID=Current_Pos to favor new MASTER_DEMOTE_TO_SLAVE option · 90c3b283
      Brandon Nesterenko authored
      New Feature:
      ========
      This feature adds a safe replacement to the
      MASTER_USE_GTID=Current_Pos option for CHANGE MASTER TO as
      MASTER_DEMOTE_TO_SLAVE=<bool>. The use case of Current_Pos is to
      transition a master to become a slave; however, can break
      replication state if the slave executes local transactions due to
      actively updating gtid_current_pos with gtid_binlog_pos and
      gtid_slave_pos.
      
      MASTER_DEMOTE_TO_SLAVE changes this use case by forcing users to set
      Using_Gtid=Slave_Pos and merging gtid_binlog_pos into gtid_slave_pos
      once at CHANGE MASTER TO time. Note that if gtid_slave_pos is more
      recent than gtid_binlog_pos (as in the case of chain replication),
      the replication state should be preserved.
      
      Additionally, deprecate the `Current_Pos` option of MASTER_USE_GTID
      to suggest the safe alternative option MASTER_DEMOTE_TO_SLAVE=TRUE.
      
      Reviewed By:
      ============
      Andrei Elkin <andrei.elkin@mariadb.com>
      90c3b283
    • Brandon Nesterenko's avatar
      MDEV-19801: Change defaults for CHANGE MASTER TO so that GTID-based... · 5ab5ff08
      Brandon Nesterenko authored
      MDEV-19801: Change defaults for CHANGE MASTER TO so that GTID-based replication is used by default if master supports it
      
      This commit makes replicas crash-safe by default by changing the
      Using_Gtid value to be Slave_Pos on a fresh slave start and after
      RESET SLAVE is issued. If the primary server does not support GTIDs
      (i.e., version < 10), the replica will fall back to Using_Gtid=No on
      slave start and after RESET SLAVE.
      
      The following additional informational messages/warnings are added:
      
       1. When Using_Gtid is automatically changed. That is, if RESET
      SLAVE reverts Using_Gtid back to Slave_Pos, or Using_Gtid is
      inferred to No from a CHANGE MASTER TO given with log coordinates
      without MASTER_USE_GTID.
       2. If options are ignored in CHANGE MASTER TO. If CHANGE MASTER TO
      is given with log coordinates, yet also specifies
      MASTER_USE_GTID=Slave_Pos, a warning message is given that the log
      coordinate options are ignored.
      
      Additionally, an MTR macro has been added for RESET SLAVE,
      reset_slave.inc, which provides modes/options for resetting a slave
      in log coordinate or gtid modes. When in log coordinates mode, the
      macro will execute CHANGE MASTER TO MASTER_USE_GTID=No after the
      RESET SLAVE command. When in GTID mode, an extra parameter,
      reset_slave_keep_gtid_state, can be set to reset or preserve the
      value of gtid_slave_pos.
      
      Reviewed By:
      ===========
      Andrei Elkin <andrei.elkin@mariadb.com>
      5ab5ff08
    • Sergei Petrunia's avatar
      MDEV-28929: Plan selection takes forever with MDEV-28852 ... · 8c2faad5
      Sergei Petrunia authored
      Part #2: Extend heuristic pruning to use multiple tables as the
      "Model tables".
      
      Before the patch, heuristic pruning uses only one "Model table":
      The table which had the best cost AND record became the "Model table".
      After that, if a table's cost and record were both worse than
      those of the Model Table, the table would be pruned away.
      
      This didn't work well when the first table (the optimizer sorts them
      by record_count) had low record_count but relatively high cost: nothing
      could be pruned afterwards.
      
      The patch adds the two additional "Model tables": one with the least
      cost and the other with the least record_count.
      (In both cases, a table can be pruned away if BOTH its cost and
      record_count are worse than those of a Model table)
      
      The new pruning is active when the number of tables to consider for
      the prefix is higher than @@optimizer_extra_pruning_depth.
      
      One can see the new pruning in the Optimizer Trace as
      - "pruned_by_heuristic":"min_record_count", or
      - "pruned_by_heuristic":"min_read_time".
      Old heuristic pruning shows as "pruned_by_heuristic":1.
      8c2faad5
    • Oleg Smirnov's avatar
      MDEV-28881 Fix memory leak caused by STL usage · afadd58e
      Oleg Smirnov authored
      Dep_analysis_context::create_unique_pseudo_key_if_needed() was using
      std::set which allocated memory outside MEM_ROOT and so required
      explicit deallocation. This has been solved by replacing std::set with
      MY_BITMAP which is allocated on MEM_ROOT
      afadd58e
    • Oleg Smirnov's avatar
      MDEV-28881 Server crash in Dep_analysis_context::create_table_value · c03d50fc
      Oleg Smirnov authored
      SELECT_LEX::first_select()->join is NULL for degenerate derived tables
      which are known to have just one row and so were already materialized
      by the optimizer.
      This commit adds a check for this.
      c03d50fc
    • Oleg Smirnov's avatar
      MDEV-26278 Add functionality to eliminate derived tables from the query · 7f0201a2
      Oleg Smirnov authored
      Elimination of unnecessary tables from SQL queries is already present
      in MariaDB. But it only works for regular tables and not for derived ones.
      
      Imagine we have a view:
        CREATE VIEW v1 AS SELECT a, b, max(c) AS maxc FROM t1 GROUP BY a, b
      
      Due to "GROUP BY a, b" the values of combinations {a, b} are unique,
      and this fact can be treated as like derived table "v1" has a unique key
      on fields {a, b}.
      
      Suppose we have a SQL query:
        SELECT t2.* FROM t2 LEFT JOIN v1 ON t2.a=v1.a and t2.b=v1.b
      
      1. Since {v1.a, v1.b} is unique and both these fields are bound to t2,
         "v1" is functionally dependent on t2.
         This means every record of "t2" will be either joined with
         a single record of "v1" or NULL-complemented.
      2. No fields of "v1" are present on the SELECT list
      
      These two facts allow the server to completely exclude (eliminate)
      the derived table "v1" from the query.
      7f0201a2
    • Monty's avatar
      Reduced size of POSITION · 1f0187ff
      Monty authored
      Replaced Cost_estimate prefix_cost with a double as prefix_cost was
      only used to store and retrive total prefix cost.
      
      This also speeds up things (a bit) as don't have to call
      Cost_estimate::total_cost() for every access to the prefix_cost.
      
      Sizeof POSITION decreased from 304 to 256.
      1f0187ff
    • Monty's avatar
      Added current_cost and best_cost to optimizer trace when pruning by cost · fbbc6345
      Monty authored
      This helps a lot when trying to find out why a table combination was pruned
      fbbc6345