summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-21341: Fix UBSAN failures: Issue Sixbb-10.3-mdev21341-issueSixSergei Petrunia2020-01-129-55/+71
| | | | | | | | | | | | | (Variant #2 of the patch, which keeps the sp_head object inside the MEM_ROOT that sp_head object owns) (10.3 version of the fix, with handling for class sp_package) sp_head::operator new() and operator delete() were dereferencing sp_head* pointers to memory that didn't hold a valid sp_head object (it was not created/already destroyed). This caused UBSan to crash when looking up type information. Fixed by providing static sp_head::create() and sp_head::destroy() methods.
* MDEV-21243: Join buffer: condition is checked in wrong place for range accessbb-10.3-mdev21243Sergei Petrunia2020-01-123-0/+122
| | | | | | | | | | | | | | | | | | In this scenario: - There is a possible range access for table T - And there is a ref access on the same index which uses fewer key parts - The join optimizer picks the ref access (because it is cheaper) - make_join_select applies this heuristic to switch to range: /* Range uses longer key; Use this instead of ref on key */ Join buffer will be used without having called JOIN_TAB::make_scan_filter(). This means, conditions that should be checked when reading table T will be checked after T is joined with the contents of the join buffer, instead. Fixed this by adding a make_scan_filter() check. (updated patch after backport to 10.3) (Fix testcase on Windows)
* fix compilationEugene Kosov2020-01-081-10/+7
|
* Merge branch '10.2' into 10.3Sujatha2020-01-088-31/+209
|\
| * Merge branch '10.1' into 10.2Sujatha2020-01-078-31/+209
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events Problem: ======== SHOW BINLOG EVENTS FROM <pos> reports following assert when ASAN is enabled. uint32 binlog_get_uncompress_len(const char*): Assertion `(buf[0] & 0xe0) == 0x80' failed Fix: === **Part11: Converted debug assert to error handler code**
| | * MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in ↵Sujatha2020-01-071-24/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql_show_binlog_events Problem: ======== SHOW BINLOG EVENTS FROM <pos> reports following ASAN error. AddressSanitizer: heap-buffer-overflow on address READ of size 1 at 0x60e00009cf71 thread T28 #0 0x55e37e034ae2 in net_field_length Fix: === **Part10: Avoid reading out of buffer**
| | * MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in ↵Sujatha2020-01-071-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql_show_binlog_events Problem: ======== SHOW BINLOG EVENTS FROM <pos> reports following assert when ASAN is enabled. Query_log_event::Query_log_event(const char*, uint, const Format_description_log_event*, Log_event_type): Assertion `(pos) + (6) <= (end)' failed Fix: === **Part9: Removed additional DBUG_ASSERT**
| | * MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in ↵Sujatha2020-01-071-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql_show_binlog_events Problem: ======== SHOW BINLOG EVENTS FROM <pos> reports following ASAN error AddressSanitizer: SEGV on unknown address The signal is caused by a READ memory access. User_var_log_event::User_var_log_event(char const*, unsigned int, Format_description_log_event const*) Implemented part of upstream patch. commit: mysql/mysql-server@a3a497ccf7ecacc900551fb1e47ea4078b45c351 Fix: === **Part8: added checks to avoid reading out of buffer limits**
| | * MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in ↵Sujatha2020-01-071-10/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql_show_binlog_events Problem: ======== SHOW BINLOG EVENTS FROM <pos> reports following ASAN error "heap-buffer-overflow on address" and some times it asserts. Table_map_log_event::Table_map_log_event(const char*, uint, const Format_description_log_event*) Assertion `m_field_metadata_size <= (m_colcnt * 2)' failed. Fix: === **Part7: Avoid reading out of buffer** Converted debug assert to error handler code.
| | * MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in ↵Sujatha2020-01-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql_show_binlog_events Problem: ======== SHOW BINLOG EVENTS FROM <pos> reports following ASAN error AddressSanitizer: heap-buffer-overflow on address 0x60400002acb8 Load_log_event::copy_log_event(char const*, unsigned long, int, Format_description_log_event const*) Fix: === **Part6: Moved the event_len validation to the begin of copy_log_event function**
| | * MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in ↵Sujatha2020-01-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql_show_binlog_events Problem: ======== SHOW BINLOG EVENTS FROM <pos> reports following ASAN error AddressSanitizer: heap-buffer-overflow on address String::append(char const*, unsigned int) Query_log_event::pack_info(Protocol*) Fix: === **Part5: Added check to catch buffer overflow**
| | * MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in ↵Sujatha2020-01-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql_show_binlog_events Problem: ======== SHOW BINLOG EVENTS FROM <pos> reports following ASAN error heap-buffer-overflow within "my_strndup" in Rotate_log_event my_strndup /mysys/my_malloc.c:254 Rotate_log_event::Rotate_log_event(char const*, unsigned int, Format_description_log_event const*) Fix: === **Part4: Improved the check for event_len validation**
| | * MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in ↵Sujatha2020-01-071-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql_show_binlog_events Problem: ======== SHOW BINLOG EVENTS FROM <pos> reports following crash when ASAN is enabled. SEGV on unknown address in inline_mysql_mutex_destroy in my_bitmap_free in Update_rows_log_event::~Update_rows_log_event() Fix: === **Part3: Initialize m_cols_ai.bitmap to NULL**
| | * MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in ↵Sujatha2020-01-071-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql_show_binlog_events Problem: ======== SHOW BINLOG EVENTS FROM <pos> reports following assert when ASAN is enabled. Rows_log_event::Rows_log_event(const char*, uint, const Format_description_log_event*): Assertion `var_header_len >= 2' Implemented part of upstream patch. commit: mysql/mysql-server@a3a497ccf7ecacc900551fb1e47ea4078b45c351 Fix: === **Part2: Avoid reading out of buffer limits**
| | * MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in ↵Sujatha2020-01-077-6/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql_show_binlog_events Problem: ======== SHOW BINLOG EVENTS FROM <pos> causes a variety of failures, some of which are listed below. It is not a race condition issue, but there is some non-determinism in it. Analysis: ======== "show binlog events from <pos>" code considers the user given position as a valid event start position. The code starts reading data from this event start position onwards and tries to map it to a set of known events. Each event has a specific event structure and asserts have been added to ensure that read event data satisfies the event specific requirements. When a random position is supplied to "show binlog events command" the event structure specific checks will fail and they result in assert. Fix: ==== The fix is split into different parts. Each part addresses either an ASAN issue or an assert/crash. **Part1: Checksum based position validation when checksum is enabled** Using checksum validate the very first event read at the user specified position. If there is a checksum mismatch report an appropriate error for the invalid event.
| * | Fixup MDEV-21429: Correct a definitionMarko Mäkelä2020-01-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | INNOBASE_ALTER_NOVALIDATE: Remove the set of operations INNOBASE_ONLINE_CREATE that was accidentally included in the definition. In the merge of 82187a1221467c7d193fca60a11a020ab4228e4a to 10.3 (in commit eda719793acd90f6157bcb825722dab674376bf4) the flags were defined correctly. This bug was caught by the test innodb_zip.index_large_prefix.
* | | Merge 10.2 into 10.3Marko Mäkelä2020-01-0715-191/+392
|\ \ \ | |/ /
| * | MDEV-21429 TRUNCATE and OPTIMIZE are being refused due to "row size too large"Marko Mäkelä2020-01-076-47/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default (innodb_strict_mode=ON), InnoDB attempts to guarantee at DDL time that any INSERT to the table can succeed. MDEV-19292 recently revised the "row size too large" check in InnoDB. The check still is somewhat inaccurate; that should be addressed in MDEV-20194. Note: If a table contains multiple long string columns so that each column is part of a column prefix index, then an UPDATE that attempts to modify all those columns at once may fail, because the undo log record might not fit in a single undo log page (of innodb_page_size). In the worst case, the undo log record would grow by about 3KiB of for each updated column. The DDL-time check (since the InnoDB Plugin for MySQL 5.1) is optional in the sense that when the maximum B-tree record size or undo log record size would be exceeded, the DML operation will fail and the transaction will be properly rolled back. create_table_info_t::row_size_is_acceptable(): Add the parameter 'bool strict' so that innodb_strict_mode=ON can be overridden during TRUNCATE, OPTIMIZE and ALTER TABLE...FORCE (when the storage format is not changing). create_table_info_t::create_table(): Perform a sloppy check for TRUNCATE TABLE (create_fk=false). prepare_inplace_alter_table_dict(): Perform a sloppy check for simple operations. trx_is_strict(): Remove. The function became unused in commit 98694ab0cbaf623c6ad67dd45d6f90c5c6214fd1 (MDEV-20949).
| * | MDEV-13569: wsrep_info.plugin failed in buildbot with "no nodes coming from ↵Jan Lindström2020-01-072-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | prim view Modify configuration so that all nodes are part of galera cluster i.e. wsrep_on=ON. Add missing wait conditions. test changes only.
| * | Merge 10.1 into 10.2Marko Mäkelä2020-01-072-4/+4
| |\ \ | | |/
| | * Making group_by test stableVarun Gupta2020-01-032-4/+4
| | |
| * | Lets add another intrusive double linked list!Eugene Kosov2020-01-045-141/+315
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Features: * STL-like interface * Fast modification: no branches on insertion or deletion * Fast iteration: one pointer dereference and one pointer comparison * Your class can be a part of several lists Modeled after std::list<T> but currently has fewer methods (not complete yet) For even more performance it's possible to customize list with templates so it won't have size counter variable or won't NULLify unlinked node. How existing lists differ? No existing lists support STL-like interface. I_List: * slower iteration (one more branch on iteration) * element can't be a part of two lists simultaneously I_P_List: * slower modification (branches, except for the fastest push_back() case) * slower iteration (one more branch on iteration) UT_LIST_BASE_NODE_T: * slower modification (branches) Three UT_LISTs were replaced: two in fil_system_t and one in dyn_buf_t.
* | | Merge branch '10.2' into 10.3Oleksandr Byelkin2020-01-0312-34/+116
|\ \ \ | |/ /
| * | Merge branch '10.1' into 10.2Oleksandr Byelkin2020-01-0310-7/+114
| |\ \ | | |/
| | * Merge branch '5.5' into 10.1Oleksandr Byelkin2020-01-033-5/+5
| | |\
| | | * MDEV-21416: main.events_bugs fails due to 2020-01-01 dateOleksandr Byelkin2020-01-032-4/+4
| | | | | | | | | | | | | | | | Moved to the next problematic year (2038).
| | | * MDEV-21343 Threadpool/Unix- wait_begin() function does not wake/create ↵Vladislav Vaintroub2019-12-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | threads, when it should Fixed the condition for waking up/creating another thread. If there is some work to do (if the request queue is not empty), a thread should be woken or created. The condition was incorrect since 18c9b34
| | * | MDEV-20922: Adding an order by changes the query resultsVarun Gupta2020-01-024-0/+78
| | | | | | | | | | | | | | | | | | | | | | | | For Item_direct_view_ref , get value from val_* methods instead of result* family The val_* methods gets value from the item on which it is referred.
| | * | MDEV-19680:: Assertion `!table || (!table->read_set || ↵Varun Gupta2019-12-263-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | bitmap_is_set(table->read_set, field_index) || (!(ptr >= table->record[0] && ptr < table->record[0] + table->s->reclength)))' or alike failed upon SELECT with mix of functions from simple view Set read_set bitmap for view from the JOIN::all_fields list instead of JOIN::fields_list as split_sum_func would have added items to the all_fields list.
| | * | mtr: include restart_opts in --verbose-restartSergei Golubchik2019-12-231-2/+2
| | | |
| * | | MDEV-13569: wsrep_info.plugin failed in buildbot with "no nodes coming from ↵Jan Lindström2020-01-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | prim view Modify configuration so that all nodes are part of galera cluster i.e. wsrep_on=ON.
| * | | Post-fix for MDEV-12253: Remove redundant log writesMarko Mäkelä2019-12-301-27/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 8 bytes at FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION will be overwritten at page flush, in buf_page_encrypt_before_write(), ever since commit 765a43605a42c069ede604826ede2d93d72c4fdd (MariaDB 10.1.23, 10.2.6, 10.3.1). btr_store_big_rec_extern_fields(): Remove useless writes to the page header (and to the redo log) for ROW_FORMAT=COMPRESSED BLOB pages.
* | | | MDEV-21405 Assertion failed on instant ADD COLUMNMarko Mäkelä2019-12-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | btr_cur_pessimistic_insert(): Relax a too strict debug assertion that would fail when the function is invoked by btr_cur_pessimistic_update() during innobase_add_instant_try(), that is, when updating the hidden metadata record during a subsequent ADD COLUMN operation involves splitting the leftmost clustered index leaf page. This is a partial backport of 301bd62b2536f85a8ce418dcd5e705796d8c5763 from 10.4.
* | | | MDEV-18865 Assertion `t->first->versioned_by_id()' failed in ↵bb-10.3-trxid_fixesNikita Malyavin2019-12-294-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | innodb_prepare_commit_versioned Cause: * row_start != 0 treated as it exists. Probably, possible row permutations had not been taken in mind. Solution: * Checking both row_start and row_end is correct, so versioned() function is used
* | | | MDEV-18875 Assertion `thd->transaction.stmt.ha_list == __null || trans == ↵Nikita Malyavin2019-12-293-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | &thd->transaction.stmt' failed or bogus ER_DUP_ENTRY upon ALTER TABLE with versioning Cause: * when autocommit=0 (or transaction is issued by user), `ha_commit_trans` is called twice on ALTER TABLE, causing a duplicated insert into `transaction_registry` (ER_DUP_ENTRY). Solution: * ALTER TABLE makes an implicit commit by a second call. We actually need to make an insert only when it is a real commit. So is_real variable is additionally checked.
* | | | Re-record funcs_1.is_columns_is_embedded after a mergeMarko Mäkelä2019-12-271-3/+3
| | | | | | | | | | | | | | | | This was broken since commit 193b5ed50bc203a68aacc5298b01717777701285
* | | | After-merge cleanupAlexander Barkov2019-12-273-19/+23
| | | |
* | | | Merge 10.2 into 10.3Marko Mäkelä2019-12-2760-301/+843
|\ \ \ \ | |/ / /
| * | | Cleanup: Remove dict_delete_tablespace_and_datafiles()Marko Mäkelä2019-12-272-53/+0
| | | | | | | | | | | | | | | | | | | | | | | | The function was only called by innobase_drop_tablespace(), which was removed in commit 494e4b99a4a6c2f933c7e663cbb6ad5b17e8f84a and added in commit 2e814d4702d71a04388386a9f591d14a35980bfe.
| * | | MDEV-21318: Wrong results with window functions and implicit groupingVarun Gupta2019-12-264-1/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue here is for degenerate joins we should execute the window function but it is not getting executed in all the cases. To get the window function values window function needs to be executed always. This currently does not happen in few cases where the join would return 0 or 1 row like 1) IMPOSSIBLE WHERE 2) MIN/MAX optimization 3) EMPTY CONST TABLE The fix is to make sure that window functions get executed and the temporary table is setup for the execution of window functions
| * | | MDEV-21388 Wrong result of DAYNAME()=xxx in combination with ↵Alexander Barkov2019-12-246-24/+104
| | | | | | | | | | | | | | | | condition_pushdown_for_derived=on
| * | | MDEV-21362 do something with -fno-builtin-memcmp for rem0cmp.ccEugene Kosov2019-12-241-1/+2
| | | | | | | | | | | | | | | | | | | | innodb.cmake: restrict -fno-builtin-memcmp for GCC versions older that 4.6 where optimization issue was solved.
| * | | MDEV-21189 : Dropping partition with 'wsrep_OSU_method=RSU' and 'SESSION ↵Jan Lindström2019-12-232-13/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | sql_log_bin = 0' cases the galera node to hang Test cleanup. Best practice for using RSU, is to isolate the node up-front, so this test did not reflect real world scenario
| * | | MDEV-19176 Reduce the memory usage during recoveryThirunarayanan Balathandayuthapani2019-12-231-1/+1
| | | | | | | | | | | | | | | | - post-push to fix the compilation issue
| * | | MDEV-19176 Reduce the memory usage during recoveryThirunarayanan Balathandayuthapani2019-12-234-60/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Moved the recv_sys->heap memory condition inside recv_parse_log_recs(). So that, InnoDB can mark the status as STORE_NO earlier. - InnoDB uses one third of buffer pool chunk size for reading the redo log records. In that case, we can avoid the scenario where buffer ran out of memory issue during recovery.
| * | | Plug memory leaks from numa_get_mems_allowed()Marko Mäkelä2019-12-231-0/+2
| | | |
| * | | Merge 10.1 into 10.2Marko Mäkelä2019-12-2333-116/+377
| |\ \ \ | | |/ /
| | * | fix a bad mergeSergei Golubchik2019-12-201-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in 10.1+ one should use MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-address-of-packed-member") and it's already done in storage/tokudb/PerconaFT/CMakeLists.txt
| | * | MDEV-21319 COUNT(*) returns 1, actual SELECT returns no result in 10.3.21, ↵Alexander Barkov2019-12-196-5/+250
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | but 1 result in 10.1.41 Item_ref::val_(datetime|time)_packed() erroneously called (*ref)->val_(datetime|time)_packed(). - Fixing to call (*ref)->val_(datetime|time)_packed_result(). - Backporting Item::val_(datetime|time)_packed_result() from 10.3. - Fixing Item_field::get_date_result() to handle null_value in the same way how Item_field::get_date() does.
| | * | fix windows compilationEugene Kosov2019-12-181-1/+1
| | | |