1. 18 May, 2020 2 commits
  2. 17 May, 2020 1 commit
    • Varun Gupta's avatar
      MDEV-22556: Incorrect result for window function when using encrypt-tmp-files=ON · 0a5668f5
      Varun Gupta authored
      The issue here is that end_of_file for encrypted temporary IO_CACHE (used by filesort) is updated
      using lseek.
      Encryption adds storage overhead and hides it from the caller by recalculating offsets and lengths.
      Two different IO_CACHE cannot possibly modify the same file
      because the encryption key is randomly generated and stored in the IO_CACHE.
      So when the tempfiles are encrypted DO NOT use lseek to change end_of_file.
      
      Further observations about updating end_of_file using lseek
      1) The end_of_file update is only used for binlog index files
      2) The whole point is to update file length when the file was modified via a different file descriptor.
      3) The temporary IO_CACHE files can never be modified via a different file descriptor.
      4) For encrypted temporary IO_CACHE, end_of_file should not be updated with lseek
      0a5668f5
  3. 16 May, 2020 5 commits
  4. 15 May, 2020 17 commits
    • Marko Mäkelä's avatar
      MDEV-13626: Make test more robust · 3f12a596
      Marko Mäkelä authored
      In commit b1742a5c we forgot
      FLUSH TABLES, potentially causing errors for MyISAM system tables.
      3f12a596
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · fc0960aa
      Marko Mäkelä authored
      fc0960aa
    • Marko Mäkelä's avatar
      MDEV-22544 Inconsistent and Incorrect rw-lock stats · c8dd4117
      Marko Mäkelä authored
      The rw_lock_stats were incorrectly updated.
      While global statistics have limited usefulness, we cannot
      remove them from a GA version. This contribution is slightly
      improving performance in write workloads.
      c8dd4117
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 3d0bb2b7
      Marko Mäkelä authored
      3d0bb2b7
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 6a6bcc53
      Marko Mäkelä authored
      6a6bcc53
    • Marko Mäkelä's avatar
      MDEV-22456 Dropping the adaptive hash index may cause DDL to lock up InnoDB · ad6171b9
      Marko Mäkelä authored
      If the InnoDB buffer pool contains many pages for a table or index
      that is being dropped or rebuilt, and if many of such pages are
      pointed to by the adaptive hash index, dropping the adaptive hash index
      may consume a lot of time.
      
      The time-consuming operation of dropping the adaptive hash index entries
      is being executed while the InnoDB data dictionary cache dict_sys is
      exclusively locked.
      
      It is not actually necessary to drop all adaptive hash index entries
      at the time a table or index is being dropped or rebuilt. We can let
      the LRU replacement policy of the buffer pool take care of this gradually.
      For this to work, we must detach the dict_table_t and dict_index_t
      objects from the main dict_sys cache, and once the last
      adaptive hash index entry for the detached table is removed
      (when the garbage page is evicted from the buffer pool) we can free
      the dict_table_t and dict_index_t object.
      
      Related to this, in MDEV-16283, we made ALTER TABLE...DISCARD TABLESPACE
      skip both the buffer pool eviction and the drop of the adaptive hash index.
      We shifted the burden to ALTER TABLE...IMPORT TABLESPACE or DROP TABLE.
      We can remove the eviction from DROP TABLE. We must retain the eviction
      in the ALTER TABLE...IMPORT TABLESPACE code path, so that in case the
      discarded table is being re-imported with the same tablespace identifier,
      the fresh data from the imported tablespace will replace any stale pages
      in the buffer pool.
      
      rpl.rpl_failed_drop_tbl_binlog: Remove the test. DROP TABLE can
      no longer be interrupted inside InnoDB.
      
      fseg_free_page(), fseg_free_step(), fseg_free_step_not_header(),
      fseg_free_page_low(), fseg_free_extent(): Remove the parameter
      that specifies whether the adaptive hash index should be dropped.
      
      btr_search_lazy_free(): Lazily free an index when the last
      reference to it is dropped from the adaptive hash index.
      
      buf_pool_clear_hash_index(): Declare static, and move to the
      same compilation unit with the bulk of the adaptive hash index
      code.
      
      dict_index_t::clone(), dict_index_t::clone_if_needed():
      Clone an index that is being rebuilt while adaptive hash index
      entries exist. The original index will be inserted into
      dict_table_t::freed_indexes and dict_index_t::set_freed()
      will be called.
      
      dict_index_t::set_freed(), dict_index_t::freed(): Note that
      or check whether the index has been freed. We will use the
      impossible page number 1 to denote this condition.
      
      dict_index_t::n_ahi_pages(): Replaces btr_search_info_get_ref_count().
      
      dict_index_t::detach_columns(): Move the assignment n_fields=0
      to ha_innobase_inplace_ctx::clear_added_indexes().
      We must have access to the columns when freeing the
      adaptive hash index. Note: dict_table_t::v_cols[] will remain
      valid. If virtual columns are dropped or added, the table
      definition will be reloaded in ha_innobase::commit_inplace_alter_table().
      
      buf_page_mtr_lock(): Drop a stale adaptive hash index if needed.
      
      We will also reduce the number of btr_get_search_latch() calls
      and enclose some more code inside #ifdef BTR_CUR_HASH_ADAPT
      in order to benefit cmake -DWITH_INNODB_AHI=OFF.
      ad6171b9
    • Marko Mäkelä's avatar
      Amend af784385: Avoid vtable overhead · ff66d65a
      Marko Mäkelä authored
      When neither MSAN nor Valgrind are enabled, declare
      Field::mark_unused_memory_as_defined() as an empty inline function,
      instead of declaring it as a virtual function.
      ff66d65a
    • Eugene Kosov's avatar
      span cleanup · 1cac6d48
      Eugene Kosov authored
      1cac6d48
    • Aleksey Midenkov's avatar
      MDEV-22563 Segfault on duplicate free of Item_func_in::array · a4996f95
      Aleksey Midenkov authored
      Same array instance in two Item_func_in instances. First Item_func_in
      instance is freed on table close. Second one is freed on
      cleanup_after_query().
      
      get_copy() depends on copy ctor for copying an item and hence does
      shallow copy for default copy ctor. Use build_clone() for deep copy of
      Item_func_in.
      a4996f95
    • Monty's avatar
      3eadb135
    • Monty's avatar
      Use history.h include file if readline is used · a7c4e85d
      Monty authored
      This allows us to remove our own declarations of functions and structures
      that are declared in the history.h file.
      a7c4e85d
    • Monty's avatar
      Fixed access to not initalized memory · 72789e4b
      Monty authored
      Most of the volations came from:
      sel_arg_range_seq_next(void*, st_key_multi_range*) (opt_range_mrr.cc:342)
      72789e4b
    • Monty's avatar
      Fix for using uninitialized memory · af784385
      Monty authored
      MDEV-22073 MSAN use-of-uninitialized-value in
      collect_statistics_for_table()
      
      Other things:
      innodb.analyze_table was changed to mainly test statistic
      collection. Was discussed with Marko.
      af784385
    • Varun Gupta's avatar
      MDEV-18100: User defined aggregate functions not working correctly when the schema is changed · d49233ca
      Varun Gupta authored
      The issue here was that when the schema was changed the value for the THD::server_status
      is ored with SERVER_SESSION_STATE_CHANGED.
      For custom aggregate functions, currently we check if the server_status is equal to
      SERVER_STATUS_LAST_ROW_SENT then we should terminate the execution of the custom
      aggregate function as there are no more rows to fetch.
      So the check should be that if the server status has the bit set for
      SERVER_STATUS_LAST_ROW_SENT then we should terminate the execution of the
      custom aggregate function.
      d49233ca
    • Monty's avatar
      Fixed bugs found by valgrind · 277aa85c
      Monty authored
      Other things:
      - Removed innodb_encryption_tables.test from valgrind as it
        takes a REALLY long time
      277aa85c
    • Jan Lindström's avatar
      MDEV-22494 : Galera assertion lock_sys.mutex.is_owned() at lock_trx_handle_wait_low · 523d67a2
      Jan Lindström authored
      Problem was that trx->lock.was_chosen_as_wsrep_victim variable was
      not set back to false after it was set true.
      
      wsrep_thd_bf_abort
      	Add assertions for correct mutex status and take necessary
      	mutexes before calling thd->awake_no_mutex().
      
      innobase_rollback_trx()
      	Reset trx->lock.was_chosen_as_wsrep_victim
      
      wsrep_abort_slave_trx()
      	Removed unused function.
      
      wsrep_innobase_kill_one_trx()
      	Added function comment, removed unnecessary parameters
      	and added debug assertions to enforce correct usage. Added
      	more debug output to help out on error analysis.
      
      wsrep_abort_transaction()
      	Added debug assertions and removed unused variables.
      
      trx0trx.h
      	Removed assert_trx_is_free macro and replaced it with
      	assert_freed() member function.
      
      trx_create()
      	Use above assert_free() and initialize wsrep variables.
      
      trx_free()
      	Use assert_free()
      
      trx_t::commit_in_memory()
      	Reset lock.was_chosen_as_wsrep_victim
      
      trx_rollback_for_mysql()
      	Reset trx->lock.was_chosen_as_wsrep_victim
      
      Add test case galera_bf_kill
      523d67a2
    • Alexander Barkov's avatar
      MDEV-22560 Crash on a table value constructor with an SP variable · 1408e26d
      Alexander Barkov authored
      fix_fields_for_tvc() could call fix_fields() for Items that have
      already been fixed before. Changing fix_fields() to fix_fields_if_needed().
      1408e26d
  5. 14 May, 2020 15 commits