- 01 Sep, 2020 1 commit
-
-
Vladislav Vaintroub authored
-
- 31 Aug, 2020 1 commit
-
-
Marko Mäkelä authored
In commit 94d0bb4d (MDEV-20377) we replaced some inline assembler code with calls to GCC-style builtin functions. These functions would only be available if the target allows SSE4.2 instructions to be used. Hence, the cmake -DWITH_MSAN=ON build would fail unless the default x86 (IA-32) or AMD64 target was overridden. It turns out that the problem can be solved by overriding the default target architecture for specific functions with the help of GCC function attributes. ut_crc32c_8(), ut_crc32c_64(): Use the compiler-builtin intrinsic functions. For GCC before 5, the header file <nmmintrin.h> does not really work, and we must keep using the compiler built-in functions. For the Microsoft compiler, we will keep using <intrin.h> because we will also need the definition of the __cpuid() function. On GCC and clang, we prefer to invoke inline assembler for that. Curiously, the inline assembler in has_sse4_2() or crc32_pclmul() is not causing any trouble for MSAN. Also, the inline assembler in WolfSSL appears to be fine now. Something might have changed between clang-8 and clang-10 (10.0.1).
-
- 28 Aug, 2020 3 commits
-
-
Marko Mäkelä authored
When MDEV-22669 introduced CRC-32C acceleration to IA-32, it worked around a compiler bug by disabling the acceleration on GCC 4 for IA-32 altogether, even though the compiler bug only affects -fPIC builds that are targeting IA-32. Let us extend the solution fe5dbfe7 and define HAVE_CPUID_INSTRUCTION that allows us to implement a necessary and sufficient work-around of the compiler bug.
-
Alexander Barkov authored
This patch improves functions my_xxx_to_str() using the idea introduced in this change in MySQL-8.0: commit 8d10f2fff6bbdea7f436b868ebb5fd811defc68a Author: Knut Anders Hatlen <knut.hatlen@oracle.com> Date: Thu Oct 10 13:55:07 2019 +0200 Bug#30472888: IMPROVE THE PERFORMANCE OF INTEGER HANDLING IN THE TEXT PROTOCOL The new way prints 2 digits at a time and demonstrates a very impressing query time reduce: 10% to 38%, depending on the exact data type and the number of fractional digits: SELECT BENCHMARK(10*1000*1000,CONCAT(TIME'10:20:30')); SELECT BENCHMARK(10*1000*1000,CONCAT(TIME'10:20:30.123456')); SELECT BENCHMARK(10*1000*1000,CONCAT(DATE'2001-01-01')); SELECT BENCHMARK(10*1000*1000,CONCAT(TIMESTAMP'2001-01-01 10:20:30')); SELECT BENCHMARK(10*1000*1000,CONCAT(TIMESTAMP'2001-01-01 10:20:30.123456')); See MDEV for details on the benchmark results.
-
Brad Smith authored
-
- 27 Aug, 2020 1 commit
-
-
Marko Mäkelä authored
GCC before version 5 would fail to emit the CPUID instruction when targeting IA-32 in -fPIC mode. Therefore, we must add the CPUID instruction to the HAVE_CLMUL_INSTRUCTION check. This means that the PCLMUL accelerated crc32() function will not be available on i686 executables that are compiled with GCC 4. The limitation does not impact AMD64 builds or non-PIC x86 builds, or other compilers (clang, or GCC 5 or newer).
-
- 26 Aug, 2020 1 commit
-
-
Kentoku SHIBA authored
-
- 27 Aug, 2020 2 commits
-
-
Marko Mäkelä authored
MDEV-22641 in commit dec3f8ca refactored a SIMD implementation of CRC-32 for the ISO 3309 polynomial that uses the IA-32/AMD64 carry-less multiplication (pclmul) instructions. The code was previously only available in Mariabackup; it was changed to be a general replacement of the zlib crc32(). There exist AMD64 systems where CMAKE_SYSTEM_PROCESSOR matches the pattern i[36]86 but not x86_64 or amd64. This would cause a link failure, because mysys/checksum.c would basically assume that the compiler support for instruction is always available on GCC-compatible compilers on AMD64. Furthermore, we were unnecessarily disabling the SIMD acceleration for 32-bit executables. Note: Until MDEV-22749 has been implemented, the PCLMUL instruction will not be used on Microsoft Windows. Closes: #1660
-
Marko Mäkelä authored
-
- 26 Aug, 2020 6 commits
-
-
Jan Lindström authored
If statement still contains changes it must be committed before actual transaction is committed. This assertion was found using randgen and happens only on applier. No repeatable test case found.
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Stepan Patryshev authored
-
Varun Gupta authored
When duplicates are removed from a table using a hash, if the record is a duplicate it is marked as deleted. The handler API check if the record is deleted and send an error flag HA_ERR_RECORD_DELETED. When we scan over the table if the thread is not killed then we skip the records marked as HA_ERR_RECORD_DELETED. The issue here is when a query is aborted by a user (this is happening when the LIMIT for ROWS EXAMINED is exceeded), the scan over the table does not skip the records for which HA_ERR_RECORD_DELETED is sent. It just returns an error flag HA_ERR_ABORTED_BY_USER. This error flag is not checked at the upper level and hence we hit the assert. If the query is aborted by the user we should just skip reading rows and return control to the upper levels of execution.
-
- 25 Aug, 2020 11 commits
-
-
Kentoku SHIBA authored
-
Kentoku SHIBA authored
-
Aleksey Midenkov authored
-
Aleksey Midenkov authored
Field::make_new_field() resets invisible property (needed for "CREATE .. SELECT" f.ex.). Recover invisible property in Delayed_insert::get_local_table() (unireg_check works by the same principle).
-
Marko Mäkelä authored
This bug was originally repeated on 10.4 after defining a UNIQUE KEY on a TEXT column, which is implemented by MDEV-371 by creating the index on a hidden virtual column. While row_vers_vc_matches_cluster() is executing in a purge thread to find out if an index entry may be removed in a secondary index that comprises a virtual column, another purge thread may process the undo log record that this check is interested in, and write a null BLOB pointer in that record. This would trip the assertion. To prevent this from occurring, we must propagate the 'missing BLOB' error up the call stack. row_upd_ext_fetch(): Return NULL when the error occurs. row_upd_index_replace_new_col_val(): Return whether the previous version was built successfully. row_upd_index_replace_new_col_vals_index_pos(): Check the error result. Yes, we would intentionally crash on this error if it occurs outside the purge thread. row_upd_index_replace_new_col_vals(): Check for the error condition, and simplify the logic. trx_undo_prev_version_build(): Check for the error condition.
-
Marko Mäkelä authored
mtr_t::init(): Correct the debug assertion that was added in commit c8936686 (MDEV-22970). When the original failure scenario involves the system tablespace, we could have m_user_space==nullptr. Let us compare m_user_space_id instead.
-
Marko Mäkelä authored
-
Jan Lindström authored
Revert change to MDL and set SST donor thread as a system thread. Joiner thread was already a system thread.
-
Aleksey Midenkov authored
Sys_var_bit::session_save_default() ignored reverse_semantics property.
-
Jan Lindström authored
Key buffer needs to contain max field widths i.e. add MAX_FIELD_WIDTH.
-
Jan Lindström authored
MDEV-22055: Assertion `active() == false' failed in wsrep::transaction::start_transaction upon ROLLBACK AND CHAIN The optional AND CHAIN clause is a convenience for initiating a new transaction as soon as the old transaction terminates. Therefore, do not start new transaction if it is already started at wsrep_start_transaction.
-
- 24 Aug, 2020 1 commit
-
-
Eugene Kosov authored
-
- 23 Aug, 2020 1 commit
-
-
Kentoku SHIBA authored
fix the following type mrr scan (select 0,`id`,`node` from `auto_test_remote`.`tbl_a` where (`id` <> 0) order by `id`)union all(select 1,`id`,`node` from `auto_test_remote`.`tbl_a` where (`id` <> 0) order by `id`) order by `id`
-
- 24 Aug, 2020 3 commits
-
-
Alexander Barkov authored
MDEV-23562 Assertion `time_type == MYSQL_TIMESTAMP_DATETIME' failed upon SELECT from versioned table The code in vers_select_conds_t::init_from_sysvar() assumed that the value of the system_versioning_asof is DATETIME. But it also could be DATE after a query like this: SET system_versioning_asof = DATE(NOW()); Fixing Sys_var_vers_asof::update() to convert the value of the assignment source to DATETIME if it returned DATE. Now vers_select_conds_t::init_from_sysvar() always gets a DATETIME value.
-
Alexander Barkov authored
-
Alexander Barkov authored
Problem: Queries like this showed performance degratation in 10.4 over 10.3: SELECT temporal_literal FROM t1; SELECT temporal_literal + 1 FROM t1; SELECT COUNT(*) FROM t1 WHERE temporal_column = temporal_literal; SELECT COUNT(*) FROM t1 WHERE temporal_column = string_literal; Fix: Replacing the universal member "MYSQL_TIME cached_time" in Item_temporal_literal to data type specific containers: - Date in Item_date_literal - Time in Item_time_literal - Datetime in Item_datetime_literal This restores the performance, and make it even better in some cases. See benchmark results in MDEV. Also, this change makes futher separations of Date, Time, Datetime from each other, which will make it possible not to derive them from a too heavy (40 bytes) MYSQL_TIME, and replace them to smaller data type specific containers.
-
- 23 Aug, 2020 1 commit
-
-
Kentoku SHIBA authored
fix the following type mrr scan (select 0,`id`,`node` from `auto_test_remote`.`tbl_a` where (`id` <> 0) order by `id`)union all(select 1,`id`,`node` from `auto_test_remote`.`tbl_a` where (`id` <> 0) order by `id`) order by `id`
-
- 24 Aug, 2020 1 commit
-
-
Daniel Black authored
Match 10.5 path changes in: * b2feb030 * aaaf005c * bb847777
-
- 23 Aug, 2020 1 commit
-
-
Alexander Barkov authored
-
- 22 Aug, 2020 3 commits
-
-
Alexander Barkov authored
Implementing methods: - Field::val_time_packed() - Field::val_datetime_packed() - Item_field::val_datetime_packed(THD *thd); - Item_field::val_time_packed(THD *thd); to give a faster access to temporal packed longlong representation of a Field, which is used in temporal Arg_comparator's to DATE, TIME, DATETIME data types. The same idea is used in MySQL-5.6+. This improves performance.
-
Alexander Barkov authored
-
Alexander Barkov authored
Problem: When calculatung MIN() and MAX() in a query with GROUP BY, like this: SELECT MIN(time_expr), MAX(time_expr) FROM t1 GROUP BY i; the code in Item_sum_min_max::update_field() erroneosly used string format comparison, therefore '100:20:30' was considered as smaller than '10:20:30'. Fix: 1. Implementing low level "native" related methods in class Time: Time::Time(const Native &native) - convert native to Time Time::to_native(Native *to, uint decimals) - convert Time to native The "native" binary representation for TIME is equal to the binary data format of Field_timef, which is used to store TIME when mysql56_temporal_format is ON (default). 2. Implementing Type_handler_time_common "native" related methods: Type_handler_time_common::cmp_native() Type_handler_time_common::Item_val_native_with_conversion() Type_handler_time_common::Item_val_native_with_conversion_result() Type_handler_time_common::Item_param_val_native() 3. Implementing missing "native representation" related methods in Field_time and Field_timef: Field_time::store_native() Field_time::val_native() Field_timef::store_native() Field_timef::val_native() 4. Implementing missing "native" related methods in all Items that can have the TIME data type: Item_timefunc::val_native() Item_name_const::val_native() Item_time_literal::val_native() Item_cache_time::val_native() Item_handled_func::val_native() 5. Marking Type_handler_time_common as "native ready". So now Item_sum_min_max::update_field() calculates values using min_max_update_native_field(), which uses native binary representation rather than string representation. Before this change, only the TIMESTAMP data type used native representation to calculate MIN() and MAX(). Benchmarks (see more details in MDEV): This change not only fixes the wrong result, but also makes a "SELECT .. MAX.. GROUP BY .." query faster: # TIME(0) CREATE TABLE t1 (id INT, time_col TIME) ENGINE=HEAP; INSERT INTO t1 VALUES (1,'10:10:10'); -- repeat this 1m times SELECT id, MAX(time_col) FROM t1 GROUP BY id; MySQL80: 0.159 sec 10.3: 0.108 sec 10.4: 0.094 sec (fixed) # TIME(6): CREATE TABLE t1 (id INT, time_col TIME(6)) ENGINE=HEAP; INSERT INTO t1 VALUES (1,'10:10:10.999999'); -- repeat this 1m times SELECT id, MAX(time_col) FROM t1 GROUP BY id; My80: 0.154 10.3: 0.135 10.4: 0.093 (fixed)
-
- 21 Aug, 2020 3 commits
-
-
Ian Gilfillan authored
-
Yuqi Gu authored
Raspberry Pi 4 supports crc32 but doesn't support pmull (MDEV-23030). The PR #1645 offers a solution to fix this issue. But it does not consider the condition that the target platform does support crc32 but not support PMULL. In this condition, it should leverage the Arm64 crc32 instruction (__crc32c) and just only skip parallel computation (pmull/vmull) rather than skip all hardware crc32 instruction of computation. The PR also removes unnecessary CRC32_ZERO branch in 'crc32c_aarch64' for MariaDB, formats the indent and coding style. Change-Id: I76371a6bd767b4985600e8cca10983d71b7e9459 Signed-off-by: Yuqi Gu <yuqi.gu@arm.com>
-
Marko Mäkelä authored
-