1. 18 Jan, 2023 1 commit
    • Rucha Deodhar's avatar
      MDEV-26392: Crash with json_get_path_next and 10.5.12 · ff72a943
      Rucha Deodhar authored
      Analysis:
      When we skip level when path is found, it changes the state of the json
      engine. This breaks the sequence for json_get_path_next() which is called at
      the end to ensure json document is valid and leads to crash.
      Fix:
      Use json_scan_next() at the end to check if json document has correct
      syntax (is valid).
      ff72a943
  2. 17 Jan, 2023 9 commits
  3. 16 Jan, 2023 1 commit
  4. 15 Jan, 2023 1 commit
  5. 14 Jan, 2023 2 commits
  6. 13 Jan, 2023 8 commits
    • Monty's avatar
      MDEV-30395 Wrong result with semijoin and Federated as outer table · 981a6b70
      Monty authored
      The problem was that federated engine does not support comparable rowids
      which was not taken into account by semijoin code.
      
      Fixed by checking that we don't use semijoin with tables that does not
      support comparable rowids.
      
      Other things:
      - Fixed some typos in the code comments
      981a6b70
    • Monty's avatar
      MDEV-30080 Wrong result with LEFT JOINs involving constant tables · 0595dd0f
      Monty authored
      The reason things fails in 10.5 and above is that test_quick_select()
      returns -1 (impossible range) for empty tables if there are any
      conditions attached.
      
      This didn't happen in 10.4 as the cost for a range was more than for
      a table scan with 0 rows and get_key_scan_params() did not create any
      range plans and thus did not mark the range as impossible.
      
      The code that checked the 'impossible range' conditions did not take
      into account all cases of LEFT JOIN usage.
      
      Adding an extra check if the table is used with an ON condition in case
      of 'impossible range' fixes the issue.
      0595dd0f
    • sjaakola's avatar
      10.4-MDEV-29684 Fixes for cluster wide write conflict resolving · 0ff7f33c
      sjaakola authored
      The rather recent thd_need_ordering_with() function does not take
      high priority transactions' order in consideration. Chaged this
      funtion to compare also transaction seqnos and favor earlier transaction.
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      0ff7f33c
    • sjaakola's avatar
      MDEV-29512 deadlock between commit monitor and THD::LOCK_thd_data mutex · 68cfcf9c
      sjaakola authored
      This commit contains only a mtr test for reproducing the issue in MDEV-29512
      The actual fix will be pushed in wsrep-lib repository
      
      The hanging in MDEV-29512 happens when binlog purging is attempted, and there is
      one local BF aborted transaction waiting for commit monitor.
      
      The test will launch two node cluster and enable binlogging with expire log days,
      to force binlog purging to happen.
      A local transaction is executed so that will become BF abort victim, and has advanced
      to replication stage waiting for commit monitor for final cleanup (to mark position in innodb)
      after that, applier is released to complete the BF abort and due to binlog configuration,
      starting the binlog purging. This is where the hanging would occur, if code is buggy
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      68cfcf9c
    • sjaakola's avatar
      MDEV-30317 Transaction savepoint may cause failure in galera replaying · cd97523d
      sjaakola authored
      Created mtr test for reproducing the crash
      
      Developed actual fix for the issue.
      Setting THD::system_thread_info.rpl_sql_info for replayer thread,
      same way as it is handled for appliers.
      
      Recorded test result, with the fix
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      cd97523d
    • sjaakola's avatar
      MDEV-29684 Fixes for cluster wide write conflict resolving · 66c05326
      sjaakola authored
      Cluster conflict victim's THD is marked with wsrep_aborter.
      THD::wsrep_aorter holds the thread ID of the hight priority tread,
      which is currently carrying out BF aborting for this victim.
      
      However, the BF abort operation is not always successful,
      and in such case the wsrep_aborter mark should be removed.
      In the old code, this wsrep_aborter resetting did not happen,
      and this could lead to a situation where the sticky wsrep_aborter
      mark prevents any further attempt to BF abort this transaction.
      
      This commit fixes this issue, and resets wsrep_aborter after
      unsuccesful BF abort attempt.
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      66c05326
    • Marko Mäkelä's avatar
      Merge 10.4 into 10.5 · 73ecab3d
      Marko Mäkelä authored
      73ecab3d
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · 71e8e493
      Marko Mäkelä authored
      71e8e493
  7. 12 Jan, 2023 5 commits
  8. 11 Jan, 2023 8 commits
    • Monty's avatar
      MDEV-30345 DML does not find rows it is supposed to · f3d8a546
      Monty authored
      This only happens with 'timestamp_column IN (select ...)
      
      The reason was a missing assignment in Item_cache_timestamp::cache_value()
      f3d8a546
    • 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
    • Monty's avatar
      MDEV-30373 Wrong result with range access · 7d1df207
      Monty authored
      This issue was caused by the bug fix for
      MDEV-30325 Wrong result upon range query using index condition
      
      The bug could happen in the case of several overlapping key ranges
      with OR
      7d1df207
    • 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 3 commits
    • Sergei Golubchik's avatar
      Merge branch '10.3' into 10.4 · fdcfc251
      Sergei Golubchik authored
      fdcfc251
    • 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
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-30179 mariabackup --backup fails with FATAL ERROR: ... failed · 17858e03
      Thirunarayanan Balathandayuthapani authored
      			to copy datafile
      
      - Mariabackup fails to copy the undo log tablespace when it undergoes
      truncation. So Mariabackup should detect the redo log which does
      undo tablespace truncation and also backup should read the minimum
      file size of the tablespace and ignore the error while reading.
      
      - Throw error when innodb undo tablespace read failed, but backup
      doesn't find the redo log for undo tablespace truncation
      17858e03
  10. 09 Jan, 2023 2 commits
    • Sergei Golubchik's avatar
      MDEV-17869 AddressSanitizer: use-after-poison in Item_change_list::rollback_item_tree_changes · 6cb84346
      Sergei Golubchik authored
      it's incorrect to use change_item_tree() to replace arguments
      of top-level AND/OR, because they (arguments) are stored in a List,
      so a pointer to an argument is in the list_node, and individual
      list_node's of top-level AND/OR can be deleted in Item_cond::build_equal_items().
      In that case rollback_item_tree_changes() will modify the deleted object.
      
      Luckily, it's not needed to use change_item_tree() for top-level
      AND/OR, because the whole top-level item is copied and preserved
      in prep_where and prep_on, and restored from there.
      
      So, just don't.
      
      Additionally to the test case in the commit it fixes
      * ASAN failure of main.opt_tvc --ps
      * ASAN failure of main.having_cond_pushdown --ps
      6cb84346
    • Sergei Golubchik's avatar
      cleanup · df82d684
      Sergei Golubchik authored
      remove casts. uchar can store 1/0 as good as bool.
      df82d684