1. 04 Jul, 2023 1 commit
    • Nicholas Othieno's avatar
      MDEV-31530 Localizations for Swahili language · c054a628
      Nicholas Othieno authored
      Kenyan Swahili is enabled for error messages as well as datetime.
      
      All new code of the whole pull request, including one or several files
      that are either new files or modified ones, are contributed under the
      BSD-new license. I am contributing on behalf of my employer Amazon Web
      Services, Inc.
      c054a628
  2. 02 Jul, 2023 1 commit
    • Sergei Golubchik's avatar
      MDEV-29827 collateral cleanup · 279b0db8
      Sergei Golubchik authored
      * removed universal suppression of everything "Event Schedule" everywhere
      * added suppressions in tests as needed
      * moved events test to the events suite
      * renamed -master.opt -> .opt
      * added standard test header
      * verified in the test that the error, indeed, was written into the log
      * removed useless suppressions
      * removed ER_EVENTS_NO_ACL, replaced with ER_OPTION_PREVENTS_STATEMENT
      * fixed error message to say exactly what option disabled event scheduler
        instead of "this or that or that, you figure it out"
      * also fixed old message for SET event_scheduler=
        (it was also non-translatable)
      * changed to use sql_print_error() when an error is not sent to the user
      * removed duplicate hard-coded error message
      279b0db8
  3. 30 Jun, 2023 1 commit
    • Oleg Smirnov's avatar
      MDEV-30828 Prevent pushing down unions with incorrect ORDER BY · d6c6102c
      Oleg Smirnov authored
      Fake_select_lex->join was prepared at the unit execution stage so
      the validation of fake_select_lex before the unit pushdown
      was incomplete. That caused pushing down of statements having
      an incorrect ORDER BY clause.
      This commit moves preparation of the fake_select_lex->join to the unit
      prepare() method, before initializing of the pushdown handler,
      so incorrect clauses error out before being pushed down
      d6c6102c
  4. 28 Jun, 2023 3 commits
  5. 27 Jun, 2023 5 commits
  6. 26 Jun, 2023 3 commits
  7. 25 Jun, 2023 9 commits
  8. 21 Jun, 2023 3 commits
    • 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
    • Monty's avatar
      MDEV-31375 Assertion `dbl_records <= s->records' failed with optimizer_use_condition_selectivity=1 · 3d617fdc
      Monty authored
      The reason for the crash wad that 'best splitting' optimization
      predicted less rows to be found than what opt_range did.
      This code in apply_selectivity_for_table(), when using use_cond_selectivity=1,
      was not prepared for this case which caused an assert in debug builds.
      Production builds is not affected.
      
      The fix is to choose the smaller of the two row counts. It will have a
      minimum on costs when using use_cond_selectivity=1 and should not cause
      any problems in production.
      3d617fdc
    • Monty's avatar
      MDEV-31494 Server crashes in ha_partition::index_blocks / get_key_scans_params · d3c81804
      Monty authored
      MDEV-31445 Server crashes in ha_partition::index_blocks / cost_for_index_read
      
      The crash happened in the case where partition pruning finds 0
      partitions.
      d3c81804
  9. 20 Jun, 2023 1 commit
  10. 19 Jun, 2023 1 commit
  11. 18 Jun, 2023 1 commit
  12. 16 Jun, 2023 1 commit
  13. 15 Jun, 2023 1 commit
  14. 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
  15. 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
  16. 12 Jun, 2023 1 commit
  17. 10 Jun, 2023 1 commit
  18. 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
  19. 08 Jun, 2023 2 commits