1. 17 Dec, 2023 2 commits
  2. 15 Dec, 2023 1 commit
  3. 14 Dec, 2023 3 commits
    • Marko Mäkelä's avatar
      MDEV-18322 Assertion "wrong page type" on instant ALTER TABLE · 655f78a2
      Marko Mäkelä authored
      row_ins_clust_index_entry_low(): Invoke btr_set_instant() in the same
      mini-transaction that has successfully inserted the metadata record.
      In this way, if inserting the metadata record fails before any
      undo log record was written for it, the index root page will remain
      consistent.
      
      innobase_instant_try(): Remove the btr_set_instant() call.
      
      This is a 10.6 version of c17aca2f.
      
      Tested by: Matthias Leich
      Reviewed by: Thirunarayanan Balathandayuthapani
      655f78a2
    • Marko Mäkelä's avatar
      MDEV-32939 If tables are frequently created, renamed, dropped, a backup cannot be restored · f21a6cbf
      Marko Mäkelä authored
      During mariadb-backup --backup, a table could be renamed, created and
      dropped. We could have both oldname.ibd and oldname.new, and one of
      the files would be deleted before the InnoDB recovery starts. The desired
      end result would be that we will recover both oldname.ibd and newname.ibd.
      
      During normal crash recovery, at most one file operation (create, rename,
      delete) may require to be replayed from the write-ahead log before the
      DDL recovery starts.
      
      deferred_spaces.create(): In mariadb-backup --prepare, try to create the
      file in case it does not exist.
      
      fil_name_process(): Display a message about not found files not only
      if innodb_force_recovery is set, but also in mariadb-backup --prepare.
      If we are processing a FILE_RENAME for a tablespace whose recovery is
      deferred, suppress the message and adjust the file name in case
      fil_ibd_load() returns FIL_LOAD_NOT_FOUND or FIL_LOAD_DEFER.
      
      fil_ibd_load(): Remove a redundant file name comparison.
      The caller already compared that the file names are different.
      We used to wrongly return FIL_LOAD_OK instead of FIL_LOAD_ID_CHANGED
      if only the schema name differed, such as a/t1.ibd and b/t1.ibd.
      
      Tested by: Matthias Leich
      Reviewed by: Thirunarayanan Balathandayuthapani
      f21a6cbf
    • Marko Mäkelä's avatar
      0f510d8b
  4. 13 Dec, 2023 1 commit
    • Daniel Black's avatar
      MDEV-33006 Missing required privilege CONNECTION ADMIN · 2c60d43d
      Daniel Black authored
      opt_kill_long_query_type being an enum could be 0 corresponding
      to ALL. When ALL is specified, the CONNECTION ADMIN is still
      required.
      
      Also check REPLICA MONITOR privilege and make the tests
      find the results by recording stderr.
      
      Noticed thanks to bug report by Tim van Dijen.
      
      Fixes: 79b58f1c
      2c60d43d
  5. 12 Dec, 2023 9 commits
  6. 11 Dec, 2023 5 commits
    • Kristian Nielsen's avatar
      MDEV-29816 rpl.rpl_parallel_29322 occasionally fails in BB · da9ffca9
      Kristian Nielsen authored
      Make sure the old binlog dump thread is not still running when manipulating
      binlog files; otherwise there is a small chance it will see an invalid
      partial file and report an I/O error.
      Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
      da9ffca9
    • Marko Mäkelä's avatar
      MDEV-16264 fixup: Remove a useless test · 1e80601b
      Marko Mäkelä authored
      Let us remove a test that frequently fails with a result difference.
      This test had been added in fc279d7e
      to cover a bug in thd_destructor_proxy(), which was replaced with
      simpler logic in 5e62b6a5 (MDEV-16264).
      1e80601b
    • Dmitry Shulga's avatar
      MDEV-31296: Crash in Item_func::fix_fields when prepared statement with... · 47f2b16a
      Dmitry Shulga authored
      MDEV-31296: Crash in Item_func::fix_fields when prepared statement with subqueries and window function is executed with sql_mode = ONLY_FULL_GROUP_BY
      
      Crash was caused by referencing a null pointer on getting
      the number of the nesting levels of the set function for the current
      select_lex at the method Item_field::fix_fields.
      
      The current select for processing is taken from Name_resolution_context
      that filled in at the function set_new_item_local_context() and
      where initialization of the data member Name_resolution_context
      was mistakenly removed by the commit
        d6ee351b
         (Revert "MDEV-24454 Crash at change_item_tree")
      
      To fix the issue, correct initialization of data member
        Name_resolution_context::select_lex
      that was removed by the commit d6ee351b
      is restored.
      47f2b16a
    • Alexander Barkov's avatar
      MDEV-17226 Column Data in Truncated on UNION to the length of the first value if using REPLACE · 03ee23bc
      Alexander Barkov authored
      This problem was earlier fixed by:
        commit 55b27888
      
      Adding MTR tests only.
      03ee23bc
    • Alexander Barkov's avatar
      MDEV-32958 Unusable key notes do not get reported for some operations · 4ced4898
      Alexander Barkov authored
      Enable unusable key notes for non-equality predicates:
         <, <=, =>, >, BETWEEN, IN, LIKE
      
      Note, in some scenarios it displays duplicate notes, e.g.
      for queries with ORDER BY:
      
        SELECT * FROM t1
        WHERE    indexed_string_column >= 10
        ORDER BY indexed_string_column
        LIMIT 5;
      
      This should be tolarable. Getting rid of the diplicate note
      completely would need a much more complex patch, which is
      not desiable in 10.6.
      
      Details:
      
      - Changing RANGE_OPT_PARAM::note_unusable_keys from bool
        to a new data type Item_func::Bitmap, so the caller can
        choose with a better granuality which predicates
        should raise unusable key notes inside the range optimizer:
          a. all predicates (=, <=>, <, <=, =>, >, BETWEEN, IN, LIKE)
          b. all predicates except equality (=, <=>)
          c. none of the predicates
      
        "b." is needed because in some scenarios equality predicates (=, <=>)
        send unusable key notes at an earlier stage, before the range optimizer,
        during update_ref_and_keys(). Calling the range optimizer with
        "all predicates" would produce duplicate notes for = and <=> in such cases.
      
      - Fixing get_quick_record_count() to call the range optimizer
        with "all predicates except equality" instead of "none of the predicates".
        Before this change the range optimizer suppressed all notes for
        non-equality predicates: <, <=, =>, >, BETWEEN, IN, LIKE.
        This actually fixes the reported problem.
      
      - Fixing JOIN::make_range_rowid_filters() to call the range optimizer
        with "all predicates except equality" instead of "all predicates".
        Before this change the range optimizer produced duplicate notes
        for = and <=> during a rowid_filter optimization.
      
      - Cleanup:
        Adding the op_collation argument to Field::raise_note_cannot_use_key_part()
        and displaying the operation collation rather than the argument collation
        in the unusable key note. This is important for operations with more than
        two arguments: BETWEEN and IN, e.g.:
      
          SELECT * FROM t1
          WHERE column_utf8mb3_general_ci
                BETWEEN 'a' AND 'b' COLLATE utf8mb3_unicode_ci;
      
          SELECT * FROM t1
          WHERE column_utf8mb3_general_ci
                IN ('a', 'b' COLLATE utf8mb3_unicode_ci);
      
          The note for 'a' now prints utf8mb3_unicode_ci as the collation.
          which is the collation of the entire operation:
      
            Cannot use key key1 part[0] for lookup:
            "`column_utf8mb3_general_ci`" of collation `utf8mb3_general_ci` >=
            "'a'" of collation `utf8mb3_unicode_ci`
      
          Before this change it printed the collation of 'a',
          so the note was confusing:
      
            Cannot use key key1 part[0] for lookup:
            "`column_utf8mb3_general_ci`" of collation `utf8mb3_general_ci` >=
            "'a'" of collation `utf8mb3_general_ci`"
      4ced4898
  7. 10 Dec, 2023 1 commit
  8. 08 Dec, 2023 3 commits
  9. 07 Dec, 2023 15 commits
    • Brandon Nesterenko's avatar
      MDEV-32953: main.rpl_mysqldump_slave Fails with "Master binlog wasn’t deleted" Assertion · 9be7e03f
      Brandon Nesterenko authored
      Because --delete-master-logs immediately purges logs after flushing,
      it is possible the binlog dump thread would still be using the old
      log when the purge executes, disallowing the file from being
      deleted.
      
      This patch institutes a work-around in the test as follows:
       1) temporarily stop the slave so there is no chance the old binlog
      is still being referenced.
       2) set master_use_gtid=Slave_pos so the slave can still appear
      up-to-date on the master after the master flushes/purges its logs
      (while the slave is offline). Otherwise (i.e. if using binlog
      file/pos), the slave would point to a purged log file, and receive
      an error immediately upon connecting to the master.
      
      Reviewed By
      ============
      Andrei Elkin <andrei.elkin@mariadb.com>
      9be7e03f
    • Andrew Hutchings's avatar
      MDEV-32884 Improve S3 options comaptibility · bc5e9040
      Andrew Hutchings authored
      The previous commit for MDEV-32884 fixed the s3_protocol_version option,
      which was previous only using "Auto", no matter what it was set to. This
      patch does several things to keep the old behaviour whilst correcting
      for new behaviour and laying the groundwork for the future. This
      includes:
      
      * `Original` now means v2 protocol, which it would have been due to the
        option not working, so upgrades will stil work.
      * A new `Legacy` option has been added to mean v1 protocol.
      * Options `Path` and `Domain` have been added, these will be the only
        two options apart from `Auto` in a future release, and are more
        aligned with what this variable means.
      * Fixed the s3.debug test so that it works with v2 protocol.
      * Fixed the s3.amazon test so that it works with region subdomains.
      * Added additional modes to the s3.amazon test.
      * Added s3.not_amazon test for the remaining modes.
      
      This replaces PR #2902.
      bc5e9040
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-32242 innodb.doublewrite test case always gets skipped · d5a6ea36
      Thirunarayanan Balathandayuthapani authored
      - Split the doublewrite test into two test (doublewrite,
      doublewrite_debug) to reduce the execution time of the test
      - Removed big_test tag for the newly added test case
      - Made doublewrite test as non-debug test
      - Added search pattern to make sure that InnoDB uses doublewrite buffer
      - Replaced all kill_mysqld.inc with shutdown_mysqld.inc and
      zero shutdown timeout
      - Removed the case where fsp_flags got corrupted. Because from commit
      3da5d047 (MDEV-31851) onwards,
      doublewrite buffer removes the conversion the fsp flags from buggy
      10.1 format
      
      Thanks to Marko Mäkelä for providing the non-debug test
      d5a6ea36
    • Yuchen Pei's avatar
      Merge branch '10.4' into 10.5 · c33ca17c
      Yuchen Pei authored
      c33ca17c
    • Yuchen Pei's avatar
      Merge branch '10.4' into 10.5 · 13dd7875
      Yuchen Pei authored
      13dd7875
    • Yuchen Pei's avatar
      MDEV-32753 Make spider init queries compatible with oracle sql mode · ba94778d
      Yuchen Pei authored
      Remove ORACLE from the (session) sql_mode in connections made with sql
      service to run init queries
      
      The connection is new and the global variable value takes effect
      rather than the session value from the caller of spider_db_init.
      ba94778d
    • Sergei Golubchik's avatar
      MDEV-32683 Spider engine does not load with non-default alter-algorithm · 69389c03
      Sergei Golubchik authored
      specify algorithm/lock explicitly, don't depend on server settings
      69389c03
    • Yuchen Pei's avatar
    • Yuchen Pei's avatar
      MDEV-32507 Spider: Use $MTR_SUITE_DIR for init-file files · 30af9872
      Yuchen Pei authored
      This should fix certain CI builds where the spider suite test files
      and the main suite test files do not follow the same relative paths
      relations as the mariadb source.
      30af9872
    • Yuchen Pei's avatar
      MDEV-32515 Use $MYSQLD_LAST_CMD in spider/bugfix.mdev_30370 · 70283aca
      Yuchen Pei authored
      $MYSQLD_CMD uses .1 as the defaults-group-suffix, which could cause
      the use of the default port (3306) or socket, which will fail in
      environment where these defaults are already in use by another server.
      
      Adding an extra --defaults-group-suffix=.1.1 does not help, because
      the first flag wins.
      
      So we use $MYSQLD_LAST_CMD instead, which uses the correct suffix.
      
      The extra innodb buffer pool warning is irrelevant to the goal of the
      test (running --wsrep-recover with --plug-load-add=ha_spider should
      not cause hang)
      70283aca
    • Yuchen Pei's avatar
      MDEV-22979 MDEV-27233 MDEV-28218 Fixing spider init bugs · d8f5d2be
      Yuchen Pei authored
      Fix spider init bugs (MDEV-22979, MDEV-27233, MDEV-28218) while
      preventing regression on old ones (MDEV-30370, MDEV-29904)
      
      Two things are changed:
      
      First, Spider initialisation is made fully synchronous, i.e. it no
      longer happens in a background thread. Adapted from the original fix
      by nayuta for MDEV-27233. This change itself would cause failure when
      spider is initialised early, by plugin-load-add, due to dependency on
      Aria and udf function creation, which are fixed in the second and
      third parts below. Requires SQL Service, thus porting earlier versions
      requires MDEV-27595
      
      Second, if spider is initialised before udf_init(), create udf by
      inserting into `mysql.func`, otherwise do it by `CREATE FUNCTION` as
      usual. This change may be generalised in MDEV-31401.
      
      Also factor out some clean-up queries from deinit_spider.inc for use
      of spider init tests.
      
      A minor caveat is that early spider initialisation will fail if the
      server is bootstrapped for the first time, due to missing `mysql`
      database which needs to be created by the bootstrap script.
      d8f5d2be
    • Yuchen Pei's avatar
      MDEV-27095 clean up spd_init_query.h · afe63ec6
      Yuchen Pei authored
      Removing procedures that were created and dropped during init.
      
      This also fixes a race condition where mtr test with
      plugin-load-add=ha_spider.so causes post test check to fail as it
      expects the procedures to still be there.
      afe63ec6
    • Yuchen Pei's avatar
      MDEV-27095 installing one spider plugin should not trigger others · f0af56be
      Yuchen Pei authored
      There are several plugins in ha_spider: spider, spider_alloc_mem,
      spider_wrapper_protocols, spider_rewrite etc.
      
      INSTALL PLUGIN foo SONAME ha_spider causes all the other ones to be
      installed by the init queries where foo is any of the plugins.
      
      This introduces unnecessary complexiy. For example it reads
      mysql.plugins to find all other plugins, causing the hack of moving
      spider plugin init to a separate thread.
      
      To install all spider related plugins, install soname ha_spider should
      be used instead.
      
      This also fixes spurious rows in mysql.plugin when installing say only
      the spider plugin with `plugin-load-add=SPIDER=ha_spider.so`:
      
      select * from mysql.plugin;
      name	dl
      spider_alloc_mem	ha_spider.so # should not be here
      spider_wrapper_protocols	ha_spider.so # should not be here
      
      Adapted from part of the reverted commit
      c160a115.
      f0af56be
    • Julius Goryavsky's avatar
      MDEV-32344: IST failed with ssl-mode=VERIFY_CA · 66fafdb9
      Julius Goryavsky authored
      This commit fixes a bug where IST could be rejected in favor of SST
      when ssl-mode=VERIFY_CA and when mariabackup is used. It also contains
      a test and small code simplifications that will make it easier to find
      bugs in the future.
      66fafdb9
    • Yuchen Pei's avatar
      MDEV-28683 Spider: create conn on demand when direct delete · 13896f73
      Yuchen Pei authored
      We do this in 10.4 at the same place where in 10.5+ dml_init() is
      called which does the same thing, among other things.
      13896f73