1. 10 Oct, 2022 1 commit
    • Alexander Barkov's avatar
      A followup for MDEV-29672 Add MTR tests covering key and key segment flags and types · 34163154
      Alexander Barkov authored
      Adding debug output for key and keyseg flags at ha_myisam::open() time.
      So now there are three points of debug output:
      
      1. In the very end of mysql_prepare_create_table()
      2. In ha_myisam::create(), after the table2myisam() call
      3. In ha_myisan::open(), after the mi_open() call
      
      mi_create(), which is is called between 2 and 3, modifies flags for
      some data types, so the output in 2 and 3 is different.
      34163154
  2. 09 Oct, 2022 5 commits
    • Jan Lindström's avatar
      MDEV-29707 : Incorrect/bad errno on enabling wsrep_on after setting dummy... · f6f9b7fc
      Jan Lindström authored
      MDEV-29707 : Incorrect/bad errno on enabling wsrep_on after setting dummy wsrep_provider on non-Galera build
      
      Fix error message to contain correct errno. This commit was
      tested interactively because mtr will notice if you provide
      wrong wsrep_provider in config and you may not change
      wsrep_provider dynamically.
      f6f9b7fc
    • Jan Lindström's avatar
      MDEV-25389 : Assertion `!is_thread_specific || (mysqld_server_initialized &&... · 0908a049
      Jan Lindström authored
      MDEV-25389 : Assertion `!is_thread_specific || (mysqld_server_initialized && thd)' failed in void my_malloc_size_cb_func(long long int, my_bool)
      
      If wsrep slave thread creation fails for some reason we need to handle
      this error correctly and set actual running slave threads accordingly.
      0908a049
    • Jan Lindström's avatar
      MDEV-26597 : Assertion `!wsrep_has_changes(thd) || (thd->lex->sql_command ==... · e8acec89
      Jan Lindström authored
      MDEV-26597 : Assertion `!wsrep_has_changes(thd) || (thd->lex->sql_command == SQLCOM_CREATE_TABLE && !thd->is_current_stmt_binlog_format_row())' failed.
      
      If repl.max_ws_size is set too low following CREATE TABLE could fail
      during commit. In this case wsrep_commit_empty should allow rolling
      it back if provider state is s_aborted.
      
      Furhermore, original ER_ERROR_DURING_COMMIT does not really tell anything
      clear for user. Therefore, this commit adds a new error
      ER_TOO_BIG_WRITESET. This will change some test cases output.
      e8acec89
    • Jan Lindström's avatar
      MDEV-27123 : auto_increment_increment and auto_increment_offset reset to 1 in... · ab3ec013
      Jan Lindström authored
      MDEV-27123 : auto_increment_increment and auto_increment_offset reset to 1 in current session after alter table on auto-increment column
      
      Problem was that in ALTER TABLE execution variables were set
      to 1 even when wsrep_auto_increment_control is OFF. We should
      set them only when wsrep_auto_increment_control is ON.
      ab3ec013
    • Jan Lindström's avatar
      MDEV-29142 : Assertion `!_current_thd()' failed in void destroy_background_thd(THD*) · 7be82a1f
      Jan Lindström authored
      In test user has set WSREP_ON=OFF this causes streaming replication
      recovery to fail and this caused call to unireg_abort(). However,
      this call is not necessary and we can let transaction to fail. Naturally,
      if real user does this he needs to bootstrap his cluster.
      7be82a1f
  3. 07 Oct, 2022 5 commits
  4. 06 Oct, 2022 3 commits
  5. 05 Oct, 2022 12 commits
    • Marko Mäkelä's avatar
      f600690c
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · 65d0c57c
      Marko Mäkelä authored
      65d0c57c
    • Aleksey Midenkov's avatar
      MDEV-29697 Assertion failure in Diagnostics_area::set_ok_status · 074e3582
      Aleksey Midenkov authored
                 upon CREATE OR REPLACE causing ER_UPDATE_TABLE_USED
      
      Missed set return status to 1.
      074e3582
    • Aleksey Midenkov's avatar
      MDEV-28576 RENAME COLUMN with NOCOPY algorithm leads to corrupt partitioned table · 0779e2cb
      Aleksey Midenkov authored
      When f.ex. table is partitioned by HASH(a) and we rename column `a' to
      `b' partitioning filter stays unchanged: HASH(a). That's the wrong
      behavior.
      
      The patch updates partitioning filter in accordance to the new columns
      names. That includes partition/subpartition expression and
      partition/subpartition field list.
      0779e2cb
    • Aleksey Midenkov's avatar
      MDEV-28576 Ability to manipulate List<const char *> · 4eb8c35b
      Aleksey Midenkov authored
      For "const char *" replace() and after() accepted const as "T *" and
      passed forward "void *". This cannot be cast implicitly, so we better
      use "const void *" instead of "void *" in the input interface. This
      way we avoid problems with using List for any const type.
      4eb8c35b
    • Vlad Lesin's avatar
      MDEV-27927 row_sel_try_search_shortcut_for_mysql() does not latch a page,... · c0eda62a
      Vlad Lesin authored
      MDEV-27927 row_sel_try_search_shortcut_for_mysql() does not latch a page, violating read view isolation
      
      btr_search_guess_on_hash() would only acquire an index page latch if it
      is invoked with ahi_latch=NULL. If it's invoked from
      row_sel_try_search_shortcut_for_mysql() with ahi_latch!=NULL, a page
      will not be latched, and row_search_mvcc() will get a pointer to the
      record, which can be changed by some other transaction before the record
      was stored in result buffer with row_sel_store_mysql_rec() call.
      
      ahi_latch argument of btr_cur_search_to_nth_level_func() and
      btr_pcur_open_with_no_init_func() is used only for
      row_sel_try_search_shortcut_for_mysql().
      btr_cur_search_to_nth_level_func(..., ahi_latch !=0, ...) is invoked
      only from btr_pcur_open_with_no_init_func(..., ahi_latch !=0, ...),
      which, in turns, is invoked only from
      row_sel_try_search_shortcut_for_mysql().
      
      I suppose that separate case with ahi_latch!=0 was intentionally
      implemented to protect row_sel_store_mysql_rec() call in
      row_search_mvcc() just after row_sel_try_search_shortcut_for_mysql()
      call. After the ahi_latch was moved from row_seach_mvcc() to
      row_sel_try_search_shortcut_for_mysql(), there is no need in it at all
      if btr_search_guess_on_hash() latches a page unconditionally. And if
      btr_search_guess_on_hash() latched the page, any access to the record in
      row_sel_try_search_shortcut_for_mysql() after btr_pcur_open_with_no_init()
      call will be protected with the page latch.
      
      The fix is to remove ahi_latch argument from
      btr_pcur_open_with_no_init_func(), btr_cur_search_to_nth_level_func()
      and btr_search_guess_on_hash().
      
      There will not be test, as to test it we need to freeze some SELECT
      execution in the point between row_sel_try_search_shortcut_for_mysql()
      and row_sel_store_mysql_rec() calls in row_search_mvcc(), and to change
      the record in some other transaction to let row_sel_store_mysql_rec() to
      store changed record in result buffer. Buf we can't do this with the
      fix, as the page will be latched in btr_search_guess_on_hash() call.
      c0eda62a
    • Marko Mäkelä's avatar
      MDEV-29710: Valgrind tests massively fail due to silently killing server on shutdown timeout · 111cbdf3
      Marko Mäkelä authored
      Let us disable Valgrind on tests that would fail because a
      server shutdown or a STOP SLAVE command would take longer,
      causing the test harness to forcibly and silently kill the server
      due to an exceeded timeout.
      111cbdf3
    • Marko Mäkelä's avatar
      MDEV-29710: Disable main.log_slow under Valgrind · e0bcff10
      Marko Mäkelä authored
      Under Valgrind, this test may occasionally fail because the sleep-based
      timeouts of less than 1 second could be exceeded.
      e0bcff10
    • Marko Mäkelä's avatar
      MDEV-29710: Disable sys_vars.innodb_flush_method_func under Valgrind · 380e06f8
      Marko Mäkelä authored
      The test could emit some I/O error when run under Valgrind.
      380e06f8
    • Marko Mäkelä's avatar
      c64e2d60
    • Marko Mäkelä's avatar
      Remove HAVE_SNPRINTF · df97eb14
      Marko Mäkelä authored
      This fixes up commit 77c184df
      which explicitly specifies that we use ISO/IEC 9899:1999 (C99),
      which includes the snprintf() function.
      df97eb14
    • Marko Mäkelä's avatar
      MDEV-29666 InnoDB fails to purge secondary index records when indexed virtual columns exist · 1562b2c2
      Marko Mäkelä authored
      row_purge_get_partial(): Replaces trx_undo_rec_get_partial_row().
      Also copy the purge_node_t::ref to the purge_node_t::row.
      In this way, the clustered index key fields will always be
      available, even if thanks to
      commit d384ead0 (MDEV-14799)
      they would no longer be repeated in the remaining part of the
      undo log record.
      1562b2c2
  6. 04 Oct, 2022 2 commits
    • Julius Goryavsky's avatar
      MDEV-27682: bundled wsrep_notify.sh causes mariadbd to freeze during start · 19f0b96d
      Julius Goryavsky authored
      This commit adds automation that will reduce the possibility
      of user errors when customizing wsrep_notify.sh (in particular
      caused by user-specified parameters). Now all leading and trailing
      spaces are removed from the user-specified parameters and automatic
      port and host address substitution has been added to scripts, as
      well as automatic password substitution to the client command line,
      only if it is specified in the wsrep_notify.sh and not as empty
      strings. Also added support for automatic substitution of the all
      SSL-related parameters and improved parsing for ipv6 addresses
      (to allow "[...]" notation for ipv6 addresses). Also added a
      test to check if the wsrep notify script will works with SSL.
      19f0b96d
    • Monty's avatar
      Disable valgrind for test in main that takes > 200 seconds · d1bc469d
      Monty authored
      One can run these with --valgrind --big
      d1bc469d
  7. 03 Oct, 2022 1 commit
    • Vlad Lesin's avatar
      MDEV-29575 Access to innodb_trx, innodb_locks and innodb_lock_waits along with... · c0817dac
      Vlad Lesin authored
      MDEV-29575 Access to innodb_trx, innodb_locks and innodb_lock_waits along with detached XA's can cause SIGSEGV
      
      trx->mysql_thd can be zeroed-out between thd_get_thread_id() and
      thd_query_safe() calls in fill_trx_row(). trx_disconnect_prepared() zeroes out
      trx->mysql_thd. And this can cause null pointer dereferencing in
      fill_trx_row().
      
      fill_trx_row() is invoked from fetch_data_into_cache() under trx_sys.mutex.
      
      Bug fix is in reseting trx_t::mysql_thd in trx_disconnect_prepared() under
      trx_sys.mutex lock too.
      
      MTR test case can't be created for the fix, as we need to wait for
      trx_t::mysql_thd reseting in fill_trx_row() after trx_t::mysql_thd was
      checked for null while trx_sys.mutex is held. But trx_t::mysql_thd must be
      reset in trx_disconnect_prepared() under trx_sys.mutex. There will be deadlock.
      c0817dac
  8. 01 Oct, 2022 3 commits
  9. 30 Sep, 2022 5 commits
  10. 29 Sep, 2022 2 commits
    • Sergei Golubchik's avatar
      fix sporadic failures on main.kill · f9605eb2
      Sergei Golubchik authored
      KILL QUERY ID 0 was sometimes finding con3 that was still in the process
      of disconnecting and had query_id==0 (as it didn't run any queries)
      f9605eb2
    • Igor Babaev's avatar
      MDEV-29361 Infinite recursive calls when detecting CTE dependencies · 28ae3618
      Igor Babaev authored
      This patch resolves the problem of improper name resolution of table
      references to embedded CTEs for some queries. This improper binding could
      lead to
        - infinite sequence of calls of recursive functions
        - crashes due to resolution of null pointers
        - wrong result sets returned by queries
        - bogus error messages
      
      If the definition of a CTE contains with clauses then such CTE is called
      embedding CTE while CTEs from the with clauses are called embedded CTEs.
      If a table reference used in the definition of an embedded CTE cannot be
      resolved within the unit that contains this reference it still may be
      resolved against a CTE definition from the with clause with one of the
      embedding CTEs.
      A table reference can be resolved against a CTE definition if it used in
      the the scope of this definition and it refers to the name of the CTE.
      Table reference t is in the scope of the CTE definition of CTE cte if
      - the definition of cte is an element of a with clause declared as
        RECURSIVE and the reference t belongs either to the unit to which
        this with clause is attached or to one of the elements of this clause
      - the definition of cte is an element of a with clause without RECURSIVE
        specifier and the reference t belongs either to the unit to which this
        with clause is attached or to one of the elements from this clause that
        are placed before the definition of cte.
      If a table reference can be resolved against several CTE definitions then
      it is bound to the most embedded.
      
      The code before this patch not always resolved table references used in
      embedded CTE according to the above rules.
      
      Approved by Oleksandr Byelkin <sanja@mariadb.com>
      28ae3618
  11. 28 Sep, 2022 1 commit
    • Mikhail Chalov's avatar
      Use memory safe snprintf() in Connect Engine and elsewhere (#2210) · 9de9f105
      Mikhail Chalov authored
      Continue with similar changes as done in 19af1890 to replace sprintf(buf, ...)
      with snprintf(buf, sizeof(buf), ...), specifically in the "easy" cases where buf
      is allocated with a size known at compile time.
      
      All new code of the whole pull request, including one or several files that are
      either new files or modified ones, are contributed under the BSD-new license.  I
      am contributing on behalf of my employer Amazon Web Services, Inc.
      9de9f105