1. 25 Mar, 2019 9 commits
    • Daniel Bartholomew's avatar
      bump the VERSION · b30bbb7d
      Daniel Bartholomew authored
      b30bbb7d
    • Marko Mäkelä's avatar
      Fix the Windows build · 07096ada
      Marko Mäkelä authored
      btr_cur_compress_recommendation(): Backport a change from 10.3.
      
      This is a follow-up to commit 1bd98154.
      07096ada
    • Marko Mäkelä's avatar
      MDEV-19022: InnoDB fails to cleanup useless B-tree pages · 525e79b0
      Marko Mäkelä authored
      The test case for reproducing MDEV-14126 demonstrates that InnoDB can
      end up with an index tree where a non-leaf page has only one child page.
      
      The test case innodb.innodb_bug14676111 demonstrates that such pages
      are sometimes unavoidable, because InnoDB does not implement any sort
      of B-tree rotation.
      
      But, there is no reason to allow a root page with only one child page.
      
      btr_cur_node_ptr_delete(): Replaces btr_node_ptr_delete().
      
      btr_page_get_father(): Declare globally.
      
      btr_discard_only_page_on_level(): Declare with ATTRIBUTE_COLD.
      It turns out that this function is not covered by the
      innodb.innodb_bug14676111 test case after all.
      
      btr_discard_page(): If the root page ends up having only one child
      page, shrink the tree by invoking btr_lift_page_up().
      525e79b0
    • Marko Mäkelä's avatar
      Avoid sign mismatch in comparisons · ade0a0e9
      Marko Mäkelä authored
      This is follow-up to commit 1bd98154.
      ade0a0e9
    • Marko Mäkelä's avatar
      MDEV-14126: Fix type mismatch · 1bd98154
      Marko Mäkelä authored
      Backport some changes to B-tree page accessor functions from 10.3,
      including changing page_get_n_recs() to return uint16_t.
      1bd98154
    • Marko Mäkelä's avatar
      MDEV-14126: Detect unexpected emptying of B-tree pages · 72b934e3
      Marko Mäkelä authored
      If an index page becomes empty, btr_page_empty() should be called.
      72b934e3
    • Marko Mäkelä's avatar
    • Marko Mäkelä's avatar
      MDEV-14126: Remove page_is_root() · b59d4846
      Marko Mäkelä authored
      The predicate page_is_root(), which was added in MariaDB Server 10.2.2,
      is based on a wrong assumption.
      
      Under some circumstances, InnoDB can transform B-trees into a degenerate
      state where a non-leaf page has no sibling pages. Because of this,
      we cannot assume that a page that has no siblings is the root page.
      This bug will be tracked as MDEV-19022.
      
      Because of the bug that may affect many InnoDB data files, we must remove
      and replace the wrong predicate. Using the wrong predicate can cause
      corruption. A leaf page is not allowed to be empty except if it is the
      root page, and the entire table is empty.
      b59d4846
    • Marko Mäkelä's avatar
      MDEV-18090 Assertion failures due to virtual columns after upgrading to 10.2 · 71c781bf
      Marko Mäkelä authored
      MariaDB before MDEV-5800 in version 10.2.2 did not support
      indexed virtual columns. Non-persistent virtual columns were
      hidden from storage engines. Only starting with MDEV-5800, InnoDB
      would create internal metadata on virtual columns.
      
      Similar to what was done in MDEV-18084 and MDEV-18960, we adjust two more
      code paths for the old tables.
      
      ha_innobase::build_template(): Do not invoke
      dict_index_contains_col_or_prefix() for virtual columns if InnoDB
      does not store the metadata.
      
      innobase_build_col_map(): Relax an assertion about the number of columns.
      
      ha_innobase::omits_virtual_cols(): Renamed from omits_virtual_cols().
      71c781bf
  2. 23 Mar, 2019 2 commits
  3. 22 Mar, 2019 5 commits
  4. 21 Mar, 2019 10 commits
  5. 20 Mar, 2019 2 commits
    • Marko Mäkelä's avatar
      MDEV-18981 Possible corruption when using FOREIGN KEY with virtual columns · 630199e7
      Marko Mäkelä authored
      row_ins_foreign_fill_virtual(): Construct update->old_vrow
      with ROW_COPY_DATA instead of ROW_COPY_POINTERS. With the latter,
      the object would be pointing to a buffer pool page frame. That page
      frame can become stale and invalid as soon as
      row_ins_foreign_check_on_constraint() invokes mtr_t::commit().
      
      Most of the time, the pointer target is not going to be overwritten
      by anything, and everything appears to work correctly.
      Buffer pool page replacement is highly unlikely, and any pessimistic
      operation that would overwrite the old location of the record is only
      slightly more likely. It is not known whether there is an actual bug.
      This came up while diagnosing MDEV-18879 in MariaDB 10.3.
      630199e7
    • Alexander Barkov's avatar
      Fixing "mtr func_math" failure in the test for MDEV-17643 · ef81d2ea
      Alexander Barkov authored
      Adding an intermediate volatile variable to avoid using co-processor registers
      on some platforms (e.g. 32-bit x86).
      This change makes test results stable accross all platforms.
      ef81d2ea
  6. 19 Mar, 2019 3 commits
    • Marko Mäkelä's avatar
      MDEV-18084: Crash on UPDATE after upgrade from 10.0 or 10.1 · a77e2668
      Marko Mäkelä authored
      MariaDB Server 10.0 and 10.1 support non-indexed virtual columns,
      which are hidden from the storage engine. Starting with MDEV-5800
      in MariaDB 10.2.2, the virtual columns are visible to storage engines.
      
      calc_row_difference(): Follow up the MDEV-17199 fix, which forgot
      to increment num_v when skipping virtual columns in tables that
      were created before MariaDB 10.2.2. This caused a corruption of
      the update vector when an updated persistent column is preceded
      by virtual columns.
      a77e2668
    • Marko Mäkelä's avatar
      Replace innobase_is_v_fld() with Field::stored_in_db() · 1efda582
      Marko Mäkelä authored
      The macro innobase_is_v_fld() turns out to be equivalent with
      the opposite of Field::stored_in_db(). Remove the macro and
      invoke the member function directly.
      
      innodb_base_col_setup_for_stored(): Simplify a condition to only
      check Field::vcol_info.
      
      innobase_create_index_def(): Replace some redundant code with
      DBUG_ASSERT().
      1efda582
    • Marko Mäkelä's avatar
      MDEV-18960: Assertion !omits_virtual_cols(*form->s) on TRUNCATE · 9471dbaf
      Marko Mäkelä authored
      MariaDB before MDEV-5800 in version 10.2.2 did not support
      indexed virtual columns. Non-persistent virtual columns were
      hidden from storage engines. Only starting with MDEV-5800, InnoDB
      would create internal metadata on virtual columns.
      
      On TRUNCATE TABLE, an old .frm file from before MDEV-5800 may be
      used as the table schema. When the table is being re-created by
      InnoDB, the old schema must be used. That is, we may hide
      the existence of virtual columns from InnoDB.
      
      create_table_check_doc_id_col(): Remove the assertion that failed.
      This function can actually correctly deal with virtual columns
      that could have been created before MariaDB 10.2.2 introduced MDEV-5800.
      
      create_table_info_t::create_table_def(): Do not create metadata for
      virtual columns if the table definition was created before MariaDB 10.2.2.
      9471dbaf
  7. 18 Mar, 2019 5 commits
    • Alexander Barkov's avatar
    • Marko Mäkelä's avatar
      MDEV-17482 InnoDB fails to say which fatal error fsync() returned · 00572a0b
      Marko Mäkelä authored
      os_file_fsync_posix(): If fsync() returns a fatal error,
      do include errno in the error message.
      
      In the future, we might handle fsync() or write or allocation failures
      on InnoDB data files a little more gracefully: flag the affected index
      or table as corrupted, and deny any subsequent writes to the table.
      
      If a write to the undo log or redo log fails, an alternative to
      killing the server could be to deny any writes to InnoDB tables
      until the server has been restarted.
      00572a0b
    • Marko Mäkelä's avatar
      1d728a98
    • Marko Mäkelä's avatar
      Post-merge fix after 0508d327 · e3618a33
      Marko Mäkelä authored
      e3618a33
    • sysprg's avatar
      MDEV-17262: mysql crashed on galera while node rejoined cluster (#895) · 26432e49
      sysprg authored
      This patch contains a fix for the MDEV-17262/17243 issues and
      new mtr test.
      
      These issues (MDEV-17262/17243) have two reasons:
      
      1) After an intermediate commit, a transaction loses its status
      of "transaction that registered in the MySQL for 2pc coordinator"
      (in the InnoDB) due to the fact that since version 10.2 the
      write_row() function (which located in the ha_innodb.cc) does
      not call trx_register_for_2pc(m_prebuilt->trx) during the processing
      of split transactions. It is necessary to restore this call inside
      the write_row() when an intermediate commit was made (for a split
      transaction).
      
      Similarly, we need to set the flag of the started transaction
      (m_prebuilt->sql_stat_start) after intermediate commit.
      
      The table->file->extra(HA_EXTRA_FAKE_START_STMT) called from the
      wsrep_load_data_split() function (which located in sql_load.cc)
      will also do this, but it will be too late. As a result, the call
      to the wsrep_append_keys() function from the InnoDB engine may be
      lost or function may be called with invalid transaction identifier.
      
      2) If a transaction with the LOAD DATA statement is divided into
      logical mini-transactions (of the 10K rows) and binlog is rotated,
      then in rare cases due to the wsrep handler re-registration at the
      boundary of the split, the last portion of data may be lost. Since
      splitting of the LOAD DATA into mini-transactions is technical,
      I believe that we should not allow these mini-transactions to fall
      into separate binlogs. Therefore, it is necessary to prohibit the
      rotation of binlog in the middle of processing LOAD DATA statement.
      
      https://jira.mariadb.org/browse/MDEV-17262 and
      https://jira.mariadb.org/browse/MDEV-17243
      26432e49
  8. 16 Mar, 2019 2 commits
  9. 15 Mar, 2019 2 commits
    • Sergei Golubchik's avatar
      post-merge: --ps-protocol fixes · 1f020299
      Sergei Golubchik authored
      Includes:
      
      MDEV-17302 Add support for ALTER USER command in prepared statement
      
      and
      
      MDEV-17673 main.cte_recursive fails in bb-10.4-ps branch in --ps
      
        Set correct SELECT_LEX linkage for recursive CTEs.
        Do not delegate this job to TABLE_LIST::set_as_with_table,
        because it is only run on prepare, while With_element::move_anchors_ahead
        is run both on prepare and execute (fix by Igor)
      1f020299
    • Sergei Golubchik's avatar
      post-merge: gcc 8 warnings · f1134d56
      Sergei Golubchik authored
      note: Inherit String from Sql_alloc,
      to get operators new and new[] in sync
      
      in rocksdb gcc was complaining that non-lvalue was cast to const.
      f1134d56