summaryrefslogtreecommitdiff
path: root/storage/xtradb
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-12600: crash during install_db with innodb_page_size=32K and ibdata1=3M;bb-10.1-MDEV-12113Jan Lindström2017-06-019-44/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem was that all doublewrite buffer pages must fit to first system datafile. Ported commit 27a34df7882b1f8ed283f22bf83e8bfc523cbfde Author: Shaohua Wang <shaohua.wang@oracle.com> Date: Wed Aug 12 15:55:19 2015 +0800 BUG#21551464 - SEGFAULT WHILE INITIALIZING DATABASE WHEN INNODB_DATA_FILE SIZE IS SMALL To 10.1 (with extended error printout). btr_create(): If ibuf header page allocation fails report error and return FIL_NULL. Similarly if root page allocation fails return a error. dict_build_table_def_step: If fsp_header_init fails return error code. fsp_header_init: returns true if header initialization succeeds and false if not. fseg_create_general: report error if segment or page allocation fails. innobase_init: If first datafile is smaller than 3M and could not contain all doublewrite buffer pages report error and fail to initialize InnoDB plugin. row_truncate_table_for_mysql: report error if fsp header init fails. srv_init_abort: New function to report database initialization errors. srv_undo_tablespaces_init, innobase_start_or_create_for_mysql: If database initialization fails report error and abort. trx_rseg_create: If segment header creation fails return.
* MDEV-12114: install_db shows corruption for rest encryption and ↵Jan Lindström2017-06-012-53/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | innodb_checksum_algorithm=strict_none Problem was that checksum check resulted false positives that page is both not encrypted and encryted when checksum_algorithm was strict_none. Encrypton checksum will use only crc32 regardless of setting. buf_zip_decompress: If compression fails report a error message containing the space name if available (not available during import). And note if space could be encrypted. buf_page_get_gen: Do not assert if decompression fails, instead unfix the page and return NULL to upper layer. fil_crypt_calculate_checksum: Use only crc32 method. fil_space_verify_crypt_checksum: Here we need to check crc32, innodb and none method for old datafiles. fil_space_release_for_io: Allow null space. encryption.innodb-compressed-blob is now run with crc32 and none combinations. Note that with none and strict_none method there is not really a way to detect page corruptions and page corruptions after decrypting the page with incorrect key. New test innodb-checksum-algorithm to test different checksum algorithms with encrypted, row compressed and page compressed tables.
* MDEV-12113: install_db shows corruption for rest encryption with ↵Jan Lindström2017-06-018-300/+270
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | innodb_data_file_path=ibdata1:3M; Problem was that FIL_PAGE_FLUSH_LSN_OR_KEY_VERSION field that for encrypted pages even in system datafiles should contain key_version except very first page (0:0) is after encryption overwritten with flush lsn. Ported WL#7990 Repurpose FIL_PAGE_FLUSH_LSN to 10.1 The field FIL_PAGE_FLUSH_LSN_OR_KEY_VERSION is consulted during InnoDB startup. At startup, InnoDB reads the FIL_PAGE_FLUSH_LSN_OR_KEY_VERSION from the first page of each file in the InnoDB system tablespace. If there are multiple files, the minimum and maximum LSN can differ. These numbers are passed to InnoDB startup. Having the number in other files than the first file of the InnoDB system tablespace is not providing much additional value. It is conflicting with other use of the field, such as on InnoDB R-tree index pages and encryption key_version. This worklog will stop writing FIL_PAGE_FLUSH_LSN_OR_KEY_VERSION to other files than the first file of the InnoDB system tablespace (page number 0:0) when system tablespace is encrypted. If tablespace is not encrypted we continue writing FIL_PAGE_FLUSH_LSN_OR_KEY_VERSION to all first pages of system tablespace to avoid unnecessary warnings on downgrade. open_or_create_data_files(): pass only one flushed_lsn parameter xb_load_tablespaces(): pass only one flushed_lsn parameter. buf_page_create(): Improve comment about where FIL_PAGE_FIL_FLUSH_LSN_OR_KEY_VERSION is set. fil_write_flushed_lsn(): A new function, merged from fil_write_lsn_and_arch_no_to_file() and fil_write_flushed_lsn_to_data_files(). Only write to the first page of the system tablespace (page 0:0) if tablespace is encrypted, or write all first pages of system tablespace and invoke fil_flush_file_spaces(FIL_TYPE_TABLESPACE) afterwards. fil_read_first_page(): read flush_lsn and crypt_data only from first datafile. fil_open_single_table_tablespace(): Remove output of LSN, because it was only valid for the system tablespace and the undo tablespaces, not user tablespaces. fil_validate_single_table_tablespace(): Remove output of LSN. checkpoint_now_set(): Use fil_write_flushed_lsn and output a error if operation fails. Remove lsn variable from fsp_open_info. recv_recovery_from_checkpoint_start(): Remove unnecessary second flush_lsn parameter. log_empty_and_mark_files_at_shutdown(): Use fil_writte_flushed_lsn and output error if it fails. open_or_create_data_files(): Pass only one flushed_lsn variable.
* Merge branch '10.0-galera' into 10.1Sergei Golubchik2017-05-262-3/+21
|\
| * Merge branch '10.0' into bb-10.0-galeraSachin Setiya2017-03-208-165/+107
| |\
| * | Fixed test failure on galere_wsrep_log_conflicts on XtraDB.Jan Lindström2017-03-203-7/+136
| | | | | | | | | | | | | | | | | | | | | Problem was that trx_sys->mutex was acquired to print trx info even when we already hold trx_sys->mutex. Fixed similarly as in InnoDB, i.e. with wsrep_trx_print_locking() function that does not acquire trx_sys->mutex.
| * | Merge tag 'mariadb-10.0.30' into bb-sachin-10.0-galera-mergeSachin Setiya2017-03-1777-1178/+1266
| |\ \ | | | | | | | | | | | | Signed-off-by: Sachin Setiya <sachin.setiya@mariadb.com>
| * | | Fix for post-merge build failure.mariadb-galera-10.0.29Nirbhay Choubey2017-01-131-13/+2
| | | |
| * | | Merge tag 'mariadb-10.0.29' into 10.0-galeraNirbhay Choubey2017-01-1323-2696/+140
| |\ \ \
| * | | | Fix a build failure noticed on Yakkety.Nirbhay Choubey2016-11-021-2/+2
| | | | |
* | | | | MDEV-12926 encryption.innodb_onlinealter_encryption, ↵Marko Mäkelä2017-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | encryption.innodb-bad-key-change failed in buildbot with valgrind row_merge_write(): Pass the correct (possibly encrypted) buffer to os_file_write_int_fd(). This bug was introduced in commit 65e1399e64a306f1ce1d920e66206954f8630da8 which included a commit to merge changes from MySQL 5.6.36 to MariaDB Server 10.0.
* | | | | 10.1 additions for MDEV-12052 Shutdown crash presumably due to master thread ↵Marko Mäkelä2017-05-265-29/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | activity btr_defragment_thread(): Create the thread in the same place as other threads. Do not invoke btr_defragment_shutdown(), because row_drop_tables_for_mysql_in_background() in the master thread can still keep invoking btr_defragment_remove_table(). logs_empty_and_mark_files_at_shutdown(): Wait for btr_defragment_thread() to exit. innobase_start_or_create_for_mysql(), innobase_shutdown_for_mysql(): Skip encryption and scrubbing in innodb_read_only_mode. srv_export_innodb_status(): Do not export encryption or scrubbing statistics in innodb_read_only mode, because the threads will not be running.
* | | | | Merge 10.0 to 10.1Marko Mäkelä2017-05-261-88/+59
|\ \ \ \ \
| * | | | | MDEV-12052 Shutdown crash presumably due to master thread activityMarko Mäkelä2017-05-261-88/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | InnoDB shutdown assumes that once the server has entered SRV_SHUTDOWN_FLUSH_PHASE, no change to persistent data is allowed. It was possible for the master thread to wake up while shutdown is executing in SRV_SHUTDOWN_FLUSH_PHASE or even in SRV_SHUTDOWN_LAST_PHASE. We do not yet know if further crashes at shutdown are possible. Also, we do not know if all the observed crashes could be explained by the race conditions that we are now fixing. srv_shutdown_print_master_pending(): Remove a redundant ut_time() call. srv_shutdown(): Renamed from srv_master_do_shutdown_tasks(). srv_master_thread(): Do not resume after shutdown has been initiated.
* | | | | | MDEV-12625 total_index_blocks is uninitialized in ALTER ↵Marko Mäkelä2017-05-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TABLE…ALGORITHM=INPLACE of small tables Before MDEV-6812, it did not matter that merge_files[].offset was uninitialized when no files were created. This problem was introduced in MDEV-6812. There could be a user-visible impact that the progress reports spit into the error log are bogus. row_merge_build_indexes(): Initialize merge_files[i].offset.
* | | | | | MDEV-11264 Fix DeviceIoControl() usage in innodb.Vladislav Vaintroub2017-05-231-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As documented in MSDN, DeviceIoControl() needs valid (not NULL) OVERLAPPED parameter, for files opened with for OVERLAPPED access.
* | | | | | Merge 10.0 into 10.1Marko Mäkelä2017-05-235-4/+7
|\ \ \ \ \ \ | |/ / / / /
| * | | | | MDEV-6262 analyze the coverity report on mariadbSergei Golubchik2017-05-195-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | uploaded 10.0, analyzed everything with the Impact=High (and a couple of Medium)
* | | | | | MDEV-12615: InnoDB page compression method snappy mostly does not compress pagesJan Lindström2017-05-205-77/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Snappy compression method require that output buffer used for compression is bigger than input buffer. Similarly lzo require additional work memory buffer. Increase the allocated buffer accordingly. buf_tmp_buffer_t: removed unnecessary lzo_mem, crypt_buf_free and comp_buf_free. buf_pool_reserve_tmp_slot: use alligned_alloc and if snappy available allocate size based on snappy_max_compressed_length and if lzo is available increase buffer by LZO1X_1_15_MEM_COMPRESS. fil_compress_page: Remove unneeded lzo mem (we use same buffer) and if output buffer is not yet allocated allocate based similarly as above. Decompression does not require additional work area. Modify test to use same test as other compression method tests.
* | | | | | After-merge fix for MDEV-11638Marko Mäkelä2017-05-202-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 360a4a037271d65ab6471f7ab3f9b6a893d90a31 some debug assertions were introduced to the page flushing code in XtraDB. Add these assertions to InnoDB as well, and adjust the InnoDB shutdown so that these assertions will not fail. logs_empty_and_mark_files_at_shutdown(): Advance srv_shutdown_state from the first phase SRV_SHUTDOWN_CLEANUP only after no page-dirtying activity is possible (well, except by srv_master_do_shutdown_tasks(), which will be fixed separately in MDEV-12052). rotate_thread_t::should_shutdown(): Already exit the key rotation threads at the first phase of shutdown (SRV_SHUTDOWN_CLEANUP). page_cleaner_sleep_if_needed(): Do not sleep during shutdown. This change is originally from XtraDB.
* | | | | | Merge 10.0 into 10.1Marko Mäkelä2017-05-2035-388/+952
|\ \ \ \ \ \ | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | Significantly reduce the amount of InnoDB, XtraDB and Mariabackup code changes by defining pfs_os_file_t as something that is transparently compatible with os_file_t.
| * | | | | Remove dead code added in merge commit d8b45b0c004edc0b91029b232d7cc9aad02cc822Marko Mäkelä2017-05-191-24/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a merge conflict resolution, callers of the added function rec_field_len_in_chars() were removed, but the function itself was not.
| * | | | | Update xtradb and innodb version to 5.6.36Vicențiu Ciorbaru2017-05-181-1/+1
| | | | | |
| * | | | | Fix xtradb handler compilation post mergeVicențiu Ciorbaru2017-05-181-0/+25
| | | | | |
| * | | | | Merge remote-tracking branch 'origin/10.0' into 10.0Vicențiu Ciorbaru2017-05-1828-276/+206
| |\ \ \ \ \
| * | | | | | Fix windows compilation in xtradb post-mergeVicențiu Ciorbaru2017-05-171-5/+5
| | | | | | |
| * | | | | | Merge branch 'merge-xtradb-5.6' into 10.0Vicențiu Ciorbaru2017-05-1741-434/+1204
| |\ \ \ \ \ \
| | * | | | | | 5.6.36-82.0Vicențiu Ciorbaru2017-05-1642-459/+1419
| | | | | | | |
* | | | | | | | Merge 10.0 into 10.1Marko Mäkelä2017-05-1921-367/+315
|\ \ \ \ \ \ \ \ | | |_|/ / / / / | |/| | | | | |
| * | | | | | | Fix some __attribute__((nonnull)) misuseMarko Mäkelä2017-05-185-12/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes warnings that were emitted when running InnoDB test suites on a debug server that was compiled with GCC 7.1.0 using the flags -O3 -fsanitize=undefined. thd_requested_durability(): XtraDB can call this with trx->mysql_thd=NULL. Remove the function in InnoDB, because it is not used there. calc_row_difference(): Do not call memcmp(o_ptr, NULL, 0). innobase_index_name_is_reserved(): This can be called with key_info=NULL, num_of_keys=0. innobase_dropping_foreign(), innobase_check_foreigns_low(), innobase_check_foreigns(): This can be called with drop_fk=NULL, n_drop_fk=0. rec_convert_dtuple_to_rec_comp(): Do not invoke memcpy(end, NULL, 0).
| * | | | | | | ibuf_get_volume_buffered_hash(): Use a proper type castMarko Mäkelä2017-05-181-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On 64-bit systems, the constant 1 would be 32-bit (int or unsigned) by default. Cast the constant to ulint before shifting to avoid a -fsanitize=undefined warning or any potential overflow.
| * | | | | | | Refactor trx_undo_report_row_operation()Marko Mäkelä2017-05-183-53/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a -fsanitizer=undefined warning that trx_undo_report_row_operation() was being passed thr=NULL when the BTR_NO_UNDO_LOG_FLAG flag was set. trx_undo_report_row_operation(): Remove the first two parameters. The parameter clust_entry!=NULL distinguishes inserts from updates. This should be a non-functional change (no observable change in behaviour; slightly smaller code).
| * | | | | | | Follow-up to MDEV-12534: Align srv_sysMarko Mäkelä2017-05-171-75/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allocate srv_sys statically so that the desired alignment can be guaranteed. This silences -fsanitize=undefined warnings. There probably is no performance impact of this, because the reason for the alignment to ensure the absence of false sharing between counters. Even with the misalignment, each counter would have been been aligned at 64 bits, and the counters would reside in separate cache lines.
| * | | | | | | MDEV-12358 Work around what looks like a bug in GCC 7.1.0Marko Mäkelä2017-05-175-60/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parameter thr of the function btr_cur_optimistic_insert() is not declared as nonnull, but GCC 7.1.0 with -O3 is wrongly optimizing away the first part of the condition UNIV_UNLIKELY(thr && thr_get_trx(thr)->fake_changes) when the function is being called by row_merge_insert_index_tuples() with thr==NULL. The fake_changes is an XtraDB addition. This GCC bug only appears to have an impact on XtraDB, not InnoDB. We work around the problem by not attempting to dereference thr when both BTR_NO_LOCKING_FLAG and BTR_NO_UNDO_LOG_FLAG are set in the flags. Probably BTR_NO_LOCKING_FLAG alone should suffice. btr_cur_optimistic_insert(), btr_cur_pessimistic_insert(), btr_cur_pessimistic_update(): Correct comments that disagree with usage and with nonnull attributes. No other parameter than thr can actually be NULL. row_ins_duplicate_error_in_clust(): Remove an unused parameter. innobase_is_fake_change(): Unused function; remove. ibuf_insert_low(), row_log_table_apply(), row_log_apply(), row_undo_mod_clust_low(): Because we will be passing BTR_NO_LOCKING_FLAG | BTR_NO_UNDO_LOG_FLAG in the flags, the trx->fake_changes flag will be treated as false, which is the right thing to do at these low-level operations (change buffer merge, ALTER TABLE…LOCK=NONE, or ROLLBACK). This might be fixing actual XtraDB bugs. Other callers that pass these two flags are also passing thr=NULL, implying fake_changes=false. (Some callers in ROLLBACK are passing BTR_NO_LOCKING_FLAG and a nonnull thr. In these callers, fake_changes better be false, to avoid corruption.)
| * | | | | | | fil_create_new_single_table_tablespace(): Correct a bogus nonnull attributeMarko Mäkelä2017-05-172-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parameter path can be passed as NULL. This error was reported by GCC 7.1.0 when compiling CMAKE_BUILD_TYPE=Debug with -O3.
| * | | | | | | Remove redundant UT_LIST_INIT() callsMarko Mäkelä2017-05-175-12/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The macro UT_LIST_INIT() zero-initializes the UT_LIST_NODE. There is no need to call this macro on a buffer that has already been zero-initialized by mem_zalloc() or mem_heap_zalloc() or similar. For some reason, the statement UT_LIST_INIT(srv_sys->tasks) in srv_init() caused a SIGSEGV on server startup when compiling with GCC 7.1.0 for AMD64 using -O3. The zero-initialization was attempted by the instruction movaps %xmm0,0x50(%rax), while the proper offset of srv_sys->tasks would seem to have been 0x48.
| * | | | | | | Never pass NULL to innobase_get_stmt()Marko Mäkelä2017-05-173-15/+11
| | | | | | | |
| * | | | | | | Silence bogus GCC 7 warnings -Wimplicit-fallthroughMarko Mäkelä2017-05-179-16/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not silence uncertain cases, or fix any bugs. The only functional change should be that ha_federated::extra() is not calling DBUG_PRINT to report an unhandled case for HA_EXTRA_PREPARE_FOR_DROP.
| * | | | | | | Fix an incorrect debug assertionMarko Mäkelä2017-05-171-1/+3
| | | | | | | |
| * | | | | | | MDEV-12071 storage/xtradb/handler/ha_innodb.cc: Cannot assign const_iterator ↵Marko Mäkelä2017-05-171-1/+2
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | to iterator
| * | | | | | MDEV-9998 Fix issues caught by Clang's -Wpointer-bool-conversion warningSergei Golubchik2017-05-151-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | remove useless checks and a couple of others
| * | | | | | MDEV-12188 information schema - errors populating fail to free memory, ↵Marko Mäkelä2017-05-151-143/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unlock mutexes Given the OK macro used in innodb does a DBUG_RETURN(1) on expression failure the innodb implementation has a number of errors in i_s.cc. We introduce a new macro BREAK_IF that replaces some use of the OK macro. Also, do some other cleanup detailed below. When invoking Field::store() on integers, always pass the parameter is_unsigned=true to avoid an unnecessary conversion to double. i_s_fts_deleted_generic_fill(), i_s_fts_config_fill(): Use the BREAK_IF macro instead of OK. i_s_fts_index_cache_fill_one_index(), i_s_fts_index_table_fill_one_index(): Add a parameter for conv_string, and let the caller allocate that buffer. i_s_fts_index_cache_fill(): Check the return status of i_s_fts_index_cache_fill_one_index(). i_s_fts_index_table_fill(): Check the return status of i_s_fts_index_table_fill_one_index(). i_s_fts_index_table_fill_one_fetch(): Always let the caller invoke i_s_fts_index_table_free_one_fetch(). i_s_innodb_buffer_page_fill(), i_s_innodb_buf_page_lru_fill(): Do release dict_sys->mutex if filling the buffers fails. i_s_innodb_buf_page_lru_fill(): Also display the value INFORMATION_SCHEMA.INNODB_BUFFER_PAGE.PAGE_IO_FIX='IO_PIN' when a block is in that state. Remove the unnecessary variable 'heap'.
| * | | | | | Fix the Solaris compilation after MDEV-12674Marko Mäkelä2017-05-151-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | simple_counter::add(): Add a type cast to the os_atomic_increment_ulint() call, because GCC would check the type compatibility even when the code branch is not being instantiated (atomic=false). On Solaris, os_atomic_increment_ulint() actually needs a compatible parameter type, and an error would be emitted due to an incompatible 64-bit type, for srv_stats.n_lock_wait_time.add(diff_time).
* | | | | | | MDEV-12593: InnoDB page compression should use lz4_compress_default ifJan Lindström2017-05-181-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | available lz4.cmake: Check if shared or static lz4 library has LZ4_compress_default function and if it has define HAVE_LZ4_COMPRESS_DEFAULT. fil_compress_page: If HAVE_LZ4_COMPRESS_DEFAULT is defined use LZ4_compress_default function for compression if not use LZ4_compress_limitedOutput function. Introduced a innodb-page-compression.inc file for page compression tests that will also search .ibd file to verify that pages are compressed (i.e. used search string is not found). Modified page compression tests to use this file. Note that snappy method is not included because of MDEV-12615 InnoDB page compression method snappy mostly does not compress pages that will be fixed on different commit.
* | | | | | | Make some variables const in fil_iterate()Marko Mäkelä2017-05-171-16/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a non-functional change to make it slightly easier to read the code. We seem to have some bugs in this IMPORT TABLESPACE code; see MDEV-12396.
* | | | | | | Never pass NULL to innobase_get_stmt()Marko Mäkelä2017-05-173-19/+20
| | | | | | |
* | | | | | | Silence bogus GCC 7 warnings -Wimplicit-fallthroughMarko Mäkelä2017-05-179-16/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not silence uncertain cases, or fix any bugs. The only functional change should be that ha_federated::extra() is not calling DBUG_PRINT to report an unhandled case for HA_EXTRA_PREPARE_FOR_DROP.
* | | | | | | Merge 10.0 into 10.1Marko Mäkelä2017-05-127-120/+110
|\ \ \ \ \ \ \ | |/ / / / / /
| * | | | | | MDEV-12674 Innodb_row_lock_current_waits has overflowMarko Mäkelä2017-05-126-117/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a race condition related to the variable srv_stats.n_lock_wait_current_count, which is only incremented and decremented by the function lock_wait_suspend_thread(), The incrementing is protected by lock_sys->wait_mutex, but the decrementing does not appear to be protected by anything. This mismatch could allow the counter to be corrupted when a transactional InnoDB table or record lock wait is terminating roughly at the same time with the start of a wait on a (possibly different) lock. ib_counter_t: Remove some unused methods. Prevent instantiation for N=1. Add an inc() method that takes a slot index as a parameter. single_indexer_t: Remove. simple_counter<typename Type, bool atomic=false>: A new counter wrapper. Optionally use atomic memory operations for modifying the counter. Aligned to the cache line size. lsn_ctr_1_t, ulint_ctr_1_t, int64_ctr_1_t: Define as simple_counter<Type>. These counters are either only incremented (and we do not care about losing some increment operations), or the increment/decrement operations are protected by some mutex. srv_stats_t::os_log_pending_writes: Document that the number is protected by log_sys->mutex. srv_stats_t::n_lock_wait_current_count: Use simple_counter<ulint, true>, that is, atomic inc() and dec() operations. lock_wait_suspend_thread(): Release the mutexes before incrementing the counters. Avoid acquiring the lock mutex if the lock wait has already been resolved. Atomically increment and decrement srv_stats.n_lock_wait_current_count. row_insert_for_mysql(), row_update_for_mysql(), row_update_cascade_for_mysql(): Use the inc() method with the trx->id as the slot index. This is a non-functional change, just using inc() instead of add(1). buf_LRU_get_free_block(): Replace the method add(index, n) with inc(). There is no slot index in the simple_counter.
* | | | | | | MDEV-12253 post-fix: Do not leak memory in crash recoveryMarko Mäkelä2017-05-091-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a backport from 10.2 where it fixes the cmake -DWITH_ASAN test failure that was mentioned in commit f9cc391863ab962e8c8a8a8a676d730498eb8d6f (merging MDEV-12253 from 10.1 to 10.2). fil_parse_write_crypt_data(): If the tablespace is not found, invoke fil_space_destroy_crypt_data(&crypt_data) to properly free the created object.