1. 19 May, 2017 5 commits
    • Marko Mäkelä's avatar
      Fix a compilation warning introduced by MDEV-11782 · 9756440f
      Marko Mäkelä authored
      log_crypt(): Do not cast byte* to uint32_t*, because it may break
      strict aliasing rules. Instead, cast in the opposite direction.
      9756440f
    • Marko Mäkelä's avatar
      6f54d04e
    • Marko Mäkelä's avatar
      Fix some -Wimplicit-fallthrough warnings in InnoDB · 907cbadb
      Marko Mäkelä authored
      buf_read_ahead_linear(): Do not display a message if the tablespace
      is being deleted.
      
      dtype_print(): Add a missing break statement.
      907cbadb
    • Marko Mäkelä's avatar
      MDEV-12698 innodb.innodb_stats_del_mark test failure · 0bfa3dff
      Marko Mäkelä authored
      In my merge of the MySQL fix for Oracle Bug#23333990 / WL#9513
      I overlooked some subsequent revisions to the test, and I also
      failed to notice that the test is actually always failing.
      
      Oracle introduced the parameter innodb_stats_include_delete_marked
      but failed to consistently take it into account in FOREIGN KEY
      constraints that involve CASCADE or SET NULL.
      
      When innodb_stats_include_delete_marked=ON, obviously the purge of
      delete-marked records should update the statistics as well.
      
      One more omission was that statistics were never updated on ROLLBACK.
      We are fixing that as well, properly taking into account the
      parameter innodb_stats_include_delete_marked.
      
      dict_stats_analyze_index_level(): Simplify an expression.
      (Using the ternary operator with a constant operand is unnecessary
      obfuscation.)
      
      page_scan_method_t: Revert the change done by Oracle. Instead,
      examine srv_stats_include_delete_marked directly where it is needed.
      
      dict_stats_update_if_needed(): Renamed from
      row_update_statistics_if_needed().
      
      row_update_for_mysql_using_upd_graph(): Assert that the table statistics
      are initialized, as guaranteed by ha_innobase::open(). Update the
      statistics in a consistent way, both for FOREIGN KEY triggers and
      for the main table. If FOREIGN KEY constraints exist, do not dereference
      a freed pointer, but cache the proper value of node->is_delete so that
      it matches prebuilt->table.
      
      row_purge_record_func(): Update statistics if
      innodb_stats_include_delete_marked=ON.
      
      row_undo_ins(): Update statistics (on ROLLBACK of a fresh INSERT).
      This is independent of the parameter; the record is not delete-marked.
      
      row_undo_mod(): Update statistics on the ROLLBACK of updating key columns,
      or (if innodb_stats_include_delete_marked=OFF) updating delete-marks.
      
      innodb.innodb_stats_persistent: Renamed and extended from
      innodb.innodb_stats_del_mark. Reduced the unnecessarily large dataset
      from 262,144 to 32 rows. Test both values of the configuration
      parameter innodb_stats_include_delete_marked.
      Test that purge is updating the statistics.
      
      innodb_fts.innodb_fts_multiple_index: Adjust the result. The test
      is performing a ROLLBACK of an INSERT, which now affects the statistics.
      
      include/wait_all_purged.inc: Moved from innodb.innodb_truncate_debug
      to its own file.
      0bfa3dff
    • Igor Babaev's avatar
      Fixed the bug mdev-12788. · 5e9d6511
      Igor Babaev authored
      In some rare cases queries with UNION ALL
      using a derived table specified by
      a grouping select with a subquery in WHERE and
      impossible HAVING detected after constant row
      substitution could hang.
      The cause was not a proper return from the
      function subselect_single_select_engine::exec()
      in the case when the subquery was not optimized
      beforehand and the optimization performed
      in this function requested for a change of the
      subquery engine. This was fixed.
      Also a change was applied that avoided execution
      of a subquery if impossible having was detected
      for the main query at the optimization stage.
      5e9d6511
  2. 18 May, 2017 1 commit
  3. 17 May, 2017 1 commit
  4. 16 May, 2017 1 commit
  5. 14 May, 2017 1 commit
  6. 12 May, 2017 4 commits
    • Marko Mäkelä's avatar
      MDEV-12674 Post-merge fix: Include accidentally omitted changes · f9069a3d
      Marko Mäkelä authored
      In 10.2, the definition of simple_counter resides in the file
      sync0types.h, not in the file os0sync.h which has been removed.
      f9069a3d
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · b9474b5d
      Marko Mäkelä authored
      b9474b5d
    • Marko Mäkelä's avatar
      Merge 10.0 into 10.1 · 03dca7a3
      Marko Mäkelä authored
      03dca7a3
    • Marko Mäkelä's avatar
      MDEV-12674 Innodb_row_lock_current_waits has overflow · ff166093
      Marko Mäkelä authored
      There is a race condition related to the variable
      srv_stats.n_lock_wait_current_count, which is only
      incremented and decremented by the function lock_wait_suspend_thread(),
      
      The incrementing is protected by lock_sys->wait_mutex, but the
      decrementing does not appear to be protected by anything.
      This mismatch could allow the counter to be corrupted when a
      transactional InnoDB table or record lock wait is terminating
      roughly at the same time with the start of a wait on a
      (possibly different) lock.
      
      ib_counter_t: Remove some unused methods. Prevent instantiation for N=1.
      Add an inc() method that takes a slot index as a parameter.
      
      single_indexer_t: Remove.
      
      simple_counter<typename Type, bool atomic=false>: A new counter wrapper.
      Optionally use atomic memory operations for modifying the counter.
      Aligned to the cache line size.
      
      lsn_ctr_1_t, ulint_ctr_1_t, int64_ctr_1_t: Define as simple_counter<Type>.
      These counters are either only incremented (and we do not care about
      losing some increment operations), or the increment/decrement operations
      are protected by some mutex.
      
      srv_stats_t::os_log_pending_writes: Document that the number is protected
      by log_sys->mutex.
      
      srv_stats_t::n_lock_wait_current_count: Use simple_counter<ulint, true>,
      that is, atomic inc() and dec() operations.
      
      lock_wait_suspend_thread(): Release the mutexes before incrementing
      the counters. Avoid acquiring the lock mutex if the lock wait has
      already been resolved. Atomically increment and decrement
      srv_stats.n_lock_wait_current_count.
      
      row_insert_for_mysql(), row_update_for_mysql(),
      row_update_cascade_for_mysql(): Use the inc() method with the trx->id
      as the slot index. This is a non-functional change, just using
      inc() instead of add(1).
      
      buf_LRU_get_free_block(): Replace the method add(index, n) with inc().
      There is no slot index in the simple_counter.
      ff166093
  7. 11 May, 2017 2 commits
    • Michael Widenius's avatar
      MDEV-10804 main.stat_tables_par fails sporadically in buildbot · 99332399
      Michael Widenius authored
      This was because of two issues:
      - thr_multi_lock_after_thr_lock needed to be hit 3 times before go2 could
        be signaled, because 2 of these happened before statistics_update_start
        was reached.
      - The original code didn't take into accunt that thr_locks can be executed in
        any random order, which caused sporadic failures when waiting for 1 lock
        of 3, as if the locks where in different order, there would be a dead-lock.
        Fixed by introducing thr_multi_lock_before_thr_lock which is deterministic.
      - Some of the test failures where not noticed as the DEBUG_SYNC timeout
        would cause the test to pass (after 300 seconds).
      99332399
    • Michael Widenius's avatar
  8. 10 May, 2017 11 commits
  9. 09 May, 2017 14 commits