summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Refactoringbb-mdev6915Varun Gupta2019-11-297-205/+313
|
* MDEV-6915: Allow packed keys and packed values of non-sorted fields in the ↵Varun Gupta2019-11-2816-280/+52227
| | | | sort buffer
* Cleanup: flst_read_addr(), fil_addr_tMarko Mäkelä2019-11-2812-169/+79
| | | | | | | | fil_addr_t: Use exactly sized data types. flst_read_addr(): Remove the unused parameter mtr. page_offset(): Return uint16_t.
* Merge branch '10.4' into 10.5Vladislav Vaintroub2019-11-278-271/+260
|\ | | | | | | | | # Conflicts: # win/packaging/extra.wxs.in
| * MDEV-19781 fixupsVladislav Vaintroub2019-11-278-272/+262
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - It is not enough to have and DeleteSymlinks actions because within the same installation some exes executables can be both added and removed, which needs both adding and removing some symlinks. Instead of CreateSymlinks, there is now FixSymlinks function, which goes through the list, and adds or removes the symlinks as needed. - Implemented rollback for symlink custom action. - Generate list of symlinks in C++ file, using CMake, rather than storing lists as MSI properties.
* | Merge 10.4 into 10.5Marko Mäkelä2019-11-2712-127/+720
|\ \ | |/
| * MDEV-20407 mysqld got signal 11; rowid filterIgor Babaev2019-11-262-0/+67
| | | | | | | | | | | | | | | | | | If a joined table is accessed by a full text index then now no range rowid filter can be used when accessing the records of this table. This bug was fixed by the patch for mdev-20056. This commit adds only a test case with a query using a full text index and a range condition for another index.
| * MDEV-21148: Assertion index->n_core_fields + n_add >= index->n_fieldsMarko Mäkelä2019-11-264-23/+81
| | | | | | | | | | | | | | | | Revert part of commit 6cedb671e99038f1a10e0d8504f835aaabed9780 because it turns out to be theoretically impossible to parse a ROW_FORMAT=COMPACT or ROW_FORMAT=DYNAMIC metadata record where the variable-length fields in the PRIMARY KEY have been written as nonempty strings.
| * MDEV-20056 Assertion `!prebuilt->index->is_primary()' failedIgor Babaev2019-11-263-1/+137
| | | | | | | | | | | | | | | | | | in row_search_idx_cond_check When usage of rowid filter is evaluated by the optimizer to join a table to the current partial join employing a certain index it should be checked that a key for at least the major component of this index can be constructed using values from the columns of the partial join.
| * MDEV-19781 Create MariaDB named commands on Windowsbb-10.4-MDEV-19781Rasmus Johansson2019-11-265-105/+437
| | | | | | | | | | Added CreateSymlinks and DeleteSymlinks functions to CustomAction.cpp. Extra.wxs.in calls them.
* | Code cleanupsMonty2019-11-262-23/+18
| | | | | | | | | | | | | | | | | | | | - Replace "class Repeat_count" with function call. There is no reason for this class to exists. More complex and more code than doing a function! In addition the code didn't match what the val() function was doing. Other things: - Fixed compiler failure in print_cached_tables_callback()
* | MDEV-21152 Bogus debug assertion btr_pcur_is_after_last_in_tree() in ibuf codeMarko Mäkelä2019-11-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | As noted in commit abd45cdc38e72ce329365ffe0df4c6f8c319b407 a search with PAGE_CUR_GE may land on the supremum record on a leaf page that is not the rightmost leaf page. This could occur when all keys on the current page are smaller than the search key, and the smallest key on the successor page is larger than the search key. Hence, after a failed PAGE_CUR_GE search, assertions btr_pcur_is_after_last_in_tree() are bogus and should be replaced with btr_pcur_is_after_last_on_page().
* | MDEV-21127 Assertion in key_text::key_text()Aleksey Midenkov2019-11-263-3/+22
| | | | | | | | Unsigned type while RHS expression could be less than 0.
* | MDEV-21133 Optimize access to InnoDB page header fieldsMarko Mäkelä2019-11-2612-91/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce memcpy_aligned<N>(), memcmp_aligned<N>(), memset_aligned<N>() and use them for accessing InnoDB page header fields that are known to be aligned. MY_ASSUME_ALIGNED(): Wrapper for the GCC/clang __builtin_assume_aligned(). Nothing similar seems to exist in Microsoft Visual Studio, and the C++20 std::assume_aligned is not available to us yet. Explicitly specified alignment guarantees allow compilers to generate faster code on platforms with strict alignment rules, instead of emitting calls to potentially unaligned memcpy(), memcmp(), or memset().
* | MDEV-16264 - Fix assertion `m_queue.empty() && !m_tasks_running' in ↵Vladislav Vaintroub2019-11-251-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tpool::task_group destructor This particular assertion happened when shutting down Innodb IO.IO shutdown properly waits for all IOs to finish However there is a race condition - right after releasing last IO slot and before decrementing task count in group, pending_io_count will be 0, but tasks_running will be 1, leading to assertion. The fix is to make task_group destructor to wait for last running task to finish.
* | Removed tc_purge() and purge_tables() argumentSergey Vojtovich2019-11-255-14/+10
| | | | | | | | | | | | | | | | It was mistakenly used by tdc_start_shutdown() to make sure TABLE_SHARE gets evicted from table definition cache when it becomes unused. However same effect is achieved by resetting tdc_size and tc_size. Part of MDEV-17882 - Cleanup refresh version
* | Removed kill_delayed_threads_for_table()Sergey Vojtovich2019-11-2513-80/+27
| | | | | | | | | | | | | | | | | | | | After 7fb9d64 it is used only by ALTER/DROP SERVER, which most probably wasn't intentional as Federated never supported delayed inserts anyway. If delayed inserts will ever become an issue with ALTER/DROP SERVER, we should kill them by acquiring X-lock instead. Part of MDEV-17882 - Cleanup refresh version
* | Removed tdc_increment_refresh_version()Sergey Vojtovich2019-11-256-47/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is never called after 7fb9d64, which makes the whole refresh version infrastructure useless. Removed: - tdc_version_t - TDC_VERSION_MAX - tdc_version - TDC_element::version - tdc_increment_refresh_version() - tdc_refresh_version() - refresh_version argument of tdc_wait_for_old_version() - Flush_commands status variable - refresh version from COM_STATISTICS - refresh version from dbug printouts Part of MDEV-17882 - Cleanup refresh version
* | Merge 10.4 into 10.5Aleksey Midenkov2019-11-2544-216/+722
|\ \ | |/
| * MDEV-20190 Instant operation fails when add column and collation change on ↵Marko Mäkelä2019-11-258-23/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | non-indexed column We must relax too strict debug assertions. For latin1_swedish_ci, mtype=DATA_CHAR or mtype=DATA_VARCHAR will be used instead of mtype=DATA_MYSQL or mtype=DATA_VARMYSQL. Likewise, some changes of dtype_get_charset_coll() do not affect the data type encoding, but only any indexes that are defined on the column. Charset::same_encoding(): Check whether two charset-collations have the same character set encoding. dict_col_t::same_encoding(): Check whether two character columns have the same character set encoding. dict_col_t::same_type(): Check whether two columns have a compatible data type encoding. dict_col_t::same_format(), dict_table_t::instant_column(): Do not compare mtype or the charset-collation of prtype directly. Rely on dict_col_t::same_type() instead. dtype_get_charset_coll(): Narrow the return type to uint16_t. This is a refined version of a fix that was developed by Thirunarayanan Balathandayuthapani.
| * Merge 10.3 into 10.4Aleksey Midenkov2019-11-256-4/+88
| |\
| | * MDEV-21049 Segfault in create federatedx table with empty hostnameAleksey Midenkov2019-11-223-4/+40
| | | | | | | | | | | | Use my_localhost instead of NULL for share->hostname.
| | * MDEV-18727 improve DML operation of System VersioningAleksey Midenkov2019-11-2219-87/+271
| | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-18957 UPDATE with LIMIT clause is wrong for versioned partitioned tables UPDATE, DELETE: replace linear search of current/historical records with vers_setup_conds(). Additional DML cases in view.test
| | * MDEV-21045 AddressSanitizer: use-after-poison in mem_heap_dup / ↵Eugene Kosov2019-11-213-0/+48
| | | | | | | | | | | | | | | | | | | | | row_log_table_get_pk_col row_log_table_get_pk_col(): read instant field value from instant alter table when it's required.
| | * Merge branch '10.2' into 10.3Vlad Lesin2019-11-200-0/+0
| | |\
| | | * MDEV-21082: isnan/isinf compilation errors, isfinite warnings on MacOSVlad Lesin2019-11-1916-55/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix consists of three commits backported from 10.3: 1) Cleanup isnan() portability checks (cherry picked from commit 7ffd7fe9627d1f750a3712aebb4503e5ae8aea8e) 2) Cleanup isinf() portability checks Original problem reported by Wlad: re-compilation of 10.3 on top of 10.2 build would cache undefined HAVE_ISINF from 10.2, whereas it is expected to be 1 in 10.3. std::isinf() seem to be available on all supported platforms. (cherry picked from commit bc469a0bdf85400f7a63834f5b7af1a513dcdec9) 3) Use std::isfinite in C++ code This is addition to parent revision fixing build failures. (cherry picked from commit 54999f4e75f42baca484ae436b382ca8817df1dd)
| * | | MDEV-18727 improve DML operation of System Versioning (10.4)Aleksey Midenkov2019-11-2520-107/+267
| | | | | | | | | | | | | | | | | | | | | | | | | | | | UPDATE, DELETE: replace linear search of current/historical records with vers_setup_conds(). Additional DML cases in view.test
| * | | MDEV-21096 async slave crash with gtid_log_pos table access (#1413)seppo2019-11-257-79/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original crash happened when async replication IO thread was updating mysql.gtid_slave_pos table. Operations on this table should remain node local, but it appears that protection (THD::wsrep_ignore_table flag) to prevent wsrep replication for this table mas missing for innodb write_row() and update_row(). It was somewhat difficult to reproduce the issue, because mtr seems to create the affected table mysql.gtid_log_pos as of Aria engine type, and Aria engine operations will not be replicated anyhow. It looks, though, that in release installation, mysql.gtid_slave_pos table is of InnoDB engine. It was possible to trigger somewhat related problem by running test galera.galera_as_slave_gtid with configuration: gtid_pos_auto_engines=InnoDB. However, this test mode, causes earlier crash when replication background thread creates aditional table: mysql.gtid_slave_pos_InnoDB, and this table create triggered wsrep TOI replication, which also failed for assertion. Actually, async replication IO and background threads should not replicate anything to cluster. This pull request contains new test galera.galera_as_slave_gtid_auto_engine, which basically just runs galera.galera_as_slave_gtid with configuration of gtid_pos_auto_engines=InnoDB. Test galera.galera_as_slave_gtid is also modified for better code reuse. Actual fix for MDEV-21096 is in storage/innobase/handler/ha_innodb.cc, where THD::wsrep_ignore_table flag is now honored before wsrep key population. There is additional fix in sql/service_wsrep.cc where async replication IO and background threads are marked as non-local. This fences these threads out of wsrep replication altogether. Note that this change, actually makes the use of THD::wsrep_ignore-table redundant. We may want to refactor THD::wsrep_ignore_table out in the future, if there is no other use case for it in sight.
| * | | MDEV-19919 Assertion `!prebuilt->index->is_primary()' failedIgor Babaev2019-11-223-2/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in row_search_idx_cond_check For a single table query with ORDER BY and several sargable range conditions the optimizer may choose an execution plan that employs a rowid filter. In this case it is important to build the filter before calling the function JOIN_TAB::sort_table() that creates sort index for the result set, because when this is index created the filter has to be already filled. After the sort index has been created the filter must be deactivated. If not to do this the innodb function row_search_idx_cond_check() is getting confused when it has to read rows from the created sort index by using ha_rnd_pos(). The order of actions mentioned above is needed also when processing a join query if sorting is performed for the first non constant table in the chosen execution plan.
| * | | MDEV-20972: `or` alterative operator breaking windows buildSeth Shelnutt2019-11-221-1/+1
| | | | | | | | | | | | | | | | Closes #1405
* | | | Fix shutdown hang in dict_stats , caused by MDEV-16264mariadb-10.5.0Vladislav Vaintroub2019-11-251-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dict_stats_shutdown() can hang, waiting for timer callback to finish. This happens because locks the same mutex, which can also used inside timer callback, within dict_stats_schedule() function. Fix is to make dict_stats_schedule() use mutex.try_lock() instead of mutex.lock(). In the unlikely case of simultaneous dict_stats_schedule() setting different timer delays, now the first one would win, which is fine. Important is that shutdown won't hang.
* | | | MDEV-21132 Remove buf_page_t::newest_modificationMarko Mäkelä2019-11-2513-451/+291
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At each mini-transaction commit, the log sequence number of the mini-transaction must be written to each modified page, so that it will be available in the FIL_PAGE_LSN field when the page is being read in crash recovery. InnoDB was unnecessarily allocating redundant storage for the field, in buf_page_t::newest_modification. Let us access FIL_PAGE_LSN directly. Furthermore, on ALTER TABLE...IMPORT TABLESPACE, let us write 0 to FIL_PAGE_LSN instead of using log_sys.lsn. buf_flush_init_for_writing(), buf_flush_update_zip_checksum(), fil_encrypt_buf_for_full_crc32(), fil_encrypt_buf(), fil_space_encrypt(): Remove the parameter lsn. buf_page_get_newest_modification(): Merge with the only caller. buf_tmp_reserve_compression_buf(), buf_tmp_page_encrypt(), buf_page_encrypt(): Define static in the same compilation unit with the only caller. PageConverter::m_current_lsn: Remove. Write 0 to FIL_PAGE_LSN on ALTER TABLE...IMPORT TABLESPACE.
* | | | MDEV-19903 Setup default partitions for system versioningAleksey Midenkov2019-11-225-209/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement syntax like: create table t1 (x int) with system versioning partition by system_time; which will create 1 history partition and 1 current partition. Also it is possible to specify the number of history partitions: create table t1 (x int) with system versioning partition by system_time partitions 5; which will create 4 history partitions (and 1 current partition). Tests: partition.test cases are duplicated where it is appropriate for default partitions. partition_rotation.test cases are replaced by default partitions where possible.
* | | | MDEV-21062 Do not use popen() in text mode for mysql_upgrade.Vladislav Vaintroub2019-11-221-1/+10
| | | |
* | | | Fix MTR suppressions in inconsistency voting tests (#1412)Daniele Sciascia2019-11-229-4/+59
| | | | | | | | | | | | | | | | Message "WSREP: Failed to apply write set" has been turned into an error, but tests were not adjusted accordingly.
* | | | MDEV-21110 Unify turn_parser_debug_on() in sql_yacc.yy and sql_yacc_ora.yyAlexander Barkov2019-11-214-3/+32
| | | | | | | | | | | | | | | | | | | | The block defining turn_parser_debug_on() now looks similar in both sql_yacc.yy and sql_yacc_ora.yy.
* | | | Upgrade accidentally downgraded libmariadbMarko Mäkelä2019-11-211-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | In commit daabc5cc68440fe7871b7c570e114a6a0d119bfb the libmariadb component was accidentally downgraded. Restore the latest libmariadb release, v3.1.5.
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-11-2010-29/+135
|\ \ \ \ | |/ / /
| * | | MDEV-21088 Table cannot be loaded after instant ADD/DROP COLUMNMarko Mäkelä2019-11-206-27/+101
| | | | | | | | | | | | | | | | | | | | | | | | btr_cur_instant_init_low(): Accurately parse the metadata record header for ROW_FORMAT=DYNAMIC and ROW_FORMAT=COMPACT. CHAR columns used to be unnecessarily written as nonempty strings of bytes.
| * | | Merge 10.3 into 10.4Marko Mäkelä2019-11-204-2/+34
| |\ \ \ | | |/ /
| | * | MDEV-21088: Follow-up fix for ROW_FORMAT=REDUNDANTMarko Mäkelä2019-11-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For ROW_FORMAT=REDUNDANT, we must reserve fixed-length dummy values for the CHAR columns in the metadata record. This is because in MariaDB Server 10.4, btr_cur_instant_init_low() will rely on dict_index_t::trx_id_offset being accurate for the metadata record.
| | * | MDEV-21088 Table cannot be loaded after instant ADD/DROP COLUMNMarko Mäkelä2019-11-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In MariaDB Server 10.4, btr_cur_instant_init_low() assumes that all PRIMARY KEY columns that are internally variable-length will be encoded in 0 bytes in the metadata record. Sometimes, CHAR columns can be encoded as variable-length. We should not unnecessarily reserve space for a dummy string value in the metadata record.
| | * | MDEV-14667 Assertion `used_parts > 0' failed in ↵Alexey Botchkov2019-11-203-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | ha_partition::init_record_priority_queue. Do not fail fi all the partitions were pruned out.
* | | | Bison parser cleanups: define yyerror() instead of MYSQLerror()/ORAerror()Alexander Barkov2019-11-202-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To reduce the difference between sql_yacc.yy and sql_yacc_ora.yy, using yyerror() in both files, instead of MYSQLerror() and ORAerror(). The pre-processor replaces yyerror() to MYSQLerror() and ORAerror() anyway.
* | | | MDEV-16264 fix unused variable ‘save_psi_thread’Aleksey Midenkov2019-11-201-0/+2
| | | |
* | | | MDEV-20729 Fix REFERENCES constraint in column definitionAleksey Midenkov2019-11-2020-64/+273
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support of referential constraints directly in column defininions: create table t1 (id1 int primary key); create table t2 (id2 int references t1(id1)); Referenced field name can be omitted if equal to foreign field name: create table t1 (id int primary key); create table t2 (id int references t1); Until 10.5 this syntax was understood by the parser but was silently ignored. In case of generated columns this syntax is disabled at parser level by ER_PARSE_ERROR. Note that separate FOREIGN KEY clause for generated columns is disabled at storage engine level.
* | | | MDEV-20480 Obsolete internal parser for FK in InnoDBAleksey Midenkov2019-11-2019-1401/+825
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently InnoDB uses internal parser for adding foreign keys. Remove internal parser and use data parsed by SQL parser (sql_yacc) for adding foreign keys. - create_table_info_t::create_foreign_keys() replacement for dict_create_foreign_constraints_low(); - Pass constraint name via Foreign_key object. Temporary until MDEV-20865: - Pass alter_info as part of create_info.
* | | | MDEV-21063 Very many test failures on big-endian PowerPCSachin2019-11-191-2/+1
| | | | | | | | | | | | | | | | | | | | Memcpy is endian dependent, So instead of memcpy we will use int2store. And m_metadata_size can be 0,1 or 2, And int2store will take care of it.
* | | | MDEV-21073 Collect different grammar rules into a single chunkAlexander Barkov2019-11-194-1381/+1627
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On order to unify the two *.yy files easier, this patch collects all different rules to the end of *.yy files, so the rule section looks like this: %% common rules different rules
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-11-1928-92/+633
|\ \ \ \ | |/ / /