1. 01 Apr, 2020 3 commits
    • Marko Mäkelä's avatar
      Fix GCC 9.3.0 -Wstrict-aliasing · 51a9dd67
      Marko Mäkelä authored
      copy_keys_from_share(): Use reinterpret_cast instead of
      manipulating a reference to a type-punned pointer.
      
      This cleans up after the cleanup
      commit 0515577d.
      51a9dd67
    • Marko Mäkelä's avatar
      MDEV-22103 INNODB_ENCRYPTION_NUM_KEY_REQUESTS is missing from INFORMATION_SCHEMA.GLOBAL_STATUS · abaeeffb
      Marko Mäkelä authored
      In commit a5584b13
      some scrubbing-related status variables were removed along with
      the background scrubbing code.
      The status variable INNODB_ENCRYPTION_NUM_KEY_REQUESTS
      was inadvertently removed as part of that.
      
      innodb_status_variables[]: Restore "encryption_num_key_requests".
      
      We introduce the test innodb.innodb_status_variables
      in order to catch similar regressions in the future.
      abaeeffb
    • Marko Mäkelä's avatar
      MDEV-22102 Assertion w==OPT failed in trx_undo_header_create() · a1077ab2
      Marko Mäkelä authored
      Because InnoDB is not freeing undo pages to the normal
      free-page management, old undo log pages can be reused. Due to that,
      it is possible (but unlikely) that the fields TRX_UNDO_NEEDS_PURGE
      and TRX_UNDO_LOG_START relative to the free offset that is stored at
      TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_START already have the correct value.
      Hence, we must pass the mtr_t::OPT template parameter to silence the
      debug assertion.
      
      Other writes in trx_undo_header_create() that are using the default
      template parameter seem to be correct (the data fields should be
      guaranteed to change even in the event of reusing pages).
      a1077ab2
  2. 31 Mar, 2020 18 commits
  3. 30 Mar, 2020 9 commits
    • Marko Mäkelä's avatar
      Merge 10.4 into 10.5 · 37c14690
      Marko Mäkelä authored
      37c14690
    • Marko Mäkelä's avatar
      Cleanup recv_sys: Move things to members · aae3f921
      Marko Mäkelä authored
      recv_sys.recovery_on: Replaces recv_recovery_on.
      
      recv_sys_t::apply(): Replaces recv_apply_hashed_log_recs().
      
      recv_sys_var_init(): Remove.
      
      recv_sys_t::recover_low(): Attempt to initialize a page based
      on buffered redo log records.
      aae3f921
    • Marko Mäkelä's avatar
      MDEV-12353: Remove a trace of pre-MDEV-13564 crash-upgrade · a8b04c3e
      Marko Mäkelä authored
      In commit f8a9f906
      we removed support for crash-upgrade from older versions,
      but forgot to remove a check for recovering TRUNCATE TABLE
      if MariaDB 10.2.18 or 10.3.9 or earlier were killed and
      we are attempting to upgrade to MariaDB 10.5.2 or later.
      Already MariaDB 10.4 would refuse to recover such TRUNCATE
      operations.
      a8b04c3e
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · e2f1f88f
      Marko Mäkelä authored
      e2f1f88f
    • Marko Mäkelä's avatar
      MDEV-20590 Introduce a file format constraint to ALTER TABLE · b092d35f
      Marko Mäkelä authored
      If a table is altered using the MDEV-11369/MDEV-15562/MDEV-13134
      ALGORITHM=INSTANT, it can force the table to use a non-canonical
      format:
      
      * A hidden metadata record at the start of the clustered index
      is used to store each column's DEFAULT value. This makes it possible
      to add new columns that have default values without rebuilding the table.
      
      * Starting with MDEV-15562 in MariaDB Server 10.4, a BLOB in the
      hidden metadata record is used to store column mappings. This makes
      it possible to drop or reorder columns without rebuilding the table.
      This also makes it possible to add columns to any position or drop
      columns from any position in the table without rebuilding the table.
      
      If a column is dropped without rebuilding the table, old records
      will contain garbage in that column's former position, and new records
      will be written with NULL values, empty strings, or dummy values.
      
      This is generally not a problem. However, there may be cases where
      users may want to avoid putting a table into this format.
      For example, users may want to ensure that future UPDATE operations
      after an ADD COLUMN will be performed in-place, to reduce write
      amplification. (Instantly added columns are essentially always
      variable-length.) Users might also want to avoid bugs similar to
      MDEV-19916, or they may want to be able to export tables to
      older versions of the server.
      
      We will introduce the option innodb_instant_alter_column_allowed,
      with the following values:
      
      * never (0): Do not allow instant add/drop/reorder,
      to maintain format compatibility with MariaDB 10.x and MySQL 5.x.
      If the table (or partition) is not in the canonical format, then
      any ALTER TABLE (even one that does not involve instant column
      operations) will force a table rebuild.
      
      * add_last (1, default in 10.3): Store a hidden metadata record that
      allows columns to be appended to the table instantly (MDEV-11369).
      In 10.4 or later, if the table (or partition) is not in this format,
      then any ALTER TABLE (even one that does not involve column changes)
      will force a table rebuild.
      
      Starting with 10.4:
      
      * add_drop_reorder (2, default): Like 'add_last', but allow the
      metadata record to store a column map, to support instant
      add/drop/reorder of columns (MDEV-15562).
      b092d35f
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-21832 FORCE all partition to rebuild if any one of the · f8ec3ba0
      Thirunarayanan Balathandayuthapani authored
      		partition does rebuild
      
      - In ha_innobase::commit_inplace_alter_table() assumes that all partition
      should do the same kind of alter operations. During DDL, if one partition
      requires table rebuild and other partition doesn't need rebuild
      then all partition should be forced to rebuild.
      f8ec3ba0
    • Marko Mäkelä's avatar
      Fix GCC -Wstringop-truncation · 67f27824
      Marko Mäkelä authored
      67f27824
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 1a9b6c4c
      Marko Mäkelä authored
      1a9b6c4c
    • Varun Gupta's avatar
      MDEV-22019: Sig 11 in next_breadth_first_tab | max_sort_length setting +... · b11ff3d4
      Varun Gupta authored
      MDEV-22019: Sig 11 in next_breadth_first_tab | max_sort_length setting + double GROUP BY leads to crash
      
      No need to create a temp table for aggregation if we have encountered some error.
      b11ff3d4
  4. 28 Mar, 2020 5 commits
    • Marko Mäkelä's avatar
      MDEV-20377: Enable MemorySanitizer user-poisoning · 6be56dd1
      Marko Mäkelä authored
      For ENGINE=Aria, we work around bugs in various tests that catch
      writes of uninitialized bytes from the Aria page cache.
      (Why do we even write anything on DROP TABLE?)
      6be56dd1
    • Marko Mäkelä's avatar
      MDEV-20377: Make WITH_MSAN more usable · 94d0bb4d
      Marko Mäkelä authored
      MemorySanitizer (clang -fsanitize=memory) requires that all code
      be compiled with instrumentation enabled. The C runtime library
      is an exception. Failure to use instrumented libraries will cause
      bogus messages about memory being uninitialized.
      
      In WITH_MSAN builds, we must avoid calling getservbyname(),
      because even though it is a standard library function, it is
      not instrumented, not even in clang 10.
      
      The following cmake options were tested:
      
      -DCMAKE_C_FLAGS='-march=native -O2'
      -DCMAKE_CXX_FLAGS='-stdlib=libc++ -march=native -O2'
      -DWITH_EMBEDDED_SERVER=OFF -DWITH_UNIT_TESTS=OFF -DCMAKE_BUILD_TYPE=Debug
      -DWITH_INNODB_{BZIP2,LZ4,LZMA,LZO,SNAPPY}=OFF
      -DPLUGIN_{ARCHIVE,TOKUDB,MROONGA,OQGRAPH,ROCKSDB,CONNECT,SPIDER}=NO
      -DWITH_SAFEMALLOC=OFF
      -DWITH_{ZLIB,SSL,PCRE}=bundled
      -DHAVE_LIBAIO_H=0
      -DWITH_MSAN=ON
      
      MEM_MAKE_DEFINED(): An alias for VALGRIND_MAKE_MEM_DEFINED()
      and in the future, __msan_unpoison().
      
      For now, neither MEM_MAKE_DEFINED() nor MEM_UNDEFINED()
      perform any action under MSAN. Enabling them will catch more bugs, but
      will also require some more fixes or work-arounds.
      
      Json_writer::add_double(): Work around a frequently occurring
      failure in optimizer tests, related to EXPLAIN FORMAT=JSON.
      
      dtoa(): Disable MSAN altogether. For some reason, this function
      is triggering a lot of trouble, especially when invoked for
      DBUG functions. The MDL default timeout is dd=86400 seconds,
      and for some reason it is claimed to be uninitialized.
      
      InnoDB: Define UNIV_DEBUG_VALGRIND also WITH_MSAN.
      
      ut_crc32_8_hw(), ut_crc32_64_low_hw(): Use the compiler built-in
      functions instead of inline assembler when building WITH_MSAN.
      This will require at least -msse4.2 when building for IA-32 or AMD64.
      The inline assembler would not be instrumented, and would thus cause
      bogus failures.
      94d0bb4d
    • Marko Mäkelä's avatar
      Do not compare uninitialized data · 6ec6eda4
      Marko Mäkelä authored
      Valgrind only seems to complain about memcmp() operations that
      actually end up reading uninitialized data, while MemorySanitizer
      requires that the entire length of both buffers be defined.
      6ec6eda4
    • Marko Mäkelä's avatar
    • Vladislav Vaintroub's avatar
      MDEV-20372 thread_pool_info fails randomly in 10.5 · e1295554
      Vladislav Vaintroub authored
      Rework stats a bit, so we're not missing any queue_get() now.
      
      Don't do stats_reset_table(), if generic threadpool is off.
      e1295554
  5. 27 Mar, 2020 5 commits