1. 06 Oct, 2020 4 commits
    • Daniel Black's avatar
      travis: 10.2 only - make faster · b3a9fbdb
      Daniel Black authored
      Remove from debian build:
      * tokudb
      * mroonga
      * spider
      * ograph
      * embedded server
      
      Add ccache to debian build.
      
      Backport 10.3 changes to autobake-deb
      that make travis faster.
      
      Merge instructions:
      Drop this commit on merge to 10.3
      b3a9fbdb
    • Eugene Kosov's avatar
      MDEV-23894 UBSAN: several call to function show_binlog_vars(THD*,... · 350c9eb7
      Eugene Kosov authored
      MDEV-23894 UBSAN: several call to function show_binlog_vars(THD*, st_mysql_show_var*, char*) through pointer to incorrect function type 'int (*)(THD *, st_mysql_show_var *, void *, system_status_var *, enum_var_type) errors
      350c9eb7
    • Jan Lindström's avatar
      MDEV-18593 : galera.galera_gcache_recover_full_gcache: Test failure:... · 33f19876
      Jan Lindström authored
      MDEV-18593 : galera.galera_gcache_recover_full_gcache: Test failure: galera_gcache_recover_full_gcache.test: assert_grep.inc failed
      
      Grep only the fact that we need to fall back to SST.
      33f19876
    • Marko Mäkelä's avatar
      MDEV-23888: Potential server hang on replication with InnoDB · 577c61e8
      Marko Mäkelä authored
      In MDEV-21452, SAFE_MUTEX flagged an ordering problem that involved
      trx_t::mutex, LOCK_global_system_variables, and LOCK_commit_ordered
      when running
      ./mtr --no-reorder\
       binlog.binlog_checksum,mix binlog.binlog_commit_wait,mix
      
      Because LOCK_commit_ordered is acquired by replication code before
      innobase_commit_ordered() is invoked, and because LOCK_commit_ordered
      should be below LOCK_global_system_variables in the global latching
      order, it turns out that we must avoid acquiring
      LOCK_global_system_variables in any low-level code.
      
      It also turns out that lock_rec_lock() acquires lock_sys_t::mutex
      and then carries on to call lock_rec_enqueue_waiting(), which may
      invoke THDVAR() via thd_lock_wait_timeout(). This call is problematic
      if THDVAR() had never been invoked in that thread earlier.
      
      innobase_trx_init(): Let us invoke THDVAR() at the start of an InnoDB
      transaction so that future invocations of THDVAR() will avoid
      LOCK_global_system_variables acquisition on the same THD. Because
      the first call to intern_sys_var_ptr() will initialize all session
      variables by not passing the offset to sync_dynamic_session_variables(),
      this will indeed make any future THDVAR() invocation mutex-free.
      
      There are some THDVAR() calls in other code (related to indexed virtual
      columns, fulltext indexes, and DDL operations). No SAFE_MUTEX warning
      was known for those, but there does not appear to be any replication
      test coverage for indexed virtual columns or fulltext indexes. DDL should
      be covered, and perhaps DDL code paths were already invoking THDVAR()
      while not holding any InnoDB mutex.
      
      Side note: MySQL should avoid this type of deadlocks since
      mysql/mysql-server@4d275c89954685e2ed1b368812b3b5a29ddf9389.
      MariaDB never defined alloc_and_copy_thd_dynamic_variables(),
      because we prefer to avoid overhead during connection creation.
      
      An important part of the deadlock could be the current handling of
      SET GLOBAL binlog_checksum=NONE; and similar assignments.
      In binlog_checksum_update(), we would hold LOCK_global_system_variables
      while potentially acquiring LOCK_commit_ordered in MYSQL_BIN_LOG::open().
      Even if that code was changed later to release
      LOCK_global_system_variables during the write to mysql_bin_log,
      it could be a good idea for performance to avoid invoking the
      expensive code path of THDVAR() while holding any InnoDB mutexes,
      such as lock_sys.mutex in lock_rec_enqueue_waiting().
      
      Thanks to Andrei Elkin for debugging the SAFE_MUTEX issue, and to
      Sergei Golubchik for the suggestion to invoke THDVAR() early.
      577c61e8
  2. 05 Oct, 2020 4 commits
  3. 03 Oct, 2020 1 commit
  4. 02 Oct, 2020 3 commits
  5. 30 Sep, 2020 2 commits
  6. 29 Sep, 2020 4 commits
  7. 28 Sep, 2020 5 commits
  8. 25 Sep, 2020 1 commit
  9. 24 Sep, 2020 1 commit
  10. 23 Sep, 2020 7 commits
    • Daniel Black's avatar
      3d28d1f3
    • Daniel Black's avatar
      MDEV-23697: perl -w -> perl · 4ddaa571
      Daniel Black authored
      Leave debian/additions/mysqlreport as #!/usr/bin/perl
      
      Acknowledge that `env perl` is a hack, a complete fix
      needs to consider which path perl is at and insert into
      these scripts.
      
      The usefulness of these scripts is questionable.
      4ddaa571
    • Daniel Black's avatar
    • Marko Mäkelä's avatar
      MDEV-22387: Do not violate __attribute__((nonnull)) · 7c5519c1
      Marko Mäkelä authored
      Passing a null pointer to a nonnull argument is not only undefined
      behaviour, but it also grants the compiler the permission to optimize
      away further checks whether the pointer is null. GCC -O2 at least
      starting with version 8 may do that, potentially causing SIGSEGV.
      7c5519c1
    • Marko Mäkelä's avatar
      UBSAN: Fix a bit shift overflow · 70960bd3
      Marko Mäkelä authored
      Shifting a 16-bit type by 16 bits is undefined behaviour.
      The result is at least 32 bits, so let us cast the shift operand
      to a wider type before shifting.
      70960bd3
    • Marko Mäkelä's avatar
      Fix GCC 10.2.0 -Og -fsanitize=undefined -Wmaybe-uninitialized · af40a2b4
      Marko Mäkelä authored
      For some reason, adding -fsanitize=undefined (cmake -DWITH_UBSAN=ON)
      to the compilation flags will cause even more warnings to be emitted.
      The warnings do look bogus, but the code can be simplified.
      af40a2b4
    • Marko Mäkelä's avatar
      Fix GCC 10.2.0 -Og -fsanitize=undefined -Wformat-overflow · 0448558a
      Marko Mäkelä authored
      For some reason, adding -fsanitize=undefined (cmake -DWITH_UBSAN=ON)
      to the compilation flags will cause even more warnings to be emitted.
      The warning was a bogus one:
      
      tests/mysql_client_test.c:8632:22: error: '%d' directive writing between
      1 and 11 bytes into a region of size 9 [-Werror=format-overflow=]
       8632 |     sprintf(field, "c%d int", i);
            |                      ^~
      tests/mysql_client_test.c:8632:20: note: directive argument
      in the range [-2147483648, 999]
      
      The warning does not take into account that the lower bound of the
      variable actually is 0. But, we can help the compiler and use an
      unsigned variable.
      0448558a
  11. 22 Sep, 2020 8 commits
    • Oleksandr Byelkin's avatar
      594c11ff
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · 9d0ee2dc
      Marko Mäkelä authored
      9d0ee2dc
    • Marko Mäkelä's avatar
      MDEV-22939: Restore an AUTO_INCREMENT check · 78efa109
      Marko Mäkelä authored
      It turns out that we must check for DISCARD TABLESPACE both
      when the table is being rebuilt and when the AUTO_INCREMENT
      value of the table is being added.
      
      This was caught by the test innodb.alter_missing_tablespace.
      Somehow I failed to run all tests. Sorry!
      78efa109
    • Marko Mäkelä's avatar
      MDEV-22939 Server crashes in row_make_new_pathname() · 3eb81136
      Marko Mäkelä authored
      The statement ALTER TABLE...DISCARD TABLESPACE is problematic,
      because its designed purpose is to break the referential integrity
      of the data dictionary and make a table point to nowhere.
      
      ha_innobase::commit_inplace_alter_table(): Check whether the
      table has been discarded. (This is a bit late to check it, right
      before committing the change.) Previously, we performed this check
      only in a specific branch of the function commit_set_autoinc().
      
      Note: We intentionally allow non-rebuilding ALTER TABLE even if
      the tablespace has been discarded, to remain compatible with MySQL.
      (See the various tests with "wl5522" in the name, such as
      innodb.innodb-wl5522.)
      
      The test case would crash starting with 10.3 only, but it does not hurt
      to minimize the code and test difference between 10.2 and 10.3.
      3eb81136
    • Marko Mäkelä's avatar
      Make DISCARD TABLESPACE more robust · e5e83daf
      Marko Mäkelä authored
      dict_load_table_low(): Copy the 'discarded' flag to file_unreadable.
      This allows to avoid a potentially harmful call to dict_stats_init()
      in ha_innobase::open().
      e5e83daf
    • Marko Mäkelä's avatar
      MDEV-23776: Re-apply the fix and make the test more robust · 2af8f712
      Marko Mäkelä authored
      The test that was added in commit e05650e6
      would break a subsequent run of a test encryption.innodb-bad-key-change
      because some pages in the system tablespace would be encrypted with
      a different key.
      
      The failure was repeatable with the following invocation:
      
      ./mtr --no-reorder \
      encryption.create_or_replace,cbc \
      encryption.innodb-bad-key-change,cbc
      
      Because the crash was unrelated to the code changes that we reverted
      in commit eb38b1f7
      we can safely re-apply those fixes.
      2af8f712
    • Marko Mäkelä's avatar
      MDEV-23705 Assertion 'table->data_dir_path || !space' · 732cd7fd
      Marko Mäkelä authored
      After DISCARD TABLESPACE, the tablespace of a table will no longer
      exist, and dict_get_and_save_data_dir_path() would invoke
      dict_get_first_path() to read an entry from SYS_DATAFILES.
      For some reason, DISCARD TABLESPACE would not to remove the entry
      from there.
      
      dict_get_and_save_data_dir_path(): If the tablespace has been
      discarded, do not bother trying to read the name.
      
      Side note: The tables SYS_TABLESPACES and SYS_DATAFILES are
      redundant and subject to removal in MDEV-22343.
      732cd7fd
    • Marko Mäkelä's avatar
      Revert "MDEV-23776 Test encryption.create_or_replace fails with a warning" · eb38b1f7
      Marko Mäkelä authored
      This reverts commit e33f7b6f.
      The change seems to have introduced intermittent failures of the test
      encryption.innodb-bad-key-change on many platforms.
      
      The failure that we were trying to address was not reproduced on 10.2.
      It could be related to commit a7dd7c89
      (MDEV-23651) or de942c9f (MDEV-15983)
      or other changes that reduced contention on fil_system.mutex in 10.3.
      
      The fix that we are hereby reverting from 10.2 seems to work fine
      on 10.3 and 10.4.
      eb38b1f7