summaryrefslogtreecommitdiff
path: root/storage/maria
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.3 into 10.4Marko Mäkelä2020-05-302-12/+24
|\
| * Merge 10.2 into 10.3Marko Mäkelä2020-05-272-12/+24
| |\
| | * Fixed crash in aria recovery when using bulk insertMonty2020-05-262-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-20578 Got error 126 when executing undo undo_key_delete upon Aria crash recovery The crash happens in this scenario: - Table with unique keys and non unique keys - Batch insert (LOAD DATA or INSERT ... SELECT) with REPLACE - Some insert succeeds followed by duplicate key error In the above scenario the table gets corrupted. The bug was that we don't generate any undo entry for the failed insert as the whole insert can be ignored by undo. The code did however not take into account that when bulk insert is used, we would write cached keys to the file on failure and undo would wrongly ignore these. Fixed by moving the writing of the cache keys after we write the aborted-insert event to the log.
* | | Merge 10.3 into 10.4Marko Mäkelä2020-05-191-0/+1
|\ \ \ | |/ /
| * | Merge 10.2 into 10.3Marko Mäkelä2020-05-191-0/+1
| |\ \ | | |/
| | * Fixed assert in Aria on SHOW PROCEDURE STATUSMonty2020-05-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-18457 Assertion `(bitmap->map + (bitmap->full_head_size/6*6)) <= full_head_end failed The problem was that full_head_size was not calculated correctly in the case when insert_order was inforced, which is the case for SHOW commands.
* | | MDEV-21794: Optimizer flag rowid_filter leads to long querySergei Petrunia2020-05-077-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rowid Filter check is just like Index Condition Pushdown check: before we check the filter, we must check if we have walked out of the range we are scanning. (If we did, we should return, and not continue the scan). Consequences of this: - Rowid filtering doesn't work for keys that have partially-covered blob columns (just like Index Condition Pushdown) - The rowid filter function has three return values: CHECK_POS (passed) CHECK_NEG (filtered out), CHECK_OUT_OF_RANGE. All of the above is implemented in this patch
* | | Merge 10.3 into 10.4Marko Mäkelä2020-04-271-1/+1
|\ \ \ | |/ /
| * | Merge 10.2 into 10.3Marko Mäkelä2020-04-271-1/+1
| |\ \ | | |/
| | * Merge 10.1 into 10.2Marko Mäkelä2020-04-271-1/+1
| | |\
| | | * Fix clang 10 warningsMarko Mäkelä2020-04-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _ma_fetch_keypage(): Correct an assertion that used to always hold. Thanks to clang -Wint-in-bool-context for flagging this. double_to_datetime_with_warn(): Suppress -Wimplicit-int-float-conversion by adding a cast. LONGLONG_MAX converted to double will actually be LONGLONG_MAX+1.
| | | * Aria: Avoid unused variables in embedded serverMarko Mäkelä2020-04-271-1/+1
| | | |
* | | | Fixed shutdown crash in Aria that affects debug binariesMonty2020-04-261-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-18286 Assertion `pagecache->cnt_for_resize_op == 0' failed in check_pagecache_is_cleaned_up on server shutdown The reason for the crash is that the counter-of-pinned-pages in the Aria pagecache goes wrong. This only affects debug builds, as in these we do an assert on shutdown if the counter-of-pinned-pages is not 0 (some page was left pinned). The bug was that in 2 places in the page cache, when not succeeding to pin a page and a retry was made, the counter-of-pinned-pages counter was not properly adjusted. In the given test case, BLOCK_COMMIT flushed all Aria files. If a block was flushed at the same time the insert tried to access it, the insert would retry to get the block and that would cause the counter to go wrong.
* | | | Fixed memory leak if Aria didn't startMonty2020-04-231-0/+3
| | | | | | | | | | | | | | | | This is not crtitical as if Aria doesn't start, the server will exit at once.
* | | | Merge 10.3 into 10.4Marko Mäkelä2020-04-222-2/+4
|\ \ \ \ | |/ / /
| * | | Merge 10.2 into 10.3Marko Mäkelä2020-04-222-2/+4
| |\ \ \ | | |/ /
| | * | Merge 10.1 into 10.2Marko Mäkelä2020-04-221-1/+2
| | |\ \ | | | |/
| | | * Fix GCC 10 -WoverflowMarko Mäkelä2020-04-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | maria_page_crc_check_index(): Do not attempt to convert HA_ERR_WRONG_CRC (176) to my_bool (char). On platforms where char is signed, the 176 will be converted to -80. It turns out that the callers only care whether the result is zero. Let us return 1 in this case, like we do in all other error cases.
| | * | Fixed memory leak with fulltext indexesMonty2020-04-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-22275 Assertion `global_status_var.global_memory_used == 0' failed, bytes lost, or LeakSanitizer: detected memory leaks after using temporary table with fulltext key This affected MyISAM and Aria temporary tables
* | | | Shrink my_atomic.h and my_cpu.h scopeSergey Vojtovich2020-04-151-0/+1
| | | |
* | | | Cleanup my_atomic.h includesSergey Vojtovich2020-03-215-5/+0
| | | | | | | | | | | | | | | | my_atomic.h is included indirectly anyways.
* | | | Merge 10.3 into 10.4Marko Mäkelä2020-03-202-27/+29
|\ \ \ \ | |/ / /
| * | | Merge 10.2 into 10.3Marko Mäkelä2020-03-202-27/+29
| |\ \ \ | | |/ / | | | | | | | | Also, clean up the test innodb_gis.geometry a little further.
| | * | MDEV-21981 Replace arithmetic + with bitwise OR when possibleMarko Mäkelä2020-03-192-27/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several macros such as sint2korr() and uint4korr() are using the arithmetic + operator while a bitwise or operator would suffice. GCC 5 and clang 5 and later can detect patterns consisting of bitwise or and shifts by multiples of 8 bits, such as those used in the InnoDB function mach_read_from_4(). They actually translate that verbose low-level code into high-level machine language (i486 bswap instruction or fused into the Haswell movbe instruction). We should do the same for MariaDB Server code that is outside InnoDB. Note: The Microsoft C compiler is lacking this optimization. There, we might consider using _byteswap_ushort(), _byteswap_ulong(), _byteswap_uint64(). But, those would lead to unaligned reads, which are bad for reasons stated in MDEV-20277. Besides, outside InnoDB, most data is already being stored in the native little-endian format of that compiler.
* | | | Updated aria_pack to support transactional tablesMonty2020-03-171-10/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added options: --datadir --ignore-control-file --require-control-file - Improved error messages if open fails - If control file can't be found/opened, assume that all rows in the tables are commited.
* | | | Merge 10.3 into 10.4Marko Mäkelä2020-03-161-1/+2
|\ \ \ \ | |/ / /
| * | | Merge 10.2 into 10.3Marko Mäkelä2020-03-131-0/+1
| |\ \ \ | | |/ /
| | * | Fix clang 10 warningsMarko Mäkelä2020-03-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _ma_fetch_keypage(): Correct an assertion that used to always hold. Thanks to clang -Wint-in-bool-context for flagging this. double_to_datetime_with_warn(): Suppress -Wimplicit-int-float-conversion by adding a cast. LONGLONG_MAX converted to double will actually be LONGLONG_MAX+1.
| * | | Fixed wrong assert (found by clang)Monty2020-03-111-1/+1
| | | |
* | | | MDEV-20001 Potential dangerous regression: INSERT INTO >=100 rows fail for ↵Sachin2020-02-032-34/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | myisam table with HASH indexes Problem:- So the issue is when we do bulk insert with rows > MI_MIN_ROWS_TO_DISABLE_INDEXES(100) , We try to disable the indexes to speedup insert. But current logic also disables the long unique indexes. Solution:- In ha_myisam::start_bulk_insert if we find long hash index (HA_KEY_ALG_LONG_HASH) we will not disable the index. This commit also refactors the mi_disable_indexes_for_rebuild function, Since this is function is called at only one place, it is inlined into start_bulk_insert mi_clear_key_active is added into myisamdef.h because now it is also used in ha_myisam.cc file. (Same is done for Aria Storage engine)
* | | | MDEV-18791 Wrong error upon creating Aria table with long index on BLOBSachin Setiya2020-02-021-0/+5
| | | | | | | | | | | | | | | | | | | | If we have long unique key for aria engine return too long key error, because Aria does not support key on virtual generated column.
* | | | Merge branch '10.3' into 10.4Oleksandr Byelkin2020-01-241-7/+9
|\ \ \ \ | |/ / /
| * | | Merge branch '10.2' into 10.3Oleksandr Byelkin2020-01-241-7/+9
| |\ \ \ | | |/ /
| | * | MDEV-14183: aria_pack segfaults in compress_maria_fileVlad Lesin2020-01-211-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Column definition order in st_maria_share::columndef can differ from order of fields in record(see also st_maria_share::column_nr, st_maria_columndef::column_nr, _ma_column_nr_write(), _ma_column_nr_read()). This was not taken into account in aria_pack tool. The fix is to initialize elements of HUFF_COUNTS array in the correct order.
| | * | MDEV-21082: isnan/isinf compilation errors, isfinite warnings on MacOSVlad Lesin2019-11-192-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* | | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-12-093-3/+3
|\ \ \ \ | |/ / /
| * | | Lintian complains on spelling errorFaustin Lammler2019-12-023-3/+3
| | | | | | | | | | | | | | | | | | | | The lintian check complains on spelling error: https://salsa.debian.org/mariadb-team/mariadb-10.3/-/jobs/95739
* | | | Merge 10.3 into 10.4Aleksey Midenkov2019-12-021-1/+1
|\ \ \ \ | |/ / /
| * | | MDEV-20441 ER_CRASHED_ON_USAGE upon update on versioned Aria tableAleksey Midenkov2019-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turn read cache off for update and multi-update for versioned table. no_cache is reinited on each TABLE open because it is applicable for specific algorithms. As a side fix vers_insert_history_row() honors vers_write setting. Aria with row_format=fixed uses IO_CACHE of type READ_CACHE for sequential read in update loop. When history row is inserted inside this loop the cache misses it and fails with error. TODO: Currently maria_extra() does not support SEQ_READ_APPEND. Probably it might be possible to use this type of cache.
* | | | Merge 10.3 into 10.4Marko Mäkelä2019-11-191-3/+5
|\ \ \ \ | |/ / /
| * | | MDEV-20611: MRR scan over partitioned InnoDB table produces "Out of memory" ↵Sergei Petrunia2019-11-151-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | error Fix partitioning and DS-MRR to work together - In ha_partition::index_end(): take into account that ha_innobase (and other engines using DS-MRR) will have inited=RND when initialized for DS-MRR scan. - In ha_partition::multi_range_read_next(): if the MRR scan is using HA_MRR_NO_ASSOCIATION mode, it is not guaranteed that the partition's handler will store anything into *range_info. - In DsMrr_impl::choose_mrr_impl(): ha_partition will inquire partitions about how much memory their MRR implementation needs by passing *buffer_size=0. DS-MRR code didn't know about this (actually it used uint for buffer size calculation and would have an under-flow). Returning *buffer_size=0 made ha_partition assume that partitions do not need MRR memory and pass the same buffer to each of them. Now, this is fixed. If DS-MRR gets *buffer_size=0, it will return the amount of buffer space needed, but not more than about @@mrr_buffer_size. * Fix ha_{innobase,maria,myisam}::clone. If ha_partition uses MRR on its partitions, and partition use DS-MRR, the code will call handler->clone with TABLE (*NOT partition*) name as an argument. DS-MRR has no way of knowing the partition name, so the solution was to have the ::clone() function for the affected storage engine to ignore the name argument and get it elsewhere.
* | | | Merge 10.3 into 10.4Marko Mäkelä2019-11-019-13/+55
|\ \ \ \ | |/ / /
| * | | Write error message if aria_log.??????? files are missingMonty2019-10-208-10/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This can happen if one uses a backup where not all aria_log.* files are copied or if the last one is too short. In this case the data files will contain data that is not in the logs and recovery will fail. Other things: - Fixed tprint() to not print extra new line to debug trace
| * | | Merge 10.2 into 10.3Marko Mäkelä2019-10-181-11/+15
| |\ \ \ | | |/ /
| | * | Fixed bug in lock tables + alter table with Aria tables.Monty2019-10-161-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-18451 Server crashes in maria_create_trn_for_mysql upon ALTER TABLE Problem was that when table was locked many times, not all instances where removed from the transaction by _ma_remove_table_from_trnman()
| | * | MDEV-19740: Fix GCC 9.2.1 -Wmaybe-uninitialized on AMD64Marko Mäkelä2019-09-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For CMAKE_BUILD_TYPE=Debug, the default MYSQL_MAINTAINER_MODE=AUTO implies -Werror along with other flags in cmake/maintainer.cmake, which would break the debug builds when CMAKE_CXX_FLAGS include -O2. This fix includes a backport of 6dd3f24090ce2d237037eb09cf7db083ebbc92f9 from MariaDB 10.3.
* | | | Merge 10.3 into 10.4Marko Mäkelä2019-10-104-12/+0
|\ \ \ \ | |/ / /
| * | | Cleanup mman.h includesSergey Vojtovich2019-10-024-12/+0
| | | | | | | | | | | | | | | | As it is included from my_global.h already.
* | | | Merge branch '10.3' into 10.4Sergei Golubchik2019-09-062-2/+17
|\ \ \ \ | |/ / /
| * | | Merge 10.2 into 10.3Marko Mäkelä2019-09-042-2/+20
| |\ \ \ | | |/ /