1. 20 Nov, 2019 4 commits
  2. 19 Nov, 2019 1 commit
  3. 18 Nov, 2019 4 commits
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · 589a1235
      Marko Mäkelä authored
      589a1235
    • Marko Mäkelä's avatar
      MDEV-13564 follow-up: Remove unused code · 39d8652c
      Marko Mäkelä authored
      DropIndex, CreateIndex: Remove. The file row0trunc.cc only exists
      in MariaDB Server 10.3 so that the crash recovery of TRUNCATE TABLE
      operations from older 10.2 and 10.3 servers will work. This dead code
      was being used for implementing the MySQL 5.7 WL#6501 TRUNCATE TABLE
      that was replaced with a backup-safe implementation in MDEV-13564.
      39d8652c
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 613e1307
      Marko Mäkelä authored
      613e1307
    • Marko Mäkelä's avatar
      MDEV-21069 Crash on DROP TABLE if the data file is corrupted · b80df9eb
      Marko Mäkelä authored
      buf_read_ibuf_merge_pages(): Discard any page numbers that are
      outside the current bounds of the tablespace, by invoking the
      function ibuf_delete_recs() that was introduced in MDEV-20934.
      This could avoid an infinite change buffer merge loop on
      innodb_fast_shutdown=0, because normally the change buffer merge
      would only be attempted if a page was successfully loaded into
      the buffer pool.
      
      dict_drop_index_tree(): Add the parameter trx_t*.
      To prevent the DROP TABLE crash, do not invoke btr_free_if_exists()
      if the entire .ibd file will be dropped. Thus, we will avoid a crash
      if the BTR_SEG_LEAF or BTR_SEG_TOP of the index is corrupted,
      and we will also avoid unnecessarily accessing the to-be-dropped
      tablespace via the buffer pool.
      
      In MariaDB 10.2, we disable the DROP TABLE fix if innodb_safe_truncate=0,
      because the backup-unsafe MySQL 5.7 WL#6501 form of TRUNCATE TABLE
      requires that the individual pages be freed inside the tablespace.
      b80df9eb
  4. 17 Nov, 2019 1 commit
  5. 16 Nov, 2019 1 commit
  6. 15 Nov, 2019 4 commits
    • Sergei Petrunia's avatar
      MDEV-20611: MRR scan over partitioned InnoDB table produces "Out of memory" error · 86167e90
      Sergei Petrunia authored
      Fix partitioning and DS-MRR to work together
      
      - In ha_partition::index_end(): take into account that ha_innobase (and
        other engines using DS-MRR) will have inited=RND when initialized for
        DS-MRR scan.
      - In ha_partition::multi_range_read_next(): if the MRR scan is using
        HA_MRR_NO_ASSOCIATION mode, it is not guaranteed that the partition's
        handler will store anything into *range_info.
      - In DsMrr_impl::choose_mrr_impl(): ha_partition will inquire partitions
        about how much memory their MRR implementation needs by passing
        *buffer_size=0. DS-MRR code didn't know about this (actually it used
        uint for buffer size calculation and would have an under-flow).
        Returning *buffer_size=0 made ha_partition assume that partitions do
        not need MRR memory and pass the same buffer to each of them.
      
        Now, this is fixed. If DS-MRR gets *buffer_size=0, it will return
        the amount of buffer space needed, but not more than about
        @@mrr_buffer_size.
      
      * Fix ha_{innobase,maria,myisam}::clone. If ha_partition uses MRR on its
        partitions, and partition use DS-MRR, the code will call handler->clone
        with TABLE (*NOT partition*) name as an argument.
        DS-MRR has no way of knowing the partition name, so the solution was
        to have the ::clone() function for the affected storage engine to ignore
        the name argument and get it elsewhere.
      86167e90
    • Vladislav Vaintroub's avatar
      Fix a couple of clang-cl warnings · 009674dc
      Vladislav Vaintroub authored
      009674dc
    • Vladislav Vaintroub's avatar
      MDEV-21062 Buildbot, Windows - sporadically missing lines from mtr's "exec" · 6df0bb7d
      Vladislav Vaintroub authored
      
      Provide own version of popen/pclose, in attempt to workaround
      sporadic erratic behavior of UCRT's one.
      6df0bb7d
    • Sergei Golubchik's avatar
      update create_w_max_indexes_128.result · bd2b05df
      Sergei Golubchik authored
      using create_w_max_indexes_64.result as a template
      bd2b05df
  7. 14 Nov, 2019 7 commits
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · 89ae01fd
      Marko Mäkelä authored
      89ae01fd
    • Marko Mäkelä's avatar
      MDEV-20949: Merge 10.3 into 10.4 · 746ee785
      Marko Mäkelä authored
      746ee785
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · 3bee95d7
      Marko Mäkelä authored
      3bee95d7
    • Marko Mäkelä's avatar
      MDEV-12353 preparation: Replace mtr_x_lock() and friends · 3d4a8015
      Marko Mäkelä authored
      Apart from page latches (buf_block_t::lock), mini-transactions
      are keeping track of at most one dict_index_t::lock and
      fil_space_t::latch at a time, and in a rare case, purge_sys.latch.
      
      Let us introduce interfaces for acquiring an index latch
      or a tablespace latch.
      
      In a later version, we may want to introduce mtr_t members
      for holding a latched dict_index_t* and fil_space_t*,
      and replace the remaining use of mtr_t::m_memo
      with std::set<buf_block_t*> or with a map<buf_block_t*,byte*>
      pointing to log records.
      3d4a8015
    • Marko Mäkelä's avatar
      MDEV-20949: Merge 10.2 into 10.3 · 4ded5fb9
      Marko Mäkelä authored
      In the test innodb.instant_alter,4k we would be flagging an error
      for too large row size. That error was previously only being reported
      if the table was being rebuilt. Thus, this merge is fixing a small
      omission in MDEV-11369 (instant ADD COLUMN).
      4ded5fb9
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · bc5cfe77
      Marko Mäkelä authored
      bc5cfe77
    • Sujatha's avatar
      MDEV-20707: Missing memory barrier in parallel replication error handler in wait_for_prior_commit() · caa79081
      Sujatha authored
      revision-id: 673e253724979fd9fe43a4a22bd7e1b2c3a5269e
      Author: Kristian Nielsen
      
      Fix missing memory barrier in wait_for_commit.
      
      The function wait_for_commit::wait_for_prior_commit() has a fast path where it
      checks without locks if wakeup_subsequent_commits() has already been called.
      This check was missing a memory barrier. The waitee thread does two writes to
      variables `waitee' and `wakeup_error', and if the waiting thread sees the
      first write it _must_ also see the second or incorrect behavior will occur.
      This requires memory barriers between both the writes (release semantics) and
      the reads (acquire semantics) of those two variables.
      
      Other accesses to these variables are done under lock or where only one thread
      will be accessing them, and can be done without barriers (relaxed semantics).
      caa79081
  8. 13 Nov, 2019 6 commits
    • Marko Mäkelä's avatar
      MDEV-17138 follow-up: Optimize index page creation · 49019dde
      Marko Mäkelä authored
      btr_create(), btr_root_raise_and_insert(): Write a MLOG_MEMSET record
      to set FIL_PAGE_PREV,FIL_PAGE_NEXT to FIL_NULL, instead of writing
      two MLOG_4BYTES records.
      
      For ROW_FORMAT=COMPRESSED pages, we will not use MLOG_MEMSET
      because we want the crash-downgrade to earlier 10.4 releases to succeed.
      
      mlog_parse_nbytes(): Relax the too strict assertion. There is no problem
      with MLOG_MEMSET records that affect the uncompressed header of
      ROW_FORMAT=COMPRESSED index pages.
      49019dde
    • Sergei Petrunia's avatar
      MDEV-20646: 10.3.18 is slower than 10.3.17 · d4edb051
      Sergei Petrunia authored
      Fix incorrect change introduced in the fix for MDEV-20109.
      
      The patch tried to compute a more precise estimate for the record_count
      value in SJ-Materialization-Scan strategy (in
      Sj_materialization_picker::check_qep).  However the new formula is worse
      as it produces extremely optimistic results in common cases where
      SJ-Materialization-Scan should be used)
      
      The old formula produces pessimistic results in cases when Sj-Materialization-
      Scan is unlikely to be a good choice anyway. So, the old behavior is better.
      d4edb051
    • Eugene Kosov's avatar
      MDEV-20949 Stop issuing 'row size' error on DML · 98694ab0
      Eugene Kosov authored
      Move row size check to early CREATE/ALTER TABLE phase. Stop checking
      on table open.
      
      dict_index_add_to_cache(): remove parameter 'strict', stop checking row size
      
      dict_index_t::record_size_info_t: this is a result of row size check operation
      
      create_table_info_t::row_size_is_acceptable(): performs row size check.
      Issues error or warning. Writes first overflow field to InnoDB log.
      
      create_table_info_t::create_table(): add row size check
      
      dict_index_t::record_size_info(): this is a refactored version
      of dict_index_t::rec_potentially_too_big(). New version doesn't change global
      state of a program but return all interesting info. And it's callers who
      decide how to handle row size overflow.
      
      dict_index_t::rec_potentially_too_big(): removed
      98694ab0
    • Marko Mäkelä's avatar
      Use constexpr for constants on data pages · 2b7aa60b
      Marko Mäkelä authored
      2b7aa60b
    • Marko Mäkelä's avatar
      Clean up mtr_t::commit() further · 3b573c07
      Marko Mäkelä authored
      memo_block_unfix(), memo_latch_release(): Merge to ReleaseLatches.
      
      memo_slot_release(), ReleaseAll: Clean up the formatting.
      3b573c07
    • Marko Mäkelä's avatar
      MDEV-20934: Correct a debug assertion · abd45cdc
      Marko Mäkelä authored
      A search with PAGE_CUR_GE may land on the supremum record on
      a leaf page that is not the rightmost leaf page.
      This could occur when all keys on the current page are
      smaller than the search key, and the smallest key on the
      successor page is larger than the search key.
      
      ibuf_delete_recs(): Correct the debug assertion accordingly.
      abd45cdc
  9. 12 Nov, 2019 10 commits
    • Eugene Kosov's avatar
      cleanup: replace List_iterator(_fast) in handler0alter.cc · ae72205e
      Eugene Kosov authored
      Basically, use more List<T>::iterator. This patch required adding two more
      overloads to new iterator for convenience.
      ae72205e
    • Kentoku SHIBA's avatar
      MDEV-18987 bug in "load data local infile xxx replace into " (#1408) · 83a0eaec
      Kentoku SHIBA authored
      It's just added regression tests.
      83a0eaec
    • Yasuhiro Horimoto's avatar
      Fix a typo in mariadb-plugin-mroonga.prerm · f127fb98
      Yasuhiro Horimoto authored
      Closes #1407
      f127fb98
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · 33cb10d4
      Marko Mäkelä authored
      33cb10d4
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 5098d708
      Marko Mäkelä authored
      5098d708
    • Marko Mäkelä's avatar
      MDEV-12353 preparation: Clean up mtr_t · 2570cb8b
      Marko Mäkelä authored
      mtr_t::Impl, mtr_t::Command: Merge to mtr_t.
      
      MTR_MAGIC_N: Remove.
      
      MTR_STATE_COMMITTING: Remove. This state was only being set
      internally during mtr_t::commit().
      
      mtr_t::Command::m_locks_released: Remove (set-and-never-read member).
      
      mtr_t::Command::m_start_lsn: Replaced with the return value of
      finish_write() and a parameter to release_blocks().
      
      mtr_t::Command::m_end_lsn: Removed as a duplicate of mtr_t::m_commit_lsn.
      
      mtr_t::Command::prepare_write(): Replace a switch () with a
      comparison against 0. Only 2 m_log_mode are allowed.
      2570cb8b
    • Marko Mäkelä's avatar
      MDEV-14602: Cleanup recv_dblwr_t::find_page() · dc8380b6
      Marko Mäkelä authored
      Avoid creating std::vector, and use single instead of double traversal.
      dc8380b6
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · 2350066e
      Marko Mäkelä authored
      2350066e
    • Sujatha's avatar
      MDEV-20953: binlog_encryption.rpl_corruption failed in buildbot due to wrong error code · 7df07c76
      Sujatha authored
      Problem:
      ========
      CURRENT_TEST: binlog_encryption.rpl_corruption
      
      mysqltest: In included file "./include/wait_for_slave_io_error.inc":
      ...
      At line 72: Slave stopped with wrong error code
      **** Slave stopped with wrong error code: 1743 (expected 1595,1913) ****
      
      Analysis:
      ========
      The test emulates the corruption at the various stages of replication for
      example in binlog file, in network and in relay log etc. It verifies that all
      corruption cases are handled through appropriate error messages.
      
      The test cases which emulate network failure expect following errors.
      --ER_SLAVE_RELAY_LOG_WRITE_FAILURE (1595)
      --ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE (1743)
      
      Ideally test should expect error codes as 1595 and 1743.
      But the test actually waits on incorrect error code 1595,1913
      
      Fix:
      ===
      Added appropriate error code for 'ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE'.
      Replaced 1913 with 1743.
      7df07c76
    • Eugene Kosov's avatar
      MDEV-20297 Support C++11 range-based for loop for List<T> · e5f99a0c
      Eugene Kosov authored
      New iterator has the fastest possible implementation: just moves one pointer.
      It's faster that List_iterator and List_iterator_fast: both do more on increment.
      
      Overall patch brings:
      1) work compile times
      2) possibly(!) worse debug build performance
      3) definitely better optimized build performance
      4) ability to write less code
      5) ability to write less bug-prone code
      e5f99a0c
  10. 11 Nov, 2019 2 commits