1. 05 Jul, 2023 1 commit
  2. 03 Jul, 2023 4 commits
  3. 30 Jun, 2023 3 commits
    • Marko Mäkelä's avatar
      MDEV-31559 btr_search_hash_table_validate() does not check if CHECK TABLE is killed · 3d901438
      Marko Mäkelä authored
      btr_search_hash_table_validate(), btr_search_validate(): Add the
      parameter THD for checking if the statement has been killed.
      Any non-QUICK CHECK TABLE will validate the entire adaptive hash index
      for all InnoDB tables, which may be extremely slow when running
      multiple concurrent CHECK TABLE.
      3d901438
    • Marko Mäkelä's avatar
      Merge 10.6 into 10.9 · d04de1aa
      Marko Mäkelä authored
      d04de1aa
    • Oleg Smirnov's avatar
      MDEV-30639 Upgrade to 10.8 and later does not work on Windows · 6d911219
      Oleg Smirnov authored
      During the upgrade procedure on Windows mysqld.exe is started with
      the named pipe connection protocol. mysqladmin.exe then pings the
      server to check if is up and running. Command line looks like:
         mysqladmin.exe --protocol=pipe --socket=mysql_upgrade_service_xxx ping
      But the "socket" parameter resets the "protocol" which was previously
      initialized with the "pipe" value, setting it to "socket".
      As a result, connection cannot be established and the upgrade
      procedure fails.
      "socket" in Windows is used to pass the name of the pipe so resetting
      the protocol is not valid in this case.
      
      This commit fixes resetting of the "protocol" parameter with "socket"
      parameter in the case when protocol has been previously initialized
      to "pipe" value
      6d911219
  4. 29 Jun, 2023 1 commit
    • Oleg Smirnov's avatar
      MDEV-30639 Upgrade to 10.8 and later does not work on Windows · 8e2b20bf
      Oleg Smirnov authored
      During the upgrade procedure on Windows mysqld.exe is started with
      the named pipe connection protocol. mysqladmin.exe then pings the
      server to check if is up and running. Command line looks like:
         mysqladmin.exe --protocol=pipe --socket=mysql_upgrade_service_xxx ping
      But the "socket" parameter resets the "protocol" which was previously
      initialized with the "pipe" value, setting it to "socket".
      As a result, connection cannot be established and the upgrade
      procedure fails.
      "socket" in Windows is used to pass the name of the pipe so resetting
      the protocol is not valid in this case.
      
      This commit fixes resetting of the "protocol" parameter with "socket"
      parameter in the case when protocol has been previously initialized
      to "pipe" value
      8e2b20bf
  5. 28 Jun, 2023 4 commits
    • Sergei Petrunia's avatar
      MDEV-31573: rocksdb.group_min_max test fails · cd39f4ab
      Sergei Petrunia authored
      Set the histogram_type to be DOUBLE_PREC_HB as
      it originally was.
      cd39f4ab
    • Vlad Lesin's avatar
      MDEV-31570 gap_lock_split.test hangs sporadically · 3e89b4fc
      Vlad Lesin authored
      The fix is in replacing the waiting for the whole purge finishing
      with the the waiting for only delete-marked records purging finishing.
      
      Reviewed by: Marko Mäkelä
      3e89b4fc
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-31537 Bulk insert operation aborts the server for redundant table · 73f78fb3
      Thirunarayanan Balathandayuthapani authored
      - InnoDB bulk insert operation aborts the server for redundant
      table. InnoDB miscalculates the record size in temporary file
      for the redundant table. CHAR in redundant row format table
      always fixed length, but in temporary file, it is variable-length
      for variable-length character sets.
      73f78fb3
    • Vlad Lesin's avatar
      MDEV-30648 btr_estimate_n_rows_in_range() accesses unfixed, unlatched page · 687fd6be
      Vlad Lesin authored
      The issue is caused by MDEV-30400 fix.
      
      There are two cursors in btr_estimate_n_rows_in_range() - p1 and p2, but
      both share the same mtr. Each cursor contains mtr savepoint for the
      previously fetched block to release it then the current block is
      fetched.
      
      Before MDEV-30400 the block was released with
      mtr_t::release_block_at_savepoint(), it just unfixed a block and
      released its page patch. In MDEV-30400 it was replaced with
      mtr_t::rollback_to_savepoint(), which does the same as the former
      mtr_t::release_block_at_savepoint(ulint begin, ulint end) but also
      erases the corresponding slots from mtr memo, what invalidates any
      stored mtr's memo savepoints, greater or equal to "begin".
      
      The idea of the fix is to get rid of savepoints at all in
      btr_estimate_n_rows_in_range() and
      btr_estimate_n_rows_in_range_on_level(). As
      mtr_t::rollback_to_savepoint() erases elements from mtr_t::m_memo, we
      know what element of mtr_t::m_memo can be deleted on the certain case,
      so there is no need to store savepoints.
      
      See also the following slides for details:
      https://docs.google.com/presentation/d/1RFYBo7EUhM22ab3GOYctv3j_3yC0vHtBY9auObZec8U
      
      Reviewed by: Marko Mäkelä
      687fd6be
  6. 27 Jun, 2023 3 commits
  7. 26 Jun, 2023 2 commits
    • Marko Mäkelä's avatar
      Merge 10.5 into 10.6 · 49308383
      Marko Mäkelä authored
      49308383
    • Rucha Deodhar's avatar
      MDEV-28915: mysql_upgrade fails due to old_mode="", with "Cannot load from · 14275b47
      Rucha Deodhar authored
      mysql.proc. The table is probably corrupted"
      
      Analysis: When mysql_upgrade runs statements for upgrade, characterset is
      converted to utf8mb4 because server starts with old_mode that interprets
      utf8 to utf8mb4, but mysql.proc table has "utf8mb3" as hardcoded, so
      it crashes with corrupted table.
      
      Fix: Changed Table_check_intact::check() definition to allow both
      utf8mb3 and utf8mb4 by checking prefix and changing the upgrade scripts
      to explicitly use utf8mb3
      14275b47
  8. 25 Jun, 2023 7 commits
  9. 21 Jun, 2023 1 commit
    • Brandon Nesterenko's avatar
      MDEV-29894: Calling a function from a different database in a slave side trigger crashes · c2d44ecb
      Brandon Nesterenko authored
      When opening and locking tables, if triggers will be invoked in a
      separate database, thd->set_db() is invoked, thus freeeing the memory
      and headers which thd->db had previously pointed to. In row based
      replication, the event execution logic initializes thd->db to point
      to the database which the event targets, which is owned by the
      corresponding table share (introduced in d9898c9a for MDEV-7409).
      The problem then, is that during the table opening and locking
      process for a row event, memory which belongs to the table share
      would be freed, which is not valid.
      
      This patch replaces the thd->reset_db() calls to thd->set_db(),
      which copies-by-value, rather than by reference. Then when the
      memory is freed, our copy of memory is freed, rather than memory
      which belongs to a table share.
      
      Notes:
        1. The call to change thd->db now happens on a higher-level, in
      Rows_log_event::do_apply_event() rather than ::do_exec_row(), in the
      call stack. This is because do_exec_row() is called within a loop,
      and each invocation would redundantly set and unset the db to the
      same value.
        2. thd->set_db() is only used if triggers are to be invoked, as
      there is no vulnerability in the non-trigger case, and copying
      memory would be an unnecessary inefficiency.
      
      Reviewed By:
      ============
      Andrei Elkin <andrei.elkin@mariadb.com>
      c2d44ecb
  10. 20 Jun, 2023 1 commit
  11. 16 Jun, 2023 1 commit
  12. 15 Jun, 2023 1 commit
  13. 14 Jun, 2023 1 commit
    • Sergei Petrunia's avatar
      MDEV-31479: Inconsistency between MRR and SQL layer costs can cause poor query plan · 0e2e70c4
      Sergei Petrunia authored
      (Same as
      TODO-3938: best_access_path shows negative costs for mrr=on)
      
      best_access_path() assumes that quick select cost includes
      (quick->rows/TIME_FOR_COMPARE) as a cost of checking the attached
      part of the WHERE condition.
      
      It calls adjust_quick_cost() to subtract addition from quick's cost.
      
      The problem was that DS-MRR cost formula didn't include this cost.
      For very large tables, adjust_quick_cost() would produce a negative
      cost which would cause assert in debug build or bad query plan choice
      in release builds.
      Approved-by: default avatarMonty <monty@mariadb.org>
      0e2e70c4
  14. 13 Jun, 2023 2 commits
    • Monty's avatar
      Fixed wrong assignment in calculate_block_sizes() for MEM_ROOT · e1a631fe
      Monty authored
      The effect was that that ROOT_FLAG_THREAD_SPECIFIC was cleared and
      the memory allocated by memroot would be contributed the the system,
      not to the thread.
      
      This exposed a bug in how "show explain for ..." allocated data.
      - The thread that did provide the explain allocated data in the
        "show explain" threads mem_root, which is marked as THREAD_SPECIFIC.
      - Fixed by allocating the explain data in a temporary explain_mem_root
        which is not THREAD_SPECIFIC.
      
      Other things:
      - Added extra checks when using update_malloc_size()
      - Do not call update_malloc_size() for memory not registered with
        update_malloc_size(). This avoid some wrong 'memory not freed' reports.
      - Added a checking of 'thd->killed' to ensure that
        main.truncate_notembedded.test still works.
      
      Reported by: Yury Chaikou
      e1a631fe
    • Monty's avatar
      c4cf5e17
  15. 09 Jun, 2023 2 commits
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-31442 page_cleaner thread aborts while releasing the tablespace · 841e905f
      Thirunarayanan Balathandayuthapani authored
      After further I/O on a tablespace has been stopped
      (for example due to DROP TABLE or an operation that
      rebuilds a table), page cleaner thread tries to
      flush the pending writes for the tablespace and
      releases the tablespace reference even though it was not
      acquired.
      
      fil_space_t::flush(): Don't release the tablespace when it is
      being stopped and closed
      
      Thanks to Marko Mäkelä for suggesting this patch.
      841e905f
    • Tuukka Pasanen's avatar
      MDEV-31423: Make sure that datadir is available with SySV-init script · 8171f9da
      Tuukka Pasanen authored
      Commit fixes Debian SySV-init script fail:
        /etc/init.d/mariadb: line 90: [: : integer expression expected
      which happens if datadir is not changed in configuration which
      makes it invisible when printing MariaDB config defaults.
      
      Commit makes sure that there is some value if nothing else if in hand
      use default /usr/lib/mysql or fail with correct error message if
      directory is not present
      8171f9da
  16. 08 Jun, 2023 6 commits