summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-4742 - remove leading zero handling, and cleanups.bb-10.7-MDEV-4742Vladislav Vaintroub2021-09-014-123/+227
| | | | | | | | | | | | | Leading zeros added a single byte overhead per numeric string, even when they were. Sorting leading zeros offers only for little value (except determinism in sort). I decided to drop it for now, we can be like ICU, which drops leading zeros, in numeric sorting, even with IDENTICAL collation strength. Also, disabled virtual stored columns (thus also indexes), on Serg's request Hopefully it is temporarily, and will be reenabled soon, when everyone is as happy with key generation algorithm as I am.
* MDEV-4742 additionsVladislav Vaintroub2021-08-303-28/+59
| | | | | | | - return error from natsort_encode_numeric_key, if it would need to allocate memory. All needed memory was preallocated much earlier. - Add test for sort order of leading zero vs numeric strings with suffix.
* MDEV-4742 - address review comments.Vladislav Vaintroub2021-08-265-324/+255
| | | | | | | | | | | | | | | | | | | | | | | - Remove second optional parameter to natural_sort_key(), and all fraction handling. - Rename natsort_num2str() to natsort_encode_length() to show the intention that it encodes string *lengths*, and not encode whitespaces and what not. Handles lengths for which log10(len) >= 10, even if they do not happen for MariaDB Strings (where length is limited by 32bit, and log10(len) is <= 9) - Do not let natural sort key grow past max_packet_length. - Split Item_func_natural_sort_key::val_str() further and add natsort_encode_numeric_string(), which contains comment on how whitespaces are handled. - Simplify, and speedup to_natsort_key() in common case, by removing handling of weird charsets utf16/32, that encode numbers in several bytes. In rare cases utf16/32 is used, we'll convert to utf8 prior to creating keys, and back to original charset afterwards.
* MDEV-4742 - provide function to sort string in "natural" orderVladislav Vaintroub2021-08-125-0/+525
| | | | | | | | | The numbers should be compared as numbers, while the rest should be compared as string. Introduce natural_sort_key() function that transforms original string so that the lexicographic order of such keys is suitable for natural sort.
* MDEV-26195 fixup: Inconsistent types for template instantiationMarko Mäkelä2021-07-302-4/+4
| | | | | | On Xcode on Mac OS X 11.3, a static_assert caught this mismatch. Thanks to Dmitry Shulga for pointing this out.
* MDEV-26195 fixup: Format mismatch in mariabackupMarko Mäkelä2021-07-241-1/+1
| | | | | | write_backup_config_file(): Use the correct format for innodb_undo_tablespaces. The data type was changed in commit ca501ffb04246dcaa1f1d433d916d8436e30602e.
* MDEV-26195 fixup: Fix format mismatchMarko Mäkelä2021-07-232-5/+5
| | | | | | | | In commit ca501ffb04246dcaa1f1d433d916d8436e30602e we changed some data types from ulint to uint32_t, but forgot to adjust the format strings accordingly. On 64-bit Windows, this would cause incorrect values to be output, with garbage<<32 added to the values.
* Merge 10.6 into 10.7Marko Mäkelä2021-07-223-1/+1
|\
| * Update libmariadbMarko Mäkelä2021-07-221-0/+0
| |
| * Merge 10.5 into 10.6Marko Mäkelä2021-07-222-1/+1
| |\
| | * mtr: aix test fix innodb.temporary_tableDaniel Black2021-07-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | AIX error message didn't include the filename like: 2021-07-22 9:43:04 0 [ERROR] mariadbd: Can't create/write to file '' (Errcode: 20 "Not a directory") 2021-07-22 9:43:04 0 [ERROR] mariadbd: Can't create/write to file '' (Errcode: 20 "Not a directory") Reviewer: Marko
| | * MDEV-26110 fixup: GCC 4.8.5 -Wtype-limitsMarko Mäkelä2021-07-221-1/+0
| | | | | | | | | | | | | | | | | | row_ins_index_entry_set_vals(): Remove an assertion that trivially holds because the 16-bit dict_col_t::len cannot represent the value UNIV_PAGE_SIZE_MAX.
* | | MDEV-26195 fixup: Fix -Wconversion in innochecksumMarko Mäkelä2021-07-221-22/+14
| | |
* | | MDEV-26195: Use a 32-bit data type for some tablespace fieldsMarko Mäkelä2021-07-2267-934/+692
| | | | | | | | | | | | | | | | | | | | | | | | In the InnoDB data files, we allocate 32 bits for tablespace identifiers and page numbers as well as tablespace flags. But, in main memory data structures we allocate 32 or 64 bits, depending on the register width of the processor. Let us always use 32-bit fields to eliminate a mismatch and reduce the memory footprint on 64-bit systems.
* | | Merge 10.6 into 10.7Marko Mäkelä2021-07-2267-377/+441
|\ \ \ | |/ /
| * | MDEV-26210: Disable mariabackup.log_page_corruptionMarko Mäkelä2021-07-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | MDEV-26193 exposed a race condition in the test mariabackup.log_page_corruption by no longer waking up purge tasks on every transaction commit. (Note that there never was a guarantee that the purge tasks would actually run as quickly as the test expected it to happen; that would depend on the CPU load.)
| * | MDEV-26193: Wake up purge less oftenMarko Mäkelä2021-07-223-84/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting with commit 6e12ebd4a748eba738e08ad1d7f5dec782ff63ee (MDEV-25062), srv_wake_purge_thread_if_not_active() became more expensive operation, especially on NUMA systems, because instead of reading an atomic global variable trx_sys.rseg_history_len we are traversing up to 128 cache lines in trx_sys.history_exists(). trx_t::commit_cleanup(): Do not wake up purge at all. We will wake up purge about once per second in srv_master_callback(). srv_master_do_active_tasks(), srv_master_do_idle_tasks(): Move some duplicated code to srv_master_callback(). srv_master_callback(): Invoke purge_coordinator_timer_callback() to ensure that purge will be periodically woken up, even if the latest execution of trx_t::commit_cleanup() allowed the purge view to advance but did not wake up purge. Do not call log_free_check(), because every thread that is going to generate redo log is supposed to call that function anyway, before acquiring any page latches. Additional calls to the function every few seconds should not make any difference. srv_shutdown_threads(): Ensure that srv_shutdown_state can be at most SRV_SHUTDOWN_INITIATED in srv_master_callback(), by first invoking srv_master_timer.reset() before changing srv_shutdown_state. (Note: We first terminate the srv_master_callback and only then terminate the purge tasks. Thus, the purge subsystem should exist when srv_master_callback() invokes purge_coordinator_timer_callback() if it was initiated in the first place.
| * | Merge 10.5 into 10.6Marko Mäkelä2021-07-2237-96/+123
| |\ \ | | |/
| | * MDEV-26110: Do not rely on alignment on static allocationMarko Mäkelä2021-07-229-42/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is implementation-defined whether alignment requirements that are larger than std::max_align_t (typically 8 or 16 bytes) will be honored by the compiler and linker. It turns out that on IBM AIX, both alignas() and MY_ALIGNED() only guarantees alignment up to 16 bytes. For some data structures, specifying alignment to the CPU cache line size (typically 64 or 128 bytes) is a mere performance optimization, and we do not really care whether the requested alignment is guaranteed. But, for the correct operation of direct I/O, we do require that the buffers be aligned at a block size boundary. field_ref_zero: Define as a pointer, not an array. For innochecksum, we can make this point to unaligned memory; for anything else, we will allocate an aligned buffer from the heap. This buffer will be used for overwriting freed data pages when innodb_immediate_scrub_data_uncompressed=ON. And exactly that code hit an assertion failure on AIX, in the test innodb.innodb_scrub. log_sys.checkpoint_buf: Define as a pointer to aligned memory that is allocated from heap. log_t::file::write_header_durable(): Reuse log_sys.checkpoint_buf instead of trying to allocate an aligned buffer from the stack.
| | * MDEV-26200 buf_pool.flush_list corrupted by buffer pool resizing or ↵Marko Mäkelä2021-07-223-26/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ROW_FORMAT=COMPRESSED The lazy deletion of clean blocks from buf_pool.flush_list that was introduced in commit 6441bc614a99f5cd6357c8a23b9f583c56d0a90c (MDEV-25113) introduced a race condition around the function buf_flush_relocate_on_flush_list(). The test innodb_zip.wl5522_debug_zip as well as the buffer pool resizing tests would occasionally fail in debug builds due to buf_pool.flush_list.count disagreeing with the actual length of the doubly-linked list. The safe procedure for relocating a block in buf_pool.flush_list should be as follows, now that we implement lazy deletion from buf_pool.flush_list: 1. Acquire buf_pool.mutex. 2. Acquire the exclusive buf_pool.page_hash.latch. 3. Acquire buf_pool.flush_list_mutex. 4. Copy the block descriptor. 5. Invoke buf_flush_relocate_on_flush_list(). 6. Release buf_pool.flush_list_mutex. buf_flush_relocate_on_flush_list(): Assert that buf_pool.flush_list_mutex is being held. Invoke buf_page_t::oldest_modification() only once, using std::memory_order_relaxed, now that the mutex protects us. buf_LRU_free_page(), buf_LRU_block_remove_hashed(): Avoid an unlock-lock cycle on hash_lock. (We must not acquire hash_lock while already holding buf_pool.flush_list_mutex, because that could lead to a deadlock due to latching order violation.)
| | * Fix building crc32_arm64 on NetBSD/aarch64nia2021-07-221-4/+2
| | | | | | | | | | | | | | | | | | pmull_supported is not necessarily defined before crc32c_aarch64 Signed-off-by: Nia Alarie <nia@NetBSD.org>
| | * mtr: aix - stack-trace is optionalDaniel Black2021-07-2224-24/+24
| | |
| | * debian/salsa: Show complete auth and plugin situtationDaniel Black2021-07-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SHOW PLUGINS has a more complete view of the installed plugins into the server. The mysql.user is a compatibility view that doesn't show the complete authentication picture. Use global_priv. Add `show create user` for default users to more clearly represent its contents.
| * | MDEV-26150: follow-up patch to add missing fill opt_trace,ps.rdiffDmitry Shulga2021-07-211-0/+92
| | |
| * | MDEV-26192: Sparse files are being created on thinly provisioned storageMarko Mäkelä2021-07-202-16/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In MDEV-26029 the intention was that page_compressed tables would be written as regular (non-sparse) files if the file is stored on a thinly provisioned block device. We were incorrectly requesting os_file_set_size() to create sparse files even on thinly provisioned storage. fil_space_extend_must_retry(): Extend the file in the correct fashion. fil_ibd_create(), recv_sys_t::recover_deferred(): Only create a sparse file for page_compressed tables if thin provisioning is not detected.
| * | MDEV-24626 fixup: Remove useless codeMarko Mäkelä2021-07-206-138/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fil_ibd_create(): Remove code that should have been removed in commit 86dc7b4d4cfe15a2d37f8b5f60c4fce5dba9491d already. We no longer wrote an initialized page to the file, but we would still allocate a page image in memory and write it. xb_space_create_file(): Remove an unnecessary page write. (This is a functional change for Mariabackup.)
| * | Update libmariadbMarko Mäkelä2021-07-201-0/+0
| | |
| * | MDEV-26166: non-functional changesMarko Mäkelä2021-07-202-7/+3
| | |
| * | Merge 10.5 into 10.6Marko Mäkelä2021-07-2013-17/+127
| |\ \ | | |/
| | * Merge 10.4 into 10.5Marko Mäkelä2021-07-2011-10/+123
| | |\
| | | * MDEV-25236 fixup: instant_alter_debug,dynamic resultMarko Mäkelä2021-07-201-0/+6
| | | | | | | | | | | | | | | | | | | | We only support the instantaneous removal of the NOT NULL attribute for ROW_FORMAT=REDUNDANT tables.
| | | * MDEV-22221: MariaDB with WolfSSL doesn't support AES-GCM cipher for SSLSergei Golubchik2021-07-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | commit the forgotten result file followup for b81803f0657
| | | * fix perfschema.sizing_* tests to runSergei Golubchik2021-07-1614-93/+158
| | | | | | | | | | | | | | | | | | | | still cannot be enabled permanently, but at least they could be run manually, if needed
| | | * MDEV-26139 Spider crashes with segmentation fault (signal 11) on CREATE ↵Nayuta Yanagisawa2021-07-143-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TABLE when COMMENT does not contain embedded double quotes The root cause of the bug MDEV-26139 is the lack of NULL checking on the variable `dq`. Comments on if (dq && (!sq || sq > dq)) {...} else {...}: * The if block corresponds to the case where parameters are quoted by double quotes. In that case, a single quote doesn't appear at all or only appears in the middle of double quotes. * The else block corresponds to the case where parameters are quoted by single quotes. In that case, a double quote doesn't appear at all or only appears in the middle of single quotes. * If the program reaches the if-else statement, `sq || dq` holds. Thus, the negation of `dq && (!sq || sq > dq)` is equivalent to `sq && (!dq || sq <= dq)`.
| | | * MDEV-26108 Crash with query referencing twice CTE that uses embedded ↵Igor Babaev2021-07-084-4/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | recursive CTE This bug could affect queries that had at least two references to a CTE that used an embedded recursive CTE. Starting from version 10.4 some code in With_element::clone_parsed_spec() that assumed a certain order of selects after parsing the specification of a CTE became not valid anymore. It could lead to global select lists where some selects were missing. If a missing CTE happened to belong to the recursive part of a recursive CTE some recursive table references were not set as references to materialized derived tables and this caused a crash of the server. Approved by Oleksandr Byelkin <sanja@mariadb.com>
| | | * MDEV-25978: minor post-merge fix for .result fileJulius Goryavsky2021-07-061-1/+0
| | | |
| | * | fix clang buildEugene Kosov2021-07-191-2/+1
| | | |
| | * | MDEV-26043: Fix performance_schema instrument "threadpool/group_mutex"zwang282021-07-191-4/+3
| | | | | | | | | | | | | | | | | | | | The performance_schema data related to instrument "wait/synch/mutex/threadpool/group_mutex" was incorrect. The root cause is the group_mutex was initialized in thread_group_init before registerd in PSI_register(mutex). The fix is to put PSI_register before thread_group_init, which ensures the right order.
| * | | MDEV-26181: The test compat/oracle.sp-row fails in case it is run in PS mode.Dmitry Shulga2021-07-192-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were several places where a statement delimiter missed so such statements were interpreted as multi-statements and expectedly failed in PS mode. An appropriate statement delimiters have been added to fix the issues. Addinitinally, the operators --enable_prepare_warnings/--disable_prepare_warnings have been added around statements that use depricated syntax SELECT INTO to don't miss warnings.
| * | | MDEV-26149: The test main.fetch_first fails in case it is run in PS modeDmitry Shulga2021-07-193-16/+36
| | | | | | | | | | | | | | | | | | | | | | | | The root cause of test failure is that on optimization of the statement clause 'order by (select 1)' in outer select is done incorrect in case the statement run in PS mode.
* | | | MDEV-23143 Add JSON_EQUALS functionEric Herman2021-07-215-0/+268
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements JSON_EQUALS SQL function. The function takes advantage of the json_normalize functionality and does the following: norm_a = json_normalize(a) norm_b = json_normalize(b) return strcmp(norm_a, norm_b) Co-authored-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
* | | | MDEV-16375 Function to normalize a json valueEric Herman2021-07-215-0/+221
| | | | | | | | | | | | | | | | | | | | | | | | This patch implements JSON_NORMALIZE SQL function. Co-authored-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
* | | | Add json_normalize function to json_libEric Herman2021-07-215-2/+1139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements a library for normalizing json documents. The algorithm is: * Recursively sort json keys according to utf8mb4_bin collation. * Normalize numbers to be of the form [-]<digit>.<frac>E<exponent> * All unneeded whitespace and line endings are removed. * Arrays are not sorted. Co-authored-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
* | | | fix json typo s/UNINITALIZED/UNINITIALIZED/Eric Herman2021-07-213-3/+3
| | | |
* | | | Test cases require debug_sync enabledVicențiu Ciorbaru2021-07-195-0/+5
| | | |
* | | | Make marking/testing of top level item uniformMonty2021-07-196-93/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There where several different implementations of is_top_level_item(), with different variable names and tests. In some cases the code used 'is_top_level_item()' as a test, in other cases it accessed the variable directrly. This patch makes all usage of 'top_level_item' uniform. The new implementation stores the 'is_tol_level_item()' flag as part of base_flags. This saves 7 bytes in all items that previously stored the flag in it's own bool. I had to keep 'top_level_item()' virtual to ensure that Item_bool_const item's will not be updated. 'is_top_level_item()' is not virtual anymore.
* | | | Update debian packaging for 10.7Vicențiu Ciorbaru2021-07-193-15/+19
| | | | | | | | | | | | | | | | | | | | Conflicts/Replaces mariadb-client-core mariadb-client, cover 10.6 Also update salsa-ci to appropriately name tests as upgrades to 10.7
* | | | Added support to MEM_ROOT for write protected memoryMonty2021-07-1815-94/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is useful for thing like Item_true and Item_false that we allocated and initalize once and want to ensure that nothing can change them Main changes: - Memory protection is achived by allocating memory with mmap() and protect it from write with mprotect() - init_alloc_root(...,MY_ROOT_USE_MPROTECT) will create a memroot that one can later use with protect_root() to turn it read only or turn it back to read-write. All allocations to this memroot is done with mmap() to ensure page alligned allocations. - alloc_root() code was rearranged to combine normal and valgrind code. - init_alloc_root() now changes block size to be power of 2's, to get less memory fragmentation. - Changed MEM_ROOT structure to make it smaller. Also renamed MEM_ROOT m_psi_key to psi_key. - Moved MY_THREAD_SPECIFIC marker in MEM_ROOT from block size (old hack) to flags. - Added global variable my_system_page_size. This is initialized at startup.
* | | | Change Item_true and Item_false to pointersMonty2021-07-186-23/+25
| | | | | | | | | | | | | | | | This is a prerequisite for moving them to a readonly segment.
* | | | Merge remote-tracking branch '10.6' into 10.7Vicențiu Ciorbaru2021-07-1848-76/+774
|\ \ \ \ | |/ / / | | | | | | | | Update debian changes to 10.7 to enable debian packaging to work again.