summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-20074: Lost connection on update triggerbb-10.3-MDEV-20074Oleksandr Byelkin2019-10-1710-17/+305
| | | | | Instead of checking lex->sql_command which does not corect in case of triggers mark tables for insert.
* MDEV-20812 Unexpected ER_ROW_IS_REFERENCED_2 upon DELETE from versioned ↵Aleksey Midenkov2019-10-155-17/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | table with FK MDEV-16210 original case was wrongly allowed versioned DELETE from referenced table where reference is by non-primary key. InnoDB UPDATE has optimization for new rows not changing its clustered index position. In this case InnoDB doesn't update all secondary indexes and misses the one holding the referenced key. The fix was to disable this optimization for versioned DELETE. In case of versioned DELETE we forcely update all secondary indexes and therefore check them for constraints. But the above fix raised another problem with versioned DELETE on foreign table side. In case when there was no corresponding record in referenced table (illegal foreign reference can be done with "set foreign_key_checks=off") there was spurious constraint check (because versioned DELETE is actually UPDATE) and hence the operation failed with constraint error. MDEV-16210 tried to fix the above problem by checking foreign table instead of referenced table and that at least was illegal. Constraint check is done by row_ins_check_foreign_constraint() no matter what kind of table is checked, referenced or foreign (controlled by check_ref argument). Referenced table is checked by row_upd_check_references_constraints(). Foreign table is checked by row_ins_check_foreign_constraints(). Current fix rolls back the wrong fix for the above problem and disables referenced table check for DELETE on foreign side by introducing `check_foreign` argument which when set to *false* skips row_ins_check_foreign_constraints() call.
* MDEV-20814 Assertion index->is_instant() failed on trivial upgrade from 10.1Marko Mäkelä2019-10-121-1/+3
| | | | | | | | | | | | | rec_init_offsets(): Relax the assertion that was added in commit 01f45becd1b71433e240959228e35266f271bba1 to catch ROW_FORMAT=REDUNDANT records that have fewer fields than expected. This assertion would fail when accessing the records of the built-in InnoDB table SYS_INDEXES. The column MERGE_THRESHOLD had been effectively instantly added in MariaDB Server 10.2 (and MySQL 5.7), but is_instant() does not hold for that index. Relax the assertion, so that it will not fail in this case.
* Merge 10.2 into 10.3Marko Mäkelä2019-10-122-3/+12
|\
| * MDEV-20813 Assertion failure in buf_flush_init_for_writing() for ↵Marko Mäkelä2019-10-122-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | innodb_immediate_scrub_data_uncompressed=ON The assertion that was added in commit c0c003beb48b099b5e6516e9d36adf096cd2d09c to augment the fix of MDEV-20805 turns out to be invalid when innodb_immediate_scrub_data_uncompressed is enabled. In this mode, fsp_init_file_page() will be invoked on data pages that have been freed, causing writes of almost-all-zero pages. btr_page_free(): Adjust the comment. buf_flush_init_for_writing(): Disable the assertion with a note that it should be re-enabled in MDEV-15528.
* | Merge 10.2 into 10.3Marko Mäkelä2019-10-1246-640/+757
|\ \ | |/
| * Merge 10.1 into 10.2Marko Mäkelä2019-10-120-0/+0
| |\
| | * MDEV-20728: /usr/sbin/mysqld: unknown variable 'defaults-group-suffix=mysqld1Julius Goryavsky2019-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | When the mysqld_multi script passes the --defaults-group-suffix option to mysqld, it must remove the initial substring with the group name ("mysqld") from option value, because otherwise substring "mysqld" will be added to the group name and then the group name will contain the word "mysqld" twice, which is wrong, because mysqld itself adds the suffix received to the group name.
| * | MDEV-20728: /usr/sbin/mysqld: unknown variable 'defaults-group-suffix=mysqld1Julius Goryavsky2019-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | When the mysqld_multi script passes the --defaults-group-suffix option to mysqld, it must remove the initial substring with the group name ("mysqld") from option value, because otherwise substring "mysqld" will be added to the group name and then the group name will contain the word "mysqld" twice, which is wrong, because mysqld itself adds the suffix received to the group name.
| * | Fix -std=c++98 -Wzero-length-arrayMarko Mäkelä2019-10-114-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is another follow-up fix to commit b393e2cb0c079b30563dcc87a62002c9c778643c which turned out to be still broken. Replace the C++11 keyword 'constexpr' with #define. debug_sync_t::str: Remove the zero-length array. Replace sync->str with reinterpret_cast<char*>(&sync[1]).
| * | After-merge fix: Correct an assertionMarko Mäkelä2019-10-111-1/+1
| | | | | | | | | | | | | | | During IMPORT TABLESPACE, we do invoke buf_flush_init_for_writing() with block==NULL and newest_lsn!=0.
| * | Merge 10.1 into 10.2Marko Mäkelä2019-10-1138-631/+485
| |\ \ | | |/
| | * MDEV-20805 follow-up: Catch writes of bogus pagesMarko Mäkelä2019-10-114-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | buf_flush_init_for_writing(): Assert that FIL_PAGE_TYPE is set except when creating a new data file with a dummy first page. buf_dblwr_create(): Ensure that FIL_PAGE_TYPE on all pages will be initialized. Reset buf_dblwr_being_created at the end.
| | * Merge 5.5 into 10.1Marko Mäkelä2019-10-1127-366/+382
| | |\
| | | * MDEV-20805 ibuf_add_free_page() is not initializing FIL_PAGE_TYPE firstMarko Mäkelä2019-10-112-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the function recv_parse_or_apply_log_rec_body() there are debug checks for validating the state of the page when redo log records are being applied. Most notably, FIL_PAGE_TYPE should be set before anything else is being written to the page. ibuf_add_free_page(): Set FIL_PAGE_TYPE before performing any other changes.
| | | * MDEV-19455: Avoid SET DEBUG_DBUG='-d,...' constructMarko Mäkelä2019-10-1121-224/+233
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apply the correct pattern for debug instrumentation: SET @save_dbug=@@debug_dbug; SET debug_dbug='+d,...'; ... SET debug_dbug=@save_dbug; Numerous tests use statements of the form SET debug_dbug='-d,...'; which will inadvertently enable all DBUG tracing output, causing unnecessary waste of resources.
| | * | MDEV-20804 Speed up main.index_merge_innodbMarko Mäkelä2019-10-119-272/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test main.index_merge_innodb is taking very much time, especially on later versions (10.2 and 10.3). Some of this could be attributed to the use of INSERT...SELECT, which is time-consumingly creating explicit record locks in InnoDB for the locking read in the SELECT part. In 10.3 and later, some slowness can be attributed to MDEV-12288, which makes the InnoDB purge thread spend time to reset transaction identifiers in the inserted records. If we prevent purge from running before all tables are dropped, the test seems to be 10% faster on an unoptimized debug build on 10.5. (A proper fix would be to implement MDEV-515 and stop writing row-level undo log records for inserts into an empty table or partition.) At the same time, it should not hurt to make main.index_merge_myisam to use the sequence engine. Not only could it be a little faster, but the test would be slightly more readable.
| * | | Fix CMAKE_BUILD_TYPE=DebugMarko Mäkelä2019-10-115-25/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unused variables and type mismatch that was introduced in commit b393e2cb0c079b30563dcc87a62002c9c778643c Also, fix a typo in the documentation of the parameter, and update the test.
| * | | MDEV-18546 ASAN heap-use-after-free in innobase_get_computed_value / row_purgeNikita Malyavin2019-10-113-0/+110
| | | | | | | | | | | | | | | | the bug was already fixed in MDEV-17005, so now only test is added
| * | | add innodb_debug_sync var to support DEBUG_SYNC from purge threadsNikita Malyavin2019-10-118-13/+174
| | | |
* | | | MDEV-20728: /usr/sbin/mysqld: unknown variable 'defaults-group-suffix=mysqld1Julius Goryavsky2019-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the mysqld_multi script passes the --defaults-group-suffix option to mysqld, it must remove the initial substring with the group name ("mysqld") from option value, because otherwise substring "mysqld" will be added to the group name and then the group name will contain the word "mysqld" twice, which is wrong, because mysqld itself adds the suffix received to the group name.
* | | | MDEV-19783: Relax an assertionMarko Mäkelä2019-10-101-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | btr_page_get_split_rec_to_left(): Assert that in the leftmost leaf page, if the metadata record exists, index->is_instant() must hold. The assertion of commit 01f45becd1b71433e240959228e35266f271bba1 could fail during innobase_instant_try().
* | | | MDEV-19783: Add more assertionsMarko Mäkelä2019-10-103-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | btr_page_get_split_rec_to_left(): Assert that in the leftmost leaf page, the metadata record exists if and only if index->is_instant(). page_validate(): Correct the wording of a message. rec_init_offsets(): Assert that whenever a record is in "instant ALTER" format, index->is_instant() must hold.
* | | | Merge 10.2 into 10.3Marko Mäkelä2019-10-1014-189/+162
|\ \ \ \ | |/ / /
| * | | MDEV-20788: Bogus assertion failure for PAGE_FREE listMarko Mäkelä2019-10-104-168/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In MDEV-11369 (instant ADD COLUMN) in MariaDB Server 10.3, we introduced the hidden metadata record that must be the first record in the clustered index if and only if index->is_instant() holds. To catch MDEV-19783, in commit ed0793e096a17955c5a03844b248bcf8303dd335 and commit 99dc40d6ac2234fa4c990665cc1914c1925cd641 we added some assertions to find cases where the metadata record is missing while it should not be, or a record exists when it should not. Those assertions were invalid when traversing the PAGE_FREE list. That list can contain anything; we must only be able to determine the successor and the size of each garbage record in it. page_validate(), page_simple_validate_old(), page_simple_validate_new(): Do not invoke page_rec_get_next_const() for traversing the PAGE_FREE list, but instead use a lower-level accessor that does not attempt to validate the REC_INFO_MIN_REC_FLAG. page_copy_rec_list_end_no_locks(), page_copy_rec_list_start(), page_delete_rec_list_start(): Add assertions. btr_page_get_split_rec_to_left(): Remove a redundant return value, and make the output parameter the return value. btr_page_get_split_rec_to_right(), btr_page_split_and_insert(): Clean up.
| * | | Fixed feedback_plugin_load to work with staticly loaded pluginMichael Widenius2019-10-101-1/+5
| | | |
| * | | Rename log_make_checkpoint_at() to log_make_checkpoint()Marko Mäkelä2019-10-099-21/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The function was always called with lsn=LSN_MAX. Remove that redundant parameter. Spotted by Thirunarayanan Balathandayuthapani.
* | | | Fix compilation 2 (GCC 9)Aleksey Midenkov2019-10-102-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | Fixed warning: -Woverloaded-virtual for GCC 9 (Clang treats it differently) Caused by c9cba59749e1b5a39a9e3a0a5b8bd762507245f9
* | | | Fix Mroonga compilationAleksey Midenkov2019-10-102-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Fixed warnings: -Woverloaded-virtual, -Winconsistent-missing-override Caused by c9cba59749e1b5a39a9e3a0a5b8bd762507245f9
* | | | Fix compiler error when using -Wconversion.Jan Lindström2019-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | /mariadb/10.3/wsrep/wsrep_gtid.c:45:26: error: conversion from 'long int' to 'unsigned int' may change value [-Werror=conversion] 45 | offset = endptr - str;
* | | | MDEV-17333 Assertion in update_auto_increment() upon exotic LOADAleksey Midenkov2019-10-106-5/+76
| | | | | | | | | | | | | | | | | | | | | | | | While `handler::next_insert_id` is restored on duplicate key errors `part_share->next_auto_inc_val` is not restored which causes discrepancy.
* | | | MDEV-19406 Assertion on updating view of join with versioned tableAleksey Midenkov2019-10-105-10/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TABLE::mark_columns_needed_for_update(): use_all_columns() assigns pointer of all_set into read_set and write_set, but this is not good since all_set is changed later by TABLE::mark_columns_used_by_index_no_reset(). Do column_bitmaps_signal() whenever we change read_set/write_set.
* | | | MDEV-16130 wrong error message adding AS ROW START to versioned tableAleksey Midenkov2019-10-104-12/+17
| | | |
* | | | MDEV-16210 FK constraints on versioned tables use historical rows, which may ↵Aleksey Midenkov2019-10-105-29/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cause constraint violation Constraint check is done on secondary index update. F.ex. DELETE does row_upd_sec_index_entry() and checks constraints in row_upd_check_references_constraints(). UPDATE is optimized for the case when order is not changed (node->cmpl_info & UPD_NODE_NO_ORD_CHANGE) and doesn't do row_upd_sec_index_entry(), so it doesn't check constraints. Since for versioned DELETE we do UPDATE actually, but expect behaviour of DELETE in terms of constraints, we should deny this optimization to get constraints checked. Fix wrong referenced table check when versioned DELETE inserts history in parent table. Set check_ref to false in this case. Removed unused dup_chk_only argument for row_ins_sec_index_entry() and added check_ref argument. MDEV-18057 fix was superseded by this fix and reverted. foreign.test: All key_type combinations: pk, unique, sec(ondary).
* | | | versioning test suite fixesAleksey Midenkov2019-10-1035-183/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Preparation for MDEV-16210: replace.test: key_type combinations: PK and UNIQUE. foreign.test: Preparation for key_type combinations. Other fixes: * Merged versioning.update2 into versioning.update; * Removed test2 database and done individual drop instead.
* | | | After merge fix, this line was removed in adefaefSergey Vojtovich2019-10-091-1/+0
| | | |
* | | | Merge 10.2 into 10.3Marko Mäkelä2019-10-0935-298/+355
|\ \ \ \ | |/ / /
| * | | MDEV-19335 Remove buf_page_t::encryptedThirunarayanan Balathandayuthapani2019-10-096-77/+25
| | | | | | | | | | | | | | | | | | | | The field buf_page_t::encrypted was added in MDEV-8588. It was made mostly redundant in MDEV-12699. Remove the field.
| * | | Merge 10.1 into 10.2Marko Mäkelä2019-10-098-131/+62
| |\ \ \ | | |/ /
| | * | Merge 5.5 into 10.1Marko Mäkelä2019-10-082-22/+0
| | |\ \ | | | |/
| | | * Remove orphan declaration buf_flush_wait_batch_end_wait_only()Marko Mäkelä2019-10-072-22/+0
| | | | | | | | | | | | | | | | | | | | The function was declared but not defined in commit 9d6d1902e091c868bb288e0ccf9f975ccb474db9
| | * | MDEV-19536 - Server crash or ASAN heap-use-after-free in is_temporary_table /Sergey Vojtovich2019-10-075-64/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | read_statistics_for_tables_if_needed Regression after 279a907, read_statistics_for_tables_if_needed() was called after open_normal_and_derived_tables() failure. Fixed by moving read_statistics_for_tables() call to a branch of get_schema_stat_record() where result of open_normal_and_derived_tables() is checked. Removed THD::force_read_stats, added read_statistics_for_tables() instead. Simplified away statistics_for_command_is_needed().
| | * | Cleanup EITSSergey Vojtovich2019-10-023-47/+34
| | | | | | | | | | | | | | | | | | | | Moved EITS allocation inside read_statistics_for_tables_if_needed(). Removed redundant is_safe argument.
| * | | MDEV-19783: Add more REC_INFO_MIN_REC_FLAG checksEugene Kosov2019-10-096-38/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | btr_cur_pessimistic_delete(): code changed in a way that allows to put more REC_INFO_MIN_REC_FLAG assertions inside btr_set_min_rec_mark(). Without that change tests innodb.innodb-table-online, innodb.temp_table_savepoint and innodb_zip.prefix_index_liftedlimit fail. Removed basically duplicated page_zip_validate() calls which fails because of temporary(!) invariant violation. That fixed innodb_zip.wl5522_debug_zip and innodb_zip.prefix_index_liftedlimit
| * | | MDEV-19783 Random crashes and corrupt data in INSTANT-added columnsEugene Kosov2019-10-091-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug affects MariaDB Server 10.3 or later, but it makes sense to improve CHECK TABLE in earlier versions already. page_validate(): Check REC_INFO_MIN_REC_FLAG in the records. This allows CHECK TABLE to catch more bugs.
| * | | Add page_has_prev(), page_has_next(), page_has_siblings()Marko Mäkelä2019-10-0913-62/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now, InnoDB inefficiently compared the aligned fields FIL_PAGE_PREV, FIL_PAGE_NEXT to the byte-order-agnostic value FIL_NULL. This is a backport of 32170f8c6d55c497ae7a791997e17ff7c992b86f from MariaDB Server 10.3.
| * | | MDEV-20574 Position of events reported by mysqlbinlog is wrong with ↵Sachin Setiya2019-10-089-35/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | encrypted binlogs, SHOW BINLOG EVENTS reports the correct one. Analysis Mysqlbinlog output for encrypted binary log #Q> insert into tab1 values (3,'row 003') #190912 17:36:35 server id 10221 end_log_pos 980 CRC32 0x53bcb3d3 Table_map: `test`.`tab1` mapped to number 19 # at 940 #190912 17:36:35 server id 10221 end_log_pos 1026 CRC32 0xf2ae5136 Write_rows: table id 19 flags: STMT_END_F Here we can see Table_map_log_event ends at 980 but Next event starts at 940. And the reason for that is we do not send START_ENCRYPTION_EVENT to the slave Solution:- Send Start_encryption_log_event as Ignorable_log_event to slave(mysqlbinlog), So that mysqlbinlog can update its log_pos. Since Slave can request multiple FORMAT_DESCRIPTION_EVENT while master does not have so We only update slave master pos when master actually have the FORMAT_DESCRIPTION_EVENT. Similar logic should be applied for START_ENCRYPTION_EVENT. Also added the test case when new server reads the data from old server which does not send START_ENCRYPTION_EVENT to slave. Master Slave Upgrade Scenario. When Slave is updated first, Slave will have extra logic of handling START_ENCRYPTION_EVENT But master willnot be sending START_ENCRYPTION_EVENT. So there will be no issue. When Master is updated first, It will send START_ENCRYPTION_EVENT to slave , But slave will ignore this event in queue_event.
| * | | Fix problem with warnings of new compilers.Oleksandr Byelkin2019-10-042-2/+0
| | | |
| * | | fix clang warningEugene Kosov2019-10-031-1/+1
| | | |
| * | | MDEV-20703: mariabackup creates binlog files in server binlog directory on ↵Vlad Lesin2019-10-012-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --prepare --export step When "--export" mariabackup option is used, mariabackup starts the server in bootstrap mode to generate *.cfg files for the certain innodb tables. The started instance of the server reads options from the file, pointed out in "--defaults-file" mariabackup option. If the server uses the same config file as mariabackup, and binlog is switched on in that config file, then "mariabackup --prepare --export" will create binary log files in the server's binary log directory, what can cause issues. The fix is to add "--skip-log-bin" in mysld options when the server is started to generate *.cfg files.