1. 16 May, 2019 5 commits
    • Alexander Barkov's avatar
      A joint patch for MDEV-19284 and MDEV-19285 (INSTANT ALTER) · c59d6395
      Alexander Barkov authored
      This patch fixes:
      
      - MDEV-19284 INSTANT ALTER with ucs2-to-utf16 conversion produces bad data
      - MDEV-19285 INSTANT ALTER from ascii_general_ci to latin1_general_ci produces corrupt data
      
      These regressions were introduced in 10.4.3 by:
      - MDEV-15564 Avoid table rebuild in ALTER TABLE on collation or charset changes
      
      Changes:
      
      1. Cleanup: Adding a helper method
         Field_longstr::csinfo_change_allows_instant_alter(),
         to remove some duplicate code in field.cc.
      
      2. Cleanup: removing Type_handler::Charsets_are_compatible() and static
         function charsets_are_compatible() and
         introducing new methods in the recently added class Charset instead:
         - encoding_allows_reinterpret_as()
         - encoding_and_order_allow_reinterpret_as()
      
      3. Bug fix: Removing the code that allowed instant conversion for
         ascii-to->8bit and ucs2-to->utf16.
         This actually fixes MDEV-19284 and MDEV-19285.
      
      4. Bug fix: Adding a helper method Charset::collation_specific_name().
         The old corresponding code in Type_handler::Charsets_are_compatible()
         was not safe against (badly named) user-defined collations whose
         character set name can be longer than collation name.
      c59d6395
    • Marko Mäkelä's avatar
      MDEV-19485: Crash on purge after ADD SPATIAL INDEX · 9aa80fcf
      Marko Mäkelä authored
      row_build_spatial_index_key(): Return early if the column is missing
      in the table row tuple.
      
      This is a regression that was introduced by
      commit 0e5a4ac2.
      9aa80fcf
    • Sergei Petrunia's avatar
      MDEV-19134: EXISTS() slower if ORDER BY is defined · d448cfc9
      Sergei Petrunia authored
      Step #2: "[ORDER BY ...] LIMIT n" should not prevent EXISTS-to-IN
      conversion, as long as
      - the LIMIT clause doesn't have OFFSET
      - the LIMIT is not "LIMIT 0".
      d448cfc9
    • Sergei Petrunia's avatar
      MDEV-19134: EXISTS() slower if ORDER BY is defined · b1f828a8
      Sergei Petrunia authored
      Step 1: Removal of ORDER BY [LIMIT] from the subquery should be done
      earlier and for broader class of subqueries.
      
      The rewrite was done in Item_in_subselect::select_in_like_transformer(),
      but this had problems:
      - It didn't cover EXISTS subqueries
      - It covered IN-subqueries, but was done after the semi-join transformation
        was considered inapplicable, because ORDER BY was present.
      
      Remaining issue:
      - EXISTS->IN transformation happens before
        check_and_do_in_subquery_rewrites() is called, so it is still prevented
        by the present ORDER BY.
      b1f828a8
    • Anel Husakovic's avatar
      Fix echo message · 366bf104
      Anel Husakovic authored
      366bf104
  2. 15 May, 2019 3 commits
  3. 14 May, 2019 4 commits
  4. 13 May, 2019 4 commits
  5. 11 May, 2019 2 commits
    • Varun Gupta's avatar
      MDEV-13628: ORed condition in pushed index condition is not removed from the WHERE · 6a365e0b
      Varun Gupta authored
      So to push index condition for each join tab we have calculate the index condition that can be pushed and then
      remove this index condition from the original condition. This is done through the function make_cond_remainder.
      The problem is the function make_cond_remainder does not remove index condition when there is an OR operator.
      
      Fixed this by making the function make_cond_remainder to keep in mind of the OR operator.
      Also updated results for multiple test files which were incorrectly updated by the commit e0c1b3f2
      
      code which was supposed to remove the condition present in the index
      condition was not getting executed when the condition had OR operator, with AND the pushed
      index condition was getting removed from where.
      
      This problem affects all versions starting from 5.5 but this is a performance improvement, so fixing it in 10.4
      6a365e0b
    • Monty's avatar
      Fixed that storage/funcs tests works with Aria · 9965966a
      Monty authored
      Problem was that SHOW CREATE didn't remove PAGE_CHECKSUM=1
      9965966a
  6. 10 May, 2019 2 commits
    • hygonsoc's avatar
      add Hygon Dhyana support in check-cpu · 6f3b0999
      hygonsoc authored
      Signed-off-by: default avatarhygonsoc <hygonsoc@gmail.com>
      6f3b0999
    • Daniel Black's avatar
      MDEV-8553: Impossible where for a!=a, a<a, a>a · d2fa5f8c
      Daniel Black authored
      For a table column `a`, the above expressions logically
      equate to false in all cases.
      
      With this patch the optimizer knows about this and queries
      like:
      
      SELECT * FROM t1 WHERE a!=a
      
      no longer need to evaluate a!=a for every row.
      
      The same applies if the expression was `a<a`, or `a>a`
      
      An `EXPLAIN SELECT COOUNT(*) FROM t1 WHERE a<a` will show:
      
      id     select_type     table   type    possible_keys   key     key_len ref     rows    Extra
      1      SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    Impossible WHERE
      
      Similarly `NOT (a!=a)` is always true.
      
      EXPLAIN SELECT COUNT(*) FROM t1 WHERE not (a!=a);
      id     select_type     table   type    possible_keys   key     key_len ref     rows    Extra
      1      SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    Select tables optimized away
      d2fa5f8c
  7. 09 May, 2019 2 commits
    • Vladislav Vaintroub's avatar
      MDEV-19235 MariaDB Server compiled for 128 Indexes crashes at startup · ad36d380
      Vladislav Vaintroub authored
      With MAX_INDEXIES=64(default), key_map=Bitmap<64> is just a wrapper around
      ulonglong and thus "trivial" (can be bzero-ed, or memcpy-ed, and stays
      valid still)
      
      With MAX_INDEXES=128, key_map = Bitmap<128> is not a "trivial" type
      anymore. The implementation uses MY_BITMAP, and MY_BITMAP contains pointers
      which make Bitmap invalid, when it is memcpy-ed/bzero-ed.
      
      The problem in 10.4 is that there are many new key_map members, inside TABLE
      or KEY, and those are often memcopied and bzeroed
      
      The fix makes Bitmap "trivial", by inlining most of MY_BITMAP functionality.
      pointers/heap allocations are not used anymore.
      ad36d380
    • Monty's avatar
      Disable 5733_tokudb as the result is not stable · 44b8b002
      Monty authored
      44b8b002
  8. 07 May, 2019 1 commit
  9. 06 May, 2019 5 commits
  10. 05 May, 2019 4 commits
  11. 04 May, 2019 1 commit
    • Sergey Vojtovich's avatar
      Restore vars_list destructor · e8dd18a4
      Sergey Vojtovich authored
      Regression after reverting fair THD members constructors/destructors.
      vars_list can be used standalone, in such cases destructor is needed.
      
      Part of MDEV-14984 - regression in connect performance
      e8dd18a4
  12. 03 May, 2019 7 commits
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · b6f4cccd
      Marko Mäkelä authored
      b6f4cccd
    • Marko Mäkelä's avatar
      MDEV-19385: Inconsistent definition of dtuple_get_nth_v_field() · ce195987
      Marko Mäkelä authored
      The accessor dtuple_get_nth_v_field() was defined differently between
      debug and release builds in MySQL 5.7.8 in
      mysql/mysql-server@c47e1751b742454de553937039bbf2bcbe3c6bc7
      and a debug assertion to document or enforce the questionable assumption
      tuple->v_fields == &tuple->fields[tuple->n_fields] was missing.
      
      This was apparently no problem until MDEV-11369 introduced instant
      ADD COLUMN to MariaDB Server 10.3. With that work present, in one
      test case, trx_undo_report_insert_virtual() could in release builds
      fetch the wrong value for a virtual column.
      
      We replace many of the dtuple_t accessors with const-preserving
      inline functions, and fix missing or misleadingly applied const
      qualifiers accordingly.
      ce195987
    • Marko Mäkelä's avatar
      MDEV-19346: Remove dummy InnoDB log checkpoints · 3db94d24
      Marko Mäkelä authored
      log_checkpoint(), log_make_checkpoint_at(): Remove the parameter
      write_always. It seems that the primary purpose of this parameter
      was to ensure in the function recv_reset_logs() that both checkpoint
      header pages will be overwritten, when the function is called from
      the never-enabled function recv_recovery_from_archive_start().
      
      create_log_files(): Merge recv_reset_logs() to its only caller.
      
      Debug instrumentation: Prefer to flush the redo log, instead of
      triggering a redo log checkpoint.
      
      page_header_set_field(): Disable a debug assertion that will
      always fail due to MDEV-19344, now that we no longer initiate
      a redo log checkpoint before an injected crash.
      
      In recv_reset_logs() there used to be two calls to
      log_make_checkpoint_at(). The apparent purpose of this was
      to ensure that both InnoDB redo log checkpoint header pages
      will be initialized or overwritten.
      The second call was removed (without any explanation) in MySQL 5.6.3:
      mysql/mysql-server@4ca37968da54ddc6b3b6628f41428ddba1c79bb8
      
      In MySQL 5.6.8 WL#6494, starting with
      mysql/mysql-server@00a0ba8ad92569fcf08212b3b8cf046dc8a0ce10
      the function recv_reset_logs() was not only invoked during
      InnoDB data file initialization, but also during a regular
      startup when the redo log is being resized.
      
      mysql/mysql-server@45e91679832219e2593c77185342f11f85232b58
      in MySQL 5.7.2 removed the UNIV_LOG_ARCHIVE code, but still
      did not remove the parameter write_always.
      3db94d24
    • Eugene Kosov's avatar
      MDEV-17702 fix unaligned access UB in sint4korr() and similar functions · bcc13592
      Eugene Kosov authored
      Disable (hopefully temprorary) this check. Also add tests for some serialized
      functions.
      bcc13592
    • Sergey Vojtovich's avatar
      Revert THD::THD(skip_global_sys_var_lock) argument · 779fb636
      Sergey Vojtovich authored
      Originally introduced by e972125f to avoid harmless wait for
      LOCK_global_system_variables in a newly created thread, which creation was
      initiated by system variable update.
      
      At the same time it opens dangerous hole, when system variable update
      thread already released LOCK_global_system_variables and ack_receiver
      thread haven't yet completed new THD construction. In this case THD
      constructor goes completely unprotected.
      
      Since ack_receiver.stop() waits for the thread to go down, we have to
      temporarily release LOCK_global_system_variables so that it doesn't
      deadlock with ack_receiver.run(). Unfortunately it breaks atomicity
      of rpl_semi_sync_master_enabled updates and makes them not serialized.
      
      LOCK_rpl_semi_sync_master_enabled was introduced to workaround the above.
      TODO: move ack_receiver start/stop into repl_semisync_master
      enable_master/disable_master under LOCK_binlog protection?
      
      Part of MDEV-14984 - regression in connect performance
      779fb636
    • Sergey Vojtovich's avatar
      Adieu find_sys_var_ex() · 894df7ed
      Sergey Vojtovich authored
      Only take LOCK_plugin for plugin system variables.
      
      Reverted optimisation that was originally done for session tracker: it
      makes much less sense now. Specifically only if connections would want to
      track plugin session variables changes and these changes would actually
      happen frequently. If this ever becomes an issue, there're much better
      ways to optimise this workload.
      
      Part of MDEV-14984 - regression in connect performance
      894df7ed
    • Sergey Vojtovich's avatar
      Make connect speed great again · 53671a1f
      Sergey Vojtovich authored
      Rather than parsing session_track_system_variables when thread starts, do
      it when first trackable event occurs.
      
      Benchmarked on a 2socket/20core/40threads Broadwell system using sysbench
      connect brencmark @40 threads (with select 1 disabled):
      101379.77 -> 143016.68 CPS, whereas 10.2 is currently at 137766.31 CPS.
      
      Part of MDEV-14984 - regression in connect performance
      53671a1f