1. 24 Jan, 2023 7 commits
    • Vladislav Vaintroub's avatar
      MDEV-30457 Windows, signtool error "No file digest algorithm specified." · 2279ddda
      Vladislav Vaintroub authored
      Add /fd parameter. It is now mandatory for the recent versions of
      signtool
      2279ddda
    • Andrei's avatar
      MDEV-30323 Some DDLs like ANALYZE can complete on parallel slave out of order · 7fe93244
      Andrei authored
      ANALYZE was observed to race over a preceding in binlog order DML
      in updating the binlog and slave gtid states.
      
      Tagging ANALYZE and other admin class commands in binlog by the fixes
      of MDEV-17515 left a flaw allowing such race leading to
      the gtid mode out-of-order error.
      This is fixed now to observe by ADMIN commands the ordered access to
      the slave gtid status variables and binlog.
      7fe93244
    • Andrei's avatar
      MDEV-30010 Slave (additional info): Commit failed due to failure of an earlier... · 3aa04c0d
      Andrei authored
      MDEV-30010 Slave (additional info): Commit failed due to failure of an earlier commit on which this one depends Error_code: 1964
      
      This commit merely adds is a Read-Committed version MDEV-30225 test
      solely to prove the RC isolation yields ROW binlog format as it is
      supposed to per docs.
      3aa04c0d
    • Igor Babaev's avatar
      MDEV-30081 Crash with splitting from constant mergeable derived table · f513d715
      Igor Babaev authored
      This bug manifested itself in very rare situations when splitting
      optimization was applied to a materialized derived table with group clause
      by key over a constant meargeable derived table that was in inner part of
      an outer join. In this case the used tables for the key to access the
      split table incorrectly was evaluated to a not empty table map.
      
      Approved by Oleksandr Byelkin <sanja@mariadb.com>
      f513d715
    • Brandon Nesterenko's avatar
      MDEV-29639: Seconds_Behind_Master is incorrect for Delayed, Parallel Replicas · d69e8357
      Brandon Nesterenko authored
      Problem
      ========
      On a parallel, delayed replica, Seconds_Behind_Master will not be
      calculated until after MASTER_DELAY seconds have passed and the
      event has finished executing, resulting in potentially very large
      values of Seconds_Behind_Master (which could be much larger than the
      MASTER_DELAY parameter) for the entire duration the event is
      delayed. This contradicts the documented MASTER_DELAY behavior,
      which specifies how many seconds to withhold replicated events from
      execution.
      
      Solution
      ========
      After a parallel replica idles, the first event after idling should
      immediately update last_master_timestamp with the time that it began
      execution on the primary.
      
      Reviewed By
      ===========
      Andrei Elkin <andrei.elkin@mariadb.com>
      d69e8357
    • Sergei Petrunia's avatar
      2ed598ea
    • Ian Gilfillan's avatar
      Update 10.3 HELP tables · c4563032
      Ian Gilfillan authored
      c4563032
  2. 23 Jan, 2023 2 commits
    • Igor Babaev's avatar
      MDEV-30248 Infinite sequence of recursive calls when processing embedded CTE · 074bef4d
      Igor Babaev authored
      This patch fixes the patch for bug MDEV-30248 that unsatisfactorily
      resolved the problem of resolution of references to CTE. In some cases
      when such a reference has the same table name as the name of one of
      CTEs containing this reference the reference could be resolved incorrectly
      that led to an invalid select tree where units could be mutually dependent.
      This in its turn could lead to an infinite sequence of recursive calls or
      to falls into infinite loops.
      
      The patch also removes LEX::resolve_references_to_cte_in_hanging_cte() as
      with the new code for resolution of CTE references the call of this
      function is not needed anymore.
      
      Approved by Oleksandr Byelkin <sanja@mariadb.com>
      074bef4d
    • Sergei Petrunia's avatar
      MDEV-15178: Filesort::make_sortorder: Assertion `pos->field != __null | · f18c2b6c
      Sergei Petrunia authored
      (Initial patch by Varun Gupta. Amended and added comments).
      
      When the query has both
      1. Aggregate functions that require sorting data by group, and
      2. Window functions
      
      we need to use two temporary tables. The first temp.table will hold the
      join output.  Then it is passed to filesort(). Reading it in sorted
      order allows to compute the aggregate functions.
      
      Then, we need to write their values into the second temp. table. Then,
      Window Function computation step can pass that to filesort() and read
      them in the order it needs.
      
      Failure to create the second temp. table would cause an assertion
      failure: window function could would not find where to get the values
      of the aggregate functions.
      f18c2b6c
  3. 20 Jan, 2023 4 commits
    • Vicențiu Ciorbaru's avatar
      Fix connect bson.cpp warning · 00150ff8
      Vicențiu Ciorbaru authored
      The ptyp variable is unused.
      00150ff8
    • Vicențiu Ciorbaru's avatar
      Fix mroonga warning of use-after-free · 244bf37c
      Vicențiu Ciorbaru authored
      244bf37c
    • 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
    • Igor Babaev's avatar
      MDEV-30052 Crash with a query containing nested WINDOW clauses · ea270178
      Igor Babaev authored
      Use SELECT_LEX to save lists for ORDER BY and GROUP BY before parsing
      WINDOW clauses / specifications. This is needed for proper parsing
      of a nested WINDOW clause when a WINDOW clause is used in a subquery
      contained in another WINDOW clause.
      
      Fix assignment of empty SQL_I_List to another one (in case of empty list
      next shoud point on first).
      ea270178
  4. 19 Jan, 2023 2 commits
  5. 17 Jan, 2023 1 commit
    • Marko Mäkelä's avatar
      MDEV-30422 Merge new release of InnoDB 5.7.41 to 10.3 · 489b5569
      Marko Mäkelä authored
      MySQL 5.7.41 includes one InnoDB change
      mysql/mysql-server@d2d6b2dd00f709bc528386009150d4bc726e25a0
      that seems to be applicable to MariaDB Server 10.3 and 10.4.
      Even though commit 5b9ee8d8
      seems to have fixed sporadic failures on our CI systems, it is
      theoretically possible that another race condition remained.
      
      buf_flush_page_cleaner_coordinator(): In the final loop,
      wait also for buf_get_n_pending_read_ios() to reach 0.
      In this way, if a secondary index leaf page was read into the
      buffer pool and ibuf_merge_or_delete_for_page() modified that
      page or some change buffer pages, the flush loop would execute
      until the buffer pool really is in a clean state.
      
      This potential data corruption bug does not affect MariaDB Server 10.5
      or later, thanks to commit b42294bc
      which removed change buffer merges that are not explicitly requested.
      489b5569
  6. 16 Jan, 2023 1 commit
  7. 12 Jan, 2023 2 commits
  8. 11 Jan, 2023 6 commits
    • Brandon Nesterenko's avatar
      MDEV-25277: mysqlbinlog --verbose cannot read row events with compressed... · b194c83b
      Brandon Nesterenko authored
      MDEV-25277: mysqlbinlog --verbose cannot read row events with compressed columns: Don't know how to handle column type: 140
      
      Problem:
      =======
      Mysqlbinlog cannot show the type of a compressed
      column when two levels of verbosity is provided.
      
      Solution:
      ========
      Extend the log event printing logic to handle and
      tag compressed types.
      
      Behavioral Changes:
      ==================
        Old: When mysqlbinlog is called in verbose mode and
      the database uses compressed columns, an error is
      returned to the user.
      
        New: The output will append “ COMPRESSED” on the
      type of compressed columns
      
      Reviewed By
      ===========
      Andrei Elkin <andrei.elkin@mariadb.com>
      b194c83b
    • Julius Goryavsky's avatar
      MDEV-30220: rsync SST completely ignores aria-log-dir-path · 53c4be7b
      Julius Goryavsky authored
      This commit adds support for the --aria-log-dir-path
      option on the command line and for the aria-log-dir-path
      option in the configuration file to the SST scripts, since
      before this change these parameters were completely ignored
      during SST - SST scripts assumed that aria logs files are
      always located in the same directory as logs for innodb.
      
      Tests for this change will be added as a separate commit,
      along with tests for MDEV-30157 and MDEV-28669.
      53c4be7b
    • Julius Goryavsky's avatar
      MDEV-30157: Galera SST doesn't properly handle undo* files from innodb · b84f3fa7
      Julius Goryavsky authored
      This fix adds separate handling for "undo*" files that contain undo
      logs as part of innodb files and adds a filter for undo* to the main
      filter used when initially transferring files with rsync.
      b84f3fa7
    • Julius Goryavsky's avatar
      pre-MDEV-30157 & pre-MDEV-28669: fixes before the main corrections · e4a4aad7
      Julius Goryavsky authored
      This commit adds even more correct handling of parameters
      with paths when they contain leading or trailing spaces and/or
      slashes. Also it fixes problems that occur when the user specified
      explicit paths to additional directories, but these paths match
      the specified path of the data directory - in this case, additional
      subdirectories should be treated (in relation to the data directory)
      in the same way as if these paths were not specified or as if they
      are implicitly specified as "." or "./". But prior to this fix,
      existing code treated any values as if they were completely
      separate directories, whether or not they actually point to the
      same location to which datadir points to - and this sometimes
      resulted in incorrect file transfers.
      
      This fix does not contain separate tests, as tests will be
      part of the main commit(s). This fix has been made as a separate
      commit to facilitate review for major substantive fixes related
      to MDEV-30157 and MDEV-28669.
      e4a4aad7
    • Sergei Petrunia's avatar
      MDEV-28602 Wrong result with outer join, merged derived table and view · b928c849
      Sergei Petrunia authored
      (Variant 3, initial variant was by Rex Jonston)
      
      A LEFT JOIN with a constant as a column of the inner table produced wrong
      query result if the optimizer had to write the inner table column into a
      temp table. Query pattern:
      
        SELECT ...
        FROM (SELECT /*non-mergeable select*/
              FROM t1 LEFT JOIN (SELECT 'Y' as Val) t2 ON ...) as tbl
      
      Fixed this by adding Item_direct_view_ref::save_in_field() which follows
      the pattern of Item_direct_view_ref's save_org_in_field(),
      save_in_result_field() and val_XXX() functions:
      * call check_null_ref() and handle NULL value
      * if we didn't get a NULL-complemented row, call Item_direct_ref's function.
      b928c849
    • Marko Mäkelä's avatar
      Remove an unused parameter · b218dfea
      Marko Mäkelä authored
      lock_rec_has_to_wait(): Remove the unused parameter for_locking
      that had been originally added
      in commit df4dd593
      b218dfea
  9. 10 Jan, 2023 1 commit
    • Daniel Black's avatar
      clang15 warnings - unused vars and old prototypes · 56948ee5
      Daniel Black authored
      clang15 finally errors on old prototype definations.
      
      Its also a lot fussier about variables that aren't used
      as is the case a number of time with loop counters that
      aren't examined.
      
      RocksDB was complaining that its get_range function was
      declared without the array length in ha_rocksdb.h. While
      a constant is used rather than trying to import the
      Rdb_key_def::INDEX_NUMBER_SIZE header (was causing a lot of
      errors on the defination of other orders). If the constant
      does change can be assured that the same compile warnings will
      tell us of the error.
      
      The ha_rocksdb::index_read_map_impl DBUG_EXECUTE_IF was similar
      to the existing endless functions used in replication tests.
      Its rather moot point as the rocksdb.force_shutdown test that
      uses myrocks_busy_loop_on_row_read is currently disabled.
      56948ee5
  10. 09 Jan, 2023 1 commit
  11. 07 Jan, 2023 1 commit
  12. 06 Jan, 2023 2 commits
    • Igor Babaev's avatar
      MDEV-27624 Wrong result for nested left join using not_exists optimization · b21832ef
      Igor Babaev authored
      This bug affected queries with nested left joins having the same last inner
      table such that not_exists optimization could be applied to the most inner
      outer join when optimizer chose to use join buffers. The bug could lead to
      producing wrong a result set.
      If the WHERE condition a query contains a conjunctive IS NULL predicate
      over a non-nullable column of an inner table of a not nested outer join
      then not_exists optimization can be applied to tho the outer join. With
      this optimization when looking for matches for a certain record from the
      outer table of the join the records of the inner table can be ignored
      right after the first match satisfying the ON condition is found.
      In the case of nested outer joins having the same last inner table this
      optimization still can be applied but only if all ON conditions of the
      embedding outer joins are satisfied. Such check was missing in the code
      that tried to apply not_exists optimization when join buffers were used
      for outer join operations.
      This problem has been already fixed in the patch for bug MDEV-7992. Yet
      there it was resolved only for the cases when join buffers were not used
      for outer joins.
      
      Approved by Oleksandr Byelkin <sanja@mariadb.com>
      b21832ef
    • 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
  13. 04 Jan, 2023 1 commit
  14. 03 Jan, 2023 1 commit
    • Andrew Hutchings's avatar
      MDEV-30329: mariadb-service-convert resets systemd service to default User=root · e51a1d6f
      Andrew Hutchings authored
      If mariadb-service-convert is run and the user variable is unset then
      this sets `User=` in `[Service]`, which then tries to run mariadb as
      root, which in-turn fails. This only happens when mysqld_safe is missing
      which is all the time now. So don't set `User=` if there is no user variable.
      
      Reviewer: Sergei Golubchik <serg@mariadb.org> (in PR #2382)
      e51a1d6f
  15. 01 Jan, 2023 8 commits