1. 04 Jul, 2022 3 commits
    • Vladislav Vaintroub's avatar
      MDEV-25785 Add support for OpenSSL 3.0 · 8a9c1e9c
      Vladislav Vaintroub authored
      Summary of changes
      
      - MD_CTX_SIZE is increased
      
      - EVP_CIPHER_CTX_buf_noconst(ctx) does not work anymore, points
        to nobody knows where. The assumption made previously was that
        (since the function does not seem to be documented)
        was that it points to the last partial source block.
        Add own partial block buffer for NOPAD encryption instead
      
      - SECLEVEL in CipherString in openssl.cnf
        had been downgraded to 0, from 1, to make TLSv1.0 and TLSv1.1 possible
         (according to https://github.com/openssl/openssl/blob/openssl-3.0.0/NEWS.md
         even though the manual for SSL_CTX_get_security_level claims that it
         should not be necessary)
      
      - Workaround Ssl_cipher_list issue, it now returns TLSv1.3 ciphers,
        in addition to what was set in --ssl-cipher
      
      - ctx_buf buffer now must be aligned to 16 bytes with openssl(
        previously with WolfSSL only), ot crashes will happen
      
      - updated aes-t , to be better debuggable
        using function, rather than a huge multiline macro
        added test that does "nopad" encryption piece-wise, to test
        replacement of EVP_CIPHER_CTX_buf_noconst
      
      part of MDEV-29000
      8a9c1e9c
    • Marko Mäkelä's avatar
      Merge 10.4 into 10.5 · 33f0270e
      Marko Mäkelä authored
      33f0270e
    • Marko Mäkelä's avatar
      MDEV-26294 Duplicate entries in unique index not detected when changing collation · 9a0cbd31
      Marko Mäkelä authored
      ha_innobase::check_if_supported_inplace_alter(): Refuse to change the
      collation of a column that would become or remain indexed as part of
      the ALTER TABLE operation.
      
      In MariaDB Server 10.6, we will allow this type of operation;
      that fix depends on MDEV-15250.
      9a0cbd31
  2. 01 Jul, 2022 7 commits
  3. 30 Jun, 2022 4 commits
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-28919 Assertion `(((core_null) + 7) >> 3) == oindex.n_core_null_bytes ||... · 99de8cc0
      Thirunarayanan Balathandayuthapani authored
      MDEV-28919 Assertion `(((core_null) + 7) >> 3) == oindex.n_core_null_bytes || !not_redundant()' failed
      
      - In case of discarded tablespace, InnoDB can't read the root page to
      assign the n_core_null_bytes. Consecutive instant DDL fails because
      of non-matching n_core_null_bytes.
      99de8cc0
    • Marko Mäkelä's avatar
      MDEV-26293 InnoDB: Failing assertion: space->is_ready_to_close() ... · a1267724
      Marko Mäkelä authored
      fil_space_t::acquire_low(): Introduce a parameter that specifies
      which flags should be avoided. At all times, referenced() must not
      be incremented if the STOPPING flag is set. When fil_system.mutex
      is not being held by the current thread, the reference must not be
      incremented if the CLOSING flag is set (unless NEEDS_FSYNC is set,
      in fil_space_t::flush()).
      
      fil_space_t::acquire(): Invoke acquire_low(STOPPING | CLOSING).
      In this way, the reference count cannot be incremented after
      fil_space_t::try_to_close() invoked fil_space_t::set_closing().
      
      If the CLOSING flag was set, we must retry acquire_low() after
      acquiring fil_system.mutex.
      
      fil_space_t::prepare_acquired(): Replaces prepare(true).
      
      fil_space_t::acquire_and_prepare(): Replaces prepare().
      This basically retries fil_space_t::acquire() after
      acquiring fil_system.mutex.
      a1267724
    • Marko Mäkelä's avatar
      MSAN: Disable some slow tests · afe607df
      Marko Mäkelä authored
      afe607df
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-28706 Redundant InnoDB table fails during alter · e34f8781
      Thirunarayanan Balathandayuthapani authored
      - Redundant InnoDB table fails to set the flags2 while loading
      the table. It leads to "Upgrade index name failure" during alter
      operation. InnoDB should set the flags2 to FTS_AUX_HEX_NAME when
      fts is being loaded
      e34f8781
  4. 28 Jun, 2022 2 commits
    • Aleksey Midenkov's avatar
      MDEV-28567 MDL debug logging · d89cac08
      Aleksey Midenkov authored
      Log MDL state transitions. Trace-friendly message
      format. DBUG_LOCK_FILE replaced by thread-local storage.
      
      Logged states legend:
        Seized   lock was acquired without waiting
        Waiting  lock is waiting
        Acquired lock was acquired after waiting
        Released lock was released
        Deadlock lock was aborted due to deadlock
        Timeout  lock was aborted due to timeout >0
        Nowait   lock was aborted due to zero timeout
        Killed   lock was aborted due to kill message
        OOM	   can not acquire because out of memory
      
      Usage:
        mtr --mysqld=--debug=d,mdl,query:i:o,/tmp/mdl.log
      
      Cleanup from garbage messages:
        sed -i -re \
        '/(mysql|performance_schema|sys|mtr)\// d; /MDL_BACKUP_/ d' \
        /tmp/mdl.log
      d89cac08
    • Alexander Barkov's avatar
      A cleanup for MDEV-25243 ASAN heap-use-after-free in... · efdbb3cf
      Alexander Barkov authored
      A cleanup for MDEV-25243 ASAN heap-use-after-free in Item_func_sp::execute_impl upon concurrent view DDL and I_S query with view and function
      
      The test was reported to fail sporadicaly with this diff:
      
      --- mysql-test/main/information_schema_tables.result
      +++ mysql-test/main/information_schema_tables.reject
      @@ -21,6 +21,8 @@
       disconnect con1;
       connection default;
       DROP VIEW IF EXISTS vv;
      +Warnings:
      +Note	4092	Unknown VIEW: 'test.vv'
      
      in the "The originally reported non-deterministic test" part.
      Disabling warnings around the DROP VIEW statement.
      efdbb3cf
  5. 27 Jun, 2022 13 commits
    • Nayuta Yanagisawa's avatar
      MDEV-24343 Spider Left join failed Unknown column 't0.ID' in 'on clause' · dbd56278
      Nayuta Yanagisawa authored
      The Spider mixes the comma join with other join types, and thus
      ERROR 1054 occurs. This is well-known issue caused by the higher
      precedence of JOIN over the comma (,).
      
      We can fix the problem simply by using JOINs instead of commas.
      dbd56278
    • Nayuta Yanagisawa's avatar
      MDEV-21310 AUTO_INCREMENT column throws range error on INSERT in partitioned... · 5375f0b4
      Nayuta Yanagisawa authored
      MDEV-21310 AUTO_INCREMENT column throws range error on INSERT in partitioned table | Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed.
      
      The bug is caused by a similar mechanism as MDEV-21027.
      
      The function, check_insert_or_replace_autoincrement, failed to open
      all the partitions on INSERT SELECT statements and it results in the
      assertion error.
      5375f0b4
    • Nayuta Yanagisawa's avatar
      MDEV-28352 Spider: heap-use-after-free in ha_spider::lock_tables(), heap freed by spider_commit() · a26700cc
      Nayuta Yanagisawa authored
      The heap-use-after-free is caused by the following mechanism:
      
        * In the execution of FLUSH TABLE WITH READ LOCK, the function
          spider_free_trx_conn() is called and the connections held by
          SPIDER_TRX::trx_conn_hash are freed.
      
        * Then, an instance of ha_spider maintains the freed connections
          because they are also referenced from ha_spider::conns.
          The ha_spider instance is kept in a lock structure until the
          corresponding table is unlocked.
      
        * Spider accesses ha_spider::conns on the implicit UNLOCK TABLE
          issued by BEGIN.
      
      In the first place, when the connections have been freed, it means
      that there are really no remote table locked by Spider.
      Thus, there is no need for Spider to access ha_spider::cons on the
      implicit UNLOCK TABLE.
      
      We can fix the bug by removing the above mentioned access to
      ha_spider::conns. We also modified spider_free_trx_conn() so that it
      frees the connections only when no table is locked to reduce the
      chance of another heap-use-after-free on ha_spider::conns.
      a26700cc
    • Marko Mäkelä's avatar
      Merge 10.4 into 10.5 · 773f1dad
      Marko Mäkelä authored
      773f1dad
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · b922ae5f
      Marko Mäkelä authored
      b922ae5f
    • Marko Mäkelä's avatar
      MDEV-26577 InnoDB: Failing assertion: dict_tf2_is_valid(flags, flags2) during ADD COLUMN · f339ef3f
      Marko Mäkelä authored
      prepare_inplace_alter_table_dict(): If the table will not be rebuilt,
      preserve all of the original ROW_FORMAT, including the compressed
      page size flags related to ROW_FORMAT=COMPRESSED.
      f339ef3f
    • Marko Mäkelä's avatar
      MDEV-28389 fixup: Fix compiler warnings · a75ad735
      Marko Mäkelä authored
      hex_to_ascii(): Add #if around the definition to avoid
      clang -Wunused-function. Avoid GCC 5 -Wconversion with a cast.
      a75ad735
    • Marko Mäkelä's avatar
      Merge 10.4 into 10.5 · ea847cbe
      Marko Mäkelä authored
      ea847cbe
    • Marko Mäkelä's avatar
      Fix GCC -Og -Wmaybe-uninitialized · 03174cab
      Marko Mäkelä authored
      03174cab
    • Marko Mäkelä's avatar
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · 01d75703
      Marko Mäkelä authored
      01d75703
    • Marko Mäkelä's avatar
      MDEV-28389: Simplify the InnoDB corrupted page output · c86b1389
      Marko Mäkelä authored
      buf_page_print(): Dump the buffer page 32 bytes (64 hexadecimal digits)
      per line. In this way, the limitation in mtr
      ("Data too long for column 'line'") will not be triggered.
      
      Also, do not bother decoding the page contents, because everything
      is present in the hexadecimal output.
      
      dict_index_find_on_id_low(): Merge to dict_index_get_if_in_cache_low().
      The direct call in buf_page_print() was prone to crashing, in case the
      table definition was concurrently evicted or dropped from the
      data dictionary cache.
      c86b1389
    • Hirokazu Hata's avatar
      MDEV-28854 Disallow INSERT DELAYED on Spider table · 2c1aaa66
      Hirokazu Hata authored
      Spider supports (or at least allows) INSERT DELAYED but the
      documentation does not specify spider as a storage engine that supports
      "INSERT DELAYED".
      Also, although not mentioned in the documentation, "INSERT DELAYED" is
      not intended to be executed inside a transaction, as can be seen from
      the list of supported storage engines.
      The current implementation allows executing a delayed insert on a
      remote transactional table and this breaks the consistency ensured by
      the transaction.
      
      We too remove "internal_delayed", one of the Spider table parameters.
      Documentation says,
      
      > Whether to transmit existence of delay to remote servers when
      > executing an INSERT DELAYED statement on local server.
      
      This table parameter is only used for "INSERT DELAYED".
      
      Reviewed by: Nayuta Yanagisawa
      2c1aaa66
  6. 24 Jun, 2022 1 commit
  7. 23 Jun, 2022 1 commit
  8. 21 Jun, 2022 2 commits
  9. 20 Jun, 2022 1 commit
  10. 18 Jun, 2022 2 commits
    • Daniel Black's avatar
      MDEV-28884: include kernel information in crashing signal handler · d4539426
      Daniel Black authored
      Recent adventures in liburing and btrfs have shown up some kernel
      version dependent bugs. Having a bug report of accurace kernel version
      can start to correlate these errors sooner.
      
      On Linux, /proc/version contains the kernel version.
      
      FreeBSD has kern.version (per man 8 sysctl), so include that too.
      
      Example output:
      
      Max nice priority         0                    0
      Max realtime priority     0                    0
      Max realtime timeout      unlimited            unlimited            us
      Core pattern: |/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h
      
      Kernel version: Linux version 5.19.0-0.rc2.21.fc37.x86_64 (mockbuild@bkernel01.iad2.fedoraproject.org) (gcc (GCC) 12.1.1 20220507 (Red Hat 12.1.1-1), GNU ld version 2.38-14.fc37) #1 SMP PREEMPT_DYNAMIC Mon Jun 13 15:27:24 UTC 2022
      
      Segmentation fault (core dumped)
      d4539426
    • Sergei Golubchik's avatar
      remove invalid test · f299351e
      Sergei Golubchik authored
      it starts an EXPLAIN of a multi-table join and tries to KILL it.
      no sync points.
      depending on how fast the hareware is and optimizer development
      it might kill EXPLAIN at some random point in time (generally unrelated
      to the Bug#28598 it was supposed to test) or EXPLAIN might finish
      before the KILL and the test will fail.
      f299351e
  11. 17 Jun, 2022 2 commits
  12. 16 Jun, 2022 1 commit
    • Shunsuke Tokunaga's avatar
      MDEV-21027 Assertion `part_share->auto_inc_initialized ||... · c4f65d8f
      Shunsuke Tokunaga authored
      MDEV-21027 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed in ha_partition::set_auto_increment_if_higher
      
      ha_partition::set_auto_increment_if_higher expects
      part_share->auto_inc_initialized is true or can_use_for_auto_inc_init()
      is false (but as the comment of this method says, it returns false
      only if we use Spider engine with DROP TABLE or ALTER TABLE query).
      However, part_share->auto_inc_initialized becomes true only after all
      partitions are opened (since 6dce6aec).
      
      Therefore, I added a conditional expression in order to read all
      partitions when we execute REPLACE on a table that has an
      AUTO_INCREMENT column.           
      
      Reviewed by: Nayuta Yanagisawa
      Reviewed by: Alexey Botchkov
      c4f65d8f
  13. 15 Jun, 2022 1 commit