1. 02 Mar, 2023 1 commit
    • Daniel Black's avatar
      Deb: use MariaDB naming · a1211a4e
      Daniel Black authored
      Use MariaDB named executables.
      
      Also remove unnecessary slave references.
      
      rename 50-mysql-clients.cnf -> 50-mariadb-clients.cnf
      
      50-mysqld_safe.cnf -> 50-mariadb_safe.cnf
      a1211a4e
  2. 28 Feb, 2023 6 commits
  3. 27 Feb, 2023 2 commits
  4. 26 Feb, 2023 1 commit
    • Monty's avatar
      Fixed (non crtitial) memory segment overrun · 3b9e8dfa
      Monty authored
      This was discovered as part of adding a protected memory area between
      each area allocated by multi_alloc().
      
      The patch that adds the protection will be pushed in 10.5.
      This patch adds fixes that are unique for 10.10
      3b9e8dfa
  5. 24 Feb, 2023 1 commit
    • Marko Mäkelä's avatar
      MDEV-30671 InnoDB undo log truncation fails to wait for purge of history · 0de3be8c
      Marko Mäkelä authored
      It is not safe to invoke trx_purge_free_segment() or execute
      innodb_undo_log_truncate=ON before all undo log records in
      the rollback segment has been processed.
      
      A prominent failure that would occur due to premature freeing of
      undo log pages is that trx_undo_get_undo_rec() would crash when
      trying to copy an undo log record to fetch the previous version
      of a record.
      
      If trx_undo_get_undo_rec() was not invoked in the unlucky time frame,
      then the symptom would be that some committed transaction history is
      never removed. This would be detected by CHECK TABLE...EXTENDED that
      was impleented in commit ab019010.
      Such a garbage collection leak should be possible even when using
      innodb_undo_log_truncate=OFF, just involving trx_purge_free_segment().
      
      trx_rseg_t::needs_purge: Change the type from Boolean to a transaction
      identifier, noting the most recent non-purged transaction, or 0 if
      everything has been purged. On transaction start, we initialize this
      to 1 more than the transaction start ID. On recovery, the field may be
      adjusted to the transaction end ID (TRX_UNDO_TRX_NO) if it is larger.
      
      The field TRX_UNDO_NEEDS_PURGE becomes write-only; only some debug
      assertions that would validate the value. The field reflects the old
      inaccurate Boolean field trx_rseg_t::needs_purge.
      
      trx_undo_mem_create_at_db_start(), trx_undo_lists_init(),
      trx_rseg_mem_restore(): Remove the parameter max_trx_id.
      Instead, store the maximum in trx_rseg_t::needs_purge,
      where trx_rseg_array_init() will find it.
      
      trx_purge_free_segment(): Contiguously hold a lock on
      trx_rseg_t to prevent any concurrent allocation of undo log.
      
      trx_purge_truncate_rseg_history(): Only invoke trx_purge_free_segment()
      if the rollback segment is empty and there are no pending transactions
      associated with it.
      
      trx_purge_truncate_history(): Only proceed with innodb_undo_log_truncate=ON
      if trx_rseg_t::needs_purge indicates that all history has been purged.
      
      Tested by: Matthias Leich
      0de3be8c
  6. 23 Feb, 2023 2 commits
  7. 22 Feb, 2023 3 commits
  8. 21 Feb, 2023 11 commits
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-29871 innodb_fts.fulltext_misc unexpectedly reports a result · df9f9ba1
      Thirunarayanan Balathandayuthapani authored
      - match()+0 returns the floating result and converts into integer value
      and it leads to sporadic failure.
      df9f9ba1
    • Michael Widenius's avatar
      Added mysql-log-rotate to .gitignore · 158a5824
      Michael Widenius authored
      158a5824
    • Monty's avatar
      MDEV-30699: Updated prev_record_reads() to be more exact · 15e889c3
      Monty authored
      The old code in prev_record_reads() did give wrong estimates when a
      join_buffer was used or if the table was depending on more than one
      other tables. When join_cache is used, it will cause a re-order of row
      combinations, which causes more calls to the engine for tables that
      are depending on tables before the join_cached one.
      
      The new prev_records_read() code provides more exact estimates and
      should never give a 'too low estimate', assuming that the data to the
      function is correct
      
      The definition of prev_record_read() is also updated.
      The new definition is:
        "Estimate the number of engine ha_index_read_calls for EQ_REF tables
        when taking into account the one-row-cache in join_read_always_key()"
      
      The cost of using prev_record_reads() value is changed. The value is
      now used similar as before to calculate the cost of the storage engine
      calls. However the cost of the WHERE cost is changed to take into
      account the total number of row combinations as the WHERE has to be
      checked even if the one-row-cache is used. This makes the cost
      slightly higher than before (for the same prev_record_reads() value).
      
      Other things:
      - Cached return value of prev_record_read() in best_access_path() to
        avoid some function calls.
      - Fixed bug where position[].use_join_buffer was set in
        best_acess_path() when join buffer was not used. This confused the
        semi join optimizer to try to reoptimize plans that did not need to be
        reoptimized.
        The effect of the bug fix is that we avoid doing some re-optimziations
        with semi-joins when join_buffer is not used. In these cases the value
        shown for the 'Filtering' column in EXPLAIN EXTENDED may change.
      - Added 'prev_record.cc' that was used to verify the logic in
        prev_record_reads().
      
      Changes in test suite:
      - EQ_REF tables are moved up to be earlier. This is because either the
        higher WHERE cost when EQ_REF is used with more row combination or
        change of cost when using join_cache.
      - Filtered has changed (to the better) for some cases using semi-joins
        subselect_sj.test subselect_sj_jcl6.test
      15e889c3
    • Monty's avatar
      Added r_table_loops to "ANALYZE FORMAT=JSON statement" · 793caf3a
      Monty authored
      Author: Sergei Petrunia <sergey@mariadb.com>
      793caf3a
    • Monty's avatar
      Adjust costs for rowid filter · 3c1b7fb0
      Monty authored
      - Use log2() insted of log()
      - Added missing ''+' when calculating rowid setup cost
      - Adjusted ROWID_FILTER_PER_ELEMENT_MODIFIER (from 3 to 1)
      
      Other things:
      - Adjusted cost for index_merge where rows_out < 1.0
      
      The effects of the changes:
      - rowid filter will have higher setup cost
      - rowid filter will have slightly less costs per row
      
      This can be seen in mtr where some tests, with 'small tables or
      that uses rowid filters with many rows, will not use rowid filter anymore.
      3c1b7fb0
    • Sergei Petrunia's avatar
      MDEV-30525: Assertion `ranges > 0' fails in IO_AND_CPU_COST · 9c401c8c
      Sergei Petrunia authored
      Part #2: fix the case where table->stat_records()=1 (due to EITS
      statistics), but the range returns rows=0.
      9c401c8c
    • Sergei Petrunia's avatar
      MDEV-30659 Server crash on EXPLAIN SELECT/SELECT on table with engine Aria for LooseScan Strategy · d61bc94f
      Sergei Petrunia authored
      Amended patch from Monty:
      
      The issue was that Loose_scan_opt::save_to_position() did not take
      into account records_out from best_access_path()
      
      Make sure that POSITION object filled by Loose_scan_opt::save_to_position()
      has records_out not higher than any other possible access method.
      d61bc94f
    • Marko Mäkelä's avatar
      MDEV-30544 Deprecate innodb_defragment and related parameters · d5d7c8ba
      Marko Mäkelä authored
      There is a little used option innodb_defragment that would make
      OPTIMIZE TABLE not rebuild the table as usual for InnoDB, but
      instead cause the index B-trees to be optimized in place.
      
      This option uses excessive locking (exclusively locking index trees).
      It never covered SPATIAL INDEX or FULLTEXT INDEX. Storage space
      was never reclaimed.
      
      Because this option is not particularly useful and causes a
      maintenance burden (most recently in
      commit de4030e4),
      it is best to deprecate it, to prepare for its removal.
      d5d7c8ba
    • Marko Mäkelä's avatar
    • Alexander Barkov's avatar
      MDEV-30695 Refactor case folding data types in Asian collations · 33f8f92b
      Alexander Barkov authored
      This is a non-functional change and should not change the server behavior.
      
      Casefolding information is now stored in items of a new data type MY_CASEFOLD_CHARACTER:
      
      typedef struct casefold_info_char_t
      {
        uint32 toupper;
        uint32 tolower;
      } MY_CASEFOLD_CHARACTER;
      
      Before this change, casefolding tables for Asian collations were stored in:
      
      typedef struct unicase_info_char_st
      {
        uint32 toupper;
        uint32 tolower;
        uint32 sort;
      } MY_UNICASE_CHARACTER;
      
      The "sort" member was not used in the code handling Asian collations,
      it only wasted space.
      (it's only used by Unicode _general_ci and _general_mysql500_ci collations).
      
      Unicode collations (at least UCA and _bin) should also be refactored later,
      but under terms of a separate task.
      33f8f92b
    • Alexander Barkov's avatar
      MDEV-30692 conf_to_src is not up to date · 7e341cc7
      Alexander Barkov authored
      Fixing conf_to_src.c according to changes made by
       a206658b
      
      Re-generating ctype-extra.c at once, to fix the indentation
      from manually edited to automatic.
      7e341cc7
  9. 20 Feb, 2023 2 commits
    • Vlad Lesin's avatar
      MDEV-27701 Race on trx->lock.wait_lock between lock_rec_move() and lock_sys_t::cancel() · a474e327
      Vlad Lesin authored
      The initial issue was in assertion failure, which checked the equality
      of lock to cancel with trx->lock.wait_lock in lock_sys_t::cancel().
      
      If we analyze lock_sys_t::cancel() code from the perspective of
      trx->lock.wait_lock racing, we won't find the error there, except the
      cases when we need to reload it after the corresponding latches
      acquiring.
      
      So the fix is just to remove the assertion and reload
      trx->lock.wait_lock after acquiring necessary latches.
      
      Reviewed by: Marko Mäkelä <marko.makela@mariadb.com>
      a474e327
    • Sergei Golubchik's avatar
      bump the maturity · 799f7595
      Sergei Golubchik authored
      799f7595
  10. 17 Feb, 2023 2 commits
    • Alexander Barkov's avatar
      MDEV-30661 UPPER() returns an empty string for U+0251 in uca1400 collations for utf8 · 7f6b648d
      Alexander Barkov authored
      String length growth during upper/lower conversion
      in Unicode collations depends only on the underlying MY_UNICASE_INFO
      used in the collation.
      
      Maintaining a separate member CHARSET_INFO::caseup_multiply and
      CHARSET_INFO::casedn_multiply duplicated this information
      and caused bugs like this (when MY_UNICASE_INFO and case??_multiply
      when out of sync because of incomplete CHARSET_INFO initialization).
      
      Fix:
      
      Changing CHARSET_INFO::caseup_multiply and CHARSET_INFO::casedn_multiply
      from members to virtual functions.
      The virtual functions in Unicode collations calculate case conversion
      growth factors from the MY_UNICASE_INFO. This guarantees that the growth
      factors are always in sync with the MY_UNICASE_INFO.
      7f6b648d
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-30673 InnoDB recovery hangs when buf_LRU_get_free_block · f2dc4d4c
      Thirunarayanan Balathandayuthapani authored
      			is being called
      
      - Recovery fails to release log_sys.latch for non-last batch
      before preallocates the block in recv_read_in_area().
      f2dc4d4c
  11. 16 Feb, 2023 9 commits