1. 12 Jun, 2018 1 commit
    • Marko Mäkelä's avatar
      MDEV-16456 InnoDB error "returned OS error 71" complains about wrong path · 8f5f0575
      Marko Mäkelä authored
      When attempting to rename a table to a non-existing database,
      InnoDB would misleadingly report "OS error 71" when in fact the
      error code is InnoDB's own (OS_FILE_NOT_FOUND), and not report
      both pathnames. Errors on rename could occur due to reasons
      connected to either pathname.
      
      os_file_handle_rename_error(): New function, to report errors in
      renaming files.
      8f5f0575
  2. 11 Jun, 2018 2 commits
  3. 07 Jun, 2018 4 commits
    • Vladislav Vaintroub's avatar
      aba2d730
    • Vladislav Vaintroub's avatar
      MDEV-16300 : remove rocksdb checkpoint created by mariabackup. · ea705862
      Vladislav Vaintroub authored
      Add variable rocksdb_remove_mariabackup_checkpoint.
      If set, it will remove $rocksdb_datadir/mariabackup-checkpoint directory.
      The variable is to be used by exclusively by mariabackup,
      to remove temporary checkpoints.
      ea705862
    • Marko Mäkelä's avatar
      MDEV-16367 mariabackup: error: failed to copy enough redo log · dc9c5554
      Marko Mäkelä authored
      log_copying_thread(): Keep copying redo log until the end has been
      reached. (Previously, we would stop copying as soon as
      the first batch of xtrabackup_copy_logfile() returned.)
      
      log_copying: Remove. Use log_copying_running instead.
      
      copy_logfile: Remove. Log copying will now only be invoked from
      2 places: from xtrabackup_backup_func() for the initial batch,
      and from log_copying_thread() until all of the log has been read.
      Use the global variable metadata_to_lsn for determining if the
      final part of the log is being copied.
      
      xtrabackup_copy_log(): Add diagnostic messages for terminating
      the copying. These messages should be dead code, because
      log_group_read_log_seg() should be checking for the same.
      
      xtrabackup_copy_logfile(): Correct the retrying logic.
      If anything was successfully read, process the portion that
      was read. On failure, let the caller close dst_log_file.
      
      io_watching_thread(): Stop throttling during the last phase
      of copying the log (metadata_to_lsn!=0). The final copying
      of the log will now be performed in log_copying_thread().
      
      stop_backup_threads(): Clean up the message about stopping
      the log copying thread.
      
      xtrabackup_backup_low(): Read metadata_to_lsn from the latest
      checkpoint header page, even if it is the first page.
      Let the log_copying_thread take care of copying all of
      the redo log.
      dc9c5554
    • Marko Mäkelä's avatar
      Mariabackup: Make some globals static · 619c277a
      Marko Mäkelä authored
      619c277a
  4. 06 Jun, 2018 2 commits
  5. 05 Jun, 2018 5 commits
  6. 04 Jun, 2018 2 commits
    • Marko Mäkelä's avatar
      MDEV-16376 ASAN: heap-use-after-free in gcol.innodb_virtual_debug · 8dc70c86
      Marko Mäkelä authored
      After a failed ADD INDEX, dict_index_remove_from_cache_low()
      could iterate the index fields and dereference a freed virtual
      column object when trying to remove the index from the v_indexes
      of the virtual column.
      
      This regression was caused by a merge of
      MDEV-16119 InnoDB lock->index refers to a freed object.
      
      ha_innobase_inplace_ctx::clear_added_indexes(): Detach the
      indexes of uncommitted indexes from virtual columns, so that
      the iteration in dict_index_remove_from_cache_low() can be avoided.
      
      ha_innobase::prepare_inplace_alter_table(): Ignore uncommitted
      corrupted indexes when rejecting ALTER TABLE. (This minor bug was
      revealed by the extension of the test case.)
      
      dict_index_t::detach_columns(): Detach an index from virtual columns.
      Invoked by both dict_index_remove_from_cache_low() and
      ha_innobase_inplace_ctx::clear_added_indexes().
      
      dict_col_t::detach(const dict_index_t& index): Detach an index from
      a column.
      
      dict_col_t::is_virtual(): Replaces dict_col_is_virtual().
      
      dict_index_t::has_virtual(): Replaces dict_index_has_virtual().
      8dc70c86
    • Marko Mäkelä's avatar
      MDEV-13834: Upgrade failure from 10.1 innodb_encrypt_log · 5932a4e7
      Marko Mäkelä authored
      log_crypt_101_read_block(): Mimic MariaDB 10.1, and use the first
      encryption key if the key for the checkpoint cannot be found.
      Redo log encryption key rotation was ultimately disabled
      in MDEV-9422 (MariaDB 10.1.13) due to design issues. So, from
      MariaDB 10.1.13 onwards only one log encryption key should matter.
      
      recv_log_format_0_recover(): Add the parameter 'bool crypt'.
      Indicate when the log cannot be decrypted for upgrade, instead of
      making a possibly false claim that the log requires crash recovery.
      
      init_crypt_key(): Remove extra space from a message.
      5932a4e7
  7. 01 Jun, 2018 2 commits
    • gvtek's avatar
      Better Link Spacing · 40dc1a68
      gvtek authored
      Just spacing out the links on separate linkes, they were running together
      in a block of text and could be a little hard for some people to
      differentiate where one begins and the next ends. Seems silly, but just
      trying to help in the formatting a bit.
      40dc1a68
    • Igor Babaev's avatar
      MDEV-16353 Server crash on query with CTE · b2f86ebd
      Igor Babaev authored
      This bug caused crashes for queries with unreferenced non-recursive
      CTEs specified by unions.It happened because the function
      st_select_lex_unit::prepare() tried to use the value of the field 'derived'
      that could not be set for unferenced CTEs as there was no derived
      table associated with an unreferenced CTE.
      b2f86ebd
  8. 30 May, 2018 1 commit
  9. 29 May, 2018 7 commits
    • Vladislav Vaintroub's avatar
      c1698e8d
    • Marko Mäkelä's avatar
      6f96ff72
    • Marko Mäkelä's avatar
      Add an end-marker to ease future merges · 7269c708
      Marko Mäkelä authored
      7269c708
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · 18934fb5
      Marko Mäkelä authored
      18934fb5
    • Marko Mäkelä's avatar
      MDEV-16283 ALTER TABLE...DISCARD TABLESPACE still takes long on a large buffer pool · 6aa50bad
      Marko Mäkelä authored
      Also fixes MDEV-14727, MDEV-14491
      InnoDB: Error: Waited for 5 secs for hash index ref_count (1) to drop to 0
      by replacing the flawed wait logic in dict_index_remove_from_cache_low().
      
      On DISCARD TABLESPACE, there is no need to drop the adaptive hash index.
      We must drop it on IMPORT TABLESPACE, and eventually on DROP TABLE or
      DROP INDEX. As long as the dict_index_t object remains in the cache
      and the table remains inaccessible, the adaptive hash index entries
      to orphaned pages would not do any harm. They would be dropped when
      buffer pool pages are reused for something else.
      
      btr_search_drop_page_hash_when_freed(), buf_LRU_drop_page_hash_batch():
      Remove the parameter zip_size, and pass 0 to buf_page_get_gen().
      
      buf_page_get_gen(): Ignore zip_size if mode==BUF_PEEK_IF_IN_POOL.
      
      buf_LRU_drop_page_hash_for_tablespace(): Drop the adaptive hash index
      even if the tablespace is inaccessible.
      
      buf_LRU_drop_page_hash_for_tablespace(): New global function, to drop
      the adaptive hash index.
      
      buf_LRU_flush_or_remove_pages(), fil_delete_tablespace():
      Remove the parameter drop_ahi.
      
      dict_index_remove_from_cache_low(): Actively drop the adaptive hash index
      if entries exist. This should prevent InnoDB hangs on DROP TABLE or
      DROP INDEX.
      
      row_import_for_mysql(): Drop any adaptive hash index entries for the table.
      
      row_drop_table_for_mysql(): Drop any adaptive hash index for the table,
      except if the table resides in the system tablespace. (DISCARD TABLESPACE
      does not apply to the system tablespace, and we do no want to drop the
      adaptive hash index for other tables than the one that is being dropped.)
      
      row_truncate_table_for_mysql(): Drop any adaptive hash index entries for
      the table, except if the table resides in the system tablespace.
      6aa50bad
    • Marko Mäkelä's avatar
      Fix type mismatch · b7985a45
      Marko Mäkelä authored
      b7985a45
    • Marko Mäkelä's avatar
      MDEV-14589 InnoDB should not lock a delete-marked record · 35a9c90f
      Marko Mäkelä authored
      When the transaction isolation level is SERIALIZABLE, or when
      a locking read is performed in the REPEATABLE READ isolation level,
      InnoDB must lock delete-marked records in order to prevent another
      transaction from inserting something.
      
      However, at READ UNCOMMITTED or READ COMMITTED isolation level or
      when the parameter innodb_locks_unsafe_for_binlog is set, the
      repeatability of the reads does not matter, and there is no need
      to lock any records.
      
      row_search_for_mysql(): Skip locks on delete-marked committed records
      upfront, instead of invoking row_unlock_for_mysql() afterwards.
      The unlocking never worked for secondary index records.
      35a9c90f
  10. 28 May, 2018 2 commits
    • Marko Mäkelä's avatar
      MDEV-13834 10.2 wrongly recognizes 10.1.10 innodb_encrypt_log=ON data as... · 8a42ad7a
      Marko Mäkelä authored
      MDEV-13834 10.2 wrongly recognizes 10.1.10 innodb_encrypt_log=ON data as after-crash and refuses to start
      
      infos[]: Allocate enough entries to accommodate all keys from both
      checkpoint pages.
      
      infos_used: The size of infos[].
      
      get_crypt_info(): Merge to the only caller, log_crypt_101_read_block().
      
      log_crypt_101_read_block(): Do not validate the log block checksum,
      because it will not be valid when upgrading from MariaDB 10.1.10.
      Instead, check that the encryption key exists.
      
      log_crypt_101_read_checkpoint(): Append to infos[] instead of overwriting.
      8a42ad7a
    • Sergei Petrunia's avatar
      MDEV-16310: rocksdb.check_ignore_unknown_options fails on OS X · 1a8afb48
      Sergei Petrunia authored
      Use a compatible xargs command-line arguments.
      1a8afb48
  11. 26 May, 2018 6 commits
  12. 25 May, 2018 1 commit
    • Sergei Golubchik's avatar
      embedded use-after-free ASAN error · 9e22cae1
      Sergei Golubchik authored
      Close MYSQL (and destroy THD) in the same thread where it was used,
      because THD embeds MDL_context, that owns some LF_PINS, that remember
      a pointer to my_thread_var->stack_ends_here.
      9e22cae1
  13. 24 May, 2018 5 commits
    • Vladislav Vaintroub's avatar
      Fix conversion warnings/errors. · b8fdd56a
      Vladislav Vaintroub authored
      b8fdd56a
    • Monty's avatar
      Extend debug_assert_on_not_freed_memory · 7a4f81b4
      Monty authored
      Don't check global_memory_used if
      debug_assert_on_not_freed_memory is not set
      7a4f81b4
    • Monty's avatar
      494c981d
    • Monty's avatar
      Fixed archive to work with record[1] · 72a8d29e
      Monty authored
      ha_archive::max_row_length() and ha_archive::pack_row()
      didn't use record parameter properly. Especially testing
      of null was wrong for record[1]
      72a8d29e
    • Monty's avatar
      MDEV-15243 Crash with virtual fields and row based binary logging · 4cd2a0eb
      Monty authored
      The cause of this was several different bugs:
      
      - When using binary logging with binlog_row_image=FULL
        the all bits in read_set was set, which caused a
        different (wrong) pattern for marking vcol_set.
      - TABLE::mark_virtual_columns_for_write() didn't in all
        cases mark vcol_set with the vcol_field.
      - TABLE::update_virtual_fields() has to update all
        vcol fields on REPLACE if binary logging with FULL
        is used.
      - VCOL_UPDATE_INDEXED should update all vcol fields part
        of an index that was not updated by VCOL_UPDATE_FOR_READ
      - max_row_length() calculated length of NULL and not
        used fields. This didn't cause any crash, but used
        more memory than needed.
      4cd2a0eb