1. 14 Oct, 2019 7 commits
    • Sergei Golubchik's avatar
      MDEV-12684 Show what config file a sysvar got a value from · 927521a2
      Sergei Golubchik authored
      make load_defaults() store the file name in the generated option list
      using a special marker ---file-marker--- option.
      
      Pick up this filename in handle_options().
      
      Remove ---args-separator---, use ---file-marker--- with an empty file
      name instead - this simplifies checks on the caller, only one special
      option to recognize.
      927521a2
    • Sergei Golubchik's avatar
      cleanup: don't use my_getopt_is_args_separator() · f7b8d144
      Sergei Golubchik authored
      only my_getopt should use it, because it changes my_getopt's behavior.
      If one simply wants to skip the separator - don't ask it to be added
      in the first place
      f7b8d144
    • Sergei Golubchik's avatar
      cleanup: unify --defaults* option handling · 3e569727
      Sergei Golubchik authored
      process all --defaults* options uniformly,
      get rid of special case for --no-defaults and --print-defaults
      use realpath instead of blindly concatenating pwd and relative path.
      3e569727
    • Sergei Golubchik's avatar
      cleanup: my_getopt, get_one_option isn't optional · 3ea51b51
      Sergei Golubchik authored
      it turns out that practically every single user of handle_options()
      used the get_one_option callback. Simplify the code,
      make it mandatory, adjust unit tests.
      3ea51b51
    • Sergei Golubchik's avatar
      cleanup: my_getopt, consistency · eb3431d5
      Sergei Golubchik authored
      almost all my_getopt settings and callbacks are global variables,
      directly assignable to configure my_getopt. Only getopt_get_addr
      was using a setter function. Get rid of it, make it a global
      directly assignable variable like all other settings.
      
      Also make getopt_compare_strings() static.
      eb3431d5
    • Sergei Golubchik's avatar
      cleanup: my_defaults, remove Process_option_func · 8965ae27
      Sergei Golubchik authored
      This is a remnant of "MySQL Instance Manager", which was removed in
      MySQL-5.5.0 and never existed in MariaDB
      
      Remove callback, simplify and optimize the code accordingly.
      8965ae27
    • Alexander Barkov's avatar
      MDEV-20818 ER_CRASHED_ON_USAGE or Assertion `length <= column->length' failed... · 5392726e
      Alexander Barkov authored
      MDEV-20818 ER_CRASHED_ON_USAGE or Assertion `length <= column->length' failed in write_block_record on temporary table
      
      The patch for `MDEV-20795 CAST(inet6 AS BINARY) returns wrong result`
      unintentionally changed what Item_char_typecast::type_handler()
      returns. This broke UNIONs with the BINARY() function, as the Aria
      engine started to get columns of unexpected data types.
      
      Restoring previous behaviour, to return
        Type_handler::string_type_handler(max_length).
      
      The prototype for Item_handed_func::return_type_handler() has changed
      from:
        const Type_handler *return_type_handler() const
      to:
        const Type_handler *return_type_handler(const Item_handled_func *) const
      5392726e
  2. 13 Oct, 2019 8 commits
  3. 12 Oct, 2019 12 commits
  4. 11 Oct, 2019 13 commits
    • Julius Goryavsky's avatar
      MDEV-20728: /usr/sbin/mysqld: unknown variable 'defaults-group-suffix=mysqld1 · 2ae02c29
      Julius Goryavsky authored
      When the mysqld_multi script passes the --defaults-group-suffix
      option to mysqld, it must remove the initial substring with the
      group name ("mysqld") from option value, because otherwise substring
      "mysqld" will be added to the group name and then the group name
      will contain the word "mysqld" twice, which is wrong, because
      mysqld itself adds the suffix received to the group name.
      2ae02c29
    • Julius Goryavsky's avatar
      MDEV-20728: /usr/sbin/mysqld: unknown variable 'defaults-group-suffix=mysqld1 · 4ca0abe9
      Julius Goryavsky authored
      When the mysqld_multi script passes the --defaults-group-suffix
      option to mysqld, it must remove the initial substring with the
      group name ("mysqld") from option value, because otherwise substring
      "mysqld" will be added to the group name and then the group name
      will contain the word "mysqld" twice, which is wrong, because
      mysqld itself adds the suffix received to the group name.
      4ca0abe9
    • Julius Goryavsky's avatar
      MDEV-20728: /usr/sbin/mysqld: unknown variable 'defaults-group-suffix=mysqld1 · 0ecc85c5
      Julius Goryavsky authored
      When the mysqld_multi script passes the --defaults-group-suffix
      option to mysqld, it must remove the initial substring with the
      group name ("mysqld") from option value, because otherwise substring
      "mysqld" will be added to the group name and then the group name
      will contain the word "mysqld" twice, which is wrong, because
      mysqld itself adds the suffix received to the group name.
      0ecc85c5
    • Julius Goryavsky's avatar
      MDEV-20728: /usr/sbin/mysqld: unknown variable 'defaults-group-suffix=mysqld1 · 36824d2b
      Julius Goryavsky authored
      When the mysqld_multi script passes the --defaults-group-suffix
      option to mysqld, it must remove the initial substring with the
      group name ("mysqld") from option value, because otherwise substring
      "mysqld" will be added to the group name and then the group name
      will contain the word "mysqld" twice, which is wrong, because
      mysqld itself adds the suffix received to the group name.
      36824d2b
    • Alexander Barkov's avatar
    • Marko Mäkelä's avatar
      Fix -std=c++98 -Wzero-length-array · 38736928
      Marko Mäkelä authored
      This is another follow-up fix to
      commit b393e2cb
      which turned out to be still broken.
      
      Replace the C++11 keyword 'constexpr' with #define.
      
      debug_sync_t::str: Remove the zero-length array.
      Replace sync->str with reinterpret_cast<char*>(&sync[1]).
      38736928
    • Marko Mäkelä's avatar
      After-merge fix: Correct an assertion · 1e1b53cc
      Marko Mäkelä authored
      During IMPORT TABLESPACE, we do invoke
      buf_flush_init_for_writing() with block==NULL and newest_lsn!=0.
      1e1b53cc
    • Alexander Barkov's avatar
    • Alexander Barkov's avatar
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · 966d97b5
      Marko Mäkelä authored
      966d97b5
    • Marko Mäkelä's avatar
      Fix CMAKE_BUILD_TYPE=Debug · 1fd1ef25
      Marko Mäkelä authored
      Remove unused variables and type mismatch that was introduced
      in commit b393e2cb
      
      Also, fix a typo in the documentation of the parameter, and
      update the test.
      1fd1ef25
    • Marko Mäkelä's avatar
      MDEV-19514 Defer change buffer merge until pages are requested · b42294bc
      Marko Mäkelä authored
      We will remove the InnoDB background operation of merging buffered
      changes to secondary index leaf pages. Changes will only be merged as a
      result of an operation that accesses a secondary index leaf page,
      such as a SQL statement that performs a lookup via that index,
      or is modifying the index. Also ROLLBACK and some background operations,
      such as purging the history of committed transactions, or computing
      index cardinality statistics, can cause change buffer merge.
      Encryption key rotation will not perform change buffer merge.
      
      The motivation of this change is to simplify the I/O logic and to
      allow crash recovery to happen in the background (MDEV-14481).
      We also hope that this will reduce the number of "mystery" crashes
      due to corrupted data. Because change buffer merge will typically
      take place as a result of executing SQL statements, there should be
      a clearer connection between the crash and the SQL statements that
      were executed when the server crashed.
      
      In many cases, a slight performance improvement was observed.
      
      This is joint work with Thirunarayanan Balathandayuthapani
      and was tested by Axel Schwenke and Matthias Leich.
      
      The InnoDB monitor counter innodb_ibuf_merge_usec will be removed.
      
      On slow shutdown (innodb_fast_shutdown=0), we will continue to
      merge all buffered changes (and purge all undo log history).
      
      Two InnoDB configuration parameters will be changed as follows:
      
      innodb_disable_background_merge: Removed.
      This parameter existed only in debug builds.
      All change buffer merges will use synchronous reads.
      
      innodb_force_recovery will be changed as follows:
      * innodb_force_recovery=4 will be the same as innodb_force_recovery=3
      (the change buffer merge cannot be disabled; it can only happen as
      a result of an operation that accesses a secondary index leaf page).
      The option used to be capable of corrupting secondary index leaf pages.
      Now that capability is removed, and innodb_force_recovery=4 becomes 'safe'.
      * innodb_force_recovery=5 (which essentially hard-wires
      SET GLOBAL TRANSACTION ISOLATION LEVEL READ UNCOMMITTED)
      becomes safe to use. Bogus data can be returned to SQL, but
      persistent InnoDB data files will not be corrupted further.
      * innodb_force_recovery=6 (ignore the redo log files)
      will be the only option that can potentially cause
      persistent corruption of InnoDB data files.
      
      Code changes:
      
      buf_page_t::ibuf_exist: New flag, to indicate whether buffered
      changes exist for a buffer pool page. Pages with pending changes
      can be returned by buf_page_get_gen(). Previously, the changes
      were always merged inside buf_page_get_gen() if needed.
      
      ibuf_page_exists(const buf_page_t&): Check if a buffered changes
      exist for an X-latched or read-fixed page.
      
      buf_page_get_gen(): Add the parameter allow_ibuf_merge=false.
      All callers that know that they may be accessing a secondary index
      leaf page must pass this parameter as allow_ibuf_merge=true,
      unless it does not matter for that caller whether all buffered
      changes have been applied. Assert that whenever allow_ibuf_merge
      holds, the page actually is a leaf page. Attempt change buffer
      merge only to secondary B-tree index leaf pages.
      
      btr_block_get(): Add parameter 'bool merge'.
      All callers of btr_block_get() should know whether the page could be
      a secondary index leaf page. If it is not, we should avoid consulting
      the change buffer bitmap to even consider a merge. This is the main
      interface to requesting index pages from the buffer pool.
      
      ibuf_merge_or_delete_for_page(), recv_recover_page(): Replace
      buf_page_get_known_nowait() with much simpler logic, because
      it is now guaranteed that that the block is x-latched or read-fixed.
      
      mlog_init_t::mark_ibuf_exist(): Renamed from mlog_init_t::ibuf_merge().
      On crash recovery, we will no longer merge any buffered changes
      for the pages that we read into the buffer pool during the last batch
      of applying log records.
      
      buf_page_get_gen_known_nowait(), BUF_MAKE_YOUNG, BUF_KEEP_OLD: Remove.
      
      btr_search_guess_on_hash(): Merge buf_page_get_gen_known_nowait()
      to its only remaining caller.
      
      buf_page_make_young_if_needed(): Define as an inline function.
      Add the parameter buf_pool.
      
      buf_page_peek_if_young(), buf_page_peek_if_too_old(): Add the
      parameter buf_pool.
      
      fil_space_validate_for_mtr_commit(): Remove a bogus comment
      about background merge of the change buffer.
      
      btr_cur_open_at_rnd_pos_func(), btr_cur_search_to_nth_level_func(),
      btr_cur_open_at_index_side_func(): Use narrower data types and scopes.
      
      ibuf_read_merge_pages(): Replaces buf_read_ibuf_merge_pages().
      Merge the change buffer by invoking buf_page_get_gen().
      b42294bc
    • Marko Mäkelä's avatar
      MDEV-20805 follow-up: Catch writes of bogus pages · c0c003be
      Marko Mäkelä authored
      buf_flush_init_for_writing(): Assert that FIL_PAGE_TYPE is set
      except when creating a new data file with a dummy first page.
      
      buf_dblwr_create(): Ensure that FIL_PAGE_TYPE on all pages
      will be initialized. Reset buf_dblwr_being_created at the end.
      c0c003be