diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-01-04 09:22:59 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-01-04 09:22:59 +0200 |
commit | 145ae15a33210e13d33d6f41b145b3f04cab2263 (patch) | |
tree | 02810e3c0d629f7d7def2dbc663154cbdb53242f /storage | |
parent | acd2862e65a6555fba6065b7b4ded8513e2ce37c (diff) | |
parent | 1a1bda2222e0c2ab41baed1510f6fbca80c20d31 (diff) | |
download | mariadb-git-145ae15a33210e13d33d6f41b145b3f04cab2263.tar.gz |
Merge bb-10.2-ext into 10.3
Diffstat (limited to 'storage')
28 files changed, 418 insertions, 130 deletions
diff --git a/storage/innobase/include/trx0rec.h b/storage/innobase/include/trx0rec.h index 1f89846d516..955a726eb50 100644 --- a/storage/innobase/include/trx0rec.h +++ b/storage/innobase/include/trx0rec.h @@ -155,6 +155,7 @@ trx_undo_rec_get_partial_row( used, as we do NOT copy the data in the record! */ dict_index_t* index, /*!< in: clustered index */ + const upd_t* update, /*!< in: updated columns */ dtuple_t** row, /*!< out, own: partial row */ ibool ignore_prefix, /*!< in: flag to indicate if we expect blob prefixes in undo. Used @@ -195,8 +196,8 @@ trx_undo_report_row_operation( marking, the record in the clustered index; NULL if insert */ const ulint* offsets, /*!< in: rec_get_offsets(rec) */ - roll_ptr_t* roll_ptr) /*!< out: rollback pointer to the - inserted undo log record */ + roll_ptr_t* roll_ptr) /*!< out: DB_ROLL_PTR to the + undo log record */ MY_ATTRIBUTE((nonnull(1,2,8), warn_unused_result)); /** status bit used for trx_undo_prev_version_build() */ diff --git a/storage/innobase/include/trx0sys.ic b/storage/innobase/include/trx0sys.ic index 5271601b4ea..020a46fb028 100644 --- a/storage/innobase/include/trx0sys.ic +++ b/storage/innobase/include/trx0sys.ic @@ -376,10 +376,8 @@ trx_id_t trx_sys_get_new_trx_id() /*====================*/ { -#ifndef WITH_WSREP /* wsrep_fake_trx_id violates this assert */ ut_ad(trx_sys_mutex_own()); -#endif /* WITH_WSREP */ /* VERY important: after the database is started, max_trx_id value is divisible by TRX_SYS_TRX_ID_WRITE_MARGIN, and the following if diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc index cb902776e26..9b5c9873604 100644 --- a/storage/innobase/row/row0log.cc +++ b/storage/innobase/row/row0log.cc @@ -1695,13 +1695,10 @@ row_log_table_apply_insert_low( return(error); } - do { - n_index++; - - if (!(index = dict_table_get_next_index(index))) { - break; - } + ut_ad(dict_index_is_clust(index)); + for (n_index += index->type != DICT_CLUSTERED; + (index = dict_table_get_next_index(index)); n_index++) { if (index->type & DICT_FTS) { continue; } @@ -1712,12 +1709,13 @@ row_log_table_apply_insert_low( index, offsets_heap, heap, entry, thr_get_trx(thr)->id, thr, false); - /* Report correct index name for duplicate key error. */ - if (error == DB_DUPLICATE_KEY) { - thr_get_trx(thr)->error_key_num = n_index; + if (error != DB_SUCCESS) { + if (error == DB_DUPLICATE_KEY) { + thr_get_trx(thr)->error_key_num = n_index; + } + break; } - - } while (error == DB_SUCCESS); + } return(error); } @@ -2297,17 +2295,16 @@ func_exit_committed: dtuple_big_rec_free(big_rec); } - while ((index = dict_table_get_next_index(index)) != NULL) { - if (error != DB_SUCCESS) { - break; - } - - n_index++; - + for (n_index += index->type != DICT_CLUSTERED; + (index = dict_table_get_next_index(index)); n_index++) { if (index->type & DICT_FTS) { continue; } + if (error != DB_SUCCESS) { + break; + } + if (!row_upd_changes_ord_field_binary( index, update, thr, old_row, NULL)) { continue; diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc index 62085e4d2af..f2a5d8c0c57 100644 --- a/storage/innobase/row/row0purge.cc +++ b/storage/innobase/row/row0purge.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1997, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, MariaDB Corporation. +Copyright (c) 2017, 2018, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -1004,7 +1004,7 @@ err_exit: if (!(node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) { ptr = trx_undo_rec_get_partial_row( - ptr, clust_index, &node->row, + ptr, clust_index, node->update, &node->row, type == TRX_UNDO_UPD_DEL_REC, node->heap); } diff --git a/storage/innobase/row/row0row.cc b/storage/innobase/row/row0row.cc index 93b84bdb209..3611b8c3fc7 100644 --- a/storage/innobase/row/row0row.cc +++ b/storage/innobase/row/row0row.cc @@ -195,13 +195,13 @@ row_build_index_entry_low( dfield2); break; + case SPATIAL_UNKNOWN: + ut_ad(0); + /* fall through */ case SPATIAL_NONE: /* Undo record is logged before spatial index is created.*/ return(NULL); - - case SPATIAL_UNKNOWN: - ut_ad(0); } memcpy(mbr, ptr, DATA_MBR_LEN); diff --git a/storage/innobase/trx/trx0rec.cc b/storage/innobase/trx/trx0rec.cc index 86fe7758626..ce291b7add9 100644 --- a/storage/innobase/trx/trx0rec.cc +++ b/storage/innobase/trx/trx0rec.cc @@ -1191,14 +1191,43 @@ trx_undo_page_report_modify( const dict_col_t* col = dict_table_get_nth_col(table, col_no); - const char* col_name = dict_table_get_col_name(table, - col_no); if (!col->ord_part) { continue; } - if (update) { + const ulint pos = dict_index_get_nth_col_pos( + index, col_no, NULL); + /* All non-virtual columns must be present in + the clustered index. */ + ut_ad(pos != ULINT_UNDEFINED); + + const bool is_ext = rec_offs_nth_extern(offsets, pos); + const spatial_status_t spatial_status = is_ext + ? dict_col_get_spatial_status(col) + : SPATIAL_NONE; + + switch (spatial_status) { + case SPATIAL_UNKNOWN: + ut_ad(0); + /* fall through */ + case SPATIAL_MIXED: + case SPATIAL_ONLY: + /* Externally stored spatially indexed + columns will be (redundantly) logged + again, because we did not write the + MBR yet, that is, the previous call to + trx_undo_page_report_modify_ext() + was with SPATIAL_UNKNOWN. */ + break; + case SPATIAL_NONE: + if (!update) { + /* This is a DELETE operation. */ + break; + } + /* Avoid redundantly logging indexed + columns that were updated. */ + for (i = 0; i < update->n_fields; i++) { const ulint field_no = upd_get_nth_field(update, i) @@ -1213,37 +1242,19 @@ trx_undo_page_report_modify( } if (true) { - ulint pos; - spatial_status_t spatial_status; - - spatial_status = SPATIAL_NONE; - /* Write field number to undo log */ if (trx_undo_left(undo_page, ptr) < 5 + 15) { return(0); } - pos = dict_index_get_nth_col_pos(index, - col_no, - NULL); - if (pos == ULINT_UNDEFINED) { - ib::error() << "Column " << col_no - << " name " << col_name - << " not found from index " << index->name - << " table. " << table->name.m_name - << " Table has " << dict_table_get_n_cols(table) - << " and index has " << dict_index_get_n_fields(index) - << " fields."; - } - ptr += mach_write_compressed(ptr, pos); /* Save the old value of field */ field = rec_get_nth_cfield( rec, index, offsets, pos, &flen); - if (rec_offs_nth_extern(offsets, pos)) { + if (is_ext) { const dict_col_t* col = dict_index_get_nth_col( index, pos); @@ -1253,10 +1264,6 @@ trx_undo_page_report_modify( ut_a(prefix_len < sizeof ext_buf); - spatial_status = - dict_col_get_spatial_status( - col); - /* If there is a spatial index on it, log its MBR */ if (spatial_status != SPATIAL_NONE) { @@ -1655,6 +1662,7 @@ trx_undo_rec_get_partial_row( used, as we do NOT copy the data in the record! */ dict_index_t* index, /*!< in: clustered index */ + const upd_t* update, /*!< in: updated columns */ dtuple_t** row, /*!< out, own: partial row */ ibool ignore_prefix, /*!< in: flag to indicate if we expect blob prefixes in undo. Used @@ -1685,6 +1693,16 @@ trx_undo_rec_get_partial_row( dtuple_init_v_fld(*row); + for (const upd_field_t* uf = update->fields, * const ue + = update->fields + update->n_fields; + uf != ue; uf++) { + if (uf->old_v_val) { + continue; + } + ulint c = dict_index_get_nth_col(index, uf->field_no)->ind; + *dtuple_get_nth_field(*row, c) = uf->new_val; + } + end_ptr = ptr + mach_read_from_2(ptr); ptr += 2; @@ -1730,6 +1748,13 @@ trx_undo_rec_get_partial_row( col = dict_index_get_nth_col(index, field_no); col_no = dict_col_get_no(col); dfield = dtuple_get_nth_field(*row, col_no); + ut_ad(dfield->type.mtype == DATA_MISSING + || dict_col_type_assert_equal(col, + &dfield->type)); + ut_ad(dfield->type.mtype == DATA_MISSING + || dfield->len == len + || (len != UNIV_SQL_NULL + && len >= UNIV_EXTERN_STORAGE_FIELD)); dict_col_copy_type( dict_table_get_nth_col(index->table, col_no), dfield_get_type(dfield)); @@ -1829,8 +1854,9 @@ ulint trx_undo_page_report_rename(trx_t* trx, const dict_table_t* table, buf_block_t* block, mtr_t* mtr) { - ulint first_free = mach_read_from_2(block->frame + TRX_UNDO_PAGE_HDR - + TRX_UNDO_PAGE_FREE); + byte* ptr_first_free = TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_FREE + + block->frame; + ulint first_free = mach_read_from_2(ptr_first_free); ut_ad(first_free >= TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_HDR_SIZE); ut_ad(first_free <= UNIV_PAGE_SIZE); byte* start = block->frame + first_free; @@ -1858,11 +1884,10 @@ trx_undo_page_report_rename(trx_t* trx, const dict_table_t* table, ptr += 2; ulint offset = page_offset(ptr); mach_write_to_2(start, offset); - mach_write_to_2(block->frame + TRX_UNDO_PAGE_HDR - + TRX_UNDO_PAGE_FREE, offset); + mach_write_to_2(ptr_first_free, offset); trx_undof_page_add_undo_rec_log(block->frame, first_free, offset, mtr); - return offset; + return first_free; } /** Report a RENAME TABLE operation. @@ -1956,8 +1981,8 @@ trx_undo_report_row_operation( marking, the record in the clustered index; NULL if insert */ const ulint* offsets, /*!< in: rec_get_offsets(rec) */ - roll_ptr_t* roll_ptr) /*!< out: rollback pointer to the - inserted undo log record */ + roll_ptr_t* roll_ptr) /*!< out: DB_ROLL_PTR to the + undo log record */ { trx_t* trx; ulint page_no; diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc index a332f6047d1..c2e15fea953 100644 --- a/storage/innobase/trx/trx0sys.cc +++ b/storage/innobase/trx/trx0sys.cc @@ -98,12 +98,10 @@ trx_sys_flush_max_trx_id(void) mtr_t mtr; trx_sysf_t* sys_header; -#ifndef WITH_WSREP /* wsrep_fake_trx_id violates this assert Copied from trx_sys_get_new_trx_id */ ut_ad(trx_sys_mutex_own()); -#endif /* WITH_WSREP */ if (!srv_read_only_mode) { mtr_start(&mtr); diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c index 2092e024e28..3febf879ec6 100644 --- a/storage/maria/ma_open.c +++ b/storage/maria/ma_open.c @@ -280,7 +280,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags) size_t info_length; char name_buff[FN_REFLEN], org_name[FN_REFLEN], index_name[FN_REFLEN], data_name[FN_REFLEN]; - uchar *disk_cache, *disk_pos, *end_pos; + uchar *UNINIT_VAR(disk_cache), *disk_pos, *end_pos; MARIA_HA info, *UNINIT_VAR(m_info), *old_info; MARIA_SHARE share_buff,*share; double *rec_per_key_part; diff --git a/storage/maria/ma_search.c b/storage/maria/ma_search.c index 089e3fabdb2..39d9322d903 100644 --- a/storage/maria/ma_search.c +++ b/storage/maria/ma_search.c @@ -745,11 +745,11 @@ void _ma_kpointer(register MARIA_HA *info, register uchar *buff, my_off_t pos) case 5: mi_int5store(buff,pos); break; #else case 7: *buff++=0; - /* fall trough */ + /* fall through */ case 6: *buff++=0; - /* fall trough */ + /* fall through */ case 5: *buff++=0; - /* fall trough */ + /* fall through */ #endif case 4: mi_int4store(buff,pos); break; case 3: mi_int3store(buff,pos); break; @@ -881,13 +881,13 @@ void _ma_dpointer(MARIA_SHARE *share, uchar *buff, my_off_t pos) case 5: mi_int5store(buff,pos); break; #else case 8: *buff++=0; - /* fall trough */ + /* fall through */ case 7: *buff++=0; - /* fall trough */ + /* fall through */ case 6: *buff++=0; - /* fall trough */ + /* fall through */ case 5: *buff++=0; - /* fall trough */ + /* fall through */ #endif case 4: mi_int4store(buff,pos); break; case 3: mi_int3store(buff,pos); break; diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 62c400b1c07..a52a306ce22 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -757,6 +757,7 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked) { MI_KEYDEF *keyinfo; MI_COLUMNDEF *recinfo= 0; + char readlink_buf[FN_REFLEN], name_buff[FN_REFLEN]; uint recs; uint i; @@ -812,6 +813,30 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked) (void) mi_extra(file, HA_EXTRA_NO_WAIT_LOCK, 0); info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST); + + /* + Set data_file_name and index_file_name to point at the symlink value + if table is symlinked (Ie; Real name is not same as generated name) + */ + fn_format(name_buff, file->filename, "", MI_NAME_DEXT, + MY_APPEND_EXT | MY_UNPACK_FILENAME); + if (my_is_symlink(name_buff)) + { + my_readlink(readlink_buf, name_buff, MYF(0)); + data_file_name= strdup_root(&table->mem_root, readlink_buf); + } + else + data_file_name= 0; + fn_format(name_buff, file->filename, "", MI_NAME_IEXT, + MY_APPEND_EXT | MY_UNPACK_FILENAME); + if (my_is_symlink(name_buff)) + { + my_readlink(readlink_buf, name_buff, MYF(0)); + index_file_name= strdup_root(&table->mem_root, readlink_buf); + } + else + index_file_name= 0; + if (!(test_if_locked & HA_OPEN_WAIT_IF_LOCKED)) (void) mi_extra(file, HA_EXTRA_WAIT_LOCK, 0); if (!table->s->db_record_offset) @@ -1953,7 +1978,6 @@ void ha_myisam::position(const uchar *record) int ha_myisam::info(uint flag) { MI_ISAMINFO misam_info; - char name_buff[FN_REFLEN]; if (!table) return 1; @@ -2001,27 +2025,6 @@ int ha_myisam::info(uint flag) sizeof(table->key_info[0].rec_per_key[0])*share->key_parts); if (table_share->tmp_table == NO_TMP_TABLE) mysql_mutex_unlock(&table_share->LOCK_share); - - /* - Set data_file_name and index_file_name to point at the symlink value - if table is symlinked (Ie; Real name is not same as generated name) - */ - char buf[FN_REFLEN]; - data_file_name= index_file_name= 0; - fn_format(name_buff, file->filename, "", MI_NAME_DEXT, - MY_APPEND_EXT | MY_UNPACK_FILENAME); - if (my_is_symlink(name_buff)) - { - my_readlink(buf, name_buff, MYF(0)); - data_file_name= ha_thd()->strdup(buf); - } - fn_format(name_buff, file->filename, "", MI_NAME_IEXT, - MY_APPEND_EXT | MY_UNPACK_FILENAME); - if (my_is_symlink(name_buff)) - { - my_readlink(buf, name_buff, MYF(0)); - index_file_name= ha_thd()->strdup(buf); - } } if (flag & HA_STATUS_ERRKEY) { diff --git a/storage/myisam/mi_search.c b/storage/myisam/mi_search.c index 79ed846ce7e..d570f273b74 100644 --- a/storage/myisam/mi_search.c +++ b/storage/myisam/mi_search.c @@ -607,11 +607,11 @@ void _mi_kpointer(register MI_INFO *info, register uchar *buff, my_off_t pos) case 5: mi_int5store(buff,pos); break; #else case 7: *buff++=0; - /* fall trough */ + /* fall through */ case 6: *buff++=0; - /* fall trough */ + /* fall through */ case 5: *buff++=0; - /* fall trough */ + /* fall through */ #endif case 4: mi_int4store(buff,pos); break; case 3: mi_int3store(buff,pos); break; @@ -728,13 +728,13 @@ void _mi_dpointer(MI_INFO *info, uchar *buff, my_off_t pos) case 5: mi_int5store(buff,pos); break; #else case 8: *buff++=0; - /* fall trough */ + /* fall through */ case 7: *buff++=0; - /* fall trough */ + /* fall through */ case 6: *buff++=0; - /* fall trough */ + /* fall through */ case 5: *buff++=0; - /* fall trough */ + /* fall through */ #endif case 4: mi_int4store(buff,pos); break; case 3: mi_int3store(buff,pos); break; diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt index 1e20e0fa4a3..6cb7eb1d439 100644 --- a/storage/rocksdb/CMakeLists.txt +++ b/storage/rocksdb/CMakeLists.txt @@ -220,3 +220,18 @@ IF(MSVC) # Some checks in C++ runtime that make debug build much slower ADD_DEFINITIONS(-D_ITERATOR_DEBUG_LEVEL=0) ENDIF() + +IF(GIT_EXECUTABLE) + EXECUTE_PROCESS( + COMMAND ${GIT_EXECUTABLE} rev-parse HEAD + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb + OUTPUT_VARIABLE OUT RESULT_VARIABLE RES) + IF(RES EQUAL 0) + STRING(REGEX REPLACE "\n$" "" ROCKSDB_GIT_HASH "${OUT}") + ENDIF() +ENDIF() +IF(ROCKSDB_GIT_HASH OR + (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/rdb_source_revision.h)) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/rdb_source_revision.h.in + ${CMAKE_CURRENT_BINARY_DIR}/rdb_source_revision.h ) +ENDIF() diff --git a/storage/rocksdb/build_rocksdb.cmake b/storage/rocksdb/build_rocksdb.cmake index dd23304a223..5810412f566 100644 --- a/storage/rocksdb/build_rocksdb.cmake +++ b/storage/rocksdb/build_rocksdb.cmake @@ -6,6 +6,7 @@ endif() SET(ROCKSDB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb) INCLUDE_DIRECTORIES( + ${CMAKE_CURRENT_BINARY_DIR} ${ROCKSDB_SOURCE_DIR} ${ROCKSDB_SOURCE_DIR}/include ${ROCKSDB_SOURCE_DIR}/third-party/gtest-1.7.0/fused-src diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index d79f15c458b..479e290374e 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -70,6 +70,7 @@ #include "rocksdb/utilities/memory_util.h" #include "rocksdb/utilities/sim_cache.h" #include "util/stop_watch.h" +#include "./rdb_source_revision.h" /* MyRocks includes */ #include "./event_listener.h" @@ -494,6 +495,7 @@ static uint32_t rocksdb_table_stats_sampling_pct; static my_bool rocksdb_enable_bulk_load_api = 1; static my_bool rocksdb_print_snapshot_conflict_queries = 0; static my_bool rocksdb_large_prefix = 0; +static char* rocksdb_git_hash; char *compression_types_val= const_cast<char*>(get_rocksdb_supported_compression_types()); @@ -650,6 +652,11 @@ static MYSQL_SYSVAR_BOOL(enable_bulk_load_api, rocksdb_enable_bulk_load_api, "Enables using SstFileWriter for bulk loading", nullptr, nullptr, rocksdb_enable_bulk_load_api); +static MYSQL_SYSVAR_STR(git_hash, rocksdb_git_hash, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "Git revision of the RocksDB library used by MyRocks", + nullptr, nullptr, ROCKSDB_GIT_HASH); + static MYSQL_THDVAR_STR(tmpdir, PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_MEMALLOC, "Directory for temporary files during DDL operations.", nullptr, nullptr, ""); @@ -1633,6 +1640,7 @@ static struct st_mysql_sys_var *rocksdb_system_variables[] = { MYSQL_SYSVAR(table_stats_sampling_pct), MYSQL_SYSVAR(large_prefix), + MYSQL_SYSVAR(git_hash), nullptr}; static rocksdb::WriteOptions diff --git a/storage/rocksdb/mysql-test/rocksdb/r/rocksdb.result b/storage/rocksdb/mysql-test/rocksdb/r/rocksdb.result index d791cf98bb0..9b084e63cd5 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/rocksdb.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/rocksdb.result @@ -924,6 +924,7 @@ rocksdb_force_compute_memtable_stats_cachetime 0 rocksdb_force_flush_memtable_and_lzero_now OFF rocksdb_force_flush_memtable_now OFF rocksdb_force_index_records_in_range 0 +rocksdb_git_hash # rocksdb_hash_index_allow_collision ON rocksdb_index_type kBinarySearch rocksdb_info_log_level error_level diff --git a/storage/rocksdb/mysql-test/rocksdb/t/disabled.def b/storage/rocksdb/mysql-test/rocksdb/t/disabled.def index 118d8598de3..63c3d259d4c 100644 --- a/storage/rocksdb/mysql-test/rocksdb/t/disabled.def +++ b/storage/rocksdb/mysql-test/rocksdb/t/disabled.def @@ -41,7 +41,7 @@ rocksdb_deadlock_stress_rr: stress test ## persistent_cache: Upstream RocksDB bug https://github.com/facebook/mysql-5.6/issues/579 collation: Fails on gcc 4.8 and before, MDEV-12433 -col_opt_zerofill: MDEV-14165: not MyRocks -problem in ps-protocol, happens in upstream too +col_opt_zerofill: MDEV-14729 (also MDEV-14165 which was fixed): problem in the client ## @@ -70,17 +70,10 @@ blind_delete_without_tx_api: MDEV-12286: rocksdb.blind_delete_without_tx_api tes unique_check: wrong error number autoinc_vars_thread: debug sync point wait timed out -# Enabling these didn't seem to cause any trouble: -# autoinc_vars_thread : MDEV-12474 Regularly fails on buildbot -# unique_check : MDEV-12474 Regularly fails on buildbot -# bloomfilter : MDEV-12474 Regularly fails on buildbot -# unique_sec : Intermittent failures in BB - - ## ## Tests that fail for some other reason ## + information_schema : MariaRocks: requires GTIDs mysqlbinlog_gtid_skip_empty_trans_rocksdb : MariaRocks: requires GTIDs -#read_only_tx : MariaRocks: requires GTIDs rpl_row_triggers : MariaRocks: requires GTIDs diff --git a/storage/rocksdb/mysql-test/rocksdb/t/rocksdb.test b/storage/rocksdb/mysql-test/rocksdb/t/rocksdb.test index 5c8fa9ed443..9199c572933 100644 --- a/storage/rocksdb/mysql-test/rocksdb/t/rocksdb.test +++ b/storage/rocksdb/mysql-test/rocksdb/t/rocksdb.test @@ -786,6 +786,8 @@ drop table t45; --echo # Now it fails if there is data overlap with what --echo # already exists --echo # + +--replace_regex /[a-f0-9]{40}/#/ show variables where variable_name like 'rocksdb%' and diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/my.cnf b/storage/rocksdb/mysql-test/rocksdb_rpl/my.cnf index 2beaf514cee..ec7370b65f0 100644 --- a/storage/rocksdb/mysql-test/rocksdb_rpl/my.cnf +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/my.cnf @@ -1,3 +1,4 @@ +!include rpl_1slave_base.cnf !include include/default_my.cnf [server] diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_binlog_xid_count.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_binlog_xid_count.result new file mode 100644 index 00000000000..9b46a5b5227 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_binlog_xid_count.result @@ -0,0 +1,204 @@ +CREATE TABLE `t` ( +`a` text DEFAULT NULL +) ENGINE=ROCKSDB; +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +DROP TABLE t; diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/singledelete_idempotent_table.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/singledelete_idempotent_table.result index 609d4a8821a..979e2cbf6c3 100644 --- a/storage/rocksdb/mysql-test/rocksdb_rpl/r/singledelete_idempotent_table.result +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/singledelete_idempotent_table.result @@ -1,16 +1,19 @@ include/master-slave.inc -Warnings: -Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. -Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] +connection master; drop table if exists r1; create table r1 (id1 int, id2 int, primary key (id1, id2), index i (id2)) engine=rocksdb; insert into r1 values (1, 1000); set sql_log_bin=0; delete from r1 where id1=1 and id2=1000; set sql_log_bin=1; +connection slave; +connection slave; set global rocksdb_force_flush_memtable_now=1; +connection master; insert into r1 values (1, 1000); +connection slave; +connection slave; delete r1 from r1 force index (i) where id2=1000; select id1,id2 from r1 force index (primary); id1 id2 @@ -21,5 +24,6 @@ select id1,id2 from r1 force index (primary); id1 id2 select id2 from r1 force index (i); id2 +connection master; drop table r1; include/rpl_end.inc diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/t/disabled.def b/storage/rocksdb/mysql-test/rocksdb_rpl/t/disabled.def index 07a2738eee5..956355dceee 100644 --- a/storage/rocksdb/mysql-test/rocksdb_rpl/t/disabled.def +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/t/disabled.def @@ -1,19 +1,29 @@ +## +## Tests that require FB/MySQL specific features for which there are +## no plans to port them to MariaDB +## +rpl_no_unique_check_on_lag : unique_check_lag_threshold is not available in MariaDB +rpl_no_unique_check_on_lag_mts : unique_check_lag_threshold is not available in MariaDB +consistent_snapshot_mixed_engines : Tests START TRANSACTION WITH CONSISTENT $ENGINE_NAME SNAPSHOT +rpl_skip_trx_api_binlog_format : requires @@rpl_skip_tx_api +rpl_ddl_high_priority : DDL commands with HIGH_PRIORITY syntax are not in MariaDB +rpl_gtid_rocksdb_sys_header : MariaDB doesn't support printing "RocksDB: Last MySQL Gtid UUID" into server stderr on startup +singledelete_idempotent_recovery: MariaDB doesn't support --slave-use-idempotent-for-recovery -# rpl_rocksdb_2pc_crash_recover +## +## Tests that do not fit MariaDB's test environment (Functional tests only, +## can't have stress tests) +## +rpl_rocksdb_stress_crash : Stress test + +## +## Tests that are disabled for other reasons +## -consistent_snapshot_mixed_engines : Didn't try with MariaDB, yet multiclient_2pc : Didn't try with MariaDB, yet rpl_crash_safe_wal_corrupt : Didn't try with MariaDB, yet -rpl_ddl_high_priority : Didn't try with MariaDB, yet rpl_gtid_crash_safe : Didn't try with MariaDB, yet rpl_gtid_crash_safe_wal_corrupt : Didn't try with MariaDB, yet -rpl_gtid_rocksdb_sys_header : Didn't try with MariaDB, yet -rpl_no_unique_check_on_lag : Didn't try with MariaDB, yet -rpl_no_unique_check_on_lag_mts : Didn't try with MariaDB, yet rpl_rocksdb_snapshot : Didn't try with MariaDB, yet rpl_rocksdb_snapshot_without_gtid : Didn't try with MariaDB, yet -rpl_rocksdb_stress_crash : Didn't try with MariaDB, yet -rpl_skip_trx_api_binlog_format : Didn't try with MariaDB, yet -singledelete_idempotent_recovery : Didn't try with MariaDB, yet -singledelete_idempotent_table : Didn't try with MariaDB, yet diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_binlog_xid_count-master.opt b/storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_binlog_xid_count-master.opt new file mode 100644 index 00000000000..ed50a8a3deb --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_binlog_xid_count-master.opt @@ -0,0 +1,3 @@ +--innodb --max-binlog-size=4096 + + diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_binlog_xid_count.test b/storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_binlog_xid_count.test new file mode 100644 index 00000000000..7667f153cde --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_binlog_xid_count.test @@ -0,0 +1,20 @@ +--source include/have_rocksdb.inc +--source include/have_binlog_format_row.inc + +CREATE TABLE `t` ( + `a` text DEFAULT NULL +) ENGINE=ROCKSDB; + + +--let $size=`SELECT @@GLOBAL.max_binlog_size` +--let $loop_cnt= 100 +while ($loop_cnt) +{ + --eval INSERT INTO t SET a=repeat('a', $size) + --eval INSERT INTO t SET a=repeat('a', $size/2) + + --dec $loop_cnt +} + +# Cleanup +DROP TABLE t; diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/t/singledelete_idempotent_table.cnf b/storage/rocksdb/mysql-test/rocksdb_rpl/t/singledelete_idempotent_table.cnf index ad4894f5b38..5f1f87d762f 100644 --- a/storage/rocksdb/mysql-test/rocksdb_rpl/t/singledelete_idempotent_table.cnf +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/t/singledelete_idempotent_table.cnf @@ -2,14 +2,10 @@ [mysqld.1] log_slave_updates -gtid_mode=ON -enforce_gtid_consistency=ON [mysqld.2] relay_log_recovery=1 -relay_log_info_repository=FILE +#relay_log_info_repository=FILE log_slave_updates -gtid_mode=ON -enforce_gtid_consistency=ON -rbr_idempotent_tables='r1' - +#rbr_idempotent_tables='r1' +slave_exec_mode=IDEMPOTENT diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/t/singledelete_idempotent_table.test b/storage/rocksdb/mysql-test/rocksdb_rpl/t/singledelete_idempotent_table.test index 23d335d6b57..00dce7c2ca9 100644 --- a/storage/rocksdb/mysql-test/rocksdb_rpl/t/singledelete_idempotent_table.test +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/t/singledelete_idempotent_table.test @@ -2,7 +2,7 @@ --source include/have_binlog_format_row.inc --source include/have_rocksdb.inc --source include/master-slave.inc ---source include/have_gtid.inc +#--source include/have_gtid.inc --source include/not_valgrind.inc # This is a test case for issue#655 -- SingleDelete on Primary Key may diff --git a/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_git_hash_basic.test b/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_git_hash_basic.test new file mode 100644 index 00000000000..7b314e47d4b --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_git_hash_basic.test @@ -0,0 +1,6 @@ +--source include/have_rocksdb.inc + +--let $sys_var=ROCKSDB_GIT_HASH +--let $read_only=1 +--let $session=0 +--source include/rocksdb_sys_var.inc diff --git a/storage/rocksdb/rdb_datadic.cc b/storage/rocksdb/rdb_datadic.cc index f4749d0c7cf..ff8a4faee55 100644 --- a/storage/rocksdb/rdb_datadic.cc +++ b/storage/rocksdb/rdb_datadic.cc @@ -1461,7 +1461,8 @@ int Rdb_key_def::unpack_record(TABLE *const table, uchar *const buf, if (has_covered_bitmap && field->real_type() == MYSQL_TYPE_VARCHAR && !m_pack_info[i].m_covered) { covered_column = curr_bitmap_pos < MAX_REF_PARTS && - bitmap_is_set(&covered_bitmap, curr_bitmap_pos++); + bitmap_is_set(&covered_bitmap, curr_bitmap_pos); + curr_bitmap_pos++; } if (fpi->m_unpack_func && covered_column) { /* It is possible to unpack this column. Do it. */ diff --git a/storage/rocksdb/rdb_source_revision.h.in b/storage/rocksdb/rdb_source_revision.h.in new file mode 100644 index 00000000000..617b39c9186 --- /dev/null +++ b/storage/rocksdb/rdb_source_revision.h.in @@ -0,0 +1 @@ +#define ROCKSDB_GIT_HASH "@ROCKSDB_GIT_HASH@" |