summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.2 into 10.3Marko Mäkelä2019-04-2560-287/+1130
|\
| * Merge 10.1 into 10.2Marko Mäkelä2019-04-2556-114/+1186
| |\
| | * Merge 5.5 into 10.1Marko Mäkelä2019-04-2420-38/+495
| | |\
| | | * MDEV-15772 Potential list overrun during XA recoveryThirunarayanan Balathandayuthapani2019-04-2415-71/+481
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | InnoDB could return the same list again and again if the buffer passed to trx_recover_for_mysql() is smaller than the number of transactions that InnoDB recovered in XA PREPARE state. We introduce the transaction state TRX_PREPARED_RECOVERED, which is like TRX_PREPARED, but will be set during trx_recover_for_mysql() so that each transaction will only be returned once. Because init_server_components() is invoking ha_recover() twice, we must reset the state of the transactions back to TRX_PREPARED after returning the complete list, so that repeated traversals will see the complete list again, instead of seeing an empty list. Without this tweak, the test main.tc_heuristic_recover would hang in MariaDB 10.1.
| | | * MDEV-17260: Memory leaks in mysqlbinlogSujatha Sivakumar2019-04-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ======== The mysqlbinlog tool is leaking memory, causing failures in various tests when compiling and testing with AddressSanitizer or LeakSanitizer like this: cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_ASAN:BOOL=ON /path/to/source make -j$(nproc) cd mysql-test ASAN_OPTIONS=abort_on_error=1 ./mtr --parallel=auto rpl.rpl_row_mysqlbinlog CURRENT_TEST: rpl.rpl_row_mysqlbinlog Direct leak of 112 byte(s) in 1 object(s) allocated from: #0 0x4eff87 in __interceptor_malloc (/dev/shm/5.5/client/mysqlbinlog+0x4eff87) #1 0x60eaab in my_malloc /mariadb/5.5/mysys/my_malloc.c:41:10 #2 0x5300dd in Log_event::read_log_event(char const*, unsigned int, char const**, Format_description_log_event const*, char) /mariadb/5.5/sql/log_event.cc:1568: #3 0x564a9c in dump_remote_log_entries(st_print_event_info*, char const*) /mariadb/5.5/client/mysqlbinlog.cc:1978:17 Analysis: ======== 'mysqlbinlog' tool is being used to read binary log events from a remote server. While reading binary log, if a fake rotate event is found following actions are taken. If 'to-last-log' option is specified, then fake rotate event is processed. In the absence of 'to-last-log' skip the fake rotate event. In this skipped case the fake rotate event object is not getting cleaned up resulting in memory leak. Fix: === Cleanup the fake rotate event. This issues is already fixed in MariaDB 10.0.23 and higher versions as part of commit c3018b0ff4fb02c029787d03867adf0530607bab
| | | * MDEV-18139 ALTER IGNORE ... ADD FOREIGN KEY causes bogus errorMarko Mäkelä2019-04-234-10/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dict_create_foreign_constraints_low(): Tolerate the keywords IGNORE and ONLINE between the keywords ALTER and TABLE. We should really remove the hacky FOREIGN KEY constraint parser from InnoDB.
| | | * Fix the linking of async_exampleMarko Mäkelä2019-04-231-2/+2
| | | |
| | * | MDEV-9465 The constructor StringBuffer(const char *str, size_t length, const ↵Alexander Barkov2019-04-231-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | CHARSET_INFO *cs) looks suspicious Removing the suspicious constructor, it's not used in the code anyway.
| | * | MDEV-17605 Statistics for InnoDB table is wrong if persistent statistics is usedIgor Babaev2019-04-226-1/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The command SHOW INDEXES ignored setting of the system variable use_stat_tables to the value of 'preferably' and and showed statistical data received from the engine. Similarly queries over the table STATISTICS from INFORMATION_SCHEMA ignored this setting. It happened because the function fill_schema_table_by_open() did not read any data from statistical tables.
| | * | MDEV-18920 Prepared statements with st_convexhull hang and eat 100% cpu.Alexey Botchkov2019-04-223-0/+12
| | | | | | | | | | | | | | | | | | | | In the case of error when object shapes are half-collected we need to set the NULL at the vertice's list.
| | * | Fixing -Werror=format-overflow errors (found by gcc-8.3.1)Alexander Barkov2019-04-225-7/+7
| | | |
| | * | MDEV-14041 Server crashes in String::length on queries with functions and ROLLUPAlexander Barkov2019-04-224-4/+108
| | | |
| | * | MDEV-17299 Assertion `maybe_null' failed in make_sortkeyAlexander Barkov2019-04-193-0/+41
| | | |
| | * | MDEV-17297: stats.records=0 for a table of Archive engine when it has rows, ↵Sergei Petrunia2019-04-184-17/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when we run ANALYZE command Archive storage engine assumed that any query that attempts to read from the table will call ha_archive::info() beforehand. ha_archive would flush un-written data in that call (this would make it visible for the reads). Break this assumption. Flush the data when the table is opened for reading. This way, one can do multiple write statements without causing a flush, but as soon as we might need the data, we flush it.
| | * | MDEV-17830 Server crashes in Item_null_result::field_type upon SELECT with ↵Alexander Barkov2019-04-173-0/+39
| | | | | | | | | | | | | | | | CHARSET(date) and ROLLUP
| | * | MDEV-18300: ASAN error in Field_blob::get_key_image upon UPDATE with subqueryVarun Gupta2019-04-114-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For single table updates and multi-table updates , engine independent statistics were not being read even if the statistics were collected. Fixed it, so when the optimizer_use_condition_selectivity > 2 then we would read the available statistics for update queries.
| | * | MDEV-19172 Reorder fields in PFS_events and PFS_events_waits to speed up ↵Eugene Kosov2019-04-052-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | memcpy() before: (gdb) p sizeof(PFS_events_waits) $1 = 184 after: (gdb) p sizeof(PFS_events_waits) $1 = 160 no functional changes
| | * | Merge branch '5.5' into 10.1Vladislav Vaintroub2019-04-040-0/+0
| | |\ \ | | | |/
| | | * MDEV-17610 Unexpected connection abort after certain operations from within ↵Vladislav Vaintroub2019-04-043-7/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | stored procedure Always set SERVER_MORE_RESULTS_EXIST when executing stored procedure statements If statements produce a result, EOF packet needs this flag (SP ends with an OK packet). IF statetement does not produce a result, affected rows count are part of the final OK packet.
| | * | MDEV-17610 Unexpected connection abort after certain operations fromVladislav Vaintroub2019-04-044-8/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | within stored procedure Always set SERVER_MORE_RESULTS_EXIST when executing stored procedure. statements If statements produce a result, EOF packet needs this flag (SP ends with an OK packet). IF statetement does not produce a result, affected rows count are part of the final OK packet.
| | * | MDEV-19169: Add --defaults-group-suffix option to mysql_install_db man pageIan Gilfillan2019-04-041-2/+17
| | | |
| * | | MDEV-15837: Assertion `item1->type() == Item::FIELD_ITEM && item2->type() == ↵Varun Gupta2019-04-243-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Item::FIELD_ITEM' failed in compare_order_elements function The issue here is the function compare_order_lists() is called for the order by list of the window functions so that those window function that can be computed together are adjacent. So in the function compare_order_list we iterate over all the elements in the order list of the two functions and compare the items in their order by clause. The function compare_order_elements() is called for each item in the order by clause. This function assumes that all the items that are in the order by list would be of the type Item::FIELD_ITEM. The case we have is that we have constants in the order by clause. We should ignore the constant and only compare items of the type Item::FIELD_ITEM in compare_order_elements()
| * | | MDEV-17796 WHERE filter is ignored by DISTINCT IFNULL(GROUP_CONCAT(X), Y)Igor Babaev2019-04-233-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with GROUP BY + ORDER BY The method JOIN::create_postjoin_aggr_table() should not call call JOIN::add_sorting_to_table() unless the first non-constant join table is passed as the first parameter to the method.
| * | | Do fast exit with error code and FATAL ERROR message, if innodb cannot start ↵Vladislav Vaintroub2019-04-231-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | during prepare. Otherwise, it is possible for "prepare" to exit with error code 0, even if it did not work at all.
| * | | Remove IBUF_COUNT_DEBUGMarko Mäkelä2019-04-197-189/+7
| | | | | | | | | | | | | | | | | | | | | | | | The compile-time option IBUF_COUNT_DEBUG has not been used for years. It would only work with up to 3 created .ibd files, with no buffered changes existing while InnoDB is started up.
* | | | MDEV-19239 ERROR 1300 (HY000): Invalid utf8 character string in 10.3.13-MariaDBAlexander Barkov2019-04-213-1/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A sequence of <digits>e<mbhead><mbtail>, e.g.: SELECT 123eXYzzz FROM t1; was not scanned correctly (where XY is a multi-byte character). The multi-byte head byte X was appended to 123e separately from the multi-byte tail byte Y, so a pointer to "Yzzz" was passed into scan_ident_start(), which failed on a bad multi-byte sequence. After this change, scan_ident_start() gets a pointer to "XYzzz", so it correctly sees the whole multi-byte character.
* | | | Backporting from 10.4 to 10.3: MDEV-17325 NULL-ability problems with LEAST() ↵Alexander Barkov2019-04-206-1/+309
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in combination with NO_ZERO_DATE and NO_ZERO_IN_DATE This also fixes: MDEV-17299 Assertion `maybe_null' failed in make_sortkey Note, during merge of the 10.1 version of MDEV-17299, please use the 10.3 version of the code (i.e. null merge the 10.1 version).
* | | | MDEV-18096 The server would crash when has configs ↵Andrei Elkin2019-04-195-19/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rpl_semi_sync_master_enabled = OFF rpl_semi_sync_master_wait_no_slave = OFF The patch fixes a fired assert in the semisync master module. The assert caught attempt to switch semisync off (per rpl_semi_sync_master_wait_no_slave = OFF) when it was not even initialized (per rpl_semi_sync_master_enabled = OFF). The switching-off execution branch is relocated under one that executes enable_master() first. A minor cleaup is done to remove the int return from two functions that did not return anything but an error which could not happen in the functions.
* | | | MDEV-18092 Query with the table I_S.PARAMETERS stop working after a package ↵Alexander Barkov2019-04-183-1/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is created This patch was originally made by Anel Husakovic. Skip `PACKAGE` and `PACKAGE BODY` records quickly. These stored objects do not have any parameters or return values (only procedures and functions have). So no needs to build a `CREATE` statement (in `Sp_handler::sp_load_for_information_schema()`) and parse it: this won't give us any data useful for `INFORMATION_SCHEMA.PARAMETERS`.
* | | | Merge 10.2 into 10.3Marko Mäkelä2019-04-1716-57/+495
|\ \ \ \ | |/ / /
| * | | MDEV-12699 Improve crash recovery of corrupted data pagesbb-10.2-MDEV-12699Marko Mäkelä2019-04-1711-25/+459
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | InnoDB crash recovery used to read every data page for which redo log exists. This is unnecessary for those pages that are initialized by the redo log. If a newly created page is corrupted, recovery could unnecessarily fail. It would suffice to reinitialize the page based on the redo log records. To add insult to injury, InnoDB crash recovery could hang if it encountered a corrupted page. We will fix also that problem. InnoDB would normally refuse to start up if it encounters a corrupted page on recovery, but that can be overridden by setting innodb_force_recovery=1. Data pages are completely initialized by the records MLOG_INIT_FILE_PAGE2 and MLOG_ZIP_PAGE_COMPRESS. MariaDB 10.4 additionally recognizes MLOG_INIT_FREE_PAGE, which notifies that a page has been freed and its contents can be discarded (filled with zeroes). The record MLOG_INDEX_LOAD notifies that redo logging has been re-enabled after being disabled. We can avoid loading the page if all buffered redo log records predate the MLOG_INDEX_LOAD record. For the internal tables of FULLTEXT INDEX, no MLOG_INDEX_LOAD records were written before commit aa3f7a107ce3a9a7f80daf3cadd442a61c5493ab. Hence, we will skip these optimizations for tables whose name starts with FTS_. This is joint work with Thirunarayanan Balathandayuthapani. fil_space_t::enable_lsn, file_name_t::enable_lsn: The LSN of the latest recovered MLOG_INDEX_LOAD record for a tablespace. mlog_init: Page initialization operations discovered during redo log scanning. FIXME: This really belongs in recv_sys->addr_hash, and should be removed in MDEV-19176. recv_addr_state: Add the new state RECV_WILL_NOT_READ to indicate that according to mlog_init, the page will be initialized based on redo log record contents. recv_add_to_hash_table(): Set the RECV_WILL_NOT_READ state if appropriate. For now, we do not treat MLOG_ZIP_PAGE_COMPRESS as page initialization. This works around bugs in the crash recovery of ROW_FORMAT=COMPRESSED tables. recv_mark_log_index_load(): Process a MLOG_INDEX_LOAD record by resetting the state to RECV_NOT_PROCESSED and by updating the fil_name_t::enable_lsn. recv_init_crash_recovery_spaces(): Copy fil_name_t::enable_lsn to fil_space_t::enable_lsn. recv_recover_page(): Add the parameter init_lsn, to ignore any log records that precede the page initialization. Add DBUG output about skipped operations. buf_page_create(): Initialize FIL_PAGE_LSN, so that recv_recover_page() will not wrongly skip applying the page-initialization record due to the field containing some newer LSN as a leftover from a different page. Do not invoke ibuf_merge_or_delete_for_page() during crash recovery. recv_apply_hashed_log_recs(): Remove some unnecessary lookups. Note if a corrupted page was found during recovery. After invoking buf_page_create(), do invoke ibuf_merge_or_delete_for_page() via mlog_init.ibuf_merge() in the last recovery batch. ibuf_merge_or_delete_for_page(): Relax a debug assertion. innobase_start_or_create_for_mysql(): Abort startup if a corrupted page was found during recovery. Corrupted pages will not be flagged if innodb_force_recovery is set. However, the recv_sys->found_corrupt_fs flag can be set regardless of innodb_force_recovery if file names are found to be incorrect (for example, multiple files with the same tablespace ID).
| * | | MDEV-19241 InnoDB fails to write MLOG_INDEX_LOAD upon completing ALTER TABLEMarko Mäkelä2019-04-173-26/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to what was done in commit aa3f7a107ce3a9a7f80daf3cadd442a61c5493ab for FULLTEXT INDEX, we must ensure that MLOG_INDEX_LOAD records will always be written if redo logging was disabled. row_merge_build_indexes(): Invoke row_merge_write_redo() also when online operation is not being executed or an error occurs. In case of an error, invoke flush_observer->interrupted() so that the pages will not be flushed but merely evicted from the buffer pool. Before resuming redo logging, it is crucial for the correctness of mariabackup and InnoDB crash recovery to flush or evict all affected pages and to write MLOG_INDEX_LOAD records.
| * | | MDEV-14239 Missing space: "innodb_open_files ... greaterthan"Marko Mäkelä2019-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | innobase_init(): Add a missing space to a warning message. Apparently, this message was corrupted in MariaDB 10.2.2 in commit fec844aca88e1c6b9c36bb0b811e92d9d023ffb9 related to a conflict resolution when applying a change from MySQL 5.7.12.
| * | | FSP_FLAGS_MEM_MASK: Remove traces of ATOMIC_WRITESMarko Mäkelä2019-04-101-5/+4
| | | |
* | | | Typo fix in sql_sequence.ccwayne2019-04-151-2/+2
| | | |
* | | | MDEV-19236 Improve error message for ↵Eugene Kosov2019-04-129-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE remove a sometimes misleading word INPLACE from error message
* | | | Merge remote-tracking branch 'origin/10.2' into 10.3bb-10.3-janmergeJan Lindström2019-04-122-2/+2
|\ \ \ \ | |/ / /
| * | | Fix wsrep_thd_is_applier macro to point correct function name.Jan Lindström2019-04-101-1/+1
| | | |
| * | | cmake: pass CMAKE_BUILD_TYPE into src.rpmSergei Golubchik2019-04-091-1/+1
| | | | | | | | | | | | | | | | and don't pass BUILD_CONFIG twice, once is enough.
* | | | MDEV-19212: After-merge fix for sizeof(ulong)!=sizeof(ulint)Marko Mäkelä2019-04-082-7/+7
| | | |
* | | | MDEV-12266: Pass fil_space_t* to fseg_free_page()Marko Mäkelä2019-04-085-48/+51
| | | | | | | | | | | | | | | | | | | | fseg_free_page_func(): Avoid an unnecessary tablespace ID lookup. The callers should pass the tablespace that they already know.
* | | | MDEV-14192: Add debug assertionsVlad Lesin2019-04-083-18/+36
| | | |
* | | | Merge 10.2 into 10.3Marko Mäkelä2019-04-0819-308/+156
|\ \ \ \ | |/ / /
| * | | Require --big-test for innodb.undo_truncate_recoverMarko Mäkelä2019-04-081-6/+2
| | | |
| * | | MDEV-19212: Replace macros with type-safe inline functionsMarko Mäkelä2019-04-085-28/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The regression that was reported in MDEV-19212 occurred due to use of macros that did not ensure that the arguments have compatible types. ut_2pow_remainder(), ut_2pow_round(), ut_calc_align(): Define as inline function templates. UT_CALC_ALIGN(): Define as a macro, because this is used in compile_time_assert(). Only starting with C++11 (MariaDB 10.4) we could define the inline functions as constexpr.
| * | | MDEV-19212 4GB Limit on large_pages - integer overflowMarko Mäkelä2019-04-085-35/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | os_mem_alloc_large(): Invoke the macro ut_2pow_round() with the correct argument type. innobase_large_page_size, innobase_use_large_pages, os_use_large_pages, os_large_page_size: Remove. Simply refer to opt_large_page_size, my_use_large_pages.
| * | | MDEV-14192 Mariabackup assertion failure: byte_offset % ↵Vlad Lesin2019-04-081-20/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OS_FILE_LOG_BLOCK_SIZE == 0 xtrabackup_backup_func(): If the log checkpoint header changed since we last read it, search for the most recent checkpoint again. Otherwise, we could corrupt the backup of the redo log, because the least significant bits of checkpoint_lsn_start would not match log_sys->log.lsn.
| * | | MDEV-8139: Clean up the freeing of B-tree pagesMarko Mäkelä2019-04-087-218/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | btr_page_free(): Renamed from btr_page_free_low(). If scrubbing is enabled, zero out the page with proper redo logging. Only pass ahi=true to fseg_free_page() if the page is actually indexed. fil_space_t::modify_check(): Renamed from fsp_space_modify_check(). fsp_init_file_page(): Define inline.
| * | | cmake: force Boost dependency as neededSergei Golubchik2019-04-081-0/+5
| | | | | | | | | | | | | | | | because FindBoost.cmake won't do it
| * | | copy-paste error fixedSergei Golubchik2019-04-071-1/+1
| | | | | | | | | | | | | | | | thanks @FaramosCZ