1. 30 Jul, 2020 3 commits
    • Marko Mäkelä's avatar
      MDEV-23334 Crash in rec_get_nth_cfield()/rec_offs_validate() · 6053eb1c
      Marko Mäkelä authored
      rec_get_nth_cfield(): Remove a bogus debug assertion.
      The function may be invoked by innobase_rec_to_mysql()
      for reporting a duplicate key error during CREATE UNIQUE INDEX
      or ALTER TABLE...ADD UNIQUE KEY, and in that case the record
      will be missing the 5-byte or 6-byte fixed header.
      
      It turns out that in every other code path leading to
      rec_get_nth_cfield() we either invoked rec_get_offsets()
      ourselves or asserted rec_offs_validate(). So, we can
      safely remove the assertion and make debug builds
      smaller and faster.
      6053eb1c
    • Vladislav Vaintroub's avatar
      MDEV-21101 skip test for embedded · 0435fcf9
      Vladislav Vaintroub authored
      0435fcf9
    • Vladislav Vaintroub's avatar
      MDEV-21101 unexpected wait_timeout with pool-of-threads · 71015d84
      Vladislav Vaintroub authored
      Due to restricted size of the threadpool, execution of client queries can
      be delayed (queued) for a while. This delay was interpreted as client
      inactivity, and connection is closed, if client idle time + queue time
      exceeds wait_timeout.
      
      But users did not expect queue time to be included into wait_timeout.
      
      This patch changes the behavior. We don't close connection anymore,
      if there is some unread data present on connection,
      even if wait_timeout is exceeded. Unread data means that client
      was not idle, it sent a query, which we did not have time to process yet.
      71015d84
  2. 29 Jul, 2020 1 commit
  3. 23 Jul, 2020 3 commits
    • Marko Mäkelä's avatar
      MDEV-23244 ALTER TABLE…ADD PRIMARY KEY fails to flag duplicates · 1656ea28
      Marko Mäkelä authored
      The fix of MDEV-13654 (commit ff81faf6)
      wrongly caused ADD PRIMARY KEY to ignore duplicate PRIMARY KEY values
      caused by concurrent DML transactions that had been started before the
      ALTER TABLE operation (but did not access the table before the ALTER TABLE
      started).
      
      row_ins_duplicate_online(): Always report a duplicate key error
      if DB_TRX_ID had been reset (it belongs to a transaction that had
      started before the ALTER TABLE operation).
      1656ea28
    • Oleksandr Byelkin's avatar
      A bit more safety · f7adc4a1
      Oleksandr Byelkin authored
      f7adc4a1
    • Oleksandr Byelkin's avatar
      MDEV-22134: handle_fatal_signal (sig=11) in __strlen_avx2 on START SLAVE |... · 0ec641ea
      Oleksandr Byelkin authored
      MDEV-22134: handle_fatal_signal (sig=11) in __strlen_avx2 on START SLAVE | Assertion `global_system_variables.session_track_system_variables' failed in Session_sysvars_tracker::init | *** buffer overflow detected *** (on optimized builds)
      
      Prohibit assigning NULL as for other system variables.
      0ec641ea
  4. 22 Jul, 2020 1 commit
    • Sujatha's avatar
      MDEV-23108: Point in time recovery of binary log fails when sql_mode=ORACLE · c86accc7
      Sujatha authored
      Problem:
      ========
      During point in time recovery of binary log syntax error is reported for
      BEGIN statement and recovery fails.
      
      Analysis:
      =========
      In MariaDB 10.3 and later, setting the sql_mode system variable to Oracle
      allows the server to understand a subset of Oracle's PL/SQL language. When
      sql_mode=ORACLE is set, it switches the parser from the MariaDB parser to
      Oracle compatible parser. With this change 'BEGIN' is not considered as
      'START TRANSACTION'. Hence the syntax error is reported.
      
      Fix:
      ===
      At preset 'BEGIN' query is generated from 'Gtid_log_event::print'. The current
      session specific 'sql_mode' information is not present as part of
      'Gtid_log_event'. If it was available then, mysqlbinlog tool can make use of
      'sql_mode == ORACLE' and can output "START TRANSACTION" in this particular
      mode and for other sql_modes it will write "BEGIN" as part of output. Since it
      is not available 'mysqlbinlog' tool will output all 'BEGIN' statements as
      'START TRANSACTION' irrespective of 'sql_mode'.
      c86accc7
  5. 21 Jul, 2020 2 commits
  6. 20 Jul, 2020 7 commits
    • Aleksey Midenkov's avatar
      MDEV-20661 Virtual fields are not recalculated on system fields value assignment · af83ed9f
      Aleksey Midenkov authored
      Fix stale virtual field value in 4 cases: when virtual field depends
      on row_start/row_end in timestamp/trx_id versioned table. row_start
      dep is recalculated in vers_update_fields() (SQL and InnoDB
      layer). row_end dep is recalculated on history row insert.
      af83ed9f
    • Aleksey Midenkov's avatar
      MDEV-22061 InnoDB: Assertion of missing row in sec index row_start upon... · af57c658
      Aleksey Midenkov authored
      MDEV-22061 InnoDB: Assertion of missing row in sec index row_start upon REPLACE on a system-versioned table
      
      make_versioned_helper() appended new update field unconditionally
      while it should check if this field already exists in update vector.
      
      Misc renames to conform versioning prefix. vers_update_fields() name
      conforms with sql layer TABLE::vers_update_fields().
      af57c658
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · acc58fd8
      Marko Mäkelä authored
      acc58fd8
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · ca9276e3
      Marko Mäkelä authored
      ca9276e3
    • Marko Mäkelä's avatar
      MDEV-23190 InnoDB data file extension is not crash-safe · 57ec42bc
      Marko Mäkelä authored
      When InnoDB is extending a data file, it is updating the FSP_SIZE
      field in the first page of the data file.
      
      In commit 8451e090 (MDEV-11556)
      we removed a work-around for this bug and made recovery stricter,
      by making it track changes to FSP_SIZE via redo log records, and
      extend the data files before any changes are being applied to them.
      
      It turns out that the function fsp_fill_free_list() is not crash-safe
      with respect to this when it is initializing the change buffer bitmap
      page (page 1, or generally, N*innodb_page_size+1). It uses a separate
      mini-transaction that is committed (and will be written to the redo
      log file) before the mini-transaction that actually extended the data
      file. Hence, recovery can observe a reference to a page that is
      beyond the current end of the data file.
      
      fsp_fill_free_list(): Initialize the change buffer bitmap page in
      the same mini-transaction.
      
      The rest of the changes are fixing a bug that the use of the separate
      mini-transaction was attempting to work around. Namely, we must ensure
      that no other thread will access the change buffer bitmap page before
      our mini-transaction has been committed and all page latches have been
      released.
      
      That is, for read-ahead as well as neighbour flushing, we must avoid
      accessing pages that might not yet be durably part of the tablespace.
      
      fil_space_t::committed_size: The size of the tablespace
      as persisted by mtr_commit().
      
      fil_space_t::max_page_number_for_io(): Limit the highest page
      number for I/O batches to committed_size.
      
      MTR_MEMO_SPACE_X_LOCK: Replaces MTR_MEMO_X_LOCK for fil_space_t::latch.
      
      mtr_x_space_lock(): Replaces mtr_x_lock() for fil_space_t::latch.
      
      mtr_memo_slot_release_func(): When releasing MTR_MEMO_SPACE_X_LOCK,
      copy space->size to space->committed_size. In this way, read-ahead
      or flushing will never be invoked on pages that do not yet exist
      according to FSP_SIZE.
      57ec42bc
    • Marko Mäkelä's avatar
      98e2c17e
    • Marko Mäkelä's avatar
      14543afd
  7. 18 Jul, 2020 1 commit
  8. 17 Jul, 2020 1 commit
  9. 16 Jul, 2020 6 commits
    • Julius Goryavsky's avatar
      MDEV-20401: revert unnecessary change · a1e52e7f
      Julius Goryavsky authored
      a1e52e7f
    • Julius Goryavsky's avatar
      MDEV-20401: revert unnecessary change · 1ba8df4c
      Julius Goryavsky authored
      1ba8df4c
    • Julius Goryavsky's avatar
      MDEV-20401: Server incorrectly auto-sets lower_case_file_system value · b3cae9db
      Julius Goryavsky authored
      Server auto-sets lower_case_file_system value based on default
      datadir's behavior instead of instead of using the directory specified
      by the user through the configuration file or command line options.
      
      This patch fixes this problem.
      b3cae9db
    • Julius Goryavsky's avatar
      MDEV-20401: Server incorrectly auto-sets lower_case_file_system value · 4412a461
      Julius Goryavsky authored
      Server auto-sets lower_case_file_system value based on default
      datadir's behavior instead of instead of using the directory specified
      by the user through the configuration file or command line options.
      
      This patch fixes this problem.
      4412a461
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 73aa31fb
      Marko Mäkelä authored
      73aa31fb
    • Marko Mäkelä's avatar
      MDEV-21347 innodb_log_optimize_ddl=OFF is not crash safe · 147d4b1e
      Marko Mäkelä authored
      In commit 0f90728b (MDEV-16809)
      we introduced the configuration option innodb_log_optimize_ddl
      for controlling whether native index creation or table-rebuild
      in InnoDB should avoid writing full redo log.
      
      Fungo Wang reported that this option is causing occasional failures.
      The reason is that pages may be written to data files in an
      inconsistent state. Applying log records to such inconsistent pages
      may fail.
      
      The solution is to always invoke PageBulk::finish() before page latches
      may be released, to ensure that the page contents is in a consistent
      state.
      
      Something similar was implemented in MySQL 8.0.13:
      mysql/mysql-server@d1254b947354e0f5b7223b09c521bd85f22e1e31
      
      buf_block_t::skip_flush_check: Remove. Suppressing consistency checks
      is a bad idea.
      
      PageBulk::needs_finish(): New predicate: Determine whether
      PageBulk::finish() must fix up the page.
      
      PageBulk::init(): Clear PAGE_DIRECTION to ensure that needs_finish()
      will hold. We change the field from PAGE_NO_DIRECTION to 0
      and back without writing redo log. This trick avoids the need
      to introduce any new data member to PageBulk.
      
      PageBulk::insert(): Replace some high-level accessors to bypass
      debug assertions related to PAGE_HEAP_TOP that we will be violating
      until finish() has been executed.
      
      PageBulk::finish(): Tolerate m_rec_no==0. We must invoke this also
      on an empty page, to ensure that PAGE_HEAP_TOP is initialized.
      
      PageBulk::commit(): Always invoke finish().
      
      PageBulk::release(), BtrBulk::pageSplit(), BtrBulk::storeExt(),
      BtrBulk::finish(): Invoke PageBulk::finish().
      147d4b1e
  10. 15 Jul, 2020 5 commits
  11. 14 Jul, 2020 10 commits