summaryrefslogtreecommitdiff
path: root/sql
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '10.2' into 10.3Sergei Golubchik2021-02-0136-345/+350
|\
| * ASAN heap-use-after-free in Item_exists_subselect::is_top_level_itemOleksandr Byelkin2021-01-291-1/+3
| | | | | | | | check that we can do type casting
| * MDEV-22251: get_key_scans_params: Conditional jump or move depends on ↵Sergei Petrunia2021-01-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | uninitialised value Apply the patch based on the patch by Varun Gupta: PARAM::is_ror_scan might be used unitialized when check_quick_select() is invoked for a "degenerate" SEL_ARG tree (e.g. one having type SEL_ARG::IMPOSSIBLE). Make check_quick_select() always initialize PARAM::is_ror_scan.
| * MDEV-20717 : Plugin system variables and activation options can break ↵Jan Lindström2021-01-281-4/+15
| | | | | | | | | | | | | | | | | | "mysqld --wsrep_recover" Problem is that not all plugins are loaded when wsrep_recover is executed. Thus, we allow unknown system variables and extra system variables during wsrep_recover. Any unknown system variables would still be caught when the server starts up normally after the SST.
| * MDEV-24509 : Warning: Memory not freed: 56 on SET @@global.wsrep_sst_authJan Lindström2021-01-262-0/+10
| | | | | | | | | | It seems that memory is not freed when updated value is NULL or when wsrep is not initialized before shutdown.
| * MDEV-23328 Server hang due to Galera lock conflict resolutionSergei Golubchik2021-01-241-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mutex order violation here. when wsrep bf thread kills a conflicting trx, the stack is wsrep_thd_LOCK() wsrep_kill_victim() lock_rec_other_has_conflicting() lock_clust_rec_read_check_and_lock() row_search_mvcc() ha_innobase::index_read() ha_innobase::rnd_pos() handler::ha_rnd_pos() handler::rnd_pos_by_record() handler::ha_rnd_pos_by_record() Rows_log_event::find_row() Update_rows_log_event::do_exec_row() Rows_log_event::do_apply_event() Log_event::apply_event() wsrep_apply_events() and mutexes are taken in the order lock_sys->mutex -> victim_trx->mutex -> victim_thread->LOCK_thd_data When a normal KILL statement is executed, the stack is innobase_kill_query() kill_handlerton() plugin_foreach_with_mask() ha_kill_query() THD::awake() kill_one_thread() and mutexes are victim_thread->LOCK_thd_data -> lock_sys->mutex -> victim_trx->mutex To fix the mutex order violation we kill the victim thd asynchronously, from the manager thread
| * cleanup: void hton::abort_transaction()Sergei Golubchik2021-01-241-1/+1
| | | | | | | | | | | | | | and void wsrep_innobase_kill_one_trx() as their return values are never used. Also remove redundant cast and checks that are always true
| * cleanup: remove slave background thread, use handle_manager thread insteadSergei Golubchik2021-01-243-156/+35
| |
| * cleanup: fix and generalize handle_manager threadSergei Golubchik2021-01-242-48/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * provide an argument to the callback * don't ignore a callback request if it's already present in the queue * initialize mutex/cond/in_use flag before starting the thread, in case the first callback queueing request arrives before handle_manager had time to initialize * set/check abort_manager under a mutex, otherwise handle_manager thread might destroy LOCK_manager before stop_handle_manager released it * signal COND on queueing a callback, stop cond_wait on callback request * always start the thread, even if flush_time is 0 * but keep the old behavior in embedded (no replication, no galera) * style cleanups (e.g. remove volatile for a variable protected by a mutex)
| * don't allow `KILL QUERY ID USER xxx`Sergei Golubchik2021-01-241-7/+11
| |
| * MDEV-10272: add master host/port info to slave thread exit messagesDaniel Black2021-01-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Sample log error message generated: 2021-01-21 2:33:24 139912137520896 [Note] Slave SQL thread exiting, replication stopped in log 'master-bin.000001' at position 369 33:24 139912137520896 [Note] master was 127.0.0.1:16400 2021-01-21 2:33:24 139912137828096 [Note] Slave I/O thread exiting, read up to log 'master-bin.000001', position 369 2021-01-21 2:33:24 139912137828096 [Note] master was 127.0.0.1:16400 Based on work by Hartmut Holzgraefe. Reviewer: knielsen@knielsen-hq.org, Andrei, Sachin
| * MDEV-8134: The relay-log is not flushed after the slave-relay-log.999999 showedSujatha2021-01-214-4/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ======== Auto purge of relaylogs stops when relay-log-file is 'slave-relay-log.999999' and slave_parallel_threads is enabled. Analysis: ========= The problem is that in Relay_log_info::inc_group_relay_log_pos() function, when two log names are compared via strcmp() function, it gives correct result, when log name sequence numbers are of same digits(6 digits), But when the number goes to 7 digits, a 999999 compares greater than 1000000, which is wrong, hence the bug. Fix: ==== Extract the numeric extension part of the file name, convert it into unsigned long and compare. Thanks to David Zhao for the contribution.
| * MDEV-16940 Server crashes in unsafe_key_update upon attempt to update viewIgor Babaev2021-01-192-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | through 2nd execution of SP This bug caused a server crash on the second call of any stored procedure that contained an UPDATE statement over a multi-table view reporting an error message at the prepare stage. On the first call of the stored procedure after reporting an error at the preparation stage of the UPDATE statement finished without calling the function SELECT_LEX::save_prep_leaf_tables() for the SELECT used as the definition of the view. This left the SELECT_LEX structure used by the UPDATE statement in an inconsistent state for second call of the stored procedure. Approved by Oleksandr Byelkin <sanja@mariadb.com>
| * MDEV-19723 Assertion `je->state == JST_KEY' failed while SELECT ↵Alexey Botchkov2021-01-191-0/+1
| | | | | | | | | | | | ST_GEOMFROMGEOJSON() and Assertion `!mysql_bin_log.is_open() || thd.is_current_stmt_binlog_format_row()' The invalid GeoJSON case wasn't handled here.
| * MDEV-24179: Assertion `m_status == DA_ERROR || m_status == DA_OK ||Rucha Deodhar2021-01-191-0/+6
| | | | | | | | | | | | | | | | m_status == DA_OK_BULK' failed in Diagnostics_area::message() Analysis: Assertion failure happens because we reach the maximum limit to examine rows. Fix: Return the error state.
| * MDEV-23851 BF-BF Conflict issue because of UK GAP lockssjaakola2021-01-183-5/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some DML operations on tables having unique secondary keys cause scanning in the secondary index, for instance to find potential unique key violations in the seconday index. This scanning may involve GAP locking in the index. As this locking happens also when applying replication events in high priority applier threads, there is a probabality for lock conflicts between two wsrep high priority threads. This PR avoids lock conflicts of high priority wsrep threads, which do secondary index scanning e.g. for duplicate key detection. The actual fix is the patch in sql_class.cc:thd_need_ordering_with(), where we allow relaxed GAP locking protocol between wsrep high priority threads. wsrep high priority threads (replication appliers, replayers and TOI processors) are ordered by the replication provider, and they will not need serializability support gained by secondary index GAP locks. PR contains also a mtr test, which exercises a scenario where two replication applier threads have a false positive conflict in GAP of unique secondary index. The conflicting local committing transaction has to replay, and the test verifies also that the replaying phase will not conflict with the latter repllication applier. Commit also contains new test scenario for galera.galera_UK_conflict.test, where replayer starts applying after a slave applier thread, with later seqno, has advanced to commit phase. The applier and replayer have false positive GAP lock conflict on secondary unique index, and replayer should ignore this. This test scenario caused crash with earlier version in this PR, and to fix this, the secondary index uniquenes checking has been relaxed even further. Now innodb trx_t structure has new member: bool wsrep_UK_scan, which is set to true, when high priority thread is performing unique secondary index scanning. The member trx_t::wsrep_UK_scan is defined inside WITH_WSREP directive, to make it possible to prepare a MariaDB build where this additional trx_t member is not present and is not used in the code base. trx->wsrep_UK_scan is set to true only for the duration of function call for: lock_rec_lock() trx->wsrep_UK_scan is used only in lock_rec_has_to_wait() function to relax the need to wait if wsrep_UK_scan is set and conflicting transaction is also high priority. Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
| * MDEV-24208 SHOW RELAYLOG EVENTS command is not supported in the prepared ↵Dmitry Shulga2021-01-131-0/+11
| | | | | | | | | | | | | | statement protocol yet Added sending of metadata in response to preparing request for the commands SQLCOM_SHOW_BINLOG_EVENTS, SQLCOM_SHOW_RELAYLOG_EVENTS
| * MDEV-23826: ORDER BY in view definition leads to wrong result with GROUP BY ↵Varun Gupta2021-01-122-1/+34
| | | | | | | | | | | | | | | | | | | | on query using view Introduced val_time_packed and val_datetime_packed functions for Item_direct_ref to make sure to get the value from the item it is referring to. The issue for incorrect result was that the item was getting its value from the temporary table rather than from the view.
| * MDEV-23753: SIGSEGV in Column_stat::store_stat_fieldsVarun Gupta2021-01-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For EITS collection min and max fields are allocated for each column that is set in the read_set bitmap of a table. This allocation of min and max fields happens inside alloc_statistics_for_table. For a partitioned table ha_rnd_init is called inside the function collect_statistics_for_table which sets the read_set bitmap for the columns inside the partition expression. This happens only when there is a write lock on the partitioned table. But the allocation happens before this, so min and max fields are not allocated for the columns involved in the partition expression. This resulted in a crash, as the EITS statistics were collected but there was no min and max field to store the value to. The fix would be to call ha_rnd_init inside the function alloc_statistics_for_table that would make sure that min and max fields are allocated for the columns involved in the partition expression.
| * MDEV-14884 Failed to enable encryption of temporary files in mariadb 10.3.3Sergei Golubchik2021-01-111-3/+3
| | | | | | | | | | enable the encryption (and abort on failure) after printing --help, not before
| * MDEV-18428 Memory: If transactional=0 is specified in CREATE TABLE, it is ↵Sergei Golubchik2021-01-113-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | not possible to ALTER TABLE * be strict in CREATE TABLE, just like in ALTER TABLE, because CREATE TABLE, just like ALTER TABLE, can be rolled back for any engine * but don't auto-convert warnings into errors for engine warnings (handler::create) - this matches ALTER TABLE behavior * and not when creating a default record, these errors are handled specially (and replaced with ER_INVALID_DEFAULT) * always issue a Note when a non-unique key is truncated, because it's not a Warning that can be converted to an Error. Before this commit it was a Note for blobs and a Warning for all other data types.
| * cleanup: copy RAII helpers from 10.5, cleanup testSergei Golubchik2021-01-112-3/+33
| |
| * don't do a warning for bad table options in replication slave threadSergei Golubchik2021-01-111-3/+2
| | | | | | | | otherwise ALTER TABLE can break replication
| * MDEV-18428 Memory: If transactional=0 is specified in CREATE TABLE, it is ↵Sergei Golubchik2021-01-111-1/+2
| | | | | | | | | | | | | | not possible to ALTER TABLE fix "engine does not support TRANSACTIONAL=1" error message to match user input
| * MDEV-17852 Altered connection limits for user have no effectSergei Golubchik2021-01-111-1/+1
| | | | | | | | update mqh in struct user_conn after taking it from the cache
| * MDEV-22966 Server crashes or hangs with SET ROLE when started with ↵Sergei Golubchik2021-01-111-0/+6
| | | | | | | | skip-grant-tables
| * MDEV-17251 SHOW STATUS unnecessary calls calc_sum_of_all_statusSergei Golubchik2021-01-114-11/+16
| | | | | | | | | | | | | | 1. only call calc_sum_of_all_status() if a global SHOW_xxx_STATUS variable is to be returned 2. only lock LOCK_status when copying global_status_var, but not when iterating all threads
| * MDEV-12161 Can't specify collation for virtual columnsSergei Golubchik2021-01-112-21/+28
| | | | | | | | | | | | | | | | | | | | | | sql standard (2016) allows <collate clause> in two places in the <column definition> - as a part of the <data type> or at the very end. Let's do that too. Side effect: in column/SP declaration `COLLATE cs_coll` automatically implies `CHARACTER SET cs` (unless charset was specified explicitly). See changes in sp-ucs2.result
| * MDEV-23536 Race condition between KILL and transaction commitSergei Golubchik2021-01-112-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Server part: kill_handlerton() was accessing thd->ha_data[] for some other thd, while it could be concurrently modified by its owner thd. protect thd->ha_data[] modifications with a mutex. require this mutex when accessing thd->ha_data[] from kill_handlerton. InnoDB part: on close_connection, detach trx from thd before freeing the trx
| * Revert "MDEV-23536 : Race condition between KILL and transaction commit"Sergei Golubchik2021-01-112-32/+8
| | | | | | | | | | | | | | | | This reverts the server part of the commit 775fccea0 but keeps InnoDB part (which reverted MDEV-17092 5530a93f4). So after this both MDEV-23536 and MDEV-17092 are reverted, and the original bug is resurrected.
* | MDEV-24675 Server crash when table value constructor uses a subselectIgor Babaev2021-01-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch actually fixes the bug MDEV-24675 and the bug MDEV-24618: Assertion failure when TVC uses a row in the context expecting scalar value The cause of these bugs is the same wrong call of the function that fixes value expressions in the value list of a table value constructor. The assertion failure happened when an expression in the value list is of the row type. In this case an error message was expected, but it was not issued because the function fix_fields_if_needed() was called for to check fields of value expressions in a TVC instead of the function fix_fields_if_needed_for_scalar() that would also check that the value expressions are are of a scalar type. The first bug happened when a table value expression used an expression returned by single-row subselect. In this case the call of the fix_fields_if_needed_for_scalar virtual function must be provided with and address to which the single-row subselect has to be attached. Test cases were added for each of the bugs. Approved by Oleksandr Byelkin <sanja@mariadb.com>
* | MDEV-17556 Assertion `bitmap_is_set_all(&table->s->all_set)' failedNikita Malyavin2021-01-2716-109/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The assertion failed in handler::ha_reset upon SELECT under READ UNCOMMITTED from table with index on virtual column. This was the debug-only failure, though the problem is mush wider: * MY_BITMAP is a structure containing my_bitmap_map, the latter is a raw bitmap. * read_set, write_set and vcol_set of TABLE are the pointers to MY_BITMAP * The rest of MY_BITMAPs are stored in TABLE and TABLE_SHARE * The pointers to the stored MY_BITMAPs, like orig_read_set etc, and sometimes all_set and tmp_set, are assigned to the pointers. * Sometimes tmp_use_all_columns is used to substitute the raw bitmap directly with all_set.bitmap * Sometimes even bitmaps are directly modified, like in TABLE::update_virtual_field(): bitmap_clear_all(&tmp_set) is called. The last three bullets in the list, when used together (which is mostly always) make the program flow cumbersome and impossible to follow, notwithstanding the errors they cause, like this MDEV-17556, where tmp_set pointer was assigned to read_set, write_set and vcol_set, then its bitmap was substituted with all_set.bitmap by dbug_tmp_use_all_columns() call, and then bitmap_clear_all(&tmp_set) was applied to all this. To untangle this knot, the rule should be applied: * Never substitute bitmaps! This patch is about this. orig_*, all_set bitmaps are never substituted already. This patch changes the following function prototypes: * tmp_use_all_columns, dbug_tmp_use_all_columns to accept MY_BITMAP** and to return MY_BITMAP * instead of my_bitmap_map* * tmp_restore_column_map, dbug_tmp_restore_column_maps to accept MY_BITMAP* instead of my_bitmap_map* These functions now will substitute read_set/write_set/vcol_set directly, and won't touch underlying bitmaps.
* | MDEV-24593 Signal 11 when group by primary key of table joined to ↵Sergei Golubchik2021-01-223-47/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | information_schema.columns I_S tables were materialized too late, an attempt to use table statistics before the table was created caused a crash. Let's move table creation up. it only needs read_set to be calculated properly, this happens in JOIN::optimize_inner(), after semijoin transformation. Note that tables are not populated at that point, so most of the statistics would make no sense anyway. But at least field sizes will be correct. And it won't crash.
* | MDEV-21153 Replica nodes crash due to indexed virtual columns and FK ↵bb-10.3-MDEV-21153sjaakola2021-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cascading delete Fix for MDEV-23033 fixes a problem in replication applying of transactions, which contain cascading foreign key delete for a table, which has indexed virtual column. This fix adds slave_fk_event_map flag for table, to mark when the prelocking is needed for applying of a transaction. See commit 608b0ee52ef3e854ce14a407e64e936adbbeba23 for more details. However, this fix is targeted for async replication only, Rows_log_event::do_apply_event() has condition to rule out galera replication from the fix domain, and use cases suffering from MDEV-23033 and related MDEV-21153 will fail in galera cluster. The fix in this commit removes the condition to rule out the setting of slave_fk_event_map flag from galera replication, and makes the fix in MDEV-23033 effective for galera replication as well. Finally, a mtr test for virtual column support has been added. galera.galera_virtual_column.test has as first test a scenario from MDEV-21153 Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
* | MDEV-23666: Assertion `m_cpp_buf <= ptr && ptr <= m_cpp_buf + m_buf_length' ↵Dmitry Shulga2021-01-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | failed in Lex_input_stream::body_utf8_append On parsing statements for which a starting backtick (`) delimiter doesn't have a corresponding ending backtick, a current pointer to a position inside a pre-processed buffer could go beyond the end of the buffer. This bug report caused by the commit d4967659032b18a5504198b41dd3d0a1813d79ef "MDEV-22022 Various mangled SQL statements will crash 10.3 to 10.5 debug builds". In order to fix the issue both pointers m_ptr and m_cpp_ptr must be rolled back to previous position in raw input and pre-processed input streams correspondingly in case end of query reached during parsing.
* | MDEV-24387: Wrong number of decimal digits in certain UNION/SubqeryRucha Deodhar2021-01-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | constellation Analysis: The decimals is set to NOT_FIXED_DEC for Field_str even if it is NULL. Unsigned has decimals=0. So Type_std_attributes::decimals is set to 39 (maximum between 0 and 39). This results in incorrect number of decimals when we have union of unsigned and NULL type. Fix: Check if the field is created from NULL value. If yes, set decimals to 0 otherwise set it to NOT_FIXED_DEC.
* | MDEV-23446 Missed error code fixAleksey Midenkov2021-01-121-1/+1
| |
* | MDEV-17227 Server crash in TABLE_SHARE::init_from_sql_statement_string upon ↵Sergei Golubchik2021-01-121-3/+2
| | | | | | | | | | | | | | | | table discovery with non-existent database * failed init_from_binary_frm_image can clear share->db_plugin, don't use it on the error path * cleanup the test a bit
* | MDEV-20763 Table corruption or Assertion `btr_validate_index(index, 0, ↵Sergei Golubchik2021-01-121-1/+1
| | | | | | | | | | | | | | false)' failed in row_upd_sec_index_entry with virtual column and EMPTY_STRING_IS_NULL SQL mode unset empty_string_is_null mode when parsing generated columns in a table, this mode affects pasring.
* | failing to parse an SP should not abort information_schema.routinesSergei Golubchik2021-01-121-1/+2
| |
* | MDEV-24524 Assertion `ls->length < 0xFFFFFFFFL && ((ls->length == 0 && ↵Sergei Golubchik2021-01-121-1/+1
| | | | | | | | | | | | | | | | !ls->str) || ls->length == strlen(ls->str))' failed in String::append on SELECT from I_S don't expect return type of a stored function to be valid. it's read from a table, so can be messed with. it even can contain \0 bytes in the middle of the type name
* | Merge 10.2 into 10.3 (except MDEV-17556)Marko Mäkelä2021-01-116-83/+144
|\ \ | |/ | | | | | | | | The fix of MDEV-17556 (commit e25623e78a3efde05e30070dc7362f8dc0d8c459 and commit 61a362c9493df63dc588fcb71409537ae56ab9c8) has been omitted due to conflicts and will have to be applied separately later.
| * MDEV-23536 : Race condition between KILL and transaction commitJan Lindström2021-01-082-8/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A race condition may occur between the execution of transaction commit, and an execution of a KILL statement that would attempt to abort that transaction. MDEV-17092 worked around this race condition by modifying InnoDB code. After that issue was closed, Sergey Vojtovich pointed out that this race condition would better be fixed above the storage engine layer: If you look carefully into the above, you can conclude that thd->free_connection() can be called concurrently with KILL/thd->awake(). Which is the bug. And it is partially fixed in THD::~THD(), that is destructor waits for KILL completion: Fix: Add necessary mutex operations to THD::free_connection() and move WSREP specific code also there. This ensures that no one is using THD while we do free_connection(). These mutexes will also ensures that there can't be concurrent KILL/THD::awake(). innobase_kill_query We can now remove usage of trx_sys_mutex introduced on MDEV-17092. trx_t::free() Poison trx->state and trx->mysql_thd This patch is validated with an RQG run similar to the one that reproduced MDEV-17092.
| * MDEV-19838 fixup: clang -Wunused-const-variableMarko Mäkelä2021-01-081-4/+3
| |
| * MDEV-17556 Assertion `bitmap_is_set_all(&table->s->all_set)' failedNikita Malyavin2021-01-0814-76/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The assertion failed in handler::ha_reset upon SELECT under READ UNCOMMITTED from table with index on virtual column. This was the debug-only failure, though the problem is mush wider: * MY_BITMAP is a structure containing my_bitmap_map, the latter is a raw bitmap. * read_set, write_set and vcol_set of TABLE are the pointers to MY_BITMAP * The rest of MY_BITMAPs are stored in TABLE and TABLE_SHARE * The pointers to the stored MY_BITMAPs, like orig_read_set etc, and sometimes all_set and tmp_set, are assigned to the pointers. * Sometimes tmp_use_all_columns is used to substitute the raw bitmap directly with all_set.bitmap * Sometimes even bitmaps are directly modified, like in TABLE::update_virtual_field(): bitmap_clear_all(&tmp_set) is called. The last three bullets in the list, when used together (which is mostly always) make the program flow cumbersome and impossible to follow, notwithstanding the errors they cause, like this MDEV-17556, where tmp_set pointer was assigned to read_set, write_set and vcol_set, then its bitmap was substituted with all_set.bitmap by dbug_tmp_use_all_columns() call, and then bitmap_clear_all(&tmp_set) was applied to all this. To untangle this knot, the rule should be applied: * Never substitute bitmaps! This patch is about this. orig_*, all_set bitmaps are never substituted already. This patch changes the following function prototypes: * tmp_use_all_columns, dbug_tmp_use_all_columns to accept MY_BITMAP** and to return MY_BITMAP * instead of my_bitmap_map* * tmp_restore_column_map, dbug_tmp_restore_column_maps to accept MY_BITMAP* instead of my_bitmap_map* These functions now will substitute read_set/write_set/vcol_set directly, and won't touch underlying bitmaps.
| * MDEV-23033: All slaves crash once in ~24 hours and loop restart with signal 11Sujatha2021-01-043-65/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ======= Upon deleting or updating a row in a parent table (with primary key), if the child table has virtual column and an associated key with ON UPDATE CASCADE/ON DELETE CASCADE, it will result in slave crash. Analysis: ======== Tables which are related through foreign key require prelocking similar to triggers. i.e If a table has triggers/foreign keys we should add all tables and routines used by them to the prelocking set. This prelocking happens during 'open_and_lock_tables' call. Each table being opened is checked for foreign key references. If foreign key reference exists then the child table is opened and it is linked to the table_list. Upon any modification to parent table its corresponding child tables are retried from table_list and they are updated accordingly. This prelocking work fine on master. On slave prelocking works for following cases. - Statement/mixed based replication - In row based replication when trigger execution is enabled through 'slave_run_triggers_for_rbr=YES/LOGGING/ENFORCE' Otherwise it results in an assert/crash, as the parent table will not find the corresponding child table and it will be NULL. Dereferencing NULL pointer leads to slave server exit. Fix: === Introduce a new 'slave_fk_event_map' flag similar to 'trg_event_map'. This flag will ensure that when foreign key is enabled in row based replication all the parent and child tables are prelocked, so that parent is able to locate the child table. Note: This issue is specific to slave, hence only slave needs to be upgraded.
| * MDEV-23875 is failing to build on windows.Rucha Deodhar2021-01-041-1/+1
| |
| * MDEV-23875: select into outfile not respect UMASK and UMASK_DIRRucha Deodhar2020-12-311-3/+3
| | | | | | | | | | | | | | | | Analysis: select into outfile creates files everytime with 666 permission, regardsless if umask environment variables and umask settings on OS level. It seems hardcoded. Fix: change 0666 to 0644 which will let anybody consume the file but not change it.
* | Urgent fix of MDEV-23446 fix:Oleksandr Byelkin2021-01-071-2/+1
| | | | | | | | Use the same variable in both scopes (from where we have "goto error" and target of the goto)
* | MDEV-17891 Assertion failure upon attempt to replace into a full tableNikita Malyavin2021-01-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Assertion `transactional_table || !changed || thd->transaction.stmt.modified_non_trans_table' failed due REPLACE into a versioned table. It is not specific to system versioning/pertitioning/heap, but this combination makes it much easier to reproduce. The thing is to make first ha_update_row call succeed to make info->deleted != 0. And then make REPLACE fail by any reason. In this scenario we overflow versioned partition, so next ha_update_row succeeds, but corresponding ha_write_row fails to insert history record. Fix: modified_non_trans_table is set in one missed place