1. 21 Jul, 2020 2 commits
    • Nikita Malyavin's avatar
      fix c++98 build · ebca70ea
      Nikita Malyavin authored
      ebca70ea
    • Nikita Malyavin's avatar
      MDEV-16039 Crash when selecting virtual columns generated using functions with DAYNAME() · 5acd391e
      Nikita Malyavin authored
      * Allocate items on thd->mem_root while refixing vcol exprs
      * Make vcol tree changes register and roll them back after the statement is executed.
      
      Explanation:
      Due to collation implementation specifics an Item tree could change while fixing.
      The tricky thing here is to make it on a proper arena.
      It's usually not a problem when a field is deterministic, however, makes a pain vice-versa, during allocation allocating.
      A non-deterministic field should be refixed on each statement, since it depends on the environment state.
      Changing the tree will be temporary and therefore it should be reverted after the statement execution.
      5acd391e
  2. 20 Jul, 2020 4 commits
    • 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
  3. 18 Jul, 2020 1 commit
  4. 16 Jul, 2020 5 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
      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
  5. 15 Jul, 2020 5 commits
  6. 14 Jul, 2020 9 commits
  7. 13 Jul, 2020 2 commits
  8. 12 Jul, 2020 1 commit
  9. 10 Jul, 2020 1 commit
    • Rucha Deodhar's avatar
      MDEV-19119: main.ssl_crl fails in buildbot with wrong error code · f81ff932
      Rucha Deodhar authored
      The client can only find out if the server has disconnected when it tries to
      read or send something. If the server gets disconnected before
      send_client_reply_packet(), the client will try sending authentication
      information but it will fail. But, if the client is fast enough to send
      autentication information before disconnecting, it will notice that when
      reading the ok packet. So the client can fail on read or on write.
      It is unpredictable because, the process are unsynchronized and this
      could happen in any order.
      f81ff932
  10. 09 Jul, 2020 2 commits
  11. 07 Jul, 2020 2 commits
  12. 06 Jul, 2020 4 commits
    • Rucha Deodhar's avatar
      MDEV-22654: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' · a5366255
      Rucha Deodhar authored
      failed in Diagnostics_area::set_ok_status on FUNCTION replace
      
      When there is REPLACE in the statement, sp_drop_routine_internal() returns
      0 (SP_OK) on success which is then assigned to ret. So ret becomes false
      and the error state is lost. The expression inside DBUG_ASSERT()
      evaluates to false and thus the assertion failure.
      a5366255
    • Vladislav Vaintroub's avatar
      MDEV-23098 mariadb-upgrade-service.exe does not work on WAMPServer · cad9a9b1
      Vladislav Vaintroub authored
      While trying to detect datadir, take into account that one can use
      Windows service name as section name in options file, for Windows service.
      
      The historical obscurity is being used by WAMP installations.
      cad9a9b1
    • Varun Gupta's avatar
      MDEV-22390: Assertion `m_next_rec_ptr >= m_rawmem' failed in... · 6163af93
      Varun Gupta authored
      MDEV-22390: Assertion `m_next_rec_ptr >= m_rawmem' failed in Filesort_buffer::spaceleft | SIGSEGV in __memmove_avx_unaligned_erms from my_b_write
      
      Make sure that the sort_buffer that is allocated has atleast space for MERGEBUFF2 keys.
      The issue here was that the record length is quite high and sort buffer size is very small,
      due to which we end up with zero number of keys in the sort buffer. The Sort_param::max_keys_per_buffer
      was zero in such a case, due to which we were flushing empty sort_buffer to the disk.
      6163af93
    • Daniel Black's avatar
      MDEV-22173: socket accept - test for failure · 3efdac20
      Daniel Black authored
      accept might return an error, including SOCKET_EAGAIN/
      SOCKET_EINTR. The caller, usually handle_connections_sockets
      can these however and invalid file descriptor isn't something
      to call fcntl on.
      
      Thanks to Etienne Guesnet (ATOS) for diagnosis,
      sample patch description and testing.
      3efdac20
  13. 02 Jul, 2020 2 commits