1. 20 Dec, 2023 3 commits
  2. 19 Dec, 2023 4 commits
  3. 15 Dec, 2023 3 commits
  4. 14 Dec, 2023 2 commits
  5. 13 Dec, 2023 4 commits
    • Marko Mäkelä's avatar
      MDEV-21245 InnoDB: Using a partial-field key prefix in search · 852e1383
      Marko Mäkelä authored
      ha_innobase::compare_key_parts(): If a full column index is
      being replaced with a column prefix index, return Compare_keys::NotEqual.
      852e1383
    • Rex's avatar
      MDEV-31279 Crash when lateral derived is guaranteed to return no rows · b4712242
      Rex authored
      Consider this query
      SELECT t1.* FROM t1, (SELECT t2.b FROM t2 WHERE NOT EXISTS
      (SELECT 1 FROM t3) GROUP BY b) sq where sq.b = t1.a;
      
      If SELECT 1 FROM t3 is expensive, for example t3 has >
      thd->variables.expensive_subquery_limit, first evaluation is deferred to
      mysql_derived_fill().  There it is noted that, in the above case
       NOT EXISTS (SELECT 1 FROM t3) is constant and false.
      
      This causes the join variable zero_result_cause to be set to
      "Impossible WHERE noticed after reading const tables" and the handler
      for this join is never "opened" via handler::ha_open.
      
      When mysql_derived_fill() is called for the next group of results, this
      unopened handler is not taken into account.
      
      reviewed by Igor Babaev (igor@mariadb.com)
      b4712242
    • Marko Mäkelä's avatar
      MDEV-18322 Assertion "wrong page type" on instant ALTER TABLE · c17aca2f
      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.
      
      Reviewed by: Thirunarayanan Balathandayuthapani
      Tested by: Matthias Leich
      c17aca2f
    • Daniel Black's avatar
      MDEV-32795: ALTER SEQUENCE IF NOT EXISTS non_existing_seq Errors rather than note · fbe604d8
      Daniel Black authored
      Like all IF NOT EXISTS syntax, a Note should be generated.
      
      The original commit of Seqeuences cleared the IF NOT EXISTS part
      in the sql/sql_yacc.yy with lex->create_info.init(). Without this
      bit set there was no way it could do anything other than error.
      
      To remedy this removal, the sql_yacc.yy components have been
      minimised as they where all set at the beginning of the ALTER.
      This way the opt_if_not_exists correctly set the IF_EXISTS flag.
      
      In MDEV-13005 (bb4dd70e) the error code changed, requiring
      ER_UNKNOWN_SEQUENCES to be handled in the function
      No_such_table_error_handler::handle_condition.
      fbe604d8
  6. 12 Dec, 2023 7 commits
  7. 11 Dec, 2023 5 commits
    • Brandon Nesterenko's avatar
      MDEV-10653: SHOW SLAVE STATUS Can Deadlock an Errored Slave · 8dad5148
      Brandon Nesterenko authored
      AKA rpl.rpl_parallel, binlog_encryption.rpl_parallel fails in
      buildbot with timeout in include
      
      A replication parallel worker thread can deadlock with another
      connection running SHOW SLAVE STATUS. That is, if the replication
      worker thread is in do_gco_wait() and is killed, it will already
      hold the LOCK_parallel_entry, and during error reporting, try to
      grab the err_lock. SHOW SLAVE STATUS, however, grabs these locks in
      reverse order. It will initially grab the err_lock, and then try to
      grab LOCK_parallel_entry. This leads to a deadlock when both threads
      have grabbed their first lock without the second.
      
      This patch implements the MDEV-31894 proposed fix to optimize the
      workers_idle() check to compare the last in-use relay log’s
      queued_count==dequeued_count for idleness. This removes the need for
      workers_idle() to grab LOCK_parallel_entry, as these values are
      atomically updated.
      
      Huge thanks to Kristian Nielsen for diagnosing the problem!
      
      Reviewed By:
      ============
      Kristian Nielsen <knielsen@knielsen-hq.org>
      Andrei Elkin <andrei.elkin@mariadb.com>
      8dad5148
    • Kristian Nielsen's avatar
      MDEV-26632: multi source replication filters breaking GTID semantic · 5ca63b2b
      Kristian Nielsen authored
      Add a test case that demonstrates a working setup as described in MDEV-26632.
      This requires --gtid-ignore-duplicates=1 and --gtid-strict-mode=0.
      
      In A->B->C, B filters some (but not all) events from A. C is promoted to
      create A->C->B, and the current GTID position in B contains a GTID from A that
      is not present in C (due to filtering). Demonstrate that B can still connect
      with GTID to C, starting at the "hole" in the binlog stream on C originating
      from A.
      Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
      5ca63b2b
    • Kristian Nielsen's avatar
      MDEV-13792: innodb.purge_thread_shutdown failed in buildbot with wrong result (sporadic) · 50ce001a
      Kristian Nielsen authored
      Omit `state` when selecting processlist to verify which threads are running.
      The state changes as threads are running (enter_state()), and this causes
      sporadic test failures.
      Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
      50ce001a
    • Marko Mäkelä's avatar
      MDEV-11905: Simplify encryption.innodb_encrypt_discard_import · 7e34bb5c
      Marko Mäkelä authored
      The test was populating unnecessarily large tables and
      restarting the server several times for no real reason.
      
      Let us hope that a smaller version of the test will produce more
      stable results. Occasionally, some unencrypted contents in the table t2
      was revealed in the old test.
      7e34bb5c
    • Dmitry Shulga's avatar
      MDEV-32965: Assertion `thd->active_stmt_arena_to_use()->... · 9bf50a0e
      Dmitry Shulga authored
      MDEV-32965:  Assertion `thd->active_stmt_arena_to_use()-> is_stmt_prepare_or_first_sp_execute() || thd->active_stmt_arena_to_use()-> is_conventional() || thd->active_stmt_arena_to_use()->state == Query_arena::STMT_SP_QUERY_ARGUMENTS' failed
      
      This patch fixes too strong condition in assert at the method
        Item_func_group_concat::fix_fields
      that is true in case of a stored routine and obviously broken
      for a prepared statement.
      9bf50a0e
  8. 10 Dec, 2023 1 commit
    • Marko Mäkelä's avatar
      MDEV-20142 encryption.innodb_encrypt_temporary_tables fails · 5775df01
      Marko Mäkelä authored
      The data type of the column INFORMATION_SCHEMA.GLOBAL_STATUS.VARIABLE_VALUE
      is a character string. Therefore, if we want to compare some values as
      integers, we must explicitly cast them to integer type, to avoid an
      awkward comparison where '10'<'9' because the first digit is smaller.
      5775df01
  9. 09 Dec, 2023 1 commit
  10. 07 Dec, 2023 10 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
    • 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