summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-13206: INSERT ON DUPLICATE KEY UPDATE foreign key failbb-10.2-MDEV-13206Jan Lindström2017-11-145-0/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is caused by following change: commit 95d29c99f01882ffcc2259f62b3163f9b0e80c75 Author: Marko Mäkelä <marko.makela@oracle.com> Date: Tue Nov 27 11:12:13 2012 +0200 Bug#15920445 INNODB REPORTS ER_DUP_KEY BEFORE CREATE UNIQUE INDEX COMPLETED There is a phase during online secondary index creation where the index has been internally completed inside InnoDB, but does not 'officially' exist yet. We used to report ER_DUP_KEY in these situations, like this: ERROR 23000: Can't write; duplicate key in table 't1' What we should do is to let the 'offending' operation complete, but report an error to the ALTER TABLE t1 ADD UNIQUE KEY (c2): ERROR HY000: Index c2 is corrupted (This misleading error message should be fixed separately: Bug#15920713 CREATE UNIQUE INDEX REPORTS ER_INDEX_CORRUPT INSTEAD OF DUPLICATE) row_ins_sec_index_entry_low(): flag the index corrupted instead of reporting a duplicate, in case the index has not been published yet. rb:1614 approved by Jimmy Yang Problem is that after we have found duplicate key on primary key we continue to get necessary gap locks in secondary indexes to block concurrent transactions from inserting the searched records. However, search from unique index used in foreign key constraint could return DB_NO_REFERENCED_ROW if INSERT .. ON DUPLICATE KEY UPDATE does not contain value for foreign key column. In this case we should return the original DB_DUPLICATE_KEY error instead of DB_NO_REFERENCED_ROW. Imported also missing test case from MySQL 5.7 for commit 25781c154396dbbc21023786aa3be070057d6999 Author: Annamalai Gurusami <annamalai.gurusami@oracle.com> Date: Mon Feb 24 14:00:03 2014 +0530 Bug #17604730 ASSERTION: *CURSOR->INDEX->NAME == TEMP_INDEX_PREFIX Problem: When INSERT ... ON DUPLICATE UPDATE or REPLACE statements are used, then after encountering a DB_DUPLICATE_KEY error, we continue to process all the unique secondary indexes to place the necessary gap locks. The problem is in the following scenario: 1. The table has one primary index, one unique secondary index and one non-unique secondary index. 2. The INSERT ... ON DUPLICATE UPDATE ... is executed on the table. 3. Insert into the clustered index reported DB_DUPLICATE_KEY. This error information is saved. We proceed to take gap locks in all unique secondary indexes. 4. Insert into the unique secondary index reported DB_LOCK_WAIT. 5. Step 4 is repeated from a higher layer row_ins(). When this is done, the earlier error information saved in step 3 is lost. 6. Next instead of taking just gap locks or skipping non-unique secondary indexes, because of loss of information regarding the error already saved, an actual insert is performed on the non-unique secondary index. This triggers the assert. Solution: Save the error information in a non-local location so that it is not lost. rb#4723 approved by Kevin.
* InnoDB: Remove ut_vsnprintf() and the use of my_vsnprintf(); use vsnprintf()Marko Mäkelä2017-11-135-54/+5
|
* InnoDB: Remove ut_snprintf() and the use of my_snprintf(); use snprintf()Marko Mäkelä2017-11-1325-282/+221
|
* Remove STATUS_VERBOSE (there is no visible output)Marko Mäkelä2017-11-121-47/+0
|
* MDEV-13971 crash in skip_num_constant.Alexey Botchkov2017-11-113-1/+8
| | | | | Character bigger than 0x60 wasn't handled properly inside a numeric constant.
* Fixed MDEV-13994 Bad join results with orderby_uses_equalities=on.Igor Babaev2017-11-105-1/+241
| | | | | | | | This patch effectively blocks the optimization that uses multiple equalities for ORDER BY to remove tmp table in the case when the first table happens to be the result of materialization of a semi-join nest. Currently there is no code at the execution level that would support the optimization in this case.
* Allow innodb_open_files to be exceededMarko Mäkelä2017-11-102-0/+3
|
* MDEV-14100 Assertion `!is_user_rec || leaf || ...Marko Mäkelä2017-11-101-0/+1
| | | | | | rec_get_offsets_func(): Relax a bogus debug assertion. It would fail when we are operating on a copied prefix of a node pointer record.
* Follow-up fix of MDEV-13795/MDEV-14332Marko Mäkelä2017-11-101-21/+0
| | | | | | | row_log_table_apply_op(): Remove references to dict_table_t::n_vcols. Virtual column information is no longer being written to the log. row_log_t: Remove the unused fields n_old_col, n_old_vcol.
* MDEV-13795/MDEV-14332 Corruption during online table-rebuilding ALTER when ↵Marko Mäkelä2017-11-0918-531/+243
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VIRTUAL columns exist When MySQL 5.7 introduced indexed virtual columns, it introduced several bugs into the online table-rebuilding ALTER, that is, the row_log_table_apply() family of functions. The online_log format that was introduced for online table-rebuilding ALTER in MySQL 5.6 should be sufficient. Ideally, any indexed virtual column values would be evaluated based on the log records in the temporary file. There is no need to log virtual column values. (For ADD INDEX, that is row_log_apply(), we always must log the values of the keys, no matter if the columns are virtual.) Because omitting the virtual column values removes any chance of row_log_table_apply() working with indexed virtual columns, we will for now refuse LOCK=NONE in table-rebuilding ALTER operations when indexes on virtual columns exist. This restriction would be lifted in MDEV-14341. innobase_indexed_virtual_exist(): New predicate, to determine if indexed virtual columns exist in a table definition. ha_innobase::check_if_supported_inplace_alter(): Refuse online rebuild if indexed virtual columns exist. rec_get_converted_size_temp_v(), rec_convert_dtuple_to_temp_v(): Remove. row_log_table_delete(), row_log_table_update(, row_log_table_insert(): Remove parameters for virtual columns. trx_undo_read_v_rows(): Remove the col_map parameter. row_log_table_apply(): Do not deal with virtual columns.
* MDEV-14334: Update test results for rocksdb.bulk_load_rev_dataSergei Petrunia2017-11-091-0/+3
|
* Cleanup up after failed alter table in add_index_inplace_crashMonty2017-11-091-0/+10
|
* Merge 10.1 into 10.2Marko Mäkelä2017-11-093-4/+23
|\
| * MDEV-14333 Mariabackup --apply-log-only crashes if incomplete transactions ↵Marko Mäkelä2017-11-093-6/+21
| | | | | | | | | | | | | | with update_undo logs are present trx_undo_free_prepared(): Relax the assertion for mariabackup --apply-log-only.
* | Merge remote-tracking branch 'origin/10.1' into 10.2Alexander Barkov2017-11-0918-52/+191
|\ \ | |/
| * Merge remote-tracking branch 'origin/10.0' into 10.1Alexander Barkov2017-11-0918-52/+190
| |\
| | * MDEV-14164: Unknown column error when adding aggregate to function in oracle ↵Oleksandr Byelkin2017-11-0914-45/+153
| | | | | | | | | | | | | | | | | | | | | | | | style procedure FOR loop Make differentiation between pullout for merge and pulout of outer field during exists2in transformation. In last case the field was outer and so we can safely start from name resolution context of the SELECT where it was pulled. Old behavior lead to inconsistence between list of tables and outer name resolution context (which skips one SELECT for merge purposes) which creates problem vor name resolution.
| | * MDEV-14116 INET6_NTOA output is set as null to varchar(39) variableAlexander Barkov2017-11-074-6/+37
| | |
* | | Merge 10.1 into 10.2Marko Mäkelä2017-11-0814-9/+164
|\ \ \ | |/ /
| * | Fix integer type mismatch in WSREP debug outputMarko Mäkelä2017-11-082-6/+8
| | |
| * | MDEV-10728 test excluded from embedded testsVesa Pentti2017-11-071-0/+2
| | |
| * | MDEV-8867 Wrong field type or metadata for COALESCE(bit_column, 1)Alexander Barkov2017-11-072-0/+43
| | | | | | | | | | | | This problem was earlier fixed by the patch for MDEV-8910. Adding tests only.
| * | Fix test caseVladislav Vaintroub2017-11-062-4/+6
| | |
| * | Remove dead code for non-debug buildsMarko Mäkelä2017-11-062-0/+4
| | |
| * | MDEV-12108 Fix backup for Innodb tables with DATA DIRECTORYVladislav Vaintroub2017-11-066-1/+82
| | |
* | | MDEV-14320 main.subselect failed in buildbot, results mismatchAlexander Barkov2017-11-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | There was a problem in the recent patch for MDEV-10817: get_date() must "return true" on null_value rather than "return 0" (forgot to fix Item_sum_hybrid::get_date() after copying and pasting from Item_sum_hybrid::val_str()).
* | | Merge 10.1 into 10.2Marko Mäkelä2017-11-0751-798/+523
|\ \ \ | |/ /
| * | Merge 10.0 into 10.1Marko Mäkelä2017-11-0617-234/+213
| |\ \ | | |/
| | * MDEV-14140 IMPORT TABLESPACE must not go beyond FSP_FREE_LIMITMarko Mäkelä2017-11-068-348/+287
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ibuf_check_bitmap_on_import(): Only access the pages that are below FSP_FREE_LIMIT. It is possible that especially with ROW_FORMAT=COMPRESSED, the FSP_SIZE will be much bigger than the FSP_FREE_LIMIT, and the bitmap pages (page_size*N, 1+page_size*N) are filled with zero bytes. buf_page_is_corrupted(), buf_page_io_complete(): Make the fault injection compatible with MariaDB 10.2. Backport the IMPORT tests from 10.2.
| | * MDEV-10651, MDEV-14196 sys_vars.innodb_buffer_pool_* tests failElena Stepanova2017-11-057-55/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - innodb_buffer_pool_dump_now_basic is modified to make sure it really performs a dump and waits till it completion, to avoid the apparent or hidden failure similar to MDEV-9713 / MDEV-10651 - innodb_buffer_pool_dump_pct_basic is modified to re-use the new code from innodb_buffer_pool_dump_now_basic and thus avoid the failure MDEV-10651 - innodb_buffer_pool_load_now_basic is re-written to simplify the logic by re-using the code innodb_buffer_pool_dump_now_basic and is given an opt file to avoid race conditions with buffer pool load performed upon server startup, which causes MDEV-14196 failure
| | * MDEV-14029 Server does not remove #sql*.frm files after crash during ALTER TABLEElena Stepanova2017-11-051-0/+5
| | | | | | | | | | | | Add a check for #sql* files in test and mysql subdirs to the testcase check
| | * MDEV-11864 main.view test uses CHECK PARTITION but does not check for the ↵Elena Stepanova2017-11-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | partition plugin The test would pass even with skipped partitioning, because CHECK PARTITION for a view works identically with enabled/disabled partitioning; but if the server is compiled without partitioning at all, it cannot execute the statement, and the test would fail. Check for the presence of partitioning allows to skip the test in this case, rather than let it fail
| | * MDEV-13921 Audit log writes invalid SQL if single-line comments areAlexey Botchkov2017-11-033-5/+11
| | | | | | | | | | | | | | | | | | | | | present. thread_pool_server_audit.test fixed. plugin version updated.
| | * MDEV-13921 Audit log writes invalid SQL if single-line comments areAlexey Botchkov2017-11-033-22/+31
| | | | | | | | | | | | | | | | | | | | | present. Escape special characters (like \r \n \t) instead of replacing them with spaces.
| | * MDEV-11965 -Werror should not appear in released tarballsSergei Golubchik2017-11-021-3/+3
| | |
| * | MDEV-13328 ALTER TABLE…DISCARD TABLESPACE takes a lot of timeMarko Mäkelä2017-11-0622-604/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With a big buffer pool that contains many data pages, DISCARD TABLESPACE took a long time, because it would scan the entire buffer pool to remove any pages that belong to the tablespace. With a large buffer pool, this would take a lot of time, especially when the table-to-discard is empty. The minimum amount of work that DISCARD TABLESPACE must do is to remove the pages of the to-be-discarded table from the buf_pool->flush_list because any writes to the data file must be prevented before the file is deleted. If DISCARD TABLESPACE does not evict the pages from the buffer pool, then IMPORT TABLESPACE must do it, because we must prevent pre-DISCARD, not-yet-evicted pages from being mistaken for pages of the imported tablespace. It would not be a useful fix to simply move the buffer pool scan to the IMPORT TABLESPACE step. What we can do is to actively evict those pages that could be mistaken for imported pages. In this way, when importing a small table into a big buffer pool, the import should still run relatively fast. Import is bypassing the buffer pool when reading pages for the adjustment phase. In the adjustment phase, if a page exists in the buffer pool, we could replace it with the page from the imported file. Unfortunately I did not get this to work properly, so instead we will simply evict any matching page from the buffer pool. buf_page_get_gen(): Implement BUF_EVICT_IF_IN_POOL, a new mode where the requested page will be evicted if it is found. There must be no unwritten changes for the page. buf_remove_t: Remove. Instead, use trx!=NULL to signify that a write to file is desired, and use a separate parameter bool drop_ahi. buf_LRU_flush_or_remove_pages(), fil_delete_tablespace(): Replace buf_remove_t. buf_LRU_remove_pages(), buf_LRU_remove_all_pages(): Remove. PageConverter::m_mtr: A dummy mini-transaction buffer PageConverter::PageConverter(): Complete the member initialization list. PageConverter::operator()(): Evict any 'shadow' pages from the buffer pool so that pre-existing (garbage) pages cannot be mistaken for pages that exist in the being-imported file. row_discard_tablespace(): Remove a bogus comment that seems to refer to IMPORT TABLESPACE, not DISCARD TABLESPACE.
| * | Remove redundant function parametersMarko Mäkelä2017-11-062-74/+52
| | | | | | | | | | | | | | | buf_flush_or_remove_pages(), buf_flush_dirty_pages(): Remove the redundant parameter flush=(trx!=NULL).
| * | MDEV-10728 -- mysqlbinlog can't be input to mysql clientVesa Pentti2017-11-064-1/+8
| | | | | | | | | | | | | | | | | | String comparison with utf8_bin collation is case sensitive. Hence "DELIMITER" did not match with "delimiter". The delimiter command matching now uses my_charset_latin1.
| * | MDEV-14132 InnoDB page corruptionMarko Mäkelä2017-11-062-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some old GNU/Linux systems, invoking posix_fallocate() with offset=0 would sometimes cause already allocated bytes in the data file to be overwritten. Fix a correctness regression that was introduced in commit 420798a81ac9a81d20629535fac3032e025e7733 by invoking posix_fallocate() in a safer way. A similar change was made in MDEV-5746 earlier. os_file_get_size(): Avoid changing the state of the file handle, by invoking fstat() instead of lseek(). os_file_set_size(): Determine the current size of the file by os_file_get_size(), and then extend the file from that point onwards.
| * | MDEV-14244 MariaDB fails to run with O_DIRECTMarko Mäkelä2017-11-062-12/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | os_file_set_size(): If posix_fallocate() returns EINVAL, fall back to writing zero bytes to the file. Also, remove some error log output, and make it possible for a server shutdown to interrupt the fall-back code. MariaDB used to ignore any possible return value from posix_fallocate() ever since innodb_use_fallocate was introduced in MDEV-4338. If EINVAL was returned, the file would not be extended. Starting with MDEV-11520, MariaDB would treat EINVAL as a hard error. Why is the EINVAL returned? The GNU posix_fallocate() function would first try the fallocate() system call, which would return -EOPNOTSUPP for many file systems (notably, not ext4). Then, it would fall back to extending the file one block at a time by invoking pwrite(fd, "", 1, offset) where offset is 1 less than a multiple of the file block size. This would fail with EINVAL if the file is in O_DIRECT mode, because O_DIRECT requires aligned operation.
| * | MDEV-13921 Audit log writes invalid SQL if single-line comments areAlexey Botchkov2017-11-033-5/+11
| | | | | | | | | | | | | | | | | | | | | present. thread_pool_server_audit.test fixed. plugin version updated.
| * | MDEV-13560 Copy all innodb undo tablespaces from the backup directory to ↵Vladislav Vaintroub2017-11-031-15/+17
| | | | | | | | | | | | | | | | | | | | | destination. Do not check or rely on innodb_undo_tablespaces in copy-back, there is no good reason for that.
| * | MDEV-13921 Audit log writes invalid SQL if single-line comments areAlexey Botchkov2017-11-033-22/+31
| | | | | | | | | | | | | | | | | | | | | present. Escape special characters (like \r \n \t) instead of replacing them with spaces.
| * | MDEV-12633 Error from valgrind related to dd_frm_typeMonty2017-11-022-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "Conditional jump or move depends on uninitialised value in my_scan_weight_utf8_general_ci, main.mysql_client_test fails in biuldbot with valgrind" - Fixed by ensuring that engine_name is set to empty string even in case errors in the .frm file - Added some error checking to ha_table_exists()
| * | MDEV-14221 Assertion `0' failed in Item::field_type_for_temporal_comparisonAlexander Barkov2017-11-023-0/+31
| | |
* | | MDEV-14310 ALTER TABLE…ADD INDEX may corrupt the InnoDB system tablespaceMarko Mäkelä2017-11-071-16/+9
| | | | | | | | | | | | | | | | | | FlushObserver::flush(): Never discard unwritten changes. We do not want to risk corrupting the system tablespace or .ibd files that are not part of a table-rebuilding ALTER.
* | | MDEV-14304 Unnecessary conditions in buf_page_get_gen()Marko Mäkelä2017-11-071-31/+2
| | | | | | | | | | | | | | | | | | Ever since MDEV-10813 cleaned up InnoDB use of atomic memory operations and made buf_block_fix() an atomic operation, some conditions around buf_block_fix() have been unnecessary.
* | | MDEV-10817 CAST(MAX(DATE'2001-01-01') AS TIME) returns a wrong resultAlexander Barkov2017-11-075-0/+45
| | |
* | | Test case for mdev-13753 CTE is not visible during view creationIgor Babaev2017-11-062-0/+38
| | | | | | | | | | | | The bug was fixed by the patch for the bug mdev-13780.
* | | Fixed mdev-14237 Server crash on query with regexp_substrIgor Babaev2017-11-053-4/+60
| | | | | | | | | | | | | | | | | | | | | It's better to prohibit pushdown of conditions that involve regexp_substr() and regexp_replace() into materialized derived tables / views until proper implementations of the get_copy() virtual method are provided for those functions.