summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-23320 Hex hybrid constants 0xHHHH work badly in rounding functionsAlexander Barkov2020-07-295-2/+208
| | | | | | | | | | | | | | | | | | | | - Type_handler_hex_hybrid did not override Type_handler_string_result::Item_func_round_fix_length_and_dec(), so the result type of ROUND(0xFFFFFFFFFFFFFFFF) was erroneously calculated ad DOUBLE with a wrong length. Overriding Item_func_round_fix_length_and_dec(), to calculated the result type as INT/BIGINT. Also, fixing Item_func_round::fix_arg_int() to use args[0]->decimal_precision() instead of args[0]->max_length when calculating this->max_length, to get a correct result for hex hybrids. - Type_handler_hex_hybrid::Item_func_int_val_fix_length_and_dec() called item->fix_length_and_dec_int_or_decimal(), which did not produce a correct result data type for hex hybrid. Implementing a dedicated code instead, to return INT UNSIGNED or BIGINT UNSIGNED depending in the number of digits in the arguments.
* MDEV-23245 MDEV-22898 Still getting assertion failure in file data0type.cc ↵Eugene Kosov2020-07-293-36/+148
| | | | | | | | | | | | line 67 Doesn't allow instant alter of a field which is a prefix part of some key is_part_of_a_key_prefix(): I hope the name of the function is clear ha_innobase::can_convert_string() ha_innobase::can_convert_varstring() ha_innobase::can_convert_blob(): it can't when field is_part_of_a_key_prefix()
* MDEV-23311 CEILING() and FLOOR() convert temporal input to numbers, unlike ↵Alexander Barkov2020-07-2814-12/+827
| | | | | | | | ROUND() and TRUNCATE() Fixing functions CEILING and FLOOR to return - TIME for TIME input - DATETIME for DATETIME and TIMESTAMP input
* galera_var_notify_cmd still hangs.Jan Lindström2020-07-281-1/+2
|
* fix obvious bugs hidden by current_select assigned to builtin selectOleksandr Byelkin2020-07-284-26/+38
|
* MDEV-21998: Server crashes in st_select_lex::add_table_to_list upon mix of ↵Oleksandr Byelkin2020-07-2814-44/+67
| | | | | | | KILL and sequences Continue support the hack of current select equal builtin select if selects stack is empty even after subselects.
* MDEV-23295 ROW_FORMAT mismatch in instant ALTER TABLEMarko Mäkelä2020-07-279-19/+73
| | | | | | | | | | | | | | | | An instant ADD/DROP/reorder column could create a dummy table object with the wrong ROW_FORMAT when innodb_default_row_format was changed between CREATE TABLE and ALTER TABLE. prepare_inplace_alter_table_dict(): If we had promised that ALGORITHM=INPLACE is supported, we must preserve the ROW_FORMAT. dict_table_t::prepare_instant(): Add debug assertions to catch ROW_FORMAT mismatch. The rest of the changes are related to adding Alter_inplace_info::inplace_supported to cache the return value of handler::check_if_supported_inplace_alter().
* MDEV-19918 Server hangs or crashes while trying to lock mutex when theAlexey Botchkov2020-07-261-0/+27
| | | | | | | mutex was already locked upon startup with server_audit and orphan records in mysql.plugin. Preaquire auditing plugins before LOCK_plugin to awoid double locking.
* MDEV-22651: Bogus assertion in dict_table_t::init_instant()Marko Mäkelä2020-07-243-2/+18
| | | | | | | | In commit 0e5a4ac2532c64a545796c787354dc41d61d0e62 (MDEV-15562) we introduced a bogus debug assertion, demanding that dict_col_t::len never exceed some maximum value. The intention was to match what dict_index_add_col() is doing. But, the assignment field->fixed_len = 0 applies to dict_field_t::fixed_len, not dict_col_t::len!
* MDEV-22998 Free thd->mem_root at applier commit or rollback.Teemu Ollakka2020-07-241-0/+7
|
* Add missing includes.Jan Lindström2020-07-241-0/+2
|
* Update Galera global warning ignore list.Jan Lindström2020-07-243-0/+11
|
* MDEV-21718 Assertion in wsrep::client_state::before_command().Teemu Ollakka2020-07-245-0/+54
| | | | | | | | | | | | | | An assertion `server_state_.rollback_mode() == wsrep::server_state::rm_async` fired in before_command() when - thread-handling was set to pool-of-threads and - a BF abort happened between client session calls to wait_rollback_complete_and_acquire_ownership() and before_command(). This commit introduces a test case to reproduce the crash and updates wsrep-lib submodule to fixed version.
* Silence unnecessary warning.Jan Lindström2020-07-242-0/+7
|
* Update wsrep-lib version: improved error logging and diagnosticsAlexey Yurchenko2020-07-241-0/+0
|
* MDEV-20928 mtr test galera.galera_var_innodb_disallow_writes test failuresjaakola2020-07-243-30/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sporadic test hangs happen because of mutex dealock between innodb background threads and two test connection executions. The test sets variable innodb_disallow_writes, which blocks all writes to filesyste. The test logic is to execute an INSERT, which should hang because of filesytstem writes are blocked, and through another session verify by SELECT that this hanging happens. The SELECT session will then release innodb_disallow_writes blocking. However, filesystem write blocking affects also innodb background threads and they may hang while keeping some other resources locked. As an example, in one test hang situation, buffer pool access was blocked. And, if buffer pool is blocked, the test connections will be blocked as well, and the SELECT session will not be able to continue to release the innodb_disallow_writes. The fix in this commit is refactoring of the test logic. The test will now set first innodb_disallow_writes blocking, and then record a hash of data directory's filesystem contents. This works as checksum of the state of data on the datadirectory. Then some SQL load is tried on both nodes, these sessions will be blocking due to frozen file system state. The test will have a short sleep to allow innodb background threads to loop and possibly encounter innodb_disallow_writes blocking as well. After the sleep, the test will record file system checksun for the second time, and then release the innodb_disallow-writes blocking. Finally, the two checksums are compared, they should be identical to verify that nothing was written on datadirectory during the test execution. The checksum is implemented by md5sum hash over all files found in datadirectory by find command. all these file hashes are hashed together by one more md5sum. The test therefore depends on md5sum and find. find may work differently with some OS distributions, e.g. freebsd may be problematic.
* MDEV-22458: Server with WSREP hangs after INSERT, wrong usage of mutex ↵mkaruza2020-07-243-2/+57
| | | | | | | 'LOCK_thd_data' and 'share->intern_lock' / 'lock->mutex' Add `find_thread_by_id_with_thd_data_lock` which will be used only when killing thread. This version needs to take `thd->LOCK_thd_data` lock.
* MDEV-21905: Galera test galera_var_notify_cmd causes hangmkaruza2020-07-243-10/+11
| | | | | Fixed wsrep_notify.sh script so it only reports status changes on 'joined', 'synced', 'donor'.
* aarch64: use compiler flag outline-atomics if availableTzachi Zidenberg2020-07-231-0/+5
| | | | | | | outline-atomics compilation flag changes behaviour of builtin_atomics, by adding runtime detection of LSE atomics. If these are supported, they will be used. This gains LSE atomics use without hurting compatibility with older aarch64 machines.
* MDEV-23249: Support aarch64 architecture timerTzachi Zidenberg2020-07-232-2/+14
| | | | | | | | | | | | | aarch64 timer is available to userspace via arch register. clang's __builtin_readcyclecounter is wrong for aarch64 (reads the PMU cycle counter instead of the archi-timer register), so we don't use it. my_rdtsc unit-test on AWS m6g shows: frequency: 121830845 resolution: 1 overhead: 1 This counter is not strictly increasing, but it is non-decreasing.
* MDEV-22778 Slow InnoDB shutdown on large instanceMarko Mäkelä2020-07-2310-58/+36
| | | | | | | | | | | | | | | Starting with MDEV-17441 we would no longer have os_once, and we would always initialize zip_pad_info_t::mutex and dict_table_t::autoinc_mutex, even for tables are not in ROW_FORMAT=COMPRESSED nor include any AUTO_INCREMENT column. mutex_free() on those unnecessary objects would make shutdown very slow compared to older versions. Let us use std::mutex for those two mutexes, to reduce the overhead. The critical sections protected by these mutexes is very small, and therefore contention or the need for any instrumentation should be unlikely.
* MDEV-21997 Server crashes in LEX::create_item_ident_sp upon use of unknown ↵Oleksandr Byelkin2020-07-223-0/+128
| | | | | | identifier If there is no current_select and variable is not found among SP variables it can be only an error.
* MDEV-23254 Replace FSP_FLAGS_HAS_PAGE_COMPRESSION with ↵Thirunarayanan Balathandayuthapani2020-07-221-3/+3
| | | | | | | | fil_space_t::is_compressed InnoDB should replace FSP_FLAGS_HAS_PAGE_COMPRESSION check with fil_space_t::is_compressed(). fil_space_t::is_compressed() checks for both non full crc32 and crc32 format.
* Fix regex on test.Jan Lindström2020-07-221-2/+2
|
* Merge 10.3 into 10.4Marko Mäkelä2020-07-2113-93/+295
|\
| * MDEV-15880: ASAN heap-use-after-free with innodb_evict_tables_on_commit_debugMarko Mäkelä2020-07-211-2/+7
| | | | | | | | | | | | | | | | | | trx_update_mod_tables_timestamp(): When implementing innodb_evict_tables_on_commit_debug, do not evict tables on which transactional locks exist. This debug variable was broken since its introduction in commit 947b0b5722117350c83656ee0b23502be59b7d2b.
| * MDEV-16929 Assertion ... in close_thread_tables upon killing connectionMonty2020-07-213-0/+36
| | | | | | | | | | Problem was that the code didn't handle a transaction created in innodb as part of a failed mysql_lock_tables()
| * MDEV-20661 Virtual fields are not recalculated on system fields value assignmentAleksey Midenkov2020-07-209-57/+169
| | | | | | | | | | | | | | Fix stale virtual field value in 4 cases: when virtual field depends on row_start/row_end in timestamp/trx_id versioned table. row_start dep is recalculated in vers_update_fields() (SQL and InnoDB layer). row_end dep is recalculated on history row insert.
| * MDEV-22061 InnoDB: Assertion of missing row in sec index row_start upon ↵Aleksey Midenkov2020-07-205-34/+83
| | | | | | | | | | | | | | | | | | | | REPLACE on a system-versioned table make_versioned_helper() appended new update field unconditionally while it should check if this field already exists in update vector. Misc renames to conform versioning prefix. vers_update_fields() name conforms with sql layer TABLE::vers_update_fields().
* | MDEV-21953 deadlock between BACKUP STAGE BLOCK_COMMIT and parallel repl.Monty2020-07-2111-59/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue was: T1, a parallel slave worker thread, is waiting for another worker thread to commit. While waiting, it has the MDL_BACKUP_COMMIT lock. T2, working for mariabackup, is doing BACKUP STAGE BLOCK_COMMIT and blocks all commits. This causes a deadlock as the thread T1 is waiting for can't commit. Fixed by moving locking of MDL_BACKUP_COMMIT from ha_commit_trans() to commit_one_phase_2() Other things: - Added a new argument to ha_comit_one_phase() to signal if the transaction was a write transaction. - Ensured that ha_maria::implicit_commit() is always called under MDL_BACKUP_COMMIT. This code is not needed in 10.5 - Ensure that MDL_Request values 'type' and 'ticket' are always initialized. This makes it easier to check the state of the MDL_Request. - Moved thd->store_globals() earlier in handle_rpl_parallel_thread() as thd->init_for_queries() could use a MDL that could crash if store_globals where not called. - Don't call ha_enable_transactions() in THD::init_for_queries() as this is both slow (uses MDL locks) and not needed.
* | MDEV-22899 Assertion `field->col->is_binary() || field->prefix_len % ↵Eugene Kosov2020-07-203-26/+172
| | | | | | | | | | | | | | | | | | field->col->mbmaxlen == 0' failed in dict_index_add_to_cache is_part_of_a_key(): detect is TEXT field is a part of some key ha_innobase::can_convert_blob(): now correctly detect whether our blob is a part of some key. Previously the check didn't work in some cases.
* | Merge 10.3 into 10.4Marko Mäkelä2020-07-2025-115/+195
|\ \ | |/
| * Merge 10.2 into 10.3Marko Mäkelä2020-07-2021-122/+166
| |\
| | * Merge 10.1 into 10.2Marko Mäkelä2020-07-2036-283/+358
| | |\
| | | * MDEV-23190 InnoDB data file extension is not crash-safeMarko Mäkelä2020-07-2024-197/+313
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When InnoDB is extending a data file, it is updating the FSP_SIZE field in the first page of the data file. In commit 8451e09073e8b1a300f177d74a9e3a530776640a (MDEV-11556) we removed a work-around for this bug and made recovery stricter, by making it track changes to FSP_SIZE via redo log records, and extend the data files before any changes are being applied to them. It turns out that the function fsp_fill_free_list() is not crash-safe with respect to this when it is initializing the change buffer bitmap page (page 1, or generally, N*innodb_page_size+1). It uses a separate mini-transaction that is committed (and will be written to the redo log file) before the mini-transaction that actually extended the data file. Hence, recovery can observe a reference to a page that is beyond the current end of the data file. fsp_fill_free_list(): Initialize the change buffer bitmap page in the same mini-transaction. The rest of the changes are fixing a bug that the use of the separate mini-transaction was attempting to work around. Namely, we must ensure that no other thread will access the change buffer bitmap page before our mini-transaction has been committed and all page latches have been released. That is, for read-ahead as well as neighbour flushing, we must avoid accessing pages that might not yet be durably part of the tablespace. fil_space_t::committed_size: The size of the tablespace as persisted by mtr_commit(). fil_space_t::max_page_number_for_io(): Limit the highest page number for I/O batches to committed_size. MTR_MEMO_SPACE_X_LOCK: Replaces MTR_MEMO_X_LOCK for fil_space_t::latch. mtr_x_space_lock(): Replaces mtr_x_lock() for fil_space_t::latch. mtr_memo_slot_release_func(): When releasing MTR_MEMO_SPACE_X_LOCK, copy space->size to space->committed_size. In this way, read-ahead or flushing will never be invoked on pages that do not yet exist according to FSP_SIZE.
| | | * Cleanup: Remove fil_check_adress_in_tablespace()Marko Mäkelä2020-07-206-70/+24
| | | |
| | | * Cleanup: Remove unused AbstractCallback::m_free_limitMarko Mäkelä2020-07-202-18/+0
| | | |
| | | * Making the stat_tables_innodb test deterministicVarun Gupta2020-07-182-21/+15
| | | |
| | | * MDEV-20401: revert unnecessary changeJulius Goryavsky2020-07-161-1/+1
| | | |
| | | * MDEV-20401: Server incorrectly auto-sets lower_case_file_system valueJulius Goryavsky2020-07-162-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Server auto-sets lower_case_file_system value based on default datadir's behavior instead of instead of using the directory specified by the user through the configuration file or command line options. This patch fixes this problem.
| | | * check_linker_flag: use for linker flagsDaniel Black2020-07-152-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -Wl,-z,relro,-z,now are linker flags and should be checked as such. TODO: perform module, exe shared checks separately rather than a pure linker check.
| | | * MDEV-22851: Engine independent index statistics are incorrect for large ↵Varun Gupta2020-07-154-15/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tables on Windows An oveflow was happening on windows because on Windows sizeof(ulong) is 4 bytes while it is 8 bytes on Linux. Switched avg_frequency and avg length for column statistics to ulonglong. Switched avg_frequency for index statistics to ulonglong.
| | * | MDEV-20401: revert unnecessary changeJulius Goryavsky2020-07-161-1/+1
| | | |
| | * | MDEV-20401: Server incorrectly auto-sets lower_case_file_system valueJulius Goryavsky2020-07-162-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Server auto-sets lower_case_file_system value based on default datadir's behavior instead of instead of using the directory specified by the user through the configuration file or command line options. This patch fixes this problem.
| * | | MDEV-18371 Server crashes in ha_innobase::cmp_ref upon UPDATE with PARTITION ↵Alexey Botchkov2020-07-173-3/+34
| | | | | | | | | | | | | | | | | | | | | | | | clause. m_file[0] not always is a good sample.
* | | | MDEV-22771 Instant extension of CHAR column is wrongly allowedMarko Mäkelä2020-07-204-40/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 854c219a7f0e1878517d5a821992f650342380dd (MDEV-17301) broke a constraint: Fixed-length columns cannot be extended in InnoDB without rebuilding the table. ha_innobase::can_convert_string(): Correct the condition. We must not allow any instantaneous change to the length of CHAR columns measured in characters. For any format other than ROW_FORMAT=REDUNDANT, we can allow the length in bytes to be extended if mbminlen<mbmaxlen held before the change of the character set.
* | | | Merge remote-tracking branch 'origin/bb-10.4-MDEV-21910' into 10.4Julius Goryavsky2020-07-1616-216/+442
|\ \ \ \
| * | | | Fix perfschema.nesting test case after fix.bb-10.4-MDEV-21910Jan Lindström2020-06-261-143/+152
| | | | |
| * | | | MDEV-21910 Deadlock between BF abort and manual KILL commandsjaakola2020-06-2615-73/+290
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When high priority replication slave applier encounters lock conflict in innodb, it will force the conflicting lock holder transaction (victim) to rollback. This is a must in multi-master sychronous replication model to avoid cluster lock-up. This high priority victim abort (aka "brute force" (BF) abort), is started from innodb lock manager while holding the victim's transaction's (trx) mutex. Depending on the execution state of the victim transaction, it may happen that the BF abort will call for THD::awake() to wake up the victim transaction for the rollback. Now, if BF abort requires THD::awake() to be called, then the applier thread executed locking protocol of: victim trx mutex -> victim THD::LOCK_thd_data If, at the same time another DBMS super user issues KILL command to abort the same victim, it will execute locking protocol of: victim THD::LOCK_thd_data -> victim trx mutex. These two locking protocol acquire mutexes in opposite order, hence unresolvable mutex locking deadlock may occur. The fix in this commit adds THD::wsrep_aborter flag to synchronize who can kill the victim This flag is set both when BF is called for from innodb and by KILL command. Either path of victim killing will bail out if victim's wsrep_killed is already set to avoid mutex conflicts with the other aborter execution. THD::wsrep_aborter records the aborter THD's ID. This is needed to preserve the right to kill the victim from different locations for the same aborter thread. It is also good error logging, to see who is reponsible for the abort. A new test case was added in galera.galera_bf_kill_debug.test for scenario where wsrep applier thread and manual KILL command try to kill same idle victim
* | | | | Merge 10.3 into 10.4Marko Mäkelä2020-07-167-62/+91
|\ \ \ \ \ | | |/ / / | |/| | |