1. 27 Mar, 2024 4 commits
    • Alexander Barkov's avatar
      MDEV-33772 Bad SEPARATOR value in GROUP_CONCAT on character set conversion · 0fc123c5
      Alexander Barkov authored
      Item_func_group_concat::print() did not take into account
      that Item_func_group_concat::separator can be of a different character set
      than the "String *str" (when the printing is being done to).
      Therefore, printing did not work correctly for:
      - non-ASCII separators when GROUP_CONCAT is done on 8bit data
        or multi-byte data with mbminlen==1.
      - all separators (even including simple ones like comma)
        when GROUP_CONCAT is done on ucs2/utf16/utf32 data (mbminlen>1).
      
      Because of this problem, VIEW definitions did not print correctly to
      their FRM files. This later led to a wrong SELECT and SHOW CREATE output.
      
      Fix:
      
      - Adding new String methods:
      
        bool append_for_single_quote_using_mb_wc(const char *str, size_t length,
                                                 CHARSET_INFO *cs);
      
        bool append_for_single_quote_opt_convert(const char *str,
                                                 size_t length,
                                                 CHARSET_INFO *cs)
      
        which perform both escaping and character set conversion at the same time.
      
      - Adding a new String method escaped_wc_for_single_quote(),
        to reuse the code between the old and the new methods.
      
      - Fixing Item_func_group_concat::print() to use the new
        method append_for_single_quote_opt_convert().
      0fc123c5
    • Dave Gosselin's avatar
      MDEV-33460 select '123' 'x'; unexpected result · 58df2097
      Dave Gosselin authored
      Queries that select concatenated constant strings now have
      colname and value that match.  For example,
        SELECT '123' 'x';
      will return a result where the column name and value both
      are '123x'.
      
      Review: Daniel Black
      58df2097
    • Daniel Black's avatar
      MDEV-33301 memlock with systemd still not working · 76a27155
      Daniel Black authored
      .. even with MDEV-9095 fix
      
      CapabilityBounding sets require filesystem setcap attributes
      for the executable to gain privileges during execution.
      
      A side effect of this however is the getauxvec(AT_SECURE) gets
      set, and the secure_getenv from OpenSSL internals on
      OPENSSL_CONF environment variable will get ignored (openssl gh issue
      21770).
      
      According to capabilities(7), Ambient capabilities don't trigger
      ld.so triggering the secure execution mode.
      
      Include SELinux and Apparmor capabilities for ipc_lock
      76a27155
    • Daniel Black's avatar
      Revert "MDEV-33636: RPM caps is on mariadbd exe" · ee2ed1a0
      Daniel Black authored
      This was the orginal implementation that reverted with a bunch of
      commits.
      
      This reverts commit a13e521b.
      
      Revert "cmake: append to the array correctly"
      This reverts commit 51e3f1da.
      
      Revert "build failure with cmake < 3.10"
      This reverts commit 49cf702e.
      
      Revert "MDEV-33301 memlock with systemd still not working"
      This reverts commit 8a1904d7.
      ee2ed1a0
  2. 25 Mar, 2024 2 commits
  3. 22 Mar, 2024 2 commits
  4. 19 Mar, 2024 1 commit
  5. 18 Mar, 2024 3 commits
    • Daniel Black's avatar
      MDEV-33636: RPM caps is on mariadbd exe · a13e521b
      Daniel Black authored
      Postfix on 51e3f1da that
      mariadbd should be the executable name rather than capabilities
      on a symlink.
      a13e521b
    • Marko Mäkelä's avatar
      Work around missing MSAN instrumentation · 4592af2e
      Marko Mäkelä authored
      Let us skip the recently added test main.mysql-interactive if
      an instrumented ncurses library is not available.
      
      In InnoDB, let us work around an uninstrumented libnuma, by
      declaring that the objects returned by numa_get_mems_allowed()
      are initialized.
      4592af2e
    • Marko Mäkelä's avatar
      MDEV-33478: Tests massively fail with clang-18 -fsanitize=memory · 09d991d0
      Marko Mäkelä authored
      Starting with clang-16, MemorySanitizer appears to check that
      uninitialized values not be passed by value nor returned.
      Previously, it was allowed to copy uninitialized data in such cases.
      
      get_foreign_key_info(): Remove a local variable that was passed
      uninitialized to a function.
      
      DsMrr_impl: Initialize key_buffer, because DsMrr_impl::dsmrr_init()
      is reading it.
      
      test_bind_result_ext1(): MYSQL_TYPE_LONG is 32 bits, hence we must
      use a 32-bit type, such as int. sizeof(long) differs between
      LP64 and LLP64 targets.
      09d991d0
  6. 15 Mar, 2024 2 commits
  7. 14 Mar, 2024 5 commits
  8. 13 Mar, 2024 4 commits
  9. 12 Mar, 2024 1 commit
    • Dmitry Shulga's avatar
      MDEV-33549: Incorrect handling of UPDATE in PS mode in case a table's colum declared as NOT NULL · 428a6731
      Dmitry Shulga authored
      UPDATE statement that is run in PS mode and uses positional parameter
      handles columns declared with the clause DEFAULT NULL incorrectly in
      case the clause DEFAULT is passed as actual value for the positional
      parameter of the prepared statement. Similar issue happens in case
      an expression specified in the DEFAULT clause of table's column definition.
      
      The reason for incorrect processing of columns declared as DEFAULT NULL
      is that setting of null flag for a field being updated was missed
      in implementation of the method Item_param::assign_default().
      The reason for incorrect handling of an expression in DEFAULT clause is
      also missed saving of a field inside implementation of the method
      Item_param::assign_default().
      428a6731
  10. 11 Mar, 2024 5 commits
  11. 08 Mar, 2024 1 commit
    • Daniele Sciascia's avatar
      MDEV-33540 Avoid writes to TRX_SYS page during mariabackup operations · 648d2da8
      Daniele Sciascia authored
      Fix a scenario where `mariabackup --prepare` fails with assertion
      `!m_modifications || !recv_no_log_write'  in `mtr_t::commit()`. This
      happens if the prepare step of the backup encounters a data directory
      which happens to store wsrep xid position in TRX SYS page (this is no
      longer the case since 10.3.5). And since MDEV-17458,
      `trx_rseg_array_init()` handles this case by copying the xid position
      to rollback segments, before clearing the xid from TRX SYS page.
      However, this step should be avoided when `trx_rseg_array_init()` is
      invoked from mariabackup. The relevant code was surrounded by the
      condition `srv_operation == SRV_OPERATION_NORMAL`. An additional check
      ensures that we are not trying to copy a xid position which has
      already zeroed.
      648d2da8
  12. 07 Mar, 2024 1 commit
    • mariadb-DebarunBanerjee's avatar
      MDEV-33593 Auto increment deadlock error causes ASSERT in subsequent save point · afe96329
      mariadb-DebarunBanerjee authored
      The issue here is ha_innobase::get_auto_increment() could cause a
      deadlock involving auto-increment lock and rollback the transaction
      implicitly. For such cases, storage engines usually call
      thd_mark_transaction_to_rollback() to inform SQL engine about it which
      in turn takes appropriate actions and close the transaction. In innodb,
      we call it while converting Innodb error code to MySQL.
      
      However, since ::innobase_get_autoinc() returns void, we skip the call
      for error code conversion and also miss marking the transaction for
      rollback for deadlock error. We assert eventually while releasing a
      savepoint as the transaction state is not active.
      
      Since convert_error_code_to_mysql() is handling some generic error
      handling part, like invoking the callback when needed, we should call
      that function in ha_innobase::get_auto_increment() even if we don't
      return the resulting mysql error code back.
      afe96329
  13. 06 Mar, 2024 3 commits
  14. 04 Mar, 2024 1 commit
  15. 03 Mar, 2024 1 commit
  16. 02 Mar, 2024 1 commit
  17. 01 Mar, 2024 2 commits
    • Monty's avatar
      Fixed random failure in main.kill_processlist-6619 · 8b3f470c
      Monty authored
      The problem was that SHOW PROCESSLIST was done before the command of
      the default connection was cleared.
      
      Reviewer: Sergei Golubchik <serg@mariadb.org>
      8b3f470c
    • Tony Chen's avatar
      MDEV-26923 Check all invalid config options · 32546877
      Tony Chen authored
      Previously, the behavior was to error out on the first invalid option
      encountered. With this change, a best effort approach is made so that
      all invalid options processed will be printed before exiting.
      
      There is a caveat. The options are processed many times at varying
      stages of server startup because the server is not aware of all valid
      options immediately (e.g. plugins have to be loaded first before the
      server knows what are the available plugin options). So, there are some
      options that the server can determine are invalid "early" on, and there
      are some options that the server cannot determine are invalid until
      "later" on. For example, the server can determine an option such as
      `--a` is an ambiguous option very early on but an option such as
      `--this-does-not-match-any-option` cannot be labelled as invalid until
      the server is aware of all available options.
      
      Thus, it is possible that the server will still fail before printing out
      all "invalid" options. You can see this by passing `--a
      --obvious-invalid-option`.
      
      Test cases were added to `mysqld_option_err.test` to validate that
      multiple invalid options will be displayed in the error message.
      
      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.
      32546877
  18. 27 Feb, 2024 1 commit
    • mariadb-DebarunBanerjee's avatar
      MDEV-33011 mariabackup --backup: FATAL ERROR: ... Can't open datafile cool_down/t3 · 96966976
      mariadb-DebarunBanerjee authored
      The root cause is the WAL logging of file operation when the actual
      operation fails afterwards. It creates a situation with a log entry for
      a operation that would always fail. I could simulate both the backup
      scenario error and Innodb recovery failure exploiting the weakness.
      
      We are following WAL for file rename operation and once logged the
      operation must eventually complete successfully, or it is a major
      catastrophe. Right now, we fail for rename and handle it as normal error
      and it is the problem.
      
      I created a patch to address RENAME operation to a non existing schema
      where the destination schema directory is missing. The patch checks for
      the missing schema before logging in an attempt to avoid the failure
      after WAL log is written/flushed. I also checked that the schema cannot
      be dropped or there cannot be any race with other rename to the same
      file. This is protected by the MDL lock in SQL today.
      
      The patch should this be a good improvement over the current situation
      and solves the issue at hand.
      96966976