summaryrefslogtreecommitdiff
path: root/mysql-test/suite/maria
Commit message (Collapse)AuthorAgeFilesLines
* Make maria-autozerofill a bit more rebustMonty2019-05-131-7/+7
| | | | | | | | - Remove warning about aria_control_file - Write to unique test file Other things: - Fixed typo in aria_chk --help
* MDEV-13628: ORed condition in pushed index condition is not removed from the ↵Varun Gupta2019-05-113-6/+6
| | | | | | | | | | | | | | | | | WHERE So to push index condition for each join tab we have calculate the index condition that can be pushed and then remove this index condition from the original condition. This is done through the function make_cond_remainder. The problem is the function make_cond_remainder does not remove index condition when there is an OR operator. Fixed this by making the function make_cond_remainder to keep in mind of the OR operator. Also updated results for multiple test files which were incorrectly updated by the commit e0c1b3f24246d22e6785315f9a8448bd9a590422 code which was supposed to remove the condition present in the index condition was not getting executed when the condition had OR operator, with AND the pushed index condition was getting removed from where. This problem affects all versions starting from 5.5 but this is a performance improvement, so fixing it in 10.4
* Merge 10.3 into 10.4Marko Mäkelä2019-04-252-1/+16
|\ | | | | | | | | In is_eits_usable(), we disable an assertion that fails due to MDEV-19334.
* \ Merge 10.3 into 10.4Marko Mäkelä2019-03-202-0/+68
|\ \ | |/ | | | | | | | | | | | | | | | | The MDEV-17262 commit 26432e49d37a37d09b862bb49a021e44bdf4789c was skipped. In Galera 4, the implementation would seem to require changes to the streaming replication. In the tests archive.rnd_pos main.profiling, disable_ps_protocol for SHOW STATUS and SHOW PROFILE commands until MDEV-18974 has been fixed.
| * Merge branch '10.2' into 10.3Sergei Golubchik2019-03-172-0/+68
| |\
| | * Fixed bug in redo handling of batch insert in AriaMonty2019-03-142-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The symptom of the bug was that one got the following in the aria recovery log: "Table 'xxx', id 57, has create_rename_lsn (1,0x12dee) more recent than LOGREC_FILE_ID's LSN (1,0x12dc4), ignoring open request" After this all future redo entries was marked with "For table of short id 57, table skipped, so skipping record" Analyze: When ending batch insert, create_rename_lsn for the table is updated to signal that earlier redo entries for the table can't be applied. The problem was that future redo entries was also ignored as redo code assumed they where for the old table. Fixed by calling translog_dessign_id, which causes future redo entries to be seen as belonging to the updated table.
* | | MDEV-371 Unique Index for long columnsSachin2019-02-222-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements engine independent unique hash index. Usage:- Unique HASH index can be created automatically for blob/varchar/test column whose key length > handler->max_key_length() or it can be explicitly specified. Automatic Creation:- Create TABLE t1 (a blob unique); Explicit Creation:- Create TABLE t1 (a int , unique(a) using HASH); Internal KEY_PART Representations:- Long unique key_info will have 2 representations. (lets understand this with an example create table t1(a blob, b blob , unique(a, b)); ) 1. User Given Representation:- key_info->key_part array will be similar to what user has defined. So in case of example it will have 2 key_parts (a, b) 2. Storage Engine Representation:- In this case there will be only one key_part and it will point to HASH_FIELD. This key_part will be always after user defined key_parts. So:- User Given Representation [a] [b] [hash_key_part] key_info->key_part ----^ Storage Engine Representation [a] [b] [hash_key_part] key_info->key_part ------------^ Table->s->key_info will have User Given Representation, While table->key_info will have Storage Engine Representation.Representation can be changed into each other by calling re/setup_keyinfo_hash function. Working:- 1. So when user specifies HASH_INDEX or key_length is > handler->max_key_length(), In mysql_prepare_create_table One extra vfield is added (for each long unique key). And key_info->algorithm is set to HA_KEY_ALG_LONG_HASH. 2. In init_from_binary_frm_image values for hash_keypart is set (like fieldnr , field and flags) 3. In parse_vcol_defs, HASH_FIELD->vcol_info is created. Item_func_hash is used with list of Item_fields, When Explicit length is given by user then Item_left is used to concatenate Item_field values. 4. In ha_write_row/ha_update_row check_duplicate_long_entry_key is called which will create the hash key from table->record[0] and then call ha_index_read_map , if we found duplicated hash , we will compare the result field by field.
* | | MDEV-16188 Post-merge corrections and adjustmentsIgor Babaev2019-02-042-3/+15
| | |
* | | Merge 10.3 into 10.4Marko Mäkelä2018-12-181-1/+1
|\ \ \ | |/ /
| * | Merge 10.2 into 10.3Marko Mäkelä2018-12-181-1/+1
| |\ \ | | |/
| | * MDEV-14576 Include full name of object in message about incorrect value for ↵Alexey Botchkov2018-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | column. The error message modified. Then the TABLE_SHARE::error_table_name() implementation taken from 10.3, to be used as a name of the table in this message.
* | | Changed FLUSH TABLES to not change share versionMonty2018-12-092-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of MDEV-5336 Implement LOCK FOR BACKUP Originally both table metadata lock and global read lock protection were acquired before getting TABLE from table cache. This will be reordered in a future commit with MDL_BACKUP_XXX locks so that we first take table metadata lock, then get TABLE from table cache, then acquire analogue of global read lock. This patch both simplifies FLUSH TABLES code, makes FLUSH TABLES to lock less and also enables FLUSH TABLES code to be used with backup locks. The usage of FLUSH TABLES changes slightly: - FLUSH TABLES without any arguments will now only close not used tables and tables locked by the FLUSH TABLES connection. All not used table shares will be closed. Tables locked by the FLUSH TABLES connection will be reopened and re-locked after all others has stoped using the table (as before). If there was no locked tables, then FLUSH TABLES is instant and will not cause any waits. FLUSH TABLES will not wait for any in use table. - FLUSH TABLES with a table list, will ensure that the tables are closed before statement returns. The code is now only using MDL locks and not table share versions, which simplices the code greatly. One visible change is that the server will wait for the end of the transaction that are using the tables. Before FLUSH TABLES only waited for the statements to end. Signed-off-by: Monty <monty@mariadb.org>
* | | MDEV-15253: Default optimizer setting changes for MariaDB 10.4Varun Gupta2018-12-096-1/+14
| | | | | | | | | | | | | | | use_stat_tables= PREFERABLY optimizer_use_condition_selectivity= 4
* | | Merge 10.3 into 10.4Marko Mäkelä2018-11-062-0/+163
|\ \ \ | |/ /
| * | Merge 10.2 into 10.3Marko Mäkelä2018-11-062-0/+163
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | main.derived_cond_pushdown: Move all 10.3 tests to the end, trim trailing white space, and add an "End of 10.3 tests" marker. Add --sorted_result to tests where the ordering is not deterministic. main.win_percentile: Add --sorted_result to tests where the ordering is no longer deterministic.
| | * Merge 10.1 into 10.2Marko Mäkelä2018-11-062-0/+163
| | |\
| | | * Merge branch '10.0' into 10.1Sergei Golubchik2018-10-302-0/+163
| | | |\
| | | | * Merge branch '5.5' into 10.0Sergei Golubchik2018-10-272-0/+163
| | | | |\
| | | | | * MDEV-9137 MariaDB Crash on Query Using Aria EngineSergei Golubchik2018-09-222-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | more tests
| | | | | * MDEV-9137 MariaDB Crash on Query Using Aria EngineSergei Golubchik2018-09-222-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | fix for 2-level ft indexes and boolean search in Aria
| | | | | * MDEV-9137 MariaDB Crash on Query Using Aria EngineSergei Golubchik2018-09-222-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | update the code to match semantics of `key` - it's not a (char*) pointer to the buffer as in MyISAM.
| | | | | * MDEV-9137 MariaDB Crash on Query Using Aria EngineSergei Golubchik2018-09-222-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two bugs in Aria, related to 2-level fulltext indexes: * REPAIR calculated the key number incorrectly * CHECK copied the key into last_key too early and checking the second-level btree was overwriting it
* | | | | | Merge 10.3 into 10.4Marko Mäkelä2018-10-054-0/+89
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge branch '10.2' into 10.3Sergei Golubchik2018-09-284-0/+89
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge branch '10.1' into 10.2Oleksandr Byelkin2018-09-144-0/+89
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge branch '11.0' into 10.1Oleksandr Byelkin2018-09-064-0/+89
| | | |\ \ \ | | | | |/ /
| | | | * | Merge branch '5.5' into 10.0bb-10.0-merge-sanjaOleksandr Byelkin2018-09-032-0/+14
| | | | |\ \ | | | | | |/
| | | | | * MDEV-16682 Assertion `(buff[7] & 7) == HEAD_PAGE' failedMonty2018-08-302-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem was that SQL level tried to read a record with rnd_pos() that was already deleted by the same statement. In the case where the page for the record had been deleted, this caused an assert. Fixed by extending the assert to also handle empty pages and return HA_ERR_RECORD_DELETED for reads to deleted pages.
| | | | * | MDEV-17067 Server crash in write_block_recordMonty2018-08-242-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem was that Create_field::create_length_to_internal_length() calculated a different pack_length for NEWDECIMAL compared to Field_new_decimal constructor which lead to some unused bytes in the middle of the record, which Aria didn't like.
| | | | * | MDEV-17021 Server crash or assertion `length <= column->length' failure in ↵Monty2018-08-242-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | write_block_record Problem was that the number of NULL bit's was record wrong in the .frm file because there could be more fields marked NOT_NULL after the number of not_null fields where recorded. Fixed by copying test for virtual fields from prepare_create_field() The code change, only the test, doesn't have to be merged to 10.3 as this is fixed there.
* | | | | | Merge 10.3 into 10.4Marko Mäkelä2018-09-113-3/+64
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.2 into 10.3Marko Mäkelä2018-09-062-0/+61
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge 10.1 into 10.2Marko Mäkelä2018-08-312-0/+61
| | |\ \ \ \ | | | |/ / /
| | | * | | MDEV-15797 Assertion `thd->killed != 0' failed in ha_maria::enable_indexesMonty2018-08-272-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem was that a parallel open of a table, overwrote info->state that was in used by repair. Fixed by changing _ma_tmp_disable_logging_for_table() to use a new state buffer state.no_logging to store the temporary state. Other things: - Use original number of rows when retrying repair to get rid of a potential warning "Number of rows changed from X to Y" - Changed maria_commit() to make it easier to merge with 10.4 - If table is not locked (like with show commands), use the global number of rows as the local number may not be up to date. (Minor not critical fix) - Added some missing DBUG_RETURN
| * | | | | Fixed several issues with aria_chkMonty2018-08-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Made output to be aligned in aria_chk -d - Aria engine error texts are now written instead of "Undefined error" - When running with --check --force, tables with wrong TRN's but otherwise correct are now zerofilled - Fixed several bugs in check and recovery related to fulltext - When doing recovery, store highest found TRID in aria_control_file Before this, the
* | | | | | MDEV-17068 mysql system table is marked as crashed and should be repaired ↵Monty2018-08-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after the server crashes or is killed - Changed ERROR to WARNING for MyISAM/Aria message that are warnings in the check utilities. This affects for example "client is using or hasn't closed the table properly". - Print "Table is fixed" if check succeded in fixing the table.
* | | | | | MDEV-16986 Unitialized mutex, SIGSEGV and assorted assertion failures in ↵Monty2018-08-202-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Aria code The problem was that when a mysql.proc table was opened for reading it was added to the current Aria transaction context but never properly deleted from it. Normally this isn't a problem, except if the mysql.proc table is closed before the transaction ended, which happened in this test case. Fixed by removing mysql.proc from the transaction context before closing the table.
* | | | | | MDEV-16421 Make system tables crash safeMichael Widenius2018-08-145-3/+28
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make all system tables in mysql directory of type engine=Aria Privilege tables are using transactional=1 Statistical tables are using transactional=0, to allow them to be quickly updated with low overhead. Help tables are also using transactional=0 as these are only updated at init time. Other changes: - Aria store engine is now a required engine - Update comment for Aria tables to reflect their new usage - Fixed that _ma_reset_trn_for_table() removes unlocked table from transaction table list. This was needed to allow one to lock and unlock system tables separately from other tables, for example when reading a procedure from mysql.proc - Don't give a warning when using transactional=1 for engines that is using transactions. This is both logical and also to avoid warnings/errors when doing an alter of a privilege table to InnoDB. - Don't abort on warnings from ALTER TABLE for changes that would be accepted by CREATE TABLE. - New created Aria transactional tables are marked as not movable (as they include create_rename_lsn). - bootstrap.test was changed to kill orignal server, as one can't anymore have two servers started at same time on same data directory and data files. - Disable maria.small_blocksize as one can't anymore change aria block size after system tables are created. - Speed up creation of help tables by using lock tables. - wsrep_sst_resync now also copies Aria redo logs.
* | | | | Merge branch '10.2' into 10.3Sergei Golubchik2018-06-302-0/+53
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.1' into 10.2Sergei Golubchik2018-06-212-0/+53
| |\ \ \ \ | | |/ / /
| | * | | Merge remote-tracking branch 'origin/10.0' into 10.1Alexander Barkov2018-06-202-0/+53
| | |\ \ \ | | | |/ /
| | | * | Merge remote-tracking branch 'origin/5.5' into 10.0Alexander Barkov2018-06-202-0/+53
| | | |\ \ | | | | |/
| | | | * MDEV-16534 PPC64: Unexpected error with a negative value into auto-increment ↵Alexander Barkov2018-06-202-0/+54
| | | | | | | | | | | | | | | | | | | | columns in HEAP, MyISAM, ARIA
* | | | | Merge 10.2 into 10.3Marko Mäkelä2018-06-182-0/+128
|\ \ \ \ \ | |/ / / /
| * | | | MDEV-15352 AUTO_INCREMENT breaks after updating a column value to a negative ↵Alexander Barkov2018-06-142-0/+128
| | | | | | | | | | | | | | | | | | | | number
* | | | | Merge 10.2 into 10.3Marko Mäkelä2018-05-292-0/+25
|\ \ \ \ \ | |/ / / /
| * | | | Add an end-marker to ease future mergesMarko Mäkelä2018-05-292-0/+3
| | | | |
| * | | | Merge remote-tracking branch 'origin/10.1' into 10.2Monty2018-05-242-0/+22
| |\ \ \ \ | | |/ / /
| | * | | Merge remote-tracking branch 'origin/10.0' into 10.1Monty2018-05-242-0/+22
| | |\ \ \ | | | |/ /
| | | * | Fixes for Aria transaction handling with lock tablesMonty2018-05-222-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-10130 Assertion `share->in_trans == 0' failed in storage/maria/ma_close.c MDEV-10378 Assertion `trn' failed in virtual int ha_maria::start_stmt The problem was that maria_handler->trn was not properly reset at commit/rollback and ha_maria::exernal_lock() could get confused because. There was some old code in ha_maria::implicit_commit() that tried to take care of this, but it was not bullet proof. Fixed by adding list of all tables that is part of the maria transaction to TRN. A nice side effect was of the fix is that loops in ha_maria::implict_commit() got to be much simpler. Other things: - Fixed a bug in mysql_admin_table() where argument open_for_modify was wrongly reset for the next table in the chain - rollback admin command also in case of fatal error. - Split _ma_set_trn_for_table() to three version to simplify code and debugging. - Several new asserts to detect the original problem (that file was not properly removed from trn before calling ma_close())