- 25 May, 2023 3 commits
-
-
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`
-
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.
-
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
-
- 24 May, 2023 8 commits
-
-
Sergei Golubchik authored
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
trx_purge_truncate_rseg_history(): Add a parameter to specify if the entire rollback segment is safe to be freed. If not, we may still be able to invoke trx_undo_truncate_start() and free some pages.
-
- 22 May, 2023 1 commit
-
-
Oleksandr Byelkin authored
-
- 19 May, 2023 3 commits
-
-
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
-
Marko Mäkelä authored
-
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
-
- 16 May, 2023 2 commits
-
-
Sergei Petrunia authored
-
Sergei Petrunia authored
This is 11.0 part of the fix: in 11.0, get_costs_for_tables() calls best_access_path() for all possible tables, for each call it saves a POSITION object with the access method and "loose_scan_pos" POSITION object. The latter is saved even if there is no possible LooseScan plan. Saving is done by copying POSITION objects which may generate a spurious UBSan error.
-
- 15 May, 2023 1 commit
-
-
Sergei Petrunia authored
-
- 10 May, 2023 1 commit
-
-
Sergei Petrunia authored
Follow the approach taken in the rest of the test.
-
- 09 May, 2023 2 commits
-
-
Sergei Petrunia authored
In Loose_scan_opt::save_to_position, initialize POSITION::firstmatch_with_join_buf.
-
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>
-
- 05 May, 2023 13 commits
-
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
-
Sergei Petrunia authored
Derived table creation code would call Field::make_new_field() which would memcpy the Field object from the source table, including Field::read_stats. But the temp. table as a whole had table->stats_is_read=false. Which was correct but not consistent with Field::read_stats and caused an assertion. Fixed by making sure that Field::read_stats=NULL for fields in the new temporary (i.e. work) tables.
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
-
Sergei Petrunia authored
The problem, introduced in patch for MDEV-26301: When check_join_cache_usage() decides not to use join buffer, it must adjust the access method accordingly. For BNL-H joins this means switching from pseudo-"ref access"(with index=MAX_KEY) to some other access method. Failing to do this will cause assertions down the line when code that is not aware of BNL-H will try to initialize index use for ref access with index=MAX_KEY. The fix is to follow the regular code path to disable the join buffer for the join_tab ("goto no_join_cache") instead of just returning from check_join_cache_usage().
-
Oleksandr Byelkin authored
-
- 04 May, 2023 6 commits
-
-
Sergei Golubchik authored
because explicit_defaults_for_timestamp is now true
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
-