summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-21910: merge reworked 10.4-MDEV-21910 patch into 10.210.2-sysprg-MDEV-21910Julius Goryavsky2020-07-2736-211/+816
|
* fix assertionNikita Malyavin2020-07-221-1/+0
|
* fix c++98 buildNikita Malyavin2020-07-214-8/+8
|
* MDEV-16039 Crash when selecting virtual columns generated using functions ↵Nikita Malyavin2020-07-2110-51/+195
| | | | | | | | | | | | | | with DAYNAME() * Allocate items on thd->mem_root while refixing vcol exprs * Make vcol tree changes register and roll them back after the statement is executed. Explanation: Due to collation implementation specifics an Item tree could change while fixing. The tricky thing here is to make it on a proper arena. It's usually not a problem when a field is deterministic, however, makes a pain vice-versa, during allocation allocating. A non-deterministic field should be refixed on each statement, since it depends on the environment state. Changing the tree will be temporary and therefore it should be reverted after the statement execution.
* 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-21347 innodb_log_optimize_ddl=OFF is not crash safeMarko Mäkelä2020-07-166-55/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 0f90728bc0f8bc946a61500801b23f8a316e73d5 (MDEV-16809) we introduced the configuration option innodb_log_optimize_ddl for controlling whether native index creation or table-rebuild in InnoDB should avoid writing full redo log. Fungo Wang reported that this option is causing occasional failures. The reason is that pages may be written to data files in an inconsistent state. Applying log records to such inconsistent pages may fail. The solution is to always invoke PageBulk::finish() before page latches may be released, to ensure that the page contents is in a consistent state. Something similar was implemented in MySQL 8.0.13: mysql/mysql-server@d1254b947354e0f5b7223b09c521bd85f22e1e31 buf_block_t::skip_flush_check: Remove. Suppressing consistency checks is a bad idea. PageBulk::needs_finish(): New predicate: Determine whether PageBulk::finish() must fix up the page. PageBulk::init(): Clear PAGE_DIRECTION to ensure that needs_finish() will hold. We change the field from PAGE_NO_DIRECTION to 0 and back without writing redo log. This trick avoids the need to introduce any new data member to PageBulk. PageBulk::insert(): Replace some high-level accessors to bypass debug assertions related to PAGE_HEAP_TOP that we will be violating until finish() has been executed. PageBulk::finish(): Tolerate m_rec_no==0. We must invoke this also on an empty page, to ensure that PAGE_HEAP_TOP is initialized. PageBulk::commit(): Always invoke finish(). PageBulk::release(), BtrBulk::pageSplit(), BtrBulk::storeExt(), BtrBulk::finish(): Invoke PageBulk::finish().
* | Make page validation stricterMarko Mäkelä2020-07-151-8/+6
| | | | | | | | | | page_simple_validate_old(), page_simple_validate_new(): Require PAGE_N_DIR_SLOTS to be at least 2.
* | MDEV-23183 Infinite loop on page_validate() on corrupted pageMarko Mäkelä2020-07-151-1/+3
| | | | | | | | | | | | | | MDEV-22721 (commit eba2d10ac53d1d2f975027ba2b2ca39d9c9b98ad) inadvertently introduced an infinite loop. page_validate(): Remove the infinite loop.
* | Fix compile warningVladislav Vaintroub2020-07-151-1/+2
| |
* | MDEV-23163 Merge new release of InnoDB 5.7.31 to 10.2Marko Mäkelä2020-07-141-1/+1
| | | | | | | | | | | | The only InnoDB change between MySQL 5.7.30 and MySQL 5.7.31 that is applicable to MariaDB Server was applied in commit 8d061996e6531b2809aefb0ed96e0662b2c2882e (MDEV-23161).
* | Merge 10.1 into 10.2Marko Mäkelä2020-07-1420-84/+257
|\ \ | |/
| * XtraDB 5.6.48-88.0Marko Mäkelä2020-07-143-4/+4
| | | | | | | | | | | | The only InnoDB changes between Percona XtraDB Server 5.6.47-87.0 and 5.6.48-88.0 are related to InnoDB changes between MySQL 5.6.47 and MySQL 5.6.48, which we had already applied.
| * Update the InnoDB version number to 5.6.49Marko Mäkelä2020-07-144-4/+4
| | | | | | | | There were no InnoDB changes between MySQL 5.6.48 and MySQL 5.6.49.
| * MDEV-23161 avg_count_reset may wrongly be NULL in I_S.INNODB_METRICSMarko Mäkelä2020-07-142-26/+28
| | | | | | | | | | | | | | | | | | | | | | | | This issue was originally reported by Fungo Wang, along with a fix, as MySQL Bug #98990. His suggested fix was applied as part of mysql/mysql-server@a003fc373d1adb3ccea353b5d7d83f6c4c552383 and released in MySQL 5.7.31. i_s_metrics_fill(): Add the missing call to Field::set_notnull(), and simplify some code.
| * MDEV-22765 i_s_fts_index_cache_fill_one_index() is not protect by the lockThirunarayanan Balathandayuthapani2020-07-142-0/+6
| | | | | | | | | | - i_s_fts_index_cache_fill() should take shared lock of fts cache before accessing index cache to avoid reading stale data.
| * MDEV-15662 mariabackup.huge_lsn fails sporadically with "log sequence ↵Thirunarayanan Balathandayuthapani2020-07-142-0/+12
| | | | | | | | | | | | | | | | | | number is in the future" - Problem is that test case creates iblogfile* files. So existing ibdata pages could point to future LSN. Fix is that taking the backup of data before iblogfile* creation and apply it before exiting the test case.
| * MDEV-22890 DEADLOCK of threads detected: row0sel.cc S-LOCK / btr0cur.cc ↵Thirunarayanan Balathandayuthapani2020-07-142-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | S-LOCK / row0quiesce.cc X-LOCK Problem: ======= - Read operations are always allowed to hold a secondary index leaf latch and then look up the corresponding clustered index record. Flush table operation acquires secondary index latch while holding a clustered index latch. It leads to deadlock violation. Fix: ==== - Flush table operation should acquire secondary index before taking clustered index to avoid deadlock violation with select operation.
| * MDEV-23027 symlink_wsrep_sst_rsync target built when WITH_WSREP is offVicențiu Ciorbaru2020-07-131-29/+30
| | | | | | | | Only install wsrep scripts and links if WSREP_ON is actually set
| * MDEV-23114 AUTH_PAM plugin can not be disabled when using mysql_release configVicențiu Ciorbaru2020-07-071-1/+1
| | | | | | | | | | When setting the PLUGIN_AUTH_PAM variable, mark it as a "CACHE" variable so it can be overridden by the user.
| * MDEV-22654: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())'Rucha Deodhar2020-07-063-1/+42
| | | | | | | | | | | | | | | | | | failed in Diagnostics_area::set_ok_status on FUNCTION replace When there is REPLACE in the statement, sp_drop_routine_internal() returns 0 (SP_OK) on success which is then assigned to ret. So ret becomes false and the error state is lost. The expression inside DBUG_ASSERT() evaluates to false and thus the assertion failure.
| * MDEV-23098 mariadb-upgrade-service.exe does not work on WAMPServerVladislav Vaintroub2020-07-061-5/+26
| | | | | | | | | | | | | | While trying to detect datadir, take into account that one can use Windows service name as section name in options file, for Windows service. The historical obscurity is being used by WAMP installations.
| * MDEV-22390: Assertion `m_next_rec_ptr >= m_rawmem' failed in ↵Varun Gupta2020-07-064-2/+78
| | | | | | | | | | | | | | | | | | Filesort_buffer::spaceleft | SIGSEGV in __memmove_avx_unaligned_erms from my_b_write Make sure that the sort_buffer that is allocated has atleast space for MERGEBUFF2 keys. The issue here was that the record length is quite high and sort buffer size is very small, due to which we end up with zero number of keys in the sort buffer. The Sort_param::max_keys_per_buffer was zero in such a case, due to which we were flushing empty sort_buffer to the disk.
| * MDEV-22173: socket accept - test for failureDaniel Black2020-07-061-8/+16
| | | | | | | | | | | | | | | | | | | | accept might return an error, including SOCKET_EAGAIN/ SOCKET_EINTR. The caller, usually handle_connections_sockets can these however and invalid file descriptor isn't something to call fcntl on. Thanks to Etienne Guesnet (ATOS) for diagnosis, sample patch description and testing.
* | Merge branch '10.4-MDEV-18838' of ↵Julius Goryavsky2020-07-142-8/+9
| | | | | | | | https://github.com/codership/mariadb-server into 10.2-MDEV-18838
* | MDEV-22463: Element_type &Bounds_checked_array<Item *>::operator[](size_t) ↵Varun Gupta2020-07-136-5/+81
| | | | | | | | | | | | | | | | [Element_type = Item *]: Assertion `n < m_size' failed. Allocate space for fields inside the window function (arguments, PARTITION BY and ORDER BY clause) in the ref pointer array. All fields inside the window function are part of the temporary table that is required for the window function computation.
* | MDEV-22058: Assertion `!is_set() || (m_status == DA_OK_BULK && ↵Rucha Deodhar2020-07-1210-28/+70
| | | | | | | | | | | | | | | | is_bulk_op())' failed in Diagnostics_area::set_ok_status Error state is not stored in check_and_do_in_subquery_rewrites() when there is illegal combination of optimizer switches. So all the functions eventually return false. Thus the assetion failure.
* | MDEV-19119: main.ssl_crl fails in buildbot with wrong error codebb-10.2-MDEV-19119Rucha Deodhar2020-07-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | The client can only find out if the server has disconnected when it tries to read or send something. If the server gets disconnected before send_client_reply_packet(), the client will try sending authentication information but it will fail. But, if the client is fast enough to send autentication information before disconnecting, it will notice that when reading the ok packet. So the client can fail on read or on write. It is unpredictable because, the process are unsynchronized and this could happen in any order.
* | MDEV-10120: Wrong result of UNION .. ORDER BY GROUP_CONCAT()Varun Gupta2020-07-105-34/+53
| | | | | | | | | | Reject queries that have aggregate functions with UNION as these are not allowed by standard.
* | Fix typo in the comment (and old info)Oleksandr Byelkin2020-07-091-1/+1
| |
* | MDEV-12059: Assertion `precision > 0' failed with a window function or ↵Varun Gupta2020-07-073-0/+20
| | | | | | | | | | | | window aggregate function Pass the unsigned flag from the Item_sum to the window function
* | Merge 10.1 into 10.2Marko Mäkelä2020-07-024-31/+43
|\ \ | |/
| * Revert "Fix result of merge."Marko Mäkelä2020-07-021-1/+5
| | | | | | | | | | | | This reverts commit e0793d386517f4ff9c0267830d558f91c75263aa. In idiomatic C++, accessor functions should not discard qualifiers.
| * MDEV-22941: Fix the DBUG_ENTER nameMarko Mäkelä2020-07-021-4/+4
| |
| * MDEV-23067 Windows : manually registered services rejected mysql_upgrade_serviceVladislav Vaintroub2020-07-011-19/+19
| | | | | | | | | | | | - service not using "--defaults-file" can have any name not just "MySQL" - service with "--defaults-file", without datadir in them use default datadir (install_root\data)
| * MDEV-23052 mysql_install_db.exe can run on existing non-empty directory,Vladislav Vaintroub2020-07-011-7/+15
| | | | | | | | | | | | and remove it on error Disable existing non-empty datadir for mysql_install_db.exe
* | MDEV-20377: Fix cmake -DPLUGIN_PERFSCHEMA=NOMarko Mäkelä2020-07-021-0/+1
| |
* | MDEV-20377: Fix -Wunused-but-set-variableMarko Mäkelä2020-07-011-17/+8
| |
* | MDEV-20428 after-merge fix: Stabilize the testMarko Mäkelä2020-07-012-6/+6
| |
* | MDEV-20377: Make WITH_MSAN more usableMarko Mäkelä2020-07-0141-447/+368
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MemorySanitizer (clang -fsanitize=memory) requires that all code be compiled with instrumentation enabled. The only exception is the C runtime library. Failure to use instrumented libraries will cause bogus messages about memory being uninitialized. In WITH_MSAN builds, we must avoid calling getservbyname(), because even though it is a standard library function, it is not instrumented, not even in clang 10. Note: Before MariaDB Server 10.5, ./mtr will typically fail due to the old PCRE library, which was updated in MDEV-14024. The following cmake options were tested on 10.5 in commit 94d0bb4dbeb28a94d1f87fdd55f4297ff3df0157: cmake \ -DCMAKE_C_FLAGS='-march=native -O2' \ -DCMAKE_CXX_FLAGS='-stdlib=libc++ -march=native -O2' \ -DWITH_EMBEDDED_SERVER=OFF -DWITH_UNIT_TESTS=OFF -DCMAKE_BUILD_TYPE=Debug \ -DWITH_INNODB_{BZIP2,LZ4,LZMA,LZO,SNAPPY}=OFF \ -DPLUGIN_{ARCHIVE,TOKUDB,MROONGA,OQGRAPH,ROCKSDB,CONNECT,SPIDER}=NO \ -DWITH_SAFEMALLOC=OFF \ -DWITH_{ZLIB,SSL,PCRE}=bundled \ -DHAVE_LIBAIO_H=0 \ -DWITH_MSAN=ON MEM_MAKE_DEFINED(): An alias for VALGRIND_MAKE_MEM_DEFINED() and __msan_unpoison(). MEM_GET_VBITS(), MEM_SET_VBITS(): Aliases for VALGRIND_GET_VBITS(), VALGRIND_SET_VBITS(), __msan_copy_shadow(). InnoDB: Replace the UNIV_MEM_ macros with corresponding MEM_ macros. ut_crc32_8_hw(), ut_crc32_64_low_hw(): Use the compiler built-in functions instead of inline assembler when building WITH_MSAN. This will require at least -msse4.2 when building for IA-32 or AMD64. The inline assembler would not be instrumented, and would thus cause bogus failures.
* | MDEV-21222 mariabackup.incremental_backup failed with memory allocation failureSergei Golubchik2020-07-011-0/+5
| | | | | | | | | | | | | | mariabackup tries to allocate a buffer of page_size*page_size/4 size. for 64k page it means 1Gb, which doesn't work very well on 32-bit builders. Skip the 64k page test on 32bit.