An error occurred fetching the project authors.
  1. 20 Sep, 2024 1 commit
  2. 05 Sep, 2024 1 commit
  3. 17 Jul, 2024 1 commit
  4. 10 Jul, 2024 1 commit
    • Vladislav Vaintroub's avatar
      MDEV-34546 Windows - no error log entries after startup in XAMPP · 9fdc0e54
      Vladislav Vaintroub authored
      The server does not log errors after startup when it is started without the
      --console parameter and not as a service. This issue arises due to an
      undocumented behavior of FreeConsole() in Windows when only a single
      process (mariadbd/mysqld) is attached to it, causing the window to close.
      
      In this case stderr is redirected to a file before FreeConsole()
      is called. Procmon shows FreeConsole closing file handle
      subsequent writes to stderr fail with ERROR_INVALID_HANDLE because
      WriteFile() cannot operate on the closed handle. This results in losing
      all messages after startup, including warnings, errors, notes, and
      crash reports.
      
      Additionally, some users reported stderr being redirected to
      multi-master.info and failing at startup, but this could not be reproduced
      here.
      
      The workaround involves calling FreeConsole() right before the redirection of
      stdout/stderr. This fix has been tested with XAMPP and via cmd.exe using
      "start mysqld". Automated testing using MTR is challenging for this case.
      
      The fix is only applicable to version 10.5. In later versions, the
      FreeConsole() call has been removed.
      9fdc0e54
  5. 02 Jul, 2024 2 commits
    • Monty's avatar
      MDEV-34494 Add server_uid global variable and add it to error log at startup · 2739b5f5
      Monty authored
      The feedback plugin server_uid variable and the calculate_server_uid()
      function is moved from feedback/utils.cc to sql/mysqld.cc
      
      server_uid is added as a global variable (shown in 'show variables') and
      is written to the error log on server startup together with server version
      and server commit id.
      2739b5f5
    • Monty's avatar
      MDEV-34491 Setting log_slow_admin="" at startup should be converted to log_slow_admin=ALL · d8c9c5ea
      Monty authored
      We have an issue if a user have the following in a configuration file:
      log_slow_filter=""                  # Log everything to slow query log
      log_queries_not_using_indexes=ON
      
      This set log_slow_filter to 'not_using_index' which disables
      slow_query_logging of most queries.
      In effect, on should never use log_slow_filter="" in config files but
      instead use log_slow_filter=ALL.
      
      Fixed by changing log_slow_filter="" that comes either from a
      configuration file or from the command line, when starting to the server,
      to log_slow_filter=ALL.
      A warning will be printed when this happens.
      
      Other things:
      - One can now use =ALL for any 'set' variable to set all options at once.
        (backported from 10.6)
      d8c9c5ea
  6. 10 Jun, 2024 1 commit
  7. 08 May, 2024 1 commit
  8. 05 May, 2024 2 commits
  9. 30 Apr, 2024 1 commit
  10. 13 Apr, 2024 1 commit
    • Tony Chen's avatar
      Minor improvements to options error handling · 79706fd3
      Tony Chen authored
      - Add additional MTRs for more coverage on invalid options
      - Updating a few error messages to be more informative
      - Use the exit code from handle_options() when there is an error processing
        user options
      
      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.
      79706fd3
  11. 09 Apr, 2024 1 commit
    • Brandon Nesterenko's avatar
      MDEV-30260: Slave crashed:reload_acl_and_cache during shutdown · 952ab9a5
      Brandon Nesterenko authored
      The signal handler thread can use various different runtime
      resources when processing a SIGHUP (e.g. master-info information)
      due to calling into reload_acl_and_cache(). Currently, the shutdown
      process waits for the termination of the signal thread after
      performing cleanup. However, this could cause resources actively
      used by the signal handler to be freed while reload_acl_and_cache()
      is processing.
      
      The specific resource that caused MDEV-30260 is a race condition for
      the hostname_cache, such that mysqld would delete it in
      clean_up()::hostname_cache_free(), before the signal handler would
      use it in reload_acl_and_cache()::hostname_cache_refresh().
      
      Another similar resource is the active_mi/master_info_index. There
      was a race between its deletion by the main thread in end_slave(),
      and their usage by the Signal Handler as a part of
      Master_info_index::flush_all_relay_logs.read(active_mi) in
      reload_acl_and_cache().
      
      This patch fixes these race conditions by relocating where server
      shutdown waits for the signal handler to die until after
      server-level threads have been killed (i.e., as a last step of
      close_connections()). With respect to the hostname_cache, active_mi
      and master_info_cache, this ensures that they cannot be destroyed
      while the signal handler is still active, and potentially using
      them.
      
      Additionally:
      
       1) This requires that Events memory is still in place for SIGHUP
      handling's mysql_print_status(). So event deinitialization is moved
      into clean_up(), but the event scheduler still needs to be stopped
      in close_connections() at the same spot.
      
       2) The function kill_server_thread is no longer used, so it is
      deleted
      
       3) The timeout to wait for the death of the signal thread was not
      consistent with the comment. The comment mentioned up to 10 seconds,
      whereas it was actually 0.01s. The code has been fixed to wait up to
      10 seconds.
      
       4) A warning has been added if the signal handler thread fails to
      exit in time.
      
       5) Added pthread_join() to end of wait_for_signal_thread_to_end()
      if it hadn't ended in 10s with a warning. Note this also removes
      the pthread_detached attribute from the signal_thread to allow
      for the pthread_join().
      
      Reviewed By:
      ===========
      Vladislav Vaintroub <wlad@mariadb.com>
      Andrei Elkin <andrei.elkin@mariadb.com>
      952ab9a5
  12. 25 Mar, 2024 1 commit
  13. 11 Mar, 2024 1 commit
  14. 20 Feb, 2024 1 commit
  15. 16 Feb, 2024 1 commit
    • Kristian Nielsen's avatar
      MDEV-33443: Unsafe use of LOCK_thd_kill in my_malloc_size_cb_func() · fdaa7a96
      Kristian Nielsen authored
      my_malloc_size_cb_func() can be called from contexts where it is not safe to
      wait for LOCK_thd_kill, for example while holding LOCK_plugin. This could
      lead to (probably very unlikely) deadlock of the server.
      
      Fix by skipping the enforcement of --max-session-mem-used in the rare cases
      when LOCK_thd_kill cannot be obtained. The limit will instead be enforced on
      the following memory allocation. This does not significantly degrade the
      behaviour of --max-session-mem-used; that limit is in any case only enforced
      "softly", not taking effect until the next point at which the thread does a
      check_killed().
      Reviewed-by: default avatarMonty <monty@mariadb.org>
      Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
      fdaa7a96
  16. 13 Feb, 2024 1 commit
  17. 12 Feb, 2024 1 commit
    • Brandon Nesterenko's avatar
      MDEV-29369: rpl.rpl_semi_sync_shutdown_await_ack fails regularly with Result content mismatch · 03d1346e
      Brandon Nesterenko authored
      This test was prone to failures for a few reasons, summarized below:
      
       1) MDEV-32168 introduced “only_running_threads=1” to
      slave_stop.inc, which allowed the stop logic to bypass an
      attempting-to-reconnect IO thread. That is, the IO thread could
      realize the master shutdown in `read_event()`, and thereby call into
      `try_to_reconnect()`. This would leave the IO thread up when the
      test expected it to be stopped. Fixed by explicitly stopping the
      IO thread and allowing an error state, as the above case would
      lead to errno 2003.
      
       2) On slow systems (or those running profiling tools, e.g. MSAN),
      the waiting-for-ack transaction can complete before the system
      processes the `SHUTDOWN WAIT FOR ALL SLAVES`. There was shutdown
      preparation logic in-between the transaction and shutdown itself,
      which contributes to this problem. This patch also moves this
      preparation logic before the transaction, so there is less to do
      in-between the calls.
      
       3) Changed work-around for MDEV-28141 to use debug_sync instead
      of sleep delay, as it was still possible to hit the bug on very
      slow systems.
      
       4) Masked MTR variable reset with disable/enable query log
      
      Reviewed By:
      ============
      Kristian Nielsen <knielsen@knielsen-hq.org>
      03d1346e
  18. 10 Jan, 2024 1 commit
  19. 04 Jan, 2024 1 commit
  20. 05 Nov, 2023 2 commits
  21. 13 Sep, 2023 1 commit
  22. 04 Sep, 2023 1 commit
    • Daniel Black's avatar
      MDEV-25177 Better indication of refusing to start because of ProtectHome · 91ab8194
      Daniel Black authored
      Create test for for case insensitive gives a basic warning on creating
      a test file and the next thing a user might see is an abort.
      
      ProtectHome and other systemd setting protect system services from
      accessing user data. Unfortunately some of our users do put things
      on /home due space or other reasons.
      
      Rather than enumberate the systemd options in a very clunkly fragile
      way we put an error associated with the "Can't create test file" and
      hope the user can work it out from there.
      
      %M tip thanks Sergei.
      91ab8194
  23. 06 Jun, 2023 1 commit
  24. 05 Jun, 2023 1 commit
    • Brandon Nesterenko's avatar
      MDEV-13915: STOP SLAVE takes very long time on a busy system · 0a99d457
      Brandon Nesterenko authored
      The problem is that a parallel replica would not immediately stop
      running/queued transactions when issued STOP SLAVE. That is, it
      allowed the current group of transactions to run, and sometimes the
      transactions which belong to the next group could be started and run
      through commit after STOP SLAVE was issued too, if the last group
      had started committing. This would lead to long periods to wait for
      all waiting transactions to finish.
      
      This patch updates a parallel replica to try and abort immediately
      and roll-back any ongoing transactions. The exception to this is any
      transactions which are non-transactional (e.g. those modifying
      sequences or non-transactional tables), and any prior transactions,
      will be run to completion.
      
      The specifics are as follows:
      
       1. A new stage was added to SHOW PROCESSLIST output for the SQL
      Thread when it is waiting for a replica thread to either rollback or
      finish its transaction before stopping. This stage presents as
      “Waiting for worker thread to stop”
      
       2. Worker threads which error or are killed no longer perform GCO
      cleanup if there is a concurrently running prior transaction. This
      is because a worker thread scheduled to run in a future GCO could be
      killed and incorrectly perform cleanup of the active GCO.
      
       3. Refined cases when the FL_TRANSACTIONAL flag is added to GTID
      binlog events to disallow adding it to transactions which modify
      both transactional and non-transactional engines when the binlogging
      configuration allow the modifications to exist in the same event,
      i.e. when using binlog_direct_non_trans_update == 0 and
      binlog_format == statement.
      
       4. A few existing MTR tests relied on the completion of certain
      transactions after issuing STOP SLAVE, and were re-recorded
      (potentially with added synchronizations) under the new rollback
      behavior.
      
      Reviewed By
      ===========
      Andrei Elkin <andrei.elkin@mariadb.com>
      0a99d457
  25. 26 Apr, 2023 1 commit
  26. 09 Mar, 2023 1 commit
  27. 09 Feb, 2023 1 commit
    • Vicențiu Ciorbaru's avatar
      Apply clang-tidy to remove empty constructors / destructors · 08c85202
      Vicențiu Ciorbaru authored
      This patch is the result of running
      run-clang-tidy -fix -header-filter=.* -checks='-*,modernize-use-equals-default' .
      
      Code style changes have been done on top. The result of this change
      leads to the following improvements:
      
      1. Binary size reduction.
      * For a -DBUILD_CONFIG=mysql_release build, the binary size is reduced by
        ~400kb.
      * A raw -DCMAKE_BUILD_TYPE=Release reduces the binary size by ~1.4kb.
      
      2. Compiler can better understand the intent of the code, thus it leads
         to more optimization possibilities. Additionally it enabled detecting
         unused variables that had an empty default constructor but not marked
         so explicitly.
      
         Particular change required following this patch in sql/opt_range.cc
      
         result_keys, an unused template class Bitmap now correctly issues
         unused variable warnings.
      
         Setting Bitmap template class constructor to default allows the compiler
         to identify that there are no side-effects when instantiating the class.
         Previously the compiler could not issue the warning as it assumed Bitmap
         class (being a template) would not be performing a NO-OP for its default
         constructor. This prevented the "unused variable warning".
      08c85202
  28. 06 Feb, 2023 1 commit
  29. 20 Jan, 2023 1 commit
    • Mikhail Chalov's avatar
      Minimize unsafe C functions usage - replace strcat() and strcpy() (and... · 567b6812
      Mikhail Chalov authored
      Minimize unsafe C functions usage - replace strcat() and strcpy() (and strncat() and strncpy()) with custom safe_strcat() and safe_strcpy() functions
      
      The MariaDB code base uses strcat() and strcpy() in several
      places. These are known to have memory safety issues and their usage is
      discouraged. Common security scanners like Flawfinder flags them. In MariaDB we
      should start using modern and safer variants on these functions.
      
      This is similar to memory issues fixes in 19af1890
      and 9de9f105 but now replace use of strcat()
      and strcpy() with safer options strncat() and strncpy().
      
      However, add '\0' forcefully to make sure the result string is correct since
      for these two functions it is not guaranteed what new string will be null-terminated.
      
      Example:
      
          size_t dest_len = sizeof(g->Message);
          strncpy(g->Message, "Null json tree", dest_len); strncat(g->Message, ":",
          sizeof(g->Message) - strlen(g->Message)); size_t wrote_sz = strlen(g->Message);
          size_t cur_len = wrote_sz >= dest_len ? dest_len - 1 : wrote_sz;
          g->Message[cur_len] = '\0';
      
      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
      
      -- Reviewer and co-author Vicențiu Ciorbaru <vicentiu@mariadb.org>
      -- Reviewer additions:
      * The initial function implementation was flawed. Replaced with a simpler
        and also correct version.
      * Simplified code by making use of snprintf instead of chaining strcat.
      * Simplified code by removing dynamic string construction in the first
        place and using static strings if possible. See connect storage engine
        changes.
      567b6812
  30. 07 Jan, 2023 1 commit
  31. 06 Jan, 2023 1 commit
    • Haidong Ji's avatar
      MDEV-17093: SOURCE_REVISION in log and handle_fatal_signal · af0ff8b4
      Haidong Ji authored
      MariaDB MDEV-12583 added `SOURCE_REVISION` variable that exposes the
      SHA1 of source code commit that the current running engine was built
      from. This info is useful for troubleshooting and debugging.
      
      This commit does the following:
      - addes the `SOURCE_REVISION` value into engine error log.
      - when a crash triggers handle_fatal_signal, the `SOURCE_REVISION` will
        be included in crash report.
      - resolves MDEV-20344: startup messages belong in stderr/error-log not
        stdout
      
      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.
      af0ff8b4
  32. 01 Jan, 2023 1 commit
  33. 17 Nov, 2022 1 commit
    • Alexander Barkov's avatar
      MDEV-29473 UBSAN: Signed integer overflow: X * Y cannot be represented in type... · 6216a2df
      Alexander Barkov authored
      MDEV-29473 UBSAN: Signed integer overflow: X * Y cannot be represented in type 'int' in strings/dtoa.c
      
      Fixing a few problems relealed by UBSAN in type_float.test
      
      - multiplication overflow in dtoa.c
      
      - uninitialized Field::geom_type (and Field::srid as well)
      
      - Wrong call-back function types used in combination with SHOW_FUNC.
        Changes in the mysql_show_var_func data type definition were not
        properly addressed all around the code by the following commits:
          b4ff6456
          18feb62f
          0ee879ff
      
        Adding a helper SHOW_FUNC_ENTRY() function and replacing
        all mysql_show_var_func declarations using SHOW_FUNC
        to SHOW_FUNC_ENTRY, to catch mysql_show_var_func in the future
        at compilation time.
      6216a2df
  34. 28 Oct, 2022 1 commit
  35. 25 Oct, 2022 1 commit
  36. 19 Oct, 2022 1 commit
    • Monty's avatar
      MDEV-29508 perfschema.short_option_1 fails with MSAN - Error in accept · 81ad6787
      Monty authored
      This was caused by the short_option_1-master.opt file that had the
      option -T12, which means (among other things) to use blocking for
      sockets.  This was supported up to MariaDB 10.4, but not in 10.5 where
      we removed the code that changes blocking sockets to non blocking in
      case of errors.
      
      Fixed by ignoring the TEST_BLOCKING flag and also by not using the -T12
      argument in short_option_1.
      
      Other things:
      - Added back support for valgrind (the original issue had nothing to
        do with valgrind).
      - While debugging I noticed that the retry loop in
        handle_connections_sockets() was doing a lot of work during shutdown.
        Fixed by not doing retrys during shutdown.
      81ad6787
  37. 11 Oct, 2022 1 commit
    • Vladislav Vaintroub's avatar
      MDEV-29102 system_time_zone is incorrect on Windows when TZ is set · 4fec99a2
      Vladislav Vaintroub authored
      MDEV-19243 introduced a regression on Windows.
      
      In (supposedly rare) case, where environment variable TZ was set,
      @@system_time_zone no longer derives from TZ. Instead, it incorrecty
      refers to system default time zone, eventhough UTC time conversion
      takes TZ into account.
      
      The fix is to restore TZ-aware handling (timezone name derives from
      tzname), if TZ is set.
      4fec99a2