1. 30 Jan, 2023 4 commits
  2. 28 Jan, 2023 4 commits
  3. 27 Jan, 2023 1 commit
  4. 26 Jan, 2023 3 commits
    • Sergei Petrunia's avatar
      MDEV-30218: Incorrect optimization for rowid_filtering, correction · c8f9bb27
      Sergei Petrunia authored
      Enable use of Rowid Filter optimization with eq_ref access.
      Use the following assumptions:
      - Assume index-only access cost is 50% of non-index-only access cost.
      - Take into account that "Eq_ref access cache" reduces the number of
        lookups eq_ref access will make.
        = This means the number of Rowid Filter checks is reduced also
        = Eq_ref access cost is computed using that assumption (see
          prev_record_reads() call), so we should use it in all cost '
          computations.
      c8f9bb27
    • Marko Mäkelä's avatar
      MDEV-30404: Inconsistent updates of PAGE_MAX_TRX_ID on ROW_FORMAT=COMPRESSED pages · 672cdcbb
      Marko Mäkelä authored
      page_copy_rec_list_start(): Do not update the PAGE_MAX_TRX_ID
      on the compressed copy of the page. The modification is supposed
      to be logged as part of page_zip_compress() or page_zip_reorganize().
      If the page cannot be compressed (due to running out of space),
      then page_zip_decompress() must be able to roll back the changes.
      
      This fixes a regression that was introduced in
      commit 56f6dab1 (MDEV-21174).
      672cdcbb
    • Oleksandr Byelkin's avatar
      Merge branch '10.3' into 10.4 · dd24fa30
      Oleksandr Byelkin authored
      dd24fa30
  5. 25 Jan, 2023 4 commits
    • Marko Mäkelä's avatar
      e02ed04d
    • Jan Lindström's avatar
      MDEV-30465 : Galera test galera_sr.MDEV-27615 takes 5mins · 8bccba1d
      Jan Lindström authored
      After d7d3ad69 we should use KILL_CONNECTION_HARD to interrupt
      debug_sync waits. Test case uses debug_sync and then disconnects
      connection from cluster.
      8bccba1d
    • Daniel Black's avatar
      CREDITS: re-instate Tencent Cloud · 765291d6
      Daniel Black authored
      This was an accidential deletion looking at an outdated list.
      765291d6
    • Yuchen Pei's avatar
      MDEV-30370 Fixing spider hang when server aborts · 284810b3
      Yuchen Pei authored
      This is Kentoku's patch for MDEV-22979 (e6e41f04 + 22a00977),
      which fixes 30370.
      
      It changes the wait to a timed wait for the first sts thread, which
      waits on server start to execute the init queries for spider. It also
      flips the flag init_command to false when the sts thread is being
      freed. With these changes the sts thread can check the flag regularly
      and abort the init_queries when it finds out the init_command is
      false. This avoids the deadlock that causes the problem in MDEV-30370.
      
      It also fixes MDEV-22979 for 10.4, but not 10.5. I have not tested
      higher versions for MDEV-22979.
      
      A test has also been done on MDEV-29904 to avoid regression, given
      MDEV-27233 is a similar problem and its patch caused the
      regression. The test passes for 10.4-11.0.
      
      However, this adhoc test only works consistently when placed in the
      main testsuite. We should not place spider tests in the main suite, so
      we do not include it in this commit. A patch for MDEV-27912 should fix
      this problem and allow a proper test for MDEV-29904. See comments in
      the jira ticket MDEV-30370/29904 for the adhoc testcase used for this
      commit.
      284810b3
  6. 24 Jan, 2023 8 commits
  7. 23 Jan, 2023 5 commits
    • Ian Gilfillan's avatar
      Update 10.4 HELP tables · 801c0b4b
      Ian Gilfillan authored
      801c0b4b
    • 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
    • Andrei's avatar
      MDEV-30423 Deadlock on Replica during BACKUP STAGE BLOCK_COMMIT on XA transactions · dc646c23
      Andrei authored
      The user XA commit execution branch was caught not have been covered
      with MDEV-21953 fixes.
      
      The XA involved deadlock is resolved now to apply the former fixes
      pattern.
      Along the fixes the following changes have been implemented.
      - MDL lock attribute correction
      - dissociation of the externally completed XA from the current
        thread's xid_state in the error branches
      - cleanup_context() preseves the prepared XA
      - wait_for_prior_commit() is relocated to satisfy both
        the binlog ON (log-slave-updates and skip-log-bin)
        and OFF slave execution branches.
      dc646c23
    • 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
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-30438 innodb.undo_truncate,4k fails when innodb-immediate-scrub-data-uncompressed is enabled · 647a7232
      Thirunarayanan Balathandayuthapani authored
      - InnoDB fails to clear the freed ranges during truncation of innodb
      undo log tablespace. During shutdown, InnoDB flushes the freed page
      ranges and throws the out of bound error.
      
      mtr_t::commit_shrink(): clear the freed ranges while doing undo
      tablespace truncation
      647a7232
  8. 20 Jan, 2023 11 commits
    • Sergei Golubchik's avatar
    • Sergei Golubchik's avatar
      MDEV-26817 runtime error: index 24320 out of bounds for type... · 0c275599
      Sergei Golubchik authored
      MDEV-26817 runtime error: index 24320 out of bounds for type 'json_string_char_classes [128] *and* ASAN: global-buffer-overflow on address ... READ of size 4 on SELECT JSON_VALID
      
      protect from out-of-bound array access
      
      it was already done in all other places, this one was the only one missed
      0c275599
    • Sergei Golubchik's avatar
      MDEV-29199 Unique hash key is ignored upon INSERT ... SELECT into non-empty MyISAM table · fc292f42
      Sergei Golubchik authored
      disable bulk insert optimization if long uniques are used, because they
      need to read the table (index_read) after every inserted now. And bulk
      insert optimization might disable indexes.
      
      bulk insert is already disabled in other cases when there are chances
      that the table will be read duing the bulk insert.
      fc292f42
    • Sergei Golubchik's avatar
      MDEV-27631 Assertion `global_status_var.global_memory_used == 0' failed in mysqld_exit · db50919f
      Sergei Golubchik authored
      plugin_vars_free_values() was walking plugin sysvars and thus
      did not free memory of plugin PLUGIN_VAR_NOSYSVAR vars.
      
      * change it to walk all plugin vars
      * add the pluginname_ prefix to NOSYSVARS var names too,
        so that plugin_vars_free_values() would be able to find their
        bookmarks
      db50919f
    • 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
    • Oleksandr Byelkin's avatar
      d9fbc628
    • Oleksandr Byelkin's avatar
      mysql-5.7.41 · 986276f0
      Oleksandr Byelkin authored
      986276f0
    • Jan Lindström's avatar
    • Oleg Smirnov's avatar
      MDEV-29294 Assertion `functype() == ((Item_cond *) new_item)->functype()'... · b2b9d916
      Oleg Smirnov authored
      MDEV-29294 Assertion `functype() == ((Item_cond *) new_item)->functype()' failed in Item_cond::remove_eq_conds on SELECT
      
      Item_singlerow_subselect may be converted to Item_cond during
      optimization. So there is a possibility of constructing nested
      Item_cond_and or Item_cond_or which is not allowed (such
      conditions must be flattened).
      This commit checks if such kind of optimization has been applied
      and flattens the condition if needed
      b2b9d916