- 06 Jul, 2023 1 commit
-
-
Alexander Barkov authored
Removing the method LEX::delete_if_not_sp_lex_in_use(). It was not really used.
-
- 05 Jul, 2023 1 commit
-
-
Marko Mäkelä authored
fil_node_open_file_low(): Always acquire an advisory lock on the system tablespace. Originally, we already did this in SysTablespace::open_file(), but SysTablespace::open_or_create() would release those locks when it is closing the file handles. This is a 10.5+ specific follow up to commit 0ee1082b (MDEV-28495). Thanks to Daniel Black for verifying this bug.
-
- 03 Jul, 2023 1 commit
-
-
Daniel Black authored
file /usr/lib64/libmariadb.so.3 from install of MariaDB-shared-10.11.3-1.fc38.x86_64 conflicts with file from package mariadb-connector-c-3.3.5-1.fc38.x86_64
-
- 29 Jun, 2023 2 commits
-
-
Alexander Barkov authored
When CURSOR parameters get parsed, their sp_assignment_lex instances (one instance per parameter) get collected to List<sp_assignment_lex>. These instances get linked to sphead only in the end of the list. If a syntax error happened in the middle of the parameter list, these instances were not deleted, which caused memory leaks. Fix: using a Bison %destructor to free rules of the <sp_assignment_lex_list> type (on syntax errors). Afte the fix these sp_assignment_lex instances from CURSOR parameters deleted as follows: - If the CURSOR statement was fully parsed, then these instances get properly linked to sp_head structures, so they are deleted during ~sp_head (this did not change) - If the CURSOR statement failed on a syntax error, then by Bison's %destructor (this is being added in the current patch).
-
Alexander Barkov authored
The parser works as follows: The rule expr_lex returns a pointer to a newly created sp_expr_lex instance which is not linked to any MariaDB structures yet - it is pointed only from a Bison stack variable. The sp_expr_lex instance gets linked to other structures (such as sp_instr_jump_if_not) later, after scanning some following grammar. Problem before the fix: If a parse error happened immediately after expr_lex (before it got linked), the created sp_expr_lex value got lost causing a memory leak. Fix: - Using Bison's "destructor" directive to free the results of expr_lex on parse/oom errors. - Moving the call for LEX::cleanup_lex_after_parse_error() from MYSQL_YYABORT and yyerror inside parse_sql(). This is needed because Bison calls destructors after yyerror(), while it's important to delete the sp_expr_lex instance before LEX::cleanup_lex_after_parse_error(). The latter frees the memory root containing the sp_expr_lex instance. After this change the code block are executed in the following order: - yyerror() -- now only raises the error to DA (no cleanup done any more) - %destructor { delete $$; } <expr_lex> -- destructs the sp_expr_lex instance - LEX::cleanup_lex_after_parse_error() -- frees the memory root containing the sp_expr_lex instance - Removing the "delete sublex" related code from restore_lex(): - restore_lex() is called in most cases on success, when delete is not needed. - There is one place when restore_lex() is called on error: In sp_create_assignment_instr(). But in this case LEX::sp_lex_in_use is true anyway. The patch adds a new DBUG_ASSERT(lex->sp_lex_in_use) to guard this.
-
- 28 Jun, 2023 2 commits
-
-
Marko Mäkelä authored
-
Yuchen Pei authored
The server needs to have a unique name
-
- 27 Jun, 2023 1 commit
-
-
Marko Mäkelä authored
recv_sys_t::parse(): For undo tablespace truncation mini-transactions, remember the start_lsn instead of the end LSN. This is what we expect after commit 461402a5 (MDEV-30479).
-
- 20 Jun, 2023 1 commit
-
-
Sergei Petrunia authored
-
- 16 Jun, 2023 1 commit
-
-
Thirunarayanan Balathandayuthapani authored
- InnoDB shouldn't acquire the tablespace when it is being stopped or closed
-
- 15 Jun, 2023 1 commit
-
-
Sergei Petrunia authored
Fix a typo in make_join_statistics(): when updating statistics for derived table, set s->table->... not "table->..."
-
- 14 Jun, 2023 1 commit
-
-
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: Monty <monty@mariadb.org>
-
- 09 Jun, 2023 1 commit
-
-
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.
-
- 08 Jun, 2023 5 commits
-
-
Sergei Petrunia authored
embedded doesn't have optimizer trace, view-protocol doesn't work with long column names.
-
Marko Mäkelä authored
The test gcol.gcol_purge would reliably hang on 10.6 on a Microsoft Windows builder without this adjustment. A similar adjustment was applied in commit 3e40f9a7 to the tests innodb.dml_purge and innodb.instant_alter_purge.
-
Marko Mäkelä authored
-
Marko Mäkelä authored
innodb_undo_log_truncate_update(): A callback function. If SET GLOBAL innodb_undo_log_truncate=ON, invoke srv_wake_purge_thread_if_not_active(). srv_wake_purge_thread_if_not_active(): If innodb_undo_log_truncate=ON, always wake up the purge subsystem. srv_do_purge(): If the history is empty, invoke trx_purge_truncate_history() in order to free undo log pages. trx_purge_truncate_history(): If head.trx_no==0, consider the cached undo logs to be free. trx_purge(): Remove the parameter "bool truncate" and let the caller invoke trx_purge_truncate_history() directly. Reviewed by: Vladislav Lesin
-
Marko Mäkelä authored
purge_sys_t::sees(): Wrapper for view.sees(). trx_purge_truncate_history(): Invoke purge_sys.sees() instead of comparing to head.trx_no, to determine if undo pages can be safely freed. The test innodb.cursor-restore-locking was adjusted by Vladislav Lesin, as was the the debug instrumentation in row_purge_del_mark(). Reviewed by: Vladislav Lesin
-
- 07 Jun, 2023 3 commits
-
-
Marko Mäkelä authored
-
Daniel Bartholomew authored
-
Sergei Petrunia authored
LooseScan code set opt_range_condition_rows to be the MIN(loose_scan_plan->records, table->records) totally ignoring possible quick range selects. If there was a quick select $QUICK on another index with $QUICK->records < loose_scan_plan->records this would create a situation where opt_range_condition_rows > $QUICK->records which causes an assert in 10.6+ and potentially wrong query plan choice in 10.5. Fixed by making opt_range_condition_rows to be the minimum #rows of any quick select. Approved-by: Monty <monty@mariadb.org>
-
- 05 Jun, 2023 2 commits
-
-
Sergei Golubchik authored
-
Sergei Petrunia authored
The code in choose_best_splitting() assumed that the join prefix is in join->positions[]. This is not necessarily the case. This function might be called when the join prefix is in join->best_positions[], too. Follow the approach from best_access_path(), which calls this function: pass the current join prefix as an argument, "const POSITION *join_positions" and use that.
-
- 03 Jun, 2023 8 commits
-
-
Marko Mäkelä authored
trx_purge_truncate_history(): Relax a condition that would prevent undo log truncation if the undo log tablespaces were "contaminated" by the bug that commit e0084b9d fixed. That is, trx_purge_truncate_rseg_history() would have invoked flst_remove() on TRX_RSEG_HISTORY but not reduced TRX_RSEG_HISTORY_SIZE. To avoid any regression with normal operation, we implement this fixup during slow shutdown only. The condition on the history list being empty is necessary: without it, in the test innodb.undo_truncate_recover there may be much fewer than the expected 90,000 calls to row_purge() before the truncation. That is, we would truncate the undo tablespace before actually having processed all undo log records in it. To truncate such "contaminated" or "bloated" undo log tablespaces (when using innodb_undo_tablespaces=2 or more) you can execute the following SQL: BEGIN;INSERT mysql.innodb_table_stats VALUES('','',DEFAULT,0,0,0);ROLLBACK; SET GLOBAL innodb_undo_log_truncate=ON, innodb_fast_shutdown=0; SHUTDOWN; The first line creates a dummy InnoDB transaction, to ensure that there will be some history to be purged during shutdown and that the undo tablespaces will be truncated.
-
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.
-
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
-
Sergei Golubchik authored
This reverts commit b05218e0.
-
Sergei Golubchik authored
This reverts commit 844ddb11. This fixes MDEV-30967, MDEV-31325, MDEV-31388
-
Igor Babaev authored
This bug could affect queries containing a subquery over splittable derived tables and having an outer references in its WHERE clause. If such subquery contained an equality condition whose left part was a reference to a column of the derived table and the right part referred only to outer columns then the server crashed in the function st_join_table::choose_best_splitting() The crashing code was added in the commit ce7ffe61 that made the code of the function sensitive to presence of the flag OUTER_REF_TABLE_BIT in the KEYUSE_EXT::needed_in_prefix fields. The field needed_in_prefix of the KEYUSE_EXT structure should not contain table maps with OUTER_REF_TABLE_BIT or RAND_TABLE_BIT. Note that this fix is quite conservative: for affected queries it just returns the query plans that were used before the above mentioned commit. In fact the equalities causing crashes should be pushed into derived tables without any usage of split optimization. Approved by Sergei Petrunia <sergey@mariadb.com>
-
Igor Babaev authored
EXPLAIN EXTENDED should always print the field item used in the left part of an equality expression from the SET clause of an update statement as a reference to table column. Approved by Oleksandr Byelkin <sanja@mariadb.com>
-
Daniel Bartholomew authored
-
- 01 Jun, 2023 2 commits
-
-
Marko Mäkelä authored
recv_sys_t::apply(): When applying an undo log truncation operation, invoke os_file_truncate() on space->recv_size, which must not be less than the original truncated file size. Alternatively, as pointed out by Thirunarayanan Balathandayuthapani, we could assign space->size = t.pages, so that fil_system_t::extend_to_recv_size() would extend the file back to space->recv_size.
-
Marko Mäkelä authored
fil_space_t::add(): If a file handle was passed, invoke fil_node_t::find_metadata() before releasing fil_system.mutex. The call was moved from fil_ibd_create(). This is a 10.5 version of commit e3b06156 from 10.6.
-
- 24 May, 2023 2 commits
-
-
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.
-
- 23 May, 2023 5 commits
-
-
Marko Mäkelä authored
trx_purge_truncate_history(): Relax a condition that would prevent undo log truncation if the undo log tablespaces were "contaminated" by the bug that commit e0084b9d fixed. That is, trx_purge_truncate_rseg_history() would have invoked flst_remove() on TRX_RSEG_HISTORY but not reduced TRX_RSEG_HISTORY_SIZE. To avoid any regression with normal operation, we implement this fixup during slow shutdown only. The condition on the history list being empty is necessary: without it, in the test innodb.undo_truncate_recover there may be much fewer than the expected 90,000 calls to row_purge() before the truncation. That is, we would truncate the undo tablespace before actually having processed all undo log records in it. To truncate such "contaminated" or "bloated" undo log tablespaces (when using innodb_undo_tablespaces=2 or more) you can execute the following SQL: BEGIN;INSERT mysql.innodb_table_stats VALUES('','',DEFAULT,0,0,0);ROLLBACK; SET GLOBAL innodb_undo_log_truncate=ON, innodb_fast_shutdown=0; SHUTDOWN; The first line creates a dummy InnoDB transaction, to ensure that there will be some history to be purged during shutdown and that the undo tablespaces will be truncated.
-
Monty authored
Note: We should replace most case of safe_strcpy() with strmake() to avoid the not needed zerofill.
-
Monty authored
The problem was that when JOIN_TAB::remove_duplicates() noticed there can only be one possible row in the output, it adjusted limits but didn't take into account any possible offset. Fixed by not adjusting limit offset when setting one-row-limit.
-
Monty authored
The reason for ASAN report was that the MERGE and MYISAM file had different key definitions, which is not allowed. Fixed by ensuring that the MERGE code is not copying more key stats than what is in the MyISAM file. Other things: - Give an error if different MyISAM files has different number of key parts.
-
Monty authored
-