1. 10 Jan, 2023 2 commits
  2. 06 Jan, 2023 1 commit
  3. 05 Jan, 2023 4 commits
    • Alexander Kuleshov's avatar
      Fix synopses in mysys APIs · d0a534d2
      Alexander Kuleshov authored
      Since 7c58e97b the PSI_memory_key was added to some routines in the
      mysys/. This commit fixes synopses of functions that were updated with
      the PSI_memory_key parameter.
      d0a534d2
    • Monty's avatar
      MDEV-30325 Wrong result upon range query using index condition wrong result... · 494acc19
      Monty authored
      MDEV-30325 Wrong result upon range query using index condition wrong result upon range query using index condition
      
      This was caused by a bug in key_or() when SEL_ARG* key1 has been cloned
      and is overlapping with SEL_ARG *key2
      
      Cloning of SEL_ARG's happens only in very special cases, which is why this
      bug has remained undetected for years.
      
      It happend in the following query:
      
      SELECT COUNT(*) FROM lineitem force index
      (i_l_orderkey_quantity,i_l_shipdate) WHERE
      l_shipdate < '1994-01-01' AND l_orderkey < 800 OR
      l_quantity > 3 AND l_orderkey NOT IN ( 157, 1444 );
      
      Because there are two different indexes that can be used and the code for
      IN causes a 'tree_or', which causes all SEL_ARG's to be cloned.
      
      Other things:
      - While checking the code, I found a bug in SEL_ARG::SEL_ARG(SEL_ARG &arg)
       - This was incrementing next_key_part->use_count as part of creating a
         copy of an existing SEL_ARG.
         This is however not enough as the 'reverse operation' when the copy is
         not needed is 'key2_cpy.increment_use_count(-1)', which does something
         completely different.
         Fixed by calling increment_use_count(1) in SEL_ARG::SEL_ARG.
      494acc19
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-30346 Avoid block device required error in innodb_fts.misc_debug · 12a85c6c
      Thirunarayanan Balathandayuthapani authored
      - Returns DB_LOCK_WAIT_TIMEOUT for the stats_lock_fail
      debug sync point
      12a85c6c
    • Robin Newhouse's avatar
      MDEV-30344 MTR tests fail when built without WSREP · f8f74754
      Robin Newhouse authored
      When building with -DWITH_WSREP=OFF, files required for MTR tests are
      excluded and several tests fail. This is cause by a recent commit
      7b44d0ba which attempted to resolve MDEV-23230.
      
      Even when building without WSREP/Galera support some of the MTR include
      files named *wsrep* are required by other tests.
      
      Removing the following from the CMake install macros will avoid
      excluding the MTR test .inc files:
      `|include/((w.*)?wsrep.*|.*galera.*)\\.inc`
      
      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.
      f8f74754
  4. 04 Jan, 2023 1 commit
  5. 03 Jan, 2023 5 commits
  6. 02 Jan, 2023 1 commit
  7. 01 Jan, 2023 5 commits
  8. 27 Dec, 2022 1 commit
  9. 26 Dec, 2022 4 commits
    • Marko Mäkelä's avatar
      MDEV-25004 Refactorings · 72e2d1d2
      Marko Mäkelä authored
        * Avoid some pessimization
        * Slightly smaller upgrade dataset
        * Simplify vers_row_same_trx() and its caller
      72e2d1d2
    • Aleksey Midenkov's avatar
      MDEV-25004 Missing row in FTS_DOC_ID_INDEX during DELETE HISTORY · e056efdd
      Aleksey Midenkov authored
      1. In case of system-versioned table add row_end into FTS_DOC_ID index
         in fts_create_common_tables() and innobase_create_key_defs().
         fts_n_uniq() returns 1 or 2 depending on whether the table is
         system-versioned.
      
         After this patch recreate of FTS_DOC_ID index is required for
         existing system-versioned tables. If you see this message in error
         log or server warnings: "InnoDB: Table db/t1 contains 2 indexes
         inside InnoDB, which is different from the number of indexes 1
         defined in the MariaDB" use this command to fix the table:
      
            ALTER TABLE db.t1 FORCE;
      
      2. Fix duplicate history for secondary unique index like it was done
         in MDEV-23644 for clustered index (932ec586). In case of
         existing history row which conflicts with currently inseted row we
         check in row_ins_scan_sec_index_for_duplicate() whether that row
         was inserted as part of current transaction. In that case we
         indicate with DB_FOREIGN_DUPLICATE_KEY that new history row is not
         needed and should be silently skipped.
      
      3. Some parts of MDEV-21138 (7410ff43) reverted. Skipping of
         FTS_DOC_ID index for history rows made problems with purge
         system. Now this is fixed differently by p.2.
      
      4. wait_all_purged.inc checks that we didn't affect non-history rows
         so they are deleted and purged correctly.
      
      Additional FTS fixes
      
        fts_init_get_doc_id(): exclude history rows from max_doc_id
        calculation. fts_init_get_doc_id() callback is used only for crash
        recovery.
      
        fts_add_doc_by_id(): set max value for row_end field.
      
        fts_read_stopword(): stopwords table can be system-versioned too. We
        now read stopwords only for current data.
      
        row_insert_for_mysql(): exclude history rows from doc_id validation.
      
        row_merge_read_clustered_index(): exclude history_rows from doc_id
        processing.
      
        fts_load_user_stopword(): for versioned table retrieve row_end field
        and skip history rows. For non-versioned table we retrieve 'value'
        field twice (just for uniformity).
      
      FTS tests for System Versioning now include maybe_versioning.inc which
      adds 3 combinations:
      
      'vers'     for debug build sets sysvers_force and
      	   sysvers_hide. sysvers_force makes every created table
      	   system-versioned, sysvers_hide hides WITH SYSTEM VERSIONING
      	   for SHOW CREATE.
      
      	   Note: basic.test, stopword.test and versioning.test do not
      	   require debug for 'vers' combination. This is controlled by
      	   $modify_create_table in maybe_versioning.inc and these
      	   tests run WITH SYSTEM VERSIONING explicitly which allows to
      	   test 'vers' combination on non-debug builds.
      
      'vers_trx' like 'vers' sets sysvers_force_trx and sysvers_hide. That
      	   tests FTS with trx_id-based System Versioning.
      
      'orig' 	   works like before: no System Versioning is added, no debug is
      	   required.
      
      Upgrade/downgrade test for System Versioning is done by
      innodb_fts.versioning. It has 2 combinations:
      
      'prepare' makes binaries in std_data (requires old server and OLD_BINDIR).
      	  It tests upgrade/downgrade against old server as well.
      
      'upgrade' tests upgrade against binaries in std_data.
      
      Cleanups:
      
      Removed innodb-fts-stopword.test as it duplicates stopword.test
      e056efdd
    • Aleksey Midenkov's avatar
      MDEV-25004 restart_bindir option to restart server from different location · 68c437ba
      Aleksey Midenkov authored
      Adds new parameter $restart_bindir for restart_mysqld.inc.
      
      Example:
      
      let $restart_bindir= /home/midenok/src/mariadb/10.3b/build;
      --source include/restart_mysqld.inc
      
      It is good to return back original server before check_mysqld will be
      run at the test end:
      
      let $restart_bindir=;
      --source include/restart_mysqld.inc
      68c437ba
    • Aleksey Midenkov's avatar
      MDEV-25004 vers_force_trx option to force transactional System Versioning · 5d506ac2
      Aleksey Midenkov authored
      Works like vers_force but forces trx_id-based system-versioned tables
      if the storage supports it (currently InnoDB-only). Otherwise creates
      timestamp-based system-versioned table.
      5d506ac2
  10. 24 Dec, 2022 2 commits
  11. 22 Dec, 2022 2 commits
  12. 21 Dec, 2022 3 commits
  13. 20 Dec, 2022 3 commits
    • Robin Newhouse's avatar
      Fix build failure in sanitizer on GitLab-CI · 76c24028
      Robin Newhouse authored
      Sanitizer tests were introduced in 617f45b for GitLab CI, but started
      failing on latest Fedora version with error:
      
          $ yum install -y /usr/lib64/libasan.so.6.0.0 /usr/lib64/libtsan.so.0.0.0 /usr/lib64/libubsan.so.1.0.0
          Last metadata expiration check: 0:00:51 ago on Fri Dec  9 20:05:01 2022.
          No match for argument: /usr/lib64/libasan.so.6.0.0
          No match for argument: /usr/lib64/libtsan.so.0.0.0
          Error: Unable to find a match: /usr/lib64/libasan.so.6.0.0 /usr/lib64/libtsan.so.0.0.0
      
      The reason for using specific library versions is unknown. Switch to
      simply using latest package versions, as is works and is likely to work
      best in the long run.
      
      Also, enclose "../rpmlist-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log" in
      quotes to avoid `ambiguous redirect` error when $CI_JOB_NAME has spaces.
      
      Additionally use "needs" statements to allow tests to run immediately
      after dependent jobs passed instead of waiting for the full stage to
      complete.
      
      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
      76c24028
    • Vlad Lesin's avatar
      MDEV-30225 RR isolation violation with locking unique search · 3ddc00dc
      Vlad Lesin authored
      Before the fix next-key lock was requested only if a record was
      delete-marked for locking unique search in RR isolation level.
      There can be several delete-marked records for the same unique key,
      that's why InnoDB scans the records until eighter non-delete-marked record
      is reached or all delete-marked records with the same unique key are
      scanned.
      
      For range scan next-key locks are used for RR to protect scanned range from
      inserting new records by other transactions. And this is the reason of why
      next-key locks are used for delete-marked records for unique searches.
      
      If a record is not delete-marked, the requested lock type was "not-gap".
      When a record is not delete-marked during lock request by trx 1, and
      some other transaction holds conflicting lock, trx 1 creates waiting
      not-gap lock on the record and suspends. During trx 1 suspending the
      record can be delete-marked. And when the lock is granted on conflicting
      transaction commit or rollback, its type is still "not-gap". So we have
      "not-gap" lock on delete-marked record for RR. And this let some other
      transaction to insert some record with the same unique key when trx 1 is
      not committed, what can cause isolation level violation.
      
      The fix is to set next-key locks for both delete-marked and
      non-delete-marked records for unique search in RR.
      3ddc00dc
    • Yuchen Pei's avatar
      MDEV-29562 Spider table charset error should happen correctly. · 3f63aa18
      Yuchen Pei authored
      When trying to create a spider table with banned charsets including
      utf32, utf16, ucs2 and utf16le[1], spider should emit an error
      immediately, rather than wait until a separate statement that
      establishes a connection (e.g. SELECT). This also applies to ALTER
      TABLE statement that changes charsets.
      
      [1] https://mariadb.com/kb/en/server-system-variables/#character_set_clientSigned-off-by: default avatarYuchen Pei <yuchen.pei@mariadb.com>
      Reviewed-by: default avatarNayuta Yanagisawa <nayuta.yanagisawa@mariadb.com>
      3f63aa18
  14. 19 Dec, 2022 3 commits
  15. 18 Dec, 2022 1 commit
  16. 16 Dec, 2022 2 commits