1. 25 May, 2023 3 commits
    • Oleg Smirnov's avatar
      MDEV-25080 Fix incorrect view names in printed queries · 11484ad6
      Oleg Smirnov authored
      When printing Item_direct_view_ref the printed field name must be
      complemented with the view name/derived table alias.
      For example, for "SELECT a FROM (SELECT a FROM t1) q" field `a`
      in the select list must be printed as `q`.`a`.
      
      But if the view was merged then the initial `q` does not make sense
      any more so field `a` must be printed  as `t1`.`a`
      11484ad6
    • Oleg Smirnov's avatar
      MDEV-25080 Fix crash for CREATE TABLE from pushed union · 7830ae3b
      Oleg Smirnov authored
      During st_select_lex_unit::prepare() the member select_unit*
      st_select_lex_unit::union_result is being assigned to an instance
      of one of the following classes:
       - select_unit
       - select_unit_ext
       - select_unit_recursive
       - select_union_direct
      Select_union_direct used to pass the result of the query directly to
      the receiving select_result without filling a temporary table. This class
      wraps a select_result object and is currently used to process UNION ALL
      queries. Other select_unit_* classes involve some additional result processing.
      Pushed down units are processed on the engine side so the results must be
      also passed directly to a select_result object. So in the case when
      the unit pushdown is employed st_select_lex_unit::union_result must be
      assigned to an instance of select_union_direct.
      7830ae3b
    • Oleg Smirnov's avatar
      MDEV-25080 Allow pushdown of UNIONs to foreign engines · f4f5bd75
      Oleg Smirnov authored
      Allow queries of multiple SELECTs combined together with
      UNIONs/EXCEPTs/INTERSECTs to be pushed down to foreign engines.
      If the foreign engine provides an interface method "create_unit"
      and the UNIT is a top-level unit of the SQL query then the server
      tries to push the whole SELECT_LEX_UNIT down to the engine for execution.
      The engine should perform necessary checks and if they succeed,
      execute the query. If the engine is unable to execute the whole unit,
      then another attempt is made to push down SELECTs composing the unit
      separately using the "create_select" interface method. In this case
      the results of separate SELECTs are combined at the server side
      thus composing the final result
      f4f5bd75
  2. 24 May, 2023 8 commits
  3. 22 May, 2023 1 commit
  4. 19 May, 2023 3 commits
    • Marko Mäkelä's avatar
      MDEV-31234 related cleanup · e5933b99
      Marko Mäkelä authored
      trx_purge_free_segment(), trx_purge_truncate_rseg_history():
      Replace some unreachable code with debug assertions.
      A buffer-fix does prevent pages from being evicted
      from the buffer pool; see buf_page_t::can_relocate().
      
      Tested by: Matthias Leich
      e5933b99
    • Marko Mäkelä's avatar
      Merge 10.5 into 10.6 · 37492960
      Marko Mäkelä authored
      37492960
    • Marko Mäkelä's avatar
      MDEV-31234 InnoDB does not free UNDO after the fix of MDEV-30671 · e0084b9d
      Marko Mäkelä authored
      trx_purge_truncate_history(): Only call trx_purge_truncate_rseg_history()
      if the rollback segment is safe to process. This will avoid leaking undo
      log pages that are not yet ready to be processed. This fixes a regression
      that was introduced in
      commit 0de3be8c (MDEV-30671).
      
      trx_sys_t::any_active_transactions(): Separately count XA PREPARE
      transactions.
      
      srv_purge_should_exit(): Terminate slow shutdown if the history size
      does not change and XA PREPARE transactions exist in the system.
      This will avoid a hang of the test innodb.recovery_shutdown.
      
      Tested by: Matthias Leich
      e0084b9d
  5. 16 May, 2023 2 commits
  6. 15 May, 2023 1 commit
  7. 10 May, 2023 1 commit
  8. 09 May, 2023 2 commits
    • Sergei Petrunia's avatar
      MDEV-31223: UBSan error: sql_select.h:969:7: runtime error: load of value... · 368dd22a
      Sergei Petrunia authored
      In Loose_scan_opt::save_to_position, initialize
      POSITION::firstmatch_with_join_buf.
      368dd22a
    • Sergei Petrunia's avatar
      MDEV-31022: SIGSEGV in maria_create from create_internal_tmp_table · b3edbf25
      Sergei Petrunia authored
      The code in create_internal_tmp_table() didn't take into account that
      now temporary (derived) tables may have multiple indexes:
      
      - one index due to duplicate removal
         = In this example created by conversion of big-IN(...) into subquery
         = this index might be converted into a "unique constraint" if the key
           length is too large.
      - one index added by derived_with_keys optimization.
      
      Make create_internal_tmp_table() handle multiple indexes.
      
      Before this patch, use of a unique constraint was indicated in
      TABLE_SHARE::uniques. This was ok as unique constraint was the only index
      in the table. Now it's no longer the case so TABLE_SHARE::uniques is removed
      and replaced with an in-memory-only flag HA_UNIQUE_HASH.
      
      This patch is based on Monty's patch.
      Co-Author: Monty <monty@mariadb.org>
      b3edbf25
  9. 05 May, 2023 13 commits
  10. 04 May, 2023 6 commits