1. 09 May, 2018 3 commits
  2. 08 May, 2018 7 commits
  3. 07 May, 2018 9 commits
    • Igor Babaev's avatar
    • Monty's avatar
      Added test case for MDEV-13007 ALTER .. ENGINE on temporary sequence may go wrong · bd09c5ca
      Monty authored
      Looks like the bug was fixed some time ago (at least I can't repeat it).
      I added the test case just have this case tested properly.
      bd09c5ca
    • Daniel Black's avatar
      mysys: disable "optimized" memcpy from 18 years ago · d405bee0
      Daniel Black authored
      MDEV-15843 mysys: remove optimized memcpy from 18 years ago
      
      While this code has remained dormant for 18 years, libc implementers
      have used assembly features to gain improvements using achitecture
      features optimized and by the buffer length like:
      * https://svnweb.freebsd.org/base/head/lib/libc/amd64/string/memcmp.S
      * https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/aarch64/memcmp.S
      * https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/powerpc/powerpc64/memcpy.S
      
      From an sysbench-1.0.6 oltp_read_only test on binary charset table:
      
      x86_64:
      was ptr_compare_0:
      perf report -g --no-children:
      +    3.37%  mysqld   mysqld               [.] hp_rec_hashnr
      +    3.15%  mysqld   libc-2.26.so         [.] __memmove_avx_unaligned_erms
      +    2.73%  mysqld   mysqld               [.] row_search_mvcc
      +    1.97%  mysqld   mysqld               [.] rec_get_offsets_func
      +    1.24%  mysqld   mysqld               [.] ptr_compare_0
      +    1.14%  mysqld   mysqld               [.] my_qsort2
      
      After: __memcmp_avx2_movbe
      +    3.42%  mysqld   mysqld               [.] hp_rec_hashnr
      +    2.96%  mysqld   libc-2.26.so         [.] __memmove_avx_unaligned_erms
      +    2.91%  mysqld   mysqld               [.] row_search_mvcc
      +    2.13%  mysqld   mysqld               [.] rec_get_offsets_func
      +    1.18%  mysqld   libc-2.26.so         [.] __memcmp_avx2_movbe
      +    1.04%  mysqld   mysqld               [.] evaluate_join_record
      +    1.02%  mysqld   mysqld               [.] my_qsort2
      
      Power9:
      Before: ptr_compare_0
      +    4.24%  mysqld   mysqld               [.] _Z15row_search_mvccPh15page_cur_mode_tP14row_prebuilt_tmm
      +    2.18%  mysqld   mysqld               [.] hp_rec_hashnr
      +    2.07%  mysqld   mysqld               [.] _Z20rec_get_offsets_funcPKhPK12dict_index_tPmbmPP16mem_block_info_t
      +    1.60%  mysqld   mysqld               [.] _ZL20evaluate_join_recordP4JOINP13st_join_tablei
      +    1.20%  mysqld   mysqld               [.] _ZN11ha_innobase13general_fetchEPhjj
      +    1.05%  mysqld   mysqld               [.] _ZN17Item_func_between15val_int_cmp_intEv
      +    0.92%  mysqld   mysqld               [.] _Z40row_sel_field_store_in_mysql_format_funcPhPK17mysql_row_templ_tPKhm
      +    0.91%  mysqld   mysqld               [.] _ZNK10Item_param6PValue7val_intEPK19Type_std_attributes
      +    0.84%  mysqld   mysqld               [.] ptr_compare_0
      
      After: __memcmp_power8
      +    2.29%  mysqld           mysqld                  [.] _Z15row_search_mvccPh15page_cur_mode_tP14row_prebuilt_tmm
      +    1.32%  mysqld           mysqld                  [.] hp_rec_hashnr
      +    1.18%  swapper          [kernel.kallsyms]       [k] power_enter_stop
      +    1.12%  mysqld           mysqld                  [.] _Z20rec_get_offsets_funcPKhPK12dict_index_tPmbmPP16mem_block_info_t
      +    0.87%  mysqld           mysqld                  [.] _ZL20evaluate_join_recordP4JOINP13st_join_tablei
      +    0.87%  mysqld           [kernel.kallsyms]       [k] ___bpf_prog_run
      +    0.76%  mysqld           libc-2.26.so            [.] __memcmp_power8
      +    0.68%  mysqld           mysqld                  [.] _ZN11ha_innobase13general_fetchEPhjj
      +    0.58%  mysqld           mysqld                  [.] _ZN17Item_func_between15val_int_cmp_intEv
      d405bee0
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 1a4c355a
      Marko Mäkelä authored
      1a4c355a
    • Marko Mäkelä's avatar
      MDEV-14825 Assertion `col->ord_part' in row_build_index_entry_low upon... · e44ca6cc
      Marko Mäkelä authored
      MDEV-14825 Assertion `col->ord_part' in row_build_index_entry_low upon ROLLBACK or DELETE with concurrent ALTER on partitioned table
      
      If creating a secondary index fails (typically, ADD UNIQUE INDEX fails
      due to duplicate key), it is possible that concurrently running UPDATE
      or DELETE will access the index stub and hit the debug assertion.
      
      It does not make any sense to keep updating an uncommitted index whose
      creation has failed.
      
      dict_index_t::is_corrupted(): Replaces dict_index_is_corrupted().
      Also take online_status into account.
      
      Replace some calls to dict_index_is_clust() with calls to
      dict_index_t::is_primary().
      e44ca6cc
    • Daniel Black's avatar
      sp_cache_package_routine: fix compile warning · 005d53f6
      Daniel Black authored
      (clang-3.8)
      sql/sp.cc:2834:53: warning: implicit conversion of NULL constant to 'size_t' (aka 'unsigned long') [-Wnull-conversion]
          size_t prefix_length= dot ? dot - tmp.str + 1 : NULL;
                 ~~~~~~~~~~~~~                            ^~~~
                                                          0
      005d53f6
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-13134 Introduce ALTER TABLE attributes ALGORITHM=NOCOPY and ALGORITHM=INSTANT · c5b28e55
      Thirunarayanan Balathandayuthapani authored
      Remove the warning for InnoDB rebuilding table to add column FTS_DOC_ID.
      c5b28e55
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-13134 Introduce ALTER TABLE attributes ALGORITHM=NOCOPY and ALGORITHM=INSTANT · 85cc6b70
      Thirunarayanan Balathandayuthapani authored
      Introduced new alter algorithm type called NOCOPY & INSTANT for
      inplace alter operation.
      
      NOCOPY - Algorithm refuses any alter operation that would
      rebuild the clustered index. It is a subset of INPLACE algorithm.
      
      INSTANT - Algorithm allow any alter operation that would
      modify only meta data. It is a subset of NOCOPY algorithm.
      
      Introduce new variable called alter_algorithm. The values are
      DEFAULT(0), COPY(1), INPLACE(2), NOCOPY(3), INSTANT(4)
      
      Message to deprecate old_alter_table variable and make it alias
      for alter_algorithm variable.
      
      alter_algorithm variable for slave is always set to default.
      85cc6b70
    • Daniel Black's avatar
      mtr: extend func_math (CRC32) · 97486599
      Daniel Black authored
      97486599
  4. 06 May, 2018 12 commits
  5. 04 May, 2018 3 commits
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · b20039dd
      Marko Mäkelä authored
      b20039dd
    • Marko Mäkelä's avatar
      MDEV-15764 InnoDB may write uninitialized garbage to redo log · d257c425
      Marko Mäkelä authored
      log_sys_init(), log_buffer_extend(): Add TRASH_ALLOC() instrumentation
      
      log_write_up_to(): Correctly calculate the byte offset.
      d257c425
    • Marko Mäkelä's avatar
      Make a test independent of the build options · 3b50cd24
      Marko Mäkelä authored
      The number of records in INFORMATION_SCHEMA.COLUMNS depends on the
      build options, and could easily change when features are added.
      We are not interested in the number of rows returned. The test was
      originally added because of problem 15 reported in MDEV-13900
      (testing for MDEV-11369 instant ADD COLUMN). The issue was an
      assertion failure ut_ad(!rec_is_default_row(rec, index))
      in lock_clust_rec_cons_read_sees(), because the 'default row' record
      was not being properly ignored by the b-tree cursor.
      3b50cd24
  6. 03 May, 2018 5 commits
    • Elena Stepanova's avatar
    • Jacob Mathew's avatar
      MDEV-14019: Spider + binlog_format = ROW => CRASH · ca174051
      Jacob Mathew authored
      The fix for this bug was automatically merged from 10.2.  However, that fix
      was incomplete in 10.3.  This commit is for the additional changes that are
      necessary in 10.3.
      
      Author:
        Jacob Mathew.
      
      Reviewer:
        Kentoku Shiba.
      ca174051
    • Monty's avatar
      MDEV-15106 Unexpected ER_WRONG_INSERT_INTO_SEQUENCE upon INSERT with multiple locks on sequences · 57c3dd99
      Monty authored
      Fixed by removing the check of single lock in sequence insert and let MDL
      code handle deadlock detection
      57c3dd99
    • Marko Mäkelä's avatar
      MDEV-15060 Assertion in row_log_table_apply_op after instant ADD when the... · 6c43068d
      Marko Mäkelä authored
      MDEV-15060 Assertion in row_log_table_apply_op after instant ADD when the table is emptied during subsequent ALTER TABLE
      
      During an online table rebuild, a table could be emptied and converted
      from 'instant ADD' format to plain (pre-10.3) format. All online_log
      records for rebuilding the table must be written and parsed in the
      format of the table that existed at the start of the operation.
      
      row_log_t::n_core_fields: A new field for recording index->n_core_fields
      when online ALTER is initiated in row_log_allocate().
      
      row_log_t::is_instant(): Determine if the log is in the instant format.
      Only invoked by the row_log_table_ family of functions.
      
      dict_index_t::get_n_nullable(): Remove is_instant() debug assertions.
      Because a table can be converted to non-instant format during a
      table-rebuilding ALTER TABLE, these assertions would be bogus when
      executing row_log_table_apply().
      
      rec_init_offsets_temp(): Add the parameter n_core for passing the
      original index->n_core_fields.
      
      rec_init_offsets_temp(): Add a 3-parameter variant.
      
      rec_init_offsets_comp_ordinary(): Add the parameter n_core for
      passing the index->n_core_fields.
      6c43068d
    • Marko Mäkelä's avatar
      Follow-up to MDEV-12266: Do not display table->space · 01843d19
      Marko Mäkelä authored
      MDEV-12266 changed dict_table_t::space to a pointer.
      Displaying pointer values in error messages would be even more
      meaningless than displaying numeric tablespace identifiers.
      
      row_create_table_for_mysql(): Do not display table->space when
      deleting the file fails. We cannot dereference table->space here,
      because fil_delete_tablespace() would have freed the object.
      
      fil_wait_crypt_bg_threads(): Do not display table->space. We could
      display table->space_id here, but it should not really add any value,
      because the table reference-counts have no direct connection to files
      or tablespaces.
      01843d19
  7. 02 May, 2018 1 commit
    • Marko Mäkelä's avatar
      MDEV-16065 Assertion failed in btr_pcur_restore_position_func on UPDATE · 73a10cbc
      Marko Mäkelä authored
      btr_pcur_store_position(): Assert that the 'default row' record never
      is the only record in a page. (If that would happen, an empty
      root page would be re-created in the non-instant format, not containing
      the special record.) When the cursor is positioned on the page infimum,
      never use the 'default row' as the BTR_PCUR_BEFORE reference.
      (This is additional cleanup, not fixing the bug.)
      
      rec_copy_prefix_to_buf(): When converting a record prefix to
      the non-instant-add format, copy the original number of null flags.
      Rename the variable instant_len to instant_omit, and introduce a
      few more variables to make the code easiser to read.
      
      Note: In purge, rec_copy_prefix_to_buf() is also used for storing the
      persistent cursor position on a 'default row' record. The stored record
      reference will be garbage, but row_search_on_row_ref() will do special
      handling to reposition the cursor on the 'default row', based on
      ref->info_bits.
      
      innodb.dml_purge: Also cover the 'default row'.
      73a10cbc