1. 20 Jan, 2020 1 commit
    • Igor Babaev's avatar
      MDEV-21446 Assertion `!prebuilt->index->is_primary()' failed in · 7ea413ac
      Igor Babaev authored
      row_search_idx_cond_check with rowid_filter upon concurrent access to table
      
      This bug has nothing to do with the concurrent access to table. Rather it
      concerns queries for which the optimizer decides to employ a rowid filter
      when accessing an InnoDB table by a secondary index, but later when
      calling test_if_skip_sort_order() changes its mind to access the table by
      the primary key.
      Currently usage of rowid filters is not supported in InnoDB if the table
      is accessed by the primary key. So in this case usage of a rowid filter
      to access the table must be prohibited.
      7ea413ac
  2. 19 Jan, 2020 1 commit
  3. 18 Jan, 2020 2 commits
  4. 17 Jan, 2020 3 commits
  5. 16 Jan, 2020 1 commit
  6. 15 Jan, 2020 2 commits
    • Igor Babaev's avatar
      MDEV-21184 Assertion `used_tables_cache == 0' failed in Item_func::fix_fields · 1c97cd33
      Igor Babaev authored
                 with condition_pushdown_from_having
      
      This bug could manifest itself for queries with GROUP BY and HAVING clauses
      when the HAVING clause was a conjunctive condition that depended
      exclusively on grouping fields and at least one conjunct contained an
      equality of the form fld=sq where fld is a grouping field and sq is a
      constant subquery.
      In this case the optimizer tries to perform a pushdown of the HAVING
      condition into WHERE. To construct the pushable condition the optimizer
      first transforms all multiple equalities in HAVING into simple equalities.
      This has to be done for a proper processing of the pushed conditions
      in WHERE. The multiple equalities at all AND/OR levels must be converted
      to simple equalities because any multiple equality may refer to a multiple
      equality at the upper level.
      Before this patch the conversion was performed like this:
        multiple_equality(x,f1,...,fn) => x=f1 and ... and x=fn.
      When an equality item for x=fi was constructed both the items for x and fi
      were cloned. If x happened to be a constant subquery that could not be
      cloned the conversion failed. If the conversions of multiple equalities
      previously performed had succeeded then the whole condition became in an
      inconsistent state that could cause different failures.
      The solution provided by the patch is:
      1. to use a different conversion rule if x is a constant
        multiple_equality(x,f1,...,fn) => f1=x and f2=f1 and ... and fn=f1
      2. not to clone x if it's a constant.
      Such conversions cannot fail and besides the result of the conversion
      preserves the equivalence of f1,...,fn that can be used for other
      optimizations.
      This patch also made sure that expensive predicates are not pushed from
      HAVING to WHERE.
      1c97cd33
    • Marko Mäkelä's avatar
      MDEV-21485 ASAN use-after-poison in dfield_get_len or Assertion `pos < index->n_def' failed · 6a8a4c19
      Marko Mäkelä authored
      The server would crash when instantly reordering the columns of a
      table whose all columns belong to the PRIMARY KEY.
      6a8a4c19
  7. 14 Jan, 2020 1 commit
    • Daniele Sciascia's avatar
      Wsrep position not updated in InnoDB after certification failures (#1432) · 2d4b6571
      Daniele Sciascia authored
      A certification failure followed by a clean shutdown would cause an
      inconsistency between the sequence number stored in innodb and the
      sequence number stored in provider.
      This happened both in the case of local certification failure, and in
      the case where dummy writeset is applied.
      The fix consists of:
      - updating wsrep position after dummy writeset is delivered in
       `Wsrep_high_priority_service::log_dummy_write_set()`
      - updating wsrep position while releasing commit order in wsrep-lib
       side
      
      Added two tests which stress the situation where a server is shutdown
      after a certification failure.
      2d4b6571
  8. 08 Jan, 2020 3 commits
  9. 07 Jan, 2020 19 commits
    • Sujatha's avatar
      Merge branch '10.1' into 10.2 · 8317f77c
      Sujatha authored
      MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events
      
      Problem:
      ========
      SHOW BINLOG EVENTS FROM <pos> reports following assert when ASAN is enabled.
      
      uint32 binlog_get_uncompress_len(const char*):
        Assertion `(buf[0] & 0xe0) == 0x80' failed
      
      Fix:
      ===
      **Part11: Converted debug assert to error handler code**
      8317f77c
    • Sujatha's avatar
      MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events · cb204e11
      Sujatha authored
      Problem:
      ========
      SHOW BINLOG EVENTS FROM <pos> reports following ASAN error.
      
      AddressSanitizer: heap-buffer-overflow on address
      READ of size 1 at 0x60e00009cf71 thread T28
      #0 0x55e37e034ae2 in net_field_length
      
      Fix:
      ===
      **Part10: Avoid reading out of buffer**
      cb204e11
    • Sujatha's avatar
      MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events · d05c511d
      Sujatha authored
      Problem:
      ========
      SHOW BINLOG EVENTS FROM <pos> reports following assert when ASAN is enabled.
      
      Query_log_event::Query_log_event(const char*, uint,
          const Format_description_log_event*, Log_event_type):
        Assertion `(pos) + (6) <= (end)' failed
      
      Fix:
      ===
      **Part9: Removed additional DBUG_ASSERT**
      d05c511d
    • Sujatha's avatar
      MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events · bac33533
      Sujatha authored
      Problem:
      ========
      SHOW BINLOG EVENTS FROM <pos> reports following ASAN error
      
      AddressSanitizer: SEGV on unknown address
      The signal is caused by a READ memory access.
      User_var_log_event::User_var_log_event(char const*, unsigned int,
          Format_description_log_event const*)
      
      Implemented part of upstream patch.
      commit: mysql/mysql-server@a3a497ccf7ecacc900551fb1e47ea4078b45c351
      
      Fix:
      ===
      **Part8: added checks to avoid reading out of buffer limits**
      bac33533
    • Sujatha's avatar
      MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events · 2187f1c2
      Sujatha authored
      Problem:
      ========
      SHOW BINLOG EVENTS FROM <pos> reports following ASAN error
      "heap-buffer-overflow on address" and some times it asserts.
      
      Table_map_log_event::Table_map_log_event(const char*, uint,
          const Format_description_log_event*)
      Assertion `m_field_metadata_size <= (m_colcnt * 2)' failed.
      
      Fix:
      ===
      **Part7: Avoid reading out of buffer**
      
      
      Converted debug assert to error handler code.
      2187f1c2
    • Sujatha's avatar
      MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events · d6fa69e4
      Sujatha authored
      Problem:
      ========
      SHOW BINLOG EVENTS FROM <pos> reports following ASAN error
      
      AddressSanitizer: heap-buffer-overflow on address 0x60400002acb8
      Load_log_event::copy_log_event(char const*, unsigned long, int,
          Format_description_log_event const*)
      
      Fix:
      ===
      **Part6: Moved the event_len validation to the begin of copy_log_event function**
      d6fa69e4
    • Sujatha's avatar
      MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events · 15781283
      Sujatha authored
      Problem:
      ========
      SHOW BINLOG EVENTS FROM <pos> reports following ASAN error
      
      AddressSanitizer: heap-buffer-overflow on address
      String::append(char const*, unsigned int)
      Query_log_event::pack_info(Protocol*)
      
      Fix:
      ===
      **Part5: Added check to catch buffer overflow**
      15781283
    • Sujatha's avatar
      MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events · a42ef108
      Sujatha authored
      Problem:
      ========
      SHOW BINLOG EVENTS FROM <pos> reports following ASAN error
      
      heap-buffer-overflow within "my_strndup" in Rotate_log_event
      
      my_strndup /mysys/my_malloc.c:254
      Rotate_log_event::Rotate_log_event(char const*, unsigned int,
          Format_description_log_event const*)
      
      Fix:
      ===
      **Part4: Improved the check for event_len validation**
      a42ef108
    • Sujatha's avatar
      MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events · 5a54e84e
      Sujatha authored
      Problem:
      ========
      SHOW BINLOG EVENTS FROM <pos> reports following crash when ASAN is enabled.
      
      SEGV on unknown address
      in inline_mysql_mutex_destroy
      in my_bitmap_free
      in Update_rows_log_event::~Update_rows_log_event()
      
      Fix:
      ===
      **Part3: Initialize m_cols_ai.bitmap to NULL**
      5a54e84e
    • Sujatha's avatar
      MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events · 913f405d
      Sujatha authored
      Problem:
      ========
      SHOW BINLOG EVENTS FROM <pos> reports following assert when ASAN is enabled.
      
      Rows_log_event::Rows_log_event(const char*, uint,
          const Format_description_log_event*):
      Assertion `var_header_len >= 2'
      
      Implemented part of upstream patch.
      commit: mysql/mysql-server@a3a497ccf7ecacc900551fb1e47ea4078b45c351
      
      Fix:
      ===
      **Part2: Avoid reading out of buffer limits**
      913f405d
    • Sujatha's avatar
      MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events · a6dd827a
      Sujatha authored
      Problem:
      ========
      SHOW BINLOG EVENTS FROM <pos> causes a variety of failures, some of which are
      listed below. It is not a race condition issue, but there is some
      non-determinism in it.
      
      Analysis:
      ========
      "show binlog events from <pos>" code considers the user given position as a
      valid event start position. The code starts reading data from this event start
      position onwards and tries to map it to a set of known events. Each event has
      a specific event structure and asserts have been added to ensure that read
      event data satisfies the event specific requirements. When a random position
      is supplied to "show binlog events command" the event structure specific
      checks will fail and they result in assert.
      
      Fix:
      ====
      The fix is split into different parts. Each part addresses either an ASAN
      issue or an assert/crash.
      
      **Part1: Checksum based position validation when checksum is enabled**
      
      
      Using checksum validate the very first event read at the user specified
      position. If there is a checksum mismatch report an appropriate error for the
      invalid event.
      a6dd827a
    • Marko Mäkelä's avatar
      Fixup MDEV-21429: Correct a definition · 0b4ae672
      Marko Mäkelä authored
      INNOBASE_ALTER_NOVALIDATE: Remove the set of operations
      INNOBASE_ONLINE_CREATE that was accidentally included in the
      definition.
      
      In the merge of 82187a12 to 10.3
      (in commit eda71979) the flags
      were defined correctly.
      
      This bug was caught by the test innodb_zip.index_large_prefix.
      0b4ae672
    • Marko Mäkelä's avatar
      MDEV-20839 encryption.innodb-redo-badkey sporadically fails on buildbot with page dump · d2697dfb
      Marko Mäkelä authored
      The test encryption.innodb-redo-badkey will by design cause access
      to pages that appear corrupted (due to incorrect encryption key).
      Let us disable the page dumps by requiring the test to be run on
      a debug server. Page dumps on debug builds were already disabled
      in MDEV-19766.
      d2697dfb
    • Elena Stepanova's avatar
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · d60dcabd
      Marko Mäkelä authored
      d60dcabd
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · eda71979
      Marko Mäkelä authored
      eda71979
    • Marko Mäkelä's avatar
      MDEV-21429 TRUNCATE and OPTIMIZE are being refused due to "row size too large" · 82187a12
      Marko Mäkelä authored
      By default (innodb_strict_mode=ON), InnoDB attempts to guarantee
      at DDL time that any INSERT to the table can succeed.
      MDEV-19292 recently revised the "row size too large" check in InnoDB.
      The check still is somewhat inaccurate;
      that should be addressed in MDEV-20194.
      
      Note: If a table contains multiple long string columns so that each column
      is part of a column prefix index, then an UPDATE that attempts to modify
      all those columns at once may fail, because the undo log record might
      not fit in a single undo log page (of innodb_page_size). In the worst case,
      the undo log record would grow by about 3KiB of for each updated column.
      
      The DDL-time check (since the InnoDB Plugin for MySQL 5.1) is optional
      in the sense that when the maximum B-tree record size or undo log
      record size would be exceeded, the DML operation will fail and the
      transaction will be properly rolled back.
      
      create_table_info_t::row_size_is_acceptable(): Add the parameter
      'bool strict' so that innodb_strict_mode=ON can be overridden during
      TRUNCATE, OPTIMIZE and ALTER TABLE...FORCE (when the storage format
      is not changing).
      
      create_table_info_t::create_table(): Perform a sloppy check for
      TRUNCATE TABLE (create_fk=false).
      
      prepare_inplace_alter_table_dict(): Perform a sloppy check for
      simple operations.
      
      trx_is_strict(): Remove. The function became unused in
      commit 98694ab0 (MDEV-20949).
      82187a12
    • Jan Lindström's avatar
      MDEV-13569: wsrep_info.plugin failed in buildbot with "no nodes coming from prim view · 5824e9f8
      Jan Lindström authored
      Modify configuration so that all nodes are part of galera cluster
      i.e. wsrep_on=ON. Add missing wait conditions.
      
      test changes only.
      5824e9f8
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · e99ba4ba
      Marko Mäkelä authored
      e99ba4ba
  10. 06 Jan, 2020 1 commit
  11. 04 Jan, 2020 1 commit
    • Eugene Kosov's avatar
      Lets add another intrusive double linked list! · fd899b3b
      Eugene Kosov authored
      Features:
      * STL-like interface
      * Fast modification: no branches on insertion or deletion
      * Fast iteration: one pointer dereference and one pointer comparison
      * Your class can be a part of several lists
      
      Modeled after std::list<T> but currently has fewer methods (not complete yet)
      
      For even more performance it's possible to customize list with templates so
      it won't have size counter variable or won't NULLify unlinked node.
      
      How existing lists differ?
      
      No existing lists support STL-like interface.
      
      I_List:
      * slower iteration (one more branch on iteration)
      * element can't be a part of two lists simultaneously
      
      I_P_List:
      * slower modification (branches, except for the fastest push_back() case)
      * slower iteration (one more branch on iteration)
      
      UT_LIST_BASE_NODE_T:
      * slower modification (branches)
      
      Three UT_LISTs were replaced: two in fil_system_t and one in dyn_buf_t.
      fd899b3b
  12. 03 Jan, 2020 5 commits