1. 26 Apr, 2018 14 commits
    • Marko Mäkelä's avatar
      MDEV-15914: Restore MLOG_UNDO_INSERT · 76c62bc6
      Marko Mäkelä authored
      trx_undof_page_add_undo_rec_log(): Write the MLOG_UNDO_INSERT
      record instead of the equivalent MLOG_2BYTES and MLOG_WRITE_STRING.
      This essentially reverts commit 9ee8917d.
      
      In MariaDB 10.3, I attempted to simplify the crash recovery code
      by making use of lower-level redo log records. It turns out that
      we must keep the redo log parsing code in order to allow crash-upgrade
      from older MariaDB versions (MDEV-14848).
      
      Now, it further turns out that the InnoDB redo log record format is
      suboptimal for logging multiple changes to a single page. This simple
      change to the redo logging of undo log significantly affects the
      INSERT and UPDATE performance.
      
      Essentially, we wrote
      	(space_id,page_number,MLOG_2BYTES,2 bytes)
      	(space_id,page_number,MLOG_WRITE_STRING,N+4 bytes)
      instead of the previously written
      	(space_id,page_number,MLOG_UNDO_INSERT,N+2 bytes)
      
      The added redo log volume caused a single-threaded INSERT
      (without innodb_adaptive_hash_index) of
      1,000,000 rows to consume 11 seconds instead of 9 seconds,
      and a subsequent UPDATE of 30,000,000 rows to consume 64 seconds
      instead of 58 seconds. If we omitted all redo logging for the
      undo log, the INSERT would consume only 4 seconds.
      76c62bc6
    • Marko Mäkelä's avatar
      MDEV-15914: Remove trx_t::undo_mutex · 83bd4dd1
      Marko Mäkelä authored
      The trx_t::undo_mutex covered both some main-memory data structures
      (trx_undo_t) and access to undo pages. The trx_undo_t is only
      accessed by the thread that is associated with a running transaction.
      Likewise, each transaction has its private set of undo pages.
      The thread that is associated with an active transaction may
      lock multiple undo pages concurrently, but no other thread may
      lock multiple pages of a foreign transaction.
      
      Concurrent access to the undo logs of an active transaction is possible,
      but trx_undo_get_undo_rec_low() only locks one undo page at a time,
      without ever holding any undo_mutex.
      
      It seems that the trx_t::undo_mutex would have been necessary if
      multi-threaded execution or rollback of a single transaction
      had been implemented in InnoDB.
      83bd4dd1
    • Marko Mäkelä's avatar
      f7cac5e2
    • Marko Mäkelä's avatar
      MDEV-15914: Remove trx_undo_t::empty · ff0000cd
      Marko Mäkelä authored
      Use the value trx_undo_t::top_undo_no == IB_ID_MAX for indicating
      that an undo log is empty.
      ff0000cd
    • Marko Mäkelä's avatar
      c121574d
    • Marko Mäkelä's avatar
      MDEV-15914: Simplify row_search_mvcc() · 7b7e4d67
      Marko Mäkelä authored
      7b7e4d67
    • Marko Mäkelä's avatar
      MDEV-15914: Fast path for rw_trx_hash::find() · 30553aa3
      Marko Mäkelä authored
      rw_trx_hash_t::find(): Implement a fast path for looking up
      the current transaction. This helps transactions that visit
      rows modified by themselves.
      30553aa3
    • Alexey Botchkov's avatar
      MDEV-15915 Add Feature_json status variable. · 6e42d19f
      Alexey Botchkov authored
      Related implementations.
      6e42d19f
    • Monty's avatar
      Removed some old #if MYSQL_VERSION · cd48c1e2
      Monty authored
      - Removed never used warning that explicit_defaults_for_timestamp was
        not set
      cd48c1e2
    • Monty's avatar
      Fix a lot of compiler warnings found by -Wunused · 2ccd6716
      Monty authored
      2ccd6716
    • Oleksandr Byelkin's avatar
      MDEV-15732: Assertion `next_free_value % real_increment == offset &&... · 0bdc15d8
      Oleksandr Byelkin authored
      MDEV-15732: Assertion `next_free_value % real_increment == offset && next_free_value >= reserved_until' failed in sequence_definition::adjust_values upon SETVAL for sequence with INCREMENT 0
      
      there was a problem with "next_free_value >= reserved_until" condition:
      SEQUENCE::set_value handle next_free_value & reserved_until after adjust_values() call, so it is incorect to put assert on it in adjust_values()
      0bdc15d8
    • Daniel Black's avatar
      tests: func_math, correct crc32 for mariadb · 7f89d9c9
      Daniel Black authored
      Differences:
      
      MariaDB doesn't support a JSON type therefore the crc32 on those values
      are different.
      
      JSON extract syntax is different.
      
      loaddata_utf8 has 3 duplicate lines removed compared to MySQL version.
      7f89d9c9
    • Shivashankar Nagaraj's avatar
      BUG#26495791: CONTRIBUTION: EXPAND TEST SUITE TO INCLUDE CRC32 TESTS · 1a011e5b
      Shivashankar Nagaraj authored
      From mysql-server:
      09fdfad50764ff6809e7dd5300e9ce1ab727b62a
      e90ae1707e0ca46abc775d1680d1856c4be38b66
      
      described in http://github.com/mysql/mysql-server/pull/157
      
      Apart from external contribution I have added few more additional testcases
      for CRC32() function, which are given below.
      
      New Testcases added:
        ->Verify the crc value of various numeric and string data types(int,
            double, blob, text, json, enum, set)
        ->Verify the crc value when expressions having comparison_operators
            and logical_operators
        ->Verify the crc value for the expression having string_functions,
            arithmetic_functions, json_functions
        ->Verify the crc value for the expression having Geometry functions
            like POINT, LINESTRING, MULTILINESTRING, POLYGON, MULTIPOLYGON
        ->Verify the crc value generated from stored procedures, functions,
            triggers, prepare statement, views.
      
      Fix:
      Patch based on contribution by Daniel Black (Github user: grooverdan)
      
      Reviewed-by: Anitha Gopi anitha.gopi@oracle.com
      Reviewed-by: Srikanth B R srikanth.b.r@oracle.com
      
      RB: 17294
      1a011e5b
    • Igor Babaev's avatar
      Fixed a compiler error · 5bba69f8
      Igor Babaev authored
      5bba69f8
  2. 25 Apr, 2018 5 commits
  3. 24 Apr, 2018 15 commits
  4. 23 Apr, 2018 6 commits
    • Alexander Barkov's avatar
    • Marko Mäkelä's avatar
      MDEV-15723 Crash in INFORMATION_SCHEMA.INNODB_SYS_TABLES when accessing corrupted record · c7bb3372
      Marko Mäkelä authored
      dict_load_table_low(): When flagging an error, assign *table = NULL.
      Failure to do so could cause a crash if an error was flagged when
      accessing INFORMATION_SCHEMA.INNODB_SYS_TABLES.
      c7bb3372
    • Alexander Barkov's avatar
      "AS OF" clean in Type_handler · 8fce4065
      Alexander Barkov authored
      This patch does the following:
      
      1. Makes Field_vers_trx_id::type_handler() return
        &type_handler_vers_trx_id rather than &type_handler_longlong.
        Fixes Item_func::convert_const_compared_to_int_field() to
        test field_item->type_handler() against &type_handler_vers_trx_id,
        instead of testing field_item->vers_trx_id().
      
      2. Removes VERS_TRX_ID related code from
        Type_handler_hybrid_field_type::aggregate_for_comparison(),
        because "BIGINT UNSIGNED GENERATED ALWAYS AS ROW {START|END}"
        columns behave just like a BIGINT in a regular comparison,
        i.e. when not inside AS OF.
      
      3. Removes
         - Type_handler_hybrid_field_type::m_vers_trx_id;
         - Type_handler_hybrid_field_type::m_flags;
        because a "BIGINT UNSIGNED GENERATED ALWAYS AS ROW {START|END}"
        behaves like a regular BIGINT column when in UNION.
      
      4. Removes Field::vers_trx_id(), Item::vers_trx_id(), Item::field_flags()
        They are not needed anymore. See N1.
      8fce4065
    • Jan Lindström's avatar
      Merge pull request #713 from codership/MDEV-15948 · 82d4f081
      Jan Lindström authored
      MDEV-15948 Fix error "Lost connection to MySQL server..." in test gal…
      82d4f081
    • Oleksandr Byelkin's avatar
      MDEV-13232: Assertion `(&(&share->intern_lock)->m_mutex)->count > 0 &&... · 14f84d20
      Oleksandr Byelkin authored
      MDEV-13232: Assertion `(&(&share->intern_lock)->m_mutex)->count > 0 && pthread_equal(pthread_self(), (&(&share->intern_lock)->m_mutex)->thread)' failed in _ma_state_info_write
      
      Limit length of result of "negative" operation to something reasonable
      14f84d20
    • Marko Mäkelä's avatar
      MDEV-15983 Reduce fil_system.mutex contention further · de942c9f
      Marko Mäkelä authored
      fil_space_t::n_pending_ops, n_pending_ios: Use a combination of
      fil_system.mutex and atomic memory access for protection.
      
      fil_space_t::release(): Replaces fil_space_release().
      Does not acquire fil_system.mutex.
      
      fil_space_t::release_for_io(): Replaces fil_space_release_for_io().
      Does not acquire fil_system.mutex.
      de942c9f