diff --git a/sql/sql_list.h b/sql/sql_list.h index 35aaaf49c50..9d1c01a484d 100644 --- a/sql/sql_list.h +++ b/sql/sql_list.h @@ -569,6 +569,12 @@ public: } T &operator*() { return *static_cast(node->info); } + T *operator->() { return static_cast(node->info); } + + bool operator==(const typename List::iterator &rhs) + { + return node == rhs.node; + } bool operator!=(const typename List::iterator &rhs) { diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc index 31419ed85a1..7b871a2414a 100644 --- a/storage/innobase/btr/btr0btr.cc +++ b/storage/innobase/btr/btr0btr.cc @@ -1161,8 +1161,12 @@ btr_create( btr_page_set_index_id(page, page_zip, index_id, mtr); /* Set the next node and previous node fields */ - btr_page_set_next(page, page_zip, FIL_NULL, mtr); - btr_page_set_prev(page, page_zip, FIL_NULL, mtr); + compile_time_assert(FIL_PAGE_NEXT == FIL_PAGE_PREV + 4); + compile_time_assert(FIL_NULL == 0xffffffff); + mlog_memset(block, FIL_PAGE_PREV, 8, 0xff, mtr); + if (UNIV_LIKELY_NULL(page_zip)) { + memset(page_zip->data + FIL_PAGE_PREV, 0xff, 8); + } /* We reset the free bits for the page in a separate mini-transaction to allow creation of several trees in the @@ -1939,8 +1943,12 @@ btr_root_raise_and_insert( btr_page_create(new_block, new_page_zip, index, level, mtr); /* Set the next node and previous node fields of new page */ - btr_page_set_next(new_page, new_page_zip, FIL_NULL, mtr); - btr_page_set_prev(new_page, new_page_zip, FIL_NULL, mtr); + compile_time_assert(FIL_PAGE_NEXT == FIL_PAGE_PREV + 4); + compile_time_assert(FIL_NULL == 0xffffffff); + mlog_memset(new_block, FIL_PAGE_PREV, 8, 0xff, mtr); + if (UNIV_LIKELY_NULL(new_page_zip)) { + memset(new_page_zip->data + FIL_PAGE_PREV, 0xff, 8); + } /* Copy the records from root to the new page one by one. */ diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 476de28c423..d36796c1f37 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -1397,18 +1397,14 @@ check_v_col_in_order( & ALTER_ADD_VIRTUAL_COLUMN) { bool has_new = false; - List_iterator_fast cf_it( - ha_alter_info->alter_info->create_list); - - cf_it.rewind(); - - while (const Create_field* new_field = cf_it++) { - if (new_field->stored_in_db()) { + for (const Create_field& new_field : + ha_alter_info->alter_info->create_list) { + if (new_field.stored_in_db()) { continue; } /* Found a new added virtual column. */ - if (!new_field->field) { + if (!new_field.field) { has_new = true; continue; } @@ -2109,9 +2105,6 @@ ha_innobase::check_if_supported_inplace_alter( bool online = true, need_rebuild = false; const uint fulltext_indexes = innobase_fulltext_exist(altered_table); - List_iterator_fast cf_it( - ha_alter_info->alter_info->create_list); - /* Fix the key parts. */ for (KEY* new_key = ha_alter_info->key_info_buffer; new_key < ha_alter_info->key_info_buffer @@ -2132,18 +2125,12 @@ ha_innobase::check_if_supported_inplace_alter( key_part < (new_key->key_part + new_key->user_defined_key_parts); key_part++) { - const Create_field* new_field; - DBUG_ASSERT(key_part->fieldnr < altered_table->s->fields); - cf_it.rewind(); - for (uint fieldnr = 0; (new_field = cf_it++); - fieldnr++) { - if (fieldnr == key_part->fieldnr) { - break; - } - } + const Create_field* new_field + = ha_alter_info->alter_info->create_list.elem( + key_part->fieldnr); DBUG_ASSERT(new_field); @@ -2270,18 +2257,17 @@ ha_innobase::check_if_supported_inplace_alter( DEFAULT value, ensure that the DEFAULT expression is a constant. Also, in ADD COLUMN, for now we only support a constant DEFAULT expression. */ - cf_it.rewind(); Field **af = altered_table->field; bool fts_need_rebuild = false; need_rebuild = need_rebuild || innobase_need_rebuild(ha_alter_info, table); - while (Create_field* cf = cf_it++) { - DBUG_ASSERT(cf->field + for (Create_field& cf : ha_alter_info->alter_info->create_list) { + DBUG_ASSERT(cf.field || (ha_alter_info->handler_flags & ALTER_ADD_COLUMN)); - if (const Field* f = cf->field) { + if (const Field* f = cf.field) { if (!f->real_maybe_null() || (*af)->real_maybe_null()) goto next_column; /* We are changing an existing column @@ -2873,8 +2859,6 @@ innobase_get_foreign_key_info( const trx_t* trx, dict_s_col_list*s_cols) { - Key* key; - Foreign_key* fk_key; dict_table_t* referenced_table = NULL; char* referenced_table_name = NULL; ulint num_fk = 0; @@ -2884,10 +2868,8 @@ innobase_get_foreign_key_info( *n_add_fk = 0; - List_iterator key_iterator(alter_info->key_list); - - while ((key=key_iterator++)) { - if (key->type != Key::FOREIGN_KEY) { + for (Key& key : alter_info->key_list) { + if (key.type != Key::FOREIGN_KEY) { continue; } @@ -2905,18 +2887,15 @@ innobase_get_foreign_key_info( char db_name[MAX_DATABASE_NAME_LEN]; char tbl_name[MAX_TABLE_NAME_LEN]; - fk_key = static_cast(key); + Foreign_key* fk_key = static_cast(&key); if (fk_key->columns.elements > 0) { ulint i = 0; - Key_part_spec* column; - List_iterator key_part_iterator( - fk_key->columns); /* Get all the foreign key column info for the current table */ - while ((column = key_part_iterator++)) { - column_names[i] = column->field_name.str; + for (const Key_part_spec& column : fk_key->columns) { + column_names[i] = column.field_name.str; ut_ad(i < MAX_NUM_FK_COLUMNS); i++; } @@ -3010,13 +2989,10 @@ innobase_get_foreign_key_info( if (fk_key->ref_columns.elements > 0) { ulint i = 0; - Key_part_spec* column; - List_iterator key_part_iterator( - fk_key->ref_columns); - while ((column = key_part_iterator++)) { + for (Key_part_spec &column : fk_key->ref_columns) { referenced_column_names[i] = - column->field_name.str; + column.field_name.str; ut_ad(i < MAX_NUM_FK_COLUMNS); i++; } @@ -4221,26 +4197,21 @@ innobase_check_foreigns( dict_foreign_t** drop_fk, ulint n_drop_fk) { - List_iterator_fast cf_it( - ha_alter_info->alter_info->create_list); - for (Field** fp = old_table->field; *fp; fp++) { - cf_it.rewind(); - const Create_field* new_field; - ut_ad(!(*fp)->real_maybe_null() == !!((*fp)->flags & NOT_NULL_FLAG)); - while ((new_field = cf_it++)) { - if (new_field->field == *fp) { - break; - } - } + auto end = ha_alter_info->alter_info->create_list.end(); + auto it = std::find_if( + ha_alter_info->alter_info->create_list.begin(), end, + [fp](const Create_field& field) { + return field.field == *fp; + }); - if (!new_field || (new_field->flags & NOT_NULL_FLAG)) { + if (it == end || (it->flags & NOT_NULL_FLAG)) { if (innobase_check_foreigns_low( user_table, drop_fk, n_drop_fk, - (*fp)->field_name.str, !new_field)) { + (*fp)->field_name.str, it == end)) { return(true); } } @@ -4331,8 +4302,6 @@ innobase_build_col_map( heap, (size_t(old_table->n_cols) + old_n_v_cols) * sizeof *col_map)); - List_iterator_fast cf_it( - ha_alter_info->alter_info->create_list); uint i = 0; uint num_v = 0; @@ -4348,14 +4317,15 @@ innobase_build_col_map( const bool omits_virtual = ha_innobase::omits_virtual_cols(*table->s); - while (const Create_field* new_field = cf_it++) { - bool is_v = !new_field->stored_in_db(); + for (const Create_field& new_field : + ha_alter_info->alter_info->create_list) { + bool is_v = !new_field.stored_in_db(); ulint num_old_v = 0; for (uint old_i = 0; table->field[old_i]; old_i++) { const Field* field = table->field[old_i]; if (!field->stored_in_db()) { - if (is_v && new_field->field == field) { + if (is_v && new_field.field == field) { if (!omits_virtual) { col_map[old_table->n_cols + num_v] @@ -4368,7 +4338,7 @@ innobase_build_col_map( continue; } - if (new_field->field == field) { + if (new_field.field == field) { const Field* altered_field = altered_table->field[i + num_v]; @@ -4520,21 +4490,20 @@ innobase_get_col_names( mem_heap_zalloc(heap, user_table->n_def * sizeof *cols)); i = 0; - List_iterator_fast cf_it( - ha_alter_info->alter_info->create_list); - while (const Create_field* new_field = cf_it++) { + for (const Create_field& new_field : + ha_alter_info->alter_info->create_list) { ulint num_v = 0; DBUG_ASSERT(i < altered_table->s->fields); - if (!new_field->stored_in_db()) { + if (!new_field.stored_in_db()) { continue; } for (uint old_i = 0; table->field[old_i]; old_i++) { num_v += !table->field[old_i]->stored_in_db(); - if (new_field->field == table->field[old_i]) { - cols[old_i - num_v] = new_field->field_name.str; + if (new_field.field == table->field[old_i]) { + cols[old_i - num_v] = new_field.field_name.str; break; } } @@ -4882,13 +4851,11 @@ prepare_inplace_add_virtual( mem_heap_alloc(ctx->heap, ctx->num_to_add_vcol * sizeof *ctx->add_vcol_name)); - List_iterator_fast cf_it( - ha_alter_info->alter_info->create_list); - - while (const Create_field* new_field = cf_it++) { + for (const Create_field& new_field : + ha_alter_info->alter_info->create_list) { const Field* field = altered_table->field[i++]; - if (new_field->field || field->stored_in_db()) { + if (new_field.field || field->stored_in_db()) { continue; } @@ -5971,8 +5938,6 @@ innodb_v_adjust_idx_col( ulint num_v_dropped, index_def_t* index_def) { - List_iterator_fast cf_it( - ha_alter_info->alter_info->create_list); for (ulint i = 0; i < index_def->n_fields; i++) { #ifdef UNIV_DEBUG bool col_found = false; @@ -5990,15 +5955,14 @@ innodb_v_adjust_idx_col( const Field* field = NULL; - cf_it.rewind(); - /* Found the field in the new table */ - while (const Create_field* new_field = cf_it++) { - if (new_field->stored_in_db()) { + for (const Create_field& new_field : + ha_alter_info->alter_info->create_list) { + if (new_field.stored_in_db()) { continue; } - field = new_field->field; + field = new_field.field; if (num_v == index_field->col_no) { break; @@ -6582,18 +6546,16 @@ new_clustered_failed: uint i = 0; // index of stored columns ctx->new_table->cols[] Field **af = altered_table->field; - List_iterator_fast cf_it( - ha_alter_info->alter_info->create_list); - - while (const Create_field* new_field = cf_it++) { - DBUG_ASSERT(!new_field->field + for (const Create_field& new_field : + ha_alter_info->alter_info->create_list) { + DBUG_ASSERT(!new_field.field || std::find(old_table->field, old_table->field + old_table->s->fields, - new_field->field) != + new_field.field) != old_table->field + old_table->s->fields); - DBUG_ASSERT(new_field->field - || !strcmp(new_field->field_name.str, + DBUG_ASSERT(new_field.field + || !strcmp(new_field.field_name.str, (*af)->field_name.str)); if (!(*af)->stored_in_db()) { @@ -6608,7 +6570,7 @@ new_clustered_failed: i))); DBUG_ASSERT(!col->is_added()); - if (new_field->field) { + if (new_field.field) { /* This is a pre-existing column, possibly at a different position. */ } else if ((*af)->is_real_null()) { @@ -7567,9 +7529,6 @@ err_exit_no_heap: already contains. */ if (ha_alter_info->handler_flags & ALTER_COLUMN_NAME) { - List_iterator_fast cf_it( - ha_alter_info->alter_info->create_list); - for (Field** fp = table->field; *fp; fp++) { if (!((*fp)->flags & FIELD_IS_RENAMED)) { continue; @@ -7577,10 +7536,10 @@ err_exit_no_heap: const char* name = 0; - cf_it.rewind(); - while (Create_field* cf = cf_it++) { - if (cf->field == *fp) { - name = cf->field_name.str; + for (const Create_field& cf : + ha_alter_info->alter_info->create_list) { + if (cf.field == *fp) { + name = cf.field_name.str; goto check_if_ok_to_rename; } } @@ -7739,11 +7698,8 @@ check_if_ok_to_rename: ha_alter_info->alter_info->drop_list.elements * sizeof(dict_foreign_t*))); - List_iterator drop_it( - ha_alter_info->alter_info->drop_list); - - while (Alter_drop* drop = drop_it++) { - if (drop->type != Alter_drop::FOREIGN_KEY) { + for (Alter_drop& drop : ha_alter_info->alter_info->drop_list) { + if (drop.type != Alter_drop::FOREIGN_KEY) { continue; } @@ -7764,13 +7720,13 @@ check_if_ok_to_rename: fid = fid ? fid + 1 : foreign->id; if (!my_strcasecmp(system_charset_info, - fid, drop->name)) { + fid, drop.name)) { goto found_fk; } } my_error(ER_CANT_DROP_FIELD_OR_KEY, MYF(0), - drop->type_name(), drop->name); + drop.type_name(), drop.name); goto err_exit; found_fk: for (ulint i = n_drop_fk; i--; ) { @@ -8089,21 +8045,20 @@ err_exit: /* See if an AUTO_INCREMENT column was added. */ uint i = 0; ulint num_v = 0; - List_iterator_fast cf_it( - ha_alter_info->alter_info->create_list); - while (const Create_field* new_field = cf_it++) { + for (const Create_field& new_field : + ha_alter_info->alter_info->create_list) { const Field* field; DBUG_ASSERT(i < altered_table->s->fields); for (uint old_i = 0; table->field[old_i]; old_i++) { - if (new_field->field == table->field[old_i]) { + if (new_field.field == table->field[old_i]) { goto found_col; } } /* This is an added column. */ - DBUG_ASSERT(!new_field->field); + DBUG_ASSERT(!new_field.field); DBUG_ASSERT(ha_alter_info->handler_flags & ALTER_ADD_COLUMN); @@ -8127,7 +8082,7 @@ err_exit: autoinc_col_max_value = innobase_get_int_col_max_value(field); } found_col: - num_v += !new_field->stored_in_db(); + num_v += !new_field.stored_in_db(); i++; } @@ -8200,16 +8155,14 @@ alter_templ_needs_rebuild( dict_table_t* table) { ulint i = 0; - List_iterator_fast cf_it( - ha_alter_info->alter_info->create_list); for (Field** fp = altered_table->field; *fp; fp++, i++) { - cf_it.rewind(); - while (const Create_field* cf = cf_it++) { + for (const Create_field& cf : + ha_alter_info->alter_info->create_list) { for (ulint j=0; j < table->n_cols; j++) { dict_col_t* cols = dict_table_get_nth_col(table, j); - if (cf->length > cols->len + if (cf.length > cols->len && dict_col_in_v_indexes(table, cols)) { return(true); } @@ -9000,8 +8953,6 @@ innobase_rename_columns_try( trx_t* trx, const char* table_name) { - List_iterator_fast cf_it( - ha_alter_info->alter_info->create_list); uint i = 0; ulint num_v = 0; @@ -9015,14 +8966,13 @@ innobase_rename_columns_try( goto processed_field; } - cf_it.rewind(); - - while (Create_field* cf = cf_it++) { - if (cf->field == *fp) { + for (const Create_field& cf : + ha_alter_info->alter_info->create_list) { + if (cf.field == *fp) { if (innobase_rename_column_try( *ctx, trx, table_name, - cf->field->field_name.str, - cf->field_name.str)) { + cf.field->field_name.str, + cf.field_name.str)) { return(true); } goto processed_field; @@ -9196,8 +9146,6 @@ innobase_rename_or_enlarge_columns_try( DBUG_RETURN(false); } - List_iterator_fast cf_it( - ha_alter_info->alter_info->create_list); ulint i = 0; ulint num_v = 0; @@ -9205,10 +9153,10 @@ innobase_rename_or_enlarge_columns_try( const bool is_v = !(*fp)->stored_in_db(); ulint idx = is_v ? num_v++ : i - num_v; - cf_it.rewind(); Field** af = altered_table->field; - while (Create_field* cf = cf_it++) { - if (cf->field == *fp) { + for (const Create_field& cf : + ha_alter_info->alter_info->create_list) { + if (cf.field == *fp) { if (innobase_rename_or_enlarge_column_try( ctx, trx, table_name, idx, **af, is_v)) { @@ -9244,18 +9192,16 @@ innobase_rename_or_enlarge_columns_cache( return; } - List_iterator_fast cf_it( - ha_alter_info->alter_info->create_list); uint i = 0; ulint num_v = 0; for (Field** fp = table->field; *fp; fp++, i++) { const bool is_virtual = !(*fp)->stored_in_db(); - cf_it.rewind(); Field** af = altered_table->field; - while (Create_field* cf = cf_it++) { - if (cf->field != *fp) { + for (Create_field& cf : + ha_alter_info->alter_info->create_list) { + if (cf.field != *fp) { af++; continue; } @@ -9282,7 +9228,7 @@ innobase_rename_or_enlarge_columns_cache( if ((*fp)->flags & FIELD_IS_RENAMED) { dict_mem_table_col_rename( user_table, col_n, - cf->field->field_name.str, + cf.field->field_name.str, (*af)->field_name.str, is_virtual); } @@ -9676,27 +9622,24 @@ vers_change_fields_try( DBUG_ASSERT(ha_alter_info); DBUG_ASSERT(ctx); - List_iterator_fast it( - ha_alter_info->alter_info->create_list); - - while (const Create_field* create_field = it++) { - if (!create_field->field) { + for (const Create_field& create_field : ha_alter_info->alter_info->create_list) { + if (!create_field.field) { continue; } - if (create_field->versioning + if (create_field.versioning == Column_definition::VERSIONING_NOT_SET) { continue; } const dict_table_t* new_table = ctx->new_table; - const uint pos = innodb_col_no(create_field->field); + const uint pos = innodb_col_no(create_field.field); const dict_col_t* col = dict_table_get_nth_col(new_table, pos); DBUG_ASSERT(!col->vers_sys_start()); DBUG_ASSERT(!col->vers_sys_end()); ulint new_prtype - = create_field->versioning + = create_field.versioning == Column_definition::WITHOUT_VERSIONING ? col->prtype & ~DATA_VERSIONED : col->prtype | DATA_VERSIONED; @@ -9729,23 +9672,21 @@ vers_change_fields_cache( DBUG_ASSERT(ctx); DBUG_ASSERT(ha_alter_info->handler_flags & ALTER_COLUMN_UNVERSIONED); - List_iterator_fast it( - ha_alter_info->alter_info->create_list); - - while (const Create_field* create_field = it++) { - if (!create_field->field || create_field->field->vcol_info) { + for (const Create_field& create_field : + ha_alter_info->alter_info->create_list) { + if (!create_field.field || create_field.field->vcol_info) { continue; } dict_col_t* col = dict_table_get_nth_col( - ctx->new_table, innodb_col_no(create_field->field)); + ctx->new_table, innodb_col_no(create_field.field)); - if (create_field->versioning + if (create_field.versioning == Column_definition::WITHOUT_VERSIONING) { DBUG_ASSERT(!col->vers_sys_start()); DBUG_ASSERT(!col->vers_sys_end()); col->prtype &= ~DATA_VERSIONED; - } else if (create_field->versioning + } else if (create_field.versioning == Column_definition::WITH_VERSIONING) { DBUG_ASSERT(!col->vers_sys_start()); diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index 74bdb365e26..5647cb488b5 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -37,7 +37,7 @@ extern bool innodb_table_stats_not_found; extern bool innodb_index_stats_not_found; /** the first table or index ID for other than hard-coded system tables */ -#define DICT_HDR_FIRST_ID 10 +constexpr uint8_t DICT_HDR_FIRST_ID= 10; /********************************************************************//** Get the database name length in a table name. diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h index 0d137086569..79453e55aab 100644 --- a/storage/innobase/include/page0page.h +++ b/storage/innobase/include/page0page.h @@ -158,12 +158,12 @@ Otherwise written as 0. @see PAGE_ROOT_AUTO_INC */ not necessarily collation order; this record may have been deleted */ -/* Directions of cursor movement */ -#define PAGE_LEFT 1 -#define PAGE_RIGHT 2 -#define PAGE_SAME_REC 3 -#define PAGE_SAME_PAGE 4 -#define PAGE_NO_DIRECTION 5 +/* Directions of cursor movement (stored in PAGE_DIRECTION field) */ +constexpr uint16_t PAGE_LEFT= 1; +constexpr uint16_t PAGE_RIGHT= 2; +constexpr uint16_t PAGE_SAME_REC= 3; +constexpr uint16_t PAGE_SAME_PAGE= 4; +constexpr uint16_t PAGE_NO_DIRECTION= 5; #ifndef UNIV_INNOCHECKSUM diff --git a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h index e80b222d260..c1d1cf29dfa 100644 --- a/storage/innobase/include/trx0sys.h +++ b/storage/innobase/include/trx0sys.h @@ -344,9 +344,9 @@ FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID. */ /*-------------------------------------------------------------*/ /** Contents of TRX_SYS_DOUBLEWRITE_MAGIC */ -#define TRX_SYS_DOUBLEWRITE_MAGIC_N 536853855 +constexpr uint32_t TRX_SYS_DOUBLEWRITE_MAGIC_N= 536853855; /** Contents of TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED */ -#define TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED_N 1783657386 +constexpr uint32_t TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED_N= 1783657386; /** Size of the doublewrite block in pages */ #define TRX_SYS_DOUBLEWRITE_BLOCK_SIZE FSP_EXTENT_SIZE diff --git a/storage/innobase/include/trx0undo.h b/storage/innobase/include/trx0undo.h index 939a51ad489..ce92e5de5e1 100644 --- a/storage/innobase/include/trx0undo.h +++ b/storage/innobase/include/trx0undo.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2018, MariaDB Corporation. +Copyright (c) 2017, 2019, 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 @@ -308,16 +308,17 @@ trx_undo_mem_create_at_db_start(trx_rseg_t* rseg, ulint id, ulint page_no, and delete markings: in short, modifys (the name 'UPDATE' is a historical relic) */ -/* States of an undo log segment */ -#define TRX_UNDO_ACTIVE 1 /* contains an undo log of an active - transaction */ -#define TRX_UNDO_CACHED 2 /* cached for quick reuse */ -#define TRX_UNDO_TO_FREE 3 /* insert undo segment can be freed */ -#define TRX_UNDO_TO_PURGE 4 /* update undo segment will not be - reused: it can be freed in purge when - all undo data in it is removed */ -#define TRX_UNDO_PREPARED 5 /* contains an undo log of an - prepared transaction */ +/* TRX_UNDO_STATE values of an undo log segment */ +/** contains an undo log of an active transaction */ +constexpr uint16_t TRX_UNDO_ACTIVE = 1; +/** cached for quick reuse */ +constexpr uint16_t TRX_UNDO_CACHED = 2; +/** old_insert undo segment that can be freed */ +constexpr uint16_t TRX_UNDO_TO_FREE = 3; +/** can be freed in purge when all undo data in it is removed */ +constexpr uint16_t TRX_UNDO_TO_PURGE = 4; +/** contains an undo log of a prepared transaction */ +constexpr uint16_t TRX_UNDO_PREPARED = 5; #ifndef UNIV_INNOCHECKSUM diff --git a/storage/innobase/mtr/mtr0log.cc b/storage/innobase/mtr/mtr0log.cc index dbb85fab35a..34f988db46a 100644 --- a/storage/innobase/mtr/mtr0log.cc +++ b/storage/innobase/mtr/mtr0log.cc @@ -139,6 +139,7 @@ mlog_parse_nbytes( ut_ad(type <= MLOG_8BYTES || type == MLOG_MEMSET); ut_a(!page || !page_zip + || type == MLOG_MEMSET || !fil_page_index_page_check(page)); if (end_ptr < ptr + 2) { return NULL; @@ -164,6 +165,8 @@ mlog_parse_nbytes( if (page) { memset(page + offset, *ptr, val); if (page_zip) { + ut_ad(offset + val <= PAGE_DATA + || !fil_page_index_page_check(page)); memset(static_cast(page_zip) ->data + offset, *ptr, val); } diff --git a/storage/spider/mysql-test/spider/regression/e1121/include/load_data_ddi0_deinit.inc b/storage/spider/mysql-test/spider/regression/e1121/include/load_data_ddi0_deinit.inc new file mode 100644 index 00000000000..f1899d1576a --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/include/load_data_ddi0_deinit.inc @@ -0,0 +1,3 @@ +--connection master_1 +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +--source load_data_deinit.inc diff --git a/storage/spider/mysql-test/spider/regression/e1121/include/load_data_ddi0_init.inc b/storage/spider/mysql-test/spider/regression/e1121/include/load_data_ddi0_init.inc new file mode 100644 index 00000000000..24f0dc9820e --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/include/load_data_ddi0_init.inc @@ -0,0 +1,4 @@ +--source load_data_init.inc +--connection master_1 +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 0; diff --git a/storage/spider/mysql-test/spider/regression/e1121/include/load_data_ddi1_deinit.inc b/storage/spider/mysql-test/spider/regression/e1121/include/load_data_ddi1_deinit.inc new file mode 100644 index 00000000000..f1899d1576a --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/include/load_data_ddi1_deinit.inc @@ -0,0 +1,3 @@ +--connection master_1 +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +--source load_data_deinit.inc diff --git a/storage/spider/mysql-test/spider/regression/e1121/include/load_data_ddi1_init.inc b/storage/spider/mysql-test/spider/regression/e1121/include/load_data_ddi1_init.inc new file mode 100644 index 00000000000..50ef8d47696 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/include/load_data_ddi1_init.inc @@ -0,0 +1,4 @@ +--source load_data_init.inc +--connection master_1 +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 1; diff --git a/storage/spider/mysql-test/spider/regression/e1121/include/load_data_deinit.inc b/storage/spider/mysql-test/spider/regression/e1121/include/load_data_deinit.inc new file mode 100644 index 00000000000..f8405973768 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/include/load_data_deinit.inc @@ -0,0 +1,11 @@ +--let $MASTER_1_COMMENT_2_1= $MASTER_1_COMMENT_2_1_BACKUP +--let $CHILD2_1_DROP_TABLES= $CHILD2_1_DROP_TABLES_BACKUP +--let $CHILD2_1_CREATE_TABLES= $CHILD2_1_CREATE_TABLES_BACKUP +--let $CHILD2_1_SELECT_TABLES= $CHILD2_1_SELECT_TABLES_BACKUP +--disable_warnings +--disable_query_log +--disable_result_log +--source ../../t/test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings diff --git a/storage/spider/mysql-test/spider/regression/e1121/include/load_data_init.inc b/storage/spider/mysql-test/spider/regression/e1121/include/load_data_init.inc new file mode 100644 index 00000000000..5f4104382dc --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/include/load_data_init.inc @@ -0,0 +1,25 @@ +--disable_warnings +--disable_query_log +--disable_result_log +--source ../../t/test_init.inc +--enable_result_log +--enable_query_log +--enable_warnings +--let $MASTER_1_COMMENT_2_1_BACKUP= $MASTER_1_COMMENT_2_1 +let $MASTER_1_COMMENT_2_1= + COMMENT='table "tbl_a", srv "s_2_1"'; +--let $CHILD2_1_DROP_TABLES_BACKUP= $CHILD2_1_DROP_TABLES +let $CHILD2_1_DROP_TABLES= + DROP TABLE IF EXISTS tbl_a; +--let $CHILD2_1_CREATE_TABLES_BACKUP= $CHILD2_1_CREATE_TABLES +let $CHILD2_1_CREATE_TABLES= + CREATE TABLE tbl_a ( + pkey int NOT NULL, + val int NOT NULL, + PRIMARY KEY (pkey) + ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; +--let $CHILD2_1_SELECT_TABLES_BACKUP= $CHILD2_1_SELECT_TABLES +let $CHILD2_1_SELECT_TABLES= + SELECT pkey, val FROM tbl_a ORDER BY pkey; +let $CHILD2_1_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ddi0.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ddi0.result new file mode 100644 index 00000000000..2244b176b31 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ddi0.result @@ -0,0 +1,75 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 0; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +TRUNCATE tbl_a; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' INTO TABLE tbl_a; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 0 +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ddi1.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ddi1.result new file mode 100644 index 00000000000..6d0d29cd4bd --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ddi1.result @@ -0,0 +1,75 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 1; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +TRUNCATE tbl_a; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' INTO TABLE tbl_a; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 0 +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ignore_ddi0.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ignore_ddi0.result new file mode 100644 index 00000000000..1bdd1470faa --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ignore_ddi0.result @@ -0,0 +1,95 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 0; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +UPDATE tbl_a SET val = val + 1; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' IGNORE INTO TABLE tbl_a; +Warnings: +Warning 1062 Duplicate entry '0' for key 'PRIMARY' +Warning 1062 Duplicate entry '1' for key 'PRIMARY' +Warning 1062 Duplicate entry '2' for key 'PRIMARY' +Warning 1062 Duplicate entry '3' for key 'PRIMARY' +Warning 1062 Duplicate entry '4' for key 'PRIMARY' +Warning 1062 Duplicate entry '5' for key 'PRIMARY' +Warning 1062 Duplicate entry '6' for key 'PRIMARY' +Warning 1062 Duplicate entry '7' for key 'PRIMARY' +Warning 1062 Duplicate entry '8' for key 'PRIMARY' +Warning 1062 Duplicate entry '9' for key 'PRIMARY' +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(0,0) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(1,1) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(2,2) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(3,3) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(4,4) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(5,5) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(6,6) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(7,7) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(8,8) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(9,9) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 1 +1 2 +2 3 +3 4 +4 5 +5 6 +6 7 +7 8 +8 9 +9 10 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ignore_ddi1.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ignore_ddi1.result new file mode 100644 index 00000000000..4d64840e85d --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ignore_ddi1.result @@ -0,0 +1,75 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 1; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +UPDATE tbl_a SET val = val + 1; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' IGNORE INTO TABLE tbl_a; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority ignore into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 1 +1 2 +2 3 +3 4 +4 5 +5 6 +6 7 +7 8 +8 9 +9 10 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ddi0.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ddi0.result new file mode 100644 index 00000000000..9156c838e09 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ddi0.result @@ -0,0 +1,84 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 0; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +TRUNCATE tbl_a; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' INTO TABLE tbl_a; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(0,0) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(1,1) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(2,2) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(3,3) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(4,4) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(5,5) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(6,6) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(7,7) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(8,8) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(9,9) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 0 +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ddi1.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ddi1.result new file mode 100644 index 00000000000..761ce71dc02 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ddi1.result @@ -0,0 +1,75 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 1; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +TRUNCATE tbl_a; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' INTO TABLE tbl_a; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority ignore into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 0 +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ignore_ddi0.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ignore_ddi0.result new file mode 100644 index 00000000000..81d0fdbf785 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ignore_ddi0.result @@ -0,0 +1,95 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 0; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +UPDATE tbl_a SET val = val + 1; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' IGNORE INTO TABLE tbl_a; +Warnings: +Warning 1062 Duplicate entry '0' for key 'PRIMARY' +Warning 1062 Duplicate entry '1' for key 'PRIMARY' +Warning 1062 Duplicate entry '2' for key 'PRIMARY' +Warning 1062 Duplicate entry '3' for key 'PRIMARY' +Warning 1062 Duplicate entry '4' for key 'PRIMARY' +Warning 1062 Duplicate entry '5' for key 'PRIMARY' +Warning 1062 Duplicate entry '6' for key 'PRIMARY' +Warning 1062 Duplicate entry '7' for key 'PRIMARY' +Warning 1062 Duplicate entry '8' for key 'PRIMARY' +Warning 1062 Duplicate entry '9' for key 'PRIMARY' +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(0,0) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(1,1) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(2,2) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(3,3) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(4,4) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(5,5) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(6,6) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(7,7) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(8,8) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(9,9) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 1 +1 2 +2 3 +3 4 +4 5 +5 6 +6 7 +7 8 +8 9 +9 10 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ignore_ddi1.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ignore_ddi1.result new file mode 100644 index 00000000000..737cccc42cb --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ignore_ddi1.result @@ -0,0 +1,75 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 1; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +UPDATE tbl_a SET val = val + 1; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' IGNORE INTO TABLE tbl_a; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority ignore into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 1 +1 2 +2 3 +3 4 +4 5 +5 6 +6 7 +7 8 +8 9 +9 10 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_replace_ddi0.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_replace_ddi0.result new file mode 100644 index 00000000000..7d8fb034544 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_replace_ddi0.result @@ -0,0 +1,104 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 0; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +UPDATE tbl_a SET val = val + 1; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' REPLACE INTO TABLE tbl_a; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(0,0) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 0 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 0,`val` = 0 where `pkey` = 0 and `val` = 1 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(1,1) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 1 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 1,`val` = 1 where `pkey` = 1 and `val` = 2 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(2,2) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 2 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 2,`val` = 2 where `pkey` = 2 and `val` = 3 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(3,3) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 3 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 3,`val` = 3 where `pkey` = 3 and `val` = 4 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(4,4) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 4 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 4,`val` = 4 where `pkey` = 4 and `val` = 5 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(5,5) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 5 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 5,`val` = 5 where `pkey` = 5 and `val` = 6 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(6,6) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 6 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 6,`val` = 6 where `pkey` = 6 and `val` = 7 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(7,7) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 7 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 7,`val` = 7 where `pkey` = 7 and `val` = 8 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(8,8) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 8 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 8,`val` = 8 where `pkey` = 8 and `val` = 9 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(9,9) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 9 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 9,`val` = 9 where `pkey` = 9 and `val` = 10 limit 1 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 0 +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_replace_ddi1.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_replace_ddi1.result new file mode 100644 index 00000000000..f3e272c1cd1 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_replace_ddi1.result @@ -0,0 +1,75 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 1; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +UPDATE tbl_a SET val = val + 1; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' REPLACE INTO TABLE tbl_a; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +replace into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 0 +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_replace_ddi0.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_replace_ddi0.result new file mode 100644 index 00000000000..3ce058a9fc8 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_replace_ddi0.result @@ -0,0 +1,104 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 0; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +UPDATE tbl_a SET val = val + 1; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' REPLACE INTO TABLE tbl_a; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(0,0) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 0 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 0,`val` = 0 where `pkey` = 0 and `val` = 1 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(1,1) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 1 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 1,`val` = 1 where `pkey` = 1 and `val` = 2 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(2,2) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 2 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 2,`val` = 2 where `pkey` = 2 and `val` = 3 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(3,3) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 3 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 3,`val` = 3 where `pkey` = 3 and `val` = 4 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(4,4) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 4 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 4,`val` = 4 where `pkey` = 4 and `val` = 5 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(5,5) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 5 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 5,`val` = 5 where `pkey` = 5 and `val` = 6 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(6,6) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 6 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 6,`val` = 6 where `pkey` = 6 and `val` = 7 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(7,7) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 7 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 7,`val` = 7 where `pkey` = 7 and `val` = 8 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(8,8) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 8 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 8,`val` = 8 where `pkey` = 8 and `val` = 9 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(9,9) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 9 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 9,`val` = 9 where `pkey` = 9 and `val` = 10 limit 1 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 0 +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_replace_ddi1.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_replace_ddi1.result new file mode 100644 index 00000000000..86124b9c5c6 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_replace_ddi1.result @@ -0,0 +1,75 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 1; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +UPDATE tbl_a SET val = val + 1; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' REPLACE INTO TABLE tbl_a; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +replace into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 0 +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/t/load_data.inc b/storage/spider/mysql-test/spider/regression/e1121/t/load_data.inc new file mode 100644 index 00000000000..8c1aa4e651f --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/t/load_data.inc @@ -0,0 +1,76 @@ +--echo +--echo this test is for MDEV-18987 +--echo +--echo drop and create databases + +--connection master_1 +--disable_warnings +CREATE DATABASE auto_test_local; +USE auto_test_local; + +--connection child2_1 +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +--enable_warnings + +--echo +--echo create table and insert + +--connection child2_1 +--disable_query_log +echo CHILD2_1_CREATE_TABLES; +eval $CHILD2_1_CREATE_TABLES; +--enable_query_log +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +--disable_query_log +echo CREATE TABLE tbl_a ( + pkey int NOT NULL, + val int NOT NULL, + PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; +eval CREATE TABLE tbl_a ( + pkey int NOT NULL, + val int NOT NULL, + PRIMARY KEY (pkey) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +--enable_query_log +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +--disable_query_log +--echo SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +eval SELECT pkey,val INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +--enable_query_log +eval $COMMAND_BEFORE_LOAD_DATA; + +--echo +--echo select test 1 + +--connection child2_1 +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +--disable_query_log +--echo LOAD DATA $OPTION_LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' $OPTION_WORD INTO TABLE tbl_a; +eval LOAD DATA $OPTION_LOCAL INFILE '$MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' $OPTION_WORD INTO TABLE tbl_a; +--enable_query_log +--remove_file $MYSQLTEST_VARDIR/tmp/spider_outfile.tsv + +--connection child2_1 +eval $CHILD2_1_SELECT_ARGUMENT1; +eval $CHILD2_1_SELECT_TABLES; + +--echo +--echo deinit +--disable_warnings + +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; + +--connection child2_1 +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; + +--enable_warnings diff --git a/storage/spider/mysql-test/spider/regression/e1121/t/load_data_ddi0.test b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_ddi0.test new file mode 100644 index 00000000000..d43a944d5e1 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_ddi0.test @@ -0,0 +1,8 @@ +--source ../include/load_data_ddi0_init.inc +--let COMMAND_BEFORE_LOAD_DATA= TRUNCATE tbl_a +--let OPTION_LOCAL= +--let OPTION_WORD= +--source load_data.inc +--source ../include/load_data_ddi0_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/t/load_data_ddi1.test b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_ddi1.test new file mode 100644 index 00000000000..a73d1ef03b2 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_ddi1.test @@ -0,0 +1,8 @@ +--source ../include/load_data_ddi1_init.inc +--let COMMAND_BEFORE_LOAD_DATA= TRUNCATE tbl_a +--let OPTION_LOCAL= +--let OPTION_WORD= +--source load_data.inc +--source ../include/load_data_ddi1_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/t/load_data_ignore_ddi0.test b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_ignore_ddi0.test new file mode 100644 index 00000000000..6fee83e7b43 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_ignore_ddi0.test @@ -0,0 +1,8 @@ +--source ../include/load_data_ddi0_init.inc +--let COMMAND_BEFORE_LOAD_DATA= UPDATE tbl_a SET val = val + 1 +--let OPTION_LOCAL= +--let OPTION_WORD= IGNORE +--source load_data.inc +--source ../include/load_data_ddi0_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/t/load_data_ignore_ddi1.test b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_ignore_ddi1.test new file mode 100644 index 00000000000..1c8827911b2 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_ignore_ddi1.test @@ -0,0 +1,8 @@ +--source ../include/load_data_ddi1_init.inc +--let COMMAND_BEFORE_LOAD_DATA= UPDATE tbl_a SET val = val + 1 +--let OPTION_LOCAL= +--let OPTION_WORD= IGNORE +--source load_data.inc +--source ../include/load_data_ddi1_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/t/load_data_local_ddi0.test b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_local_ddi0.test new file mode 100644 index 00000000000..dadd02245ba --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_local_ddi0.test @@ -0,0 +1,8 @@ +--source ../include/load_data_ddi0_init.inc +--let COMMAND_BEFORE_LOAD_DATA= TRUNCATE tbl_a +--let OPTION_LOCAL= LOCAL +--let OPTION_WORD= +--source load_data.inc +--source ../include/load_data_ddi0_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/t/load_data_local_ddi1.test b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_local_ddi1.test new file mode 100644 index 00000000000..95b065050b5 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_local_ddi1.test @@ -0,0 +1,8 @@ +--source ../include/load_data_ddi1_init.inc +--let COMMAND_BEFORE_LOAD_DATA= TRUNCATE tbl_a +--let OPTION_LOCAL= LOCAL +--let OPTION_WORD= +--source load_data.inc +--source ../include/load_data_ddi1_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/t/load_data_local_ignore_ddi0.test b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_local_ignore_ddi0.test new file mode 100644 index 00000000000..2243f8924a8 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_local_ignore_ddi0.test @@ -0,0 +1,8 @@ +--source ../include/load_data_ddi0_init.inc +--let COMMAND_BEFORE_LOAD_DATA= UPDATE tbl_a SET val = val + 1 +--let OPTION_LOCAL= LOCAL +--let OPTION_WORD= IGNORE +--source load_data.inc +--source ../include/load_data_ddi0_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/t/load_data_local_ignore_ddi1.test b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_local_ignore_ddi1.test new file mode 100644 index 00000000000..2ab7307e3af --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_local_ignore_ddi1.test @@ -0,0 +1,8 @@ +--source ../include/load_data_ddi1_init.inc +--let COMMAND_BEFORE_LOAD_DATA= UPDATE tbl_a SET val = val + 1 +--let OPTION_LOCAL= LOCAL +--let OPTION_WORD= IGNORE +--source load_data.inc +--source ../include/load_data_ddi1_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/t/load_data_local_replace_ddi0.test b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_local_replace_ddi0.test new file mode 100644 index 00000000000..1821a9ef730 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_local_replace_ddi0.test @@ -0,0 +1,8 @@ +--source ../include/load_data_ddi0_init.inc +--let COMMAND_BEFORE_LOAD_DATA= UPDATE tbl_a SET val = val + 1 +--let OPTION_LOCAL= LOCAL +--let OPTION_WORD= REPLACE +--source load_data.inc +--source ../include/load_data_ddi0_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/t/load_data_local_replace_ddi1.test b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_local_replace_ddi1.test new file mode 100644 index 00000000000..3d53feca372 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_local_replace_ddi1.test @@ -0,0 +1,8 @@ +--source ../include/load_data_ddi1_init.inc +--let COMMAND_BEFORE_LOAD_DATA= UPDATE tbl_a SET val = val + 1 +--let OPTION_LOCAL= LOCAL +--let OPTION_WORD= REPLACE +--source load_data.inc +--source ../include/load_data_ddi1_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/t/load_data_replace_ddi0.test b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_replace_ddi0.test new file mode 100644 index 00000000000..4bc402a40f1 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_replace_ddi0.test @@ -0,0 +1,8 @@ +--source ../include/load_data_ddi0_init.inc +--let COMMAND_BEFORE_LOAD_DATA= UPDATE tbl_a SET val = val + 1 +--let OPTION_LOCAL= +--let OPTION_WORD= REPLACE +--source load_data.inc +--source ../include/load_data_ddi0_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e1121/t/load_data_replace_ddi1.test b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_replace_ddi1.test new file mode 100644 index 00000000000..9dafd24a15e --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e1121/t/load_data_replace_ddi1.test @@ -0,0 +1,8 @@ +--source ../include/load_data_ddi1_init.inc +--let COMMAND_BEFORE_LOAD_DATA= UPDATE tbl_a SET val = val + 1 +--let OPTION_LOCAL= +--let OPTION_WORD= REPLACE +--source load_data.inc +--source ../include/load_data_ddi1_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/include/load_data_part_ddi0_deinit.inc b/storage/spider/mysql-test/spider/regression/e112122/include/load_data_part_ddi0_deinit.inc new file mode 100644 index 00000000000..c41917340b0 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/include/load_data_part_ddi0_deinit.inc @@ -0,0 +1,3 @@ +--connection master_1 +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +--source load_data_part_deinit.inc diff --git a/storage/spider/mysql-test/spider/regression/e112122/include/load_data_part_ddi0_init.inc b/storage/spider/mysql-test/spider/regression/e112122/include/load_data_part_ddi0_init.inc new file mode 100644 index 00000000000..8e69f52cc58 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/include/load_data_part_ddi0_init.inc @@ -0,0 +1,4 @@ +--source load_data_part_init.inc +--connection master_1 +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 0; diff --git a/storage/spider/mysql-test/spider/regression/e112122/include/load_data_part_ddi1_deinit.inc b/storage/spider/mysql-test/spider/regression/e112122/include/load_data_part_ddi1_deinit.inc new file mode 100644 index 00000000000..c41917340b0 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/include/load_data_part_ddi1_deinit.inc @@ -0,0 +1,3 @@ +--connection master_1 +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +--source load_data_part_deinit.inc diff --git a/storage/spider/mysql-test/spider/regression/e112122/include/load_data_part_ddi1_init.inc b/storage/spider/mysql-test/spider/regression/e112122/include/load_data_part_ddi1_init.inc new file mode 100644 index 00000000000..b9194ccd51c --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/include/load_data_part_ddi1_init.inc @@ -0,0 +1,4 @@ +--source load_data_part_init.inc +--connection master_1 +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 1; diff --git a/storage/spider/mysql-test/spider/regression/e112122/include/load_data_part_deinit.inc b/storage/spider/mysql-test/spider/regression/e112122/include/load_data_part_deinit.inc new file mode 100644 index 00000000000..2248eef3650 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/include/load_data_part_deinit.inc @@ -0,0 +1,14 @@ +--let $MASTER_1_COMMENT_2_1= $MASTER_1_COMMENT_2_1_BACKUP +--let $CHILD2_1_DROP_TABLES= $CHILD2_1_DROP_TABLES_BACKUP +--let $CHILD2_1_CREATE_TABLES= $CHILD2_1_CREATE_TABLES_BACKUP +--let $CHILD2_1_SELECT_TABLES= $CHILD2_1_SELECT_TABLES_BACKUP +--let $CHILD2_2_DROP_TABLES= $CHILD2_2_DROP_TABLES_BACKUP +--let $CHILD2_2_CREATE_TABLES= $CHILD2_2_CREATE_TABLES_BACKUP +--let $CHILD2_2_SELECT_TABLES= $CHILD2_2_SELECT_TABLES_BACKUP +--disable_warnings +--disable_query_log +--disable_result_log +--source ../../t/test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings diff --git a/storage/spider/mysql-test/spider/regression/e112122/include/load_data_part_init.inc b/storage/spider/mysql-test/spider/regression/e112122/include/load_data_part_init.inc new file mode 100644 index 00000000000..42a0ea72539 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/include/load_data_part_init.inc @@ -0,0 +1,52 @@ +--disable_warnings +--disable_query_log +--disable_result_log +--source ../../t/test_init.inc +if (!$HAVE_PARTITION) +{ + --source load_data_part_deinit.inc + --enable_result_log + --enable_query_log + --enable_warnings + skip Test requires partitioning; +} +--enable_result_log +--enable_query_log +--enable_warnings +--let $MASTER_1_COMMENT_2_1_BACKUP= $MASTER_1_COMMENT_2_1 +let $MASTER_1_COMMENT_2_1= + COMMENT='table "tbl_a"' + PARTITION BY KEY(pkey) ( + PARTITION pt1 COMMENT='srv "s_2_1"', + PARTITION pt2 COMMENT='srv "s_2_2"' + ); +--let $CHILD2_1_DROP_TABLES_BACKUP= $CHILD2_1_DROP_TABLES +let $CHILD2_1_DROP_TABLES= + DROP TABLE IF EXISTS tbl_a; +--let $CHILD2_1_CREATE_TABLES_BACKUP= $CHILD2_1_CREATE_TABLES +let $CHILD2_1_CREATE_TABLES= + CREATE TABLE tbl_a ( + pkey int NOT NULL, + val int NOT NULL, + PRIMARY KEY (pkey) + ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; +--let $CHILD2_1_SELECT_TABLES_BACKUP= $CHILD2_1_SELECT_TABLES +let $CHILD2_1_SELECT_TABLES= + SELECT pkey, val FROM tbl_a ORDER BY pkey; +let $CHILD2_1_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +--let $CHILD2_2_DROP_TABLES_BACKUP= $CHILD2_2_DROP_TABLES +let $CHILD2_2_DROP_TABLES= + DROP TABLE IF EXISTS tbl_a; +--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES +let $CHILD2_2_CREATE_TABLES= + CREATE TABLE tbl_a ( + pkey int NOT NULL, + val int NOT NULL, + PRIMARY KEY (pkey) + ) $CHILD2_2_ENGINE $CHILD2_2_CHARSET; +--let $CHILD2_2_SELECT_TABLES_BACKUP= $CHILD2_2_SELECT_TABLES +let $CHILD2_2_SELECT_TABLES= + SELECT pkey, val FROM tbl_a ORDER BY pkey; +let $CHILD2_2_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ddi0.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ddi0.result new file mode 100644 index 00000000000..23753239054 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ddi0.result @@ -0,0 +1,95 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 0; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +connection child2_2; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +TRUNCATE tbl_a; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' INTO TABLE tbl_a; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(1,1),(3,3),(5,5),(7,7),(9,9) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +1 1 +3 3 +5 5 +7 7 +9 9 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(0,0),(2,2),(4,4),(6,6),(8,8) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 0 +2 2 +4 4 +6 6 +8 8 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ddi1.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ddi1.result new file mode 100644 index 00000000000..c30a5c037a7 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ddi1.result @@ -0,0 +1,95 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 1; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +connection child2_2; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +TRUNCATE tbl_a; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' INTO TABLE tbl_a; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(1,1),(3,3),(5,5),(7,7),(9,9) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +1 1 +3 3 +5 5 +7 7 +9 9 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(0,0),(2,2),(4,4),(6,6),(8,8) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 0 +2 2 +4 4 +6 6 +8 8 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ignore_ddi0.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ignore_ddi0.result new file mode 100644 index 00000000000..0071042cd58 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ignore_ddi0.result @@ -0,0 +1,114 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 0; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +connection child2_2; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +UPDATE tbl_a SET val = val + 1; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' IGNORE INTO TABLE tbl_a; +Warnings: +Warning 1062 Duplicate entry '0' for key 'PRIMARY' +Warning 1062 Duplicate entry '1' for key 'PRIMARY' +Warning 1062 Duplicate entry '2' for key 'PRIMARY' +Warning 1062 Duplicate entry '3' for key 'PRIMARY' +Warning 1062 Duplicate entry '4' for key 'PRIMARY' +Warning 1062 Duplicate entry '5' for key 'PRIMARY' +Warning 1062 Duplicate entry '6' for key 'PRIMARY' +Warning 1062 Duplicate entry '7' for key 'PRIMARY' +Warning 1062 Duplicate entry '8' for key 'PRIMARY' +Warning 1062 Duplicate entry '9' for key 'PRIMARY' +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(1,1) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(3,3) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(5,5) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(7,7) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(9,9) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +1 2 +3 4 +5 6 +7 8 +9 10 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(0,0) +insert high_priority into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(2,2) +insert high_priority into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(4,4) +insert high_priority into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(6,6) +insert high_priority into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(8,8) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 1 +2 3 +4 5 +6 7 +8 9 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ignore_ddi1.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ignore_ddi1.result new file mode 100644 index 00000000000..9f2e8dec535 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ignore_ddi1.result @@ -0,0 +1,95 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 1; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +connection child2_2; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +UPDATE tbl_a SET val = val + 1; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' IGNORE INTO TABLE tbl_a; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority ignore into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(1,1),(3,3),(5,5),(7,7),(9,9) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +1 2 +3 4 +5 6 +7 8 +9 10 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority ignore into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(0,0),(2,2),(4,4),(6,6),(8,8) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 1 +2 3 +4 5 +6 7 +8 9 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ddi0.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ddi0.result new file mode 100644 index 00000000000..7ec2b5b0b9e --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ddi0.result @@ -0,0 +1,103 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 0; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +connection child2_2; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +TRUNCATE tbl_a; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' INTO TABLE tbl_a; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(1,1) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(3,3) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(5,5) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(7,7) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(9,9) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +1 1 +3 3 +5 5 +7 7 +9 9 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(0,0) +insert high_priority into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(2,2) +insert high_priority into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(4,4) +insert high_priority into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(6,6) +insert high_priority into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(8,8) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 0 +2 2 +4 4 +6 6 +8 8 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ddi1.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ddi1.result new file mode 100644 index 00000000000..f908ce1c1d5 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ddi1.result @@ -0,0 +1,95 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 1; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +connection child2_2; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +TRUNCATE tbl_a; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' INTO TABLE tbl_a; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority ignore into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(1,1),(3,3),(5,5),(7,7),(9,9) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +1 1 +3 3 +5 5 +7 7 +9 9 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority ignore into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(0,0),(2,2),(4,4),(6,6),(8,8) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 0 +2 2 +4 4 +6 6 +8 8 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ignore_ddi0.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ignore_ddi0.result new file mode 100644 index 00000000000..c0a8f653fee --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ignore_ddi0.result @@ -0,0 +1,114 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 0; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +connection child2_2; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +UPDATE tbl_a SET val = val + 1; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' IGNORE INTO TABLE tbl_a; +Warnings: +Warning 1062 Duplicate entry '0' for key 'PRIMARY' +Warning 1062 Duplicate entry '1' for key 'PRIMARY' +Warning 1062 Duplicate entry '2' for key 'PRIMARY' +Warning 1062 Duplicate entry '3' for key 'PRIMARY' +Warning 1062 Duplicate entry '4' for key 'PRIMARY' +Warning 1062 Duplicate entry '5' for key 'PRIMARY' +Warning 1062 Duplicate entry '6' for key 'PRIMARY' +Warning 1062 Duplicate entry '7' for key 'PRIMARY' +Warning 1062 Duplicate entry '8' for key 'PRIMARY' +Warning 1062 Duplicate entry '9' for key 'PRIMARY' +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(1,1) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(3,3) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(5,5) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(7,7) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(9,9) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +1 2 +3 4 +5 6 +7 8 +9 10 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(0,0) +insert high_priority into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(2,2) +insert high_priority into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(4,4) +insert high_priority into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(6,6) +insert high_priority into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(8,8) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 1 +2 3 +4 5 +6 7 +8 9 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ignore_ddi1.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ignore_ddi1.result new file mode 100644 index 00000000000..619dd789d9a --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ignore_ddi1.result @@ -0,0 +1,95 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 1; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +connection child2_2; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +UPDATE tbl_a SET val = val + 1; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' IGNORE INTO TABLE tbl_a; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority ignore into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(1,1),(3,3),(5,5),(7,7),(9,9) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +1 2 +3 4 +5 6 +7 8 +9 10 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert high_priority ignore into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(0,0),(2,2),(4,4),(6,6),(8,8) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 1 +2 3 +4 5 +6 7 +8 9 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_replace_ddi0.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_replace_ddi0.result new file mode 100644 index 00000000000..e12e380bb93 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_replace_ddi0.result @@ -0,0 +1,123 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 0; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +connection child2_2; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +UPDATE tbl_a SET val = val + 1; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' REPLACE INTO TABLE tbl_a; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(1,1) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 1 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 1,`val` = 1 where `pkey` = 1 and `val` = 2 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(3,3) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 3 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 3,`val` = 3 where `pkey` = 3 and `val` = 4 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(5,5) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 5 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 5,`val` = 5 where `pkey` = 5 and `val` = 6 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(7,7) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 7 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 7,`val` = 7 where `pkey` = 7 and `val` = 8 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(9,9) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 9 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 9,`val` = 9 where `pkey` = 9 and `val` = 10 limit 1 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +1 1 +3 3 +5 5 +7 7 +9 9 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(0,0) +select `pkey`,`val` from `auto_test_remote2`.`tbl_a` where `pkey` = 0 for update +update ignore `auto_test_remote2`.`tbl_a` set `pkey` = 0,`val` = 0 where `pkey` = 0 and `val` = 1 limit 1 +insert into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(2,2) +select `pkey`,`val` from `auto_test_remote2`.`tbl_a` where `pkey` = 2 for update +update ignore `auto_test_remote2`.`tbl_a` set `pkey` = 2,`val` = 2 where `pkey` = 2 and `val` = 3 limit 1 +insert into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(4,4) +select `pkey`,`val` from `auto_test_remote2`.`tbl_a` where `pkey` = 4 for update +update ignore `auto_test_remote2`.`tbl_a` set `pkey` = 4,`val` = 4 where `pkey` = 4 and `val` = 5 limit 1 +insert into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(6,6) +select `pkey`,`val` from `auto_test_remote2`.`tbl_a` where `pkey` = 6 for update +update ignore `auto_test_remote2`.`tbl_a` set `pkey` = 6,`val` = 6 where `pkey` = 6 and `val` = 7 limit 1 +insert into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(8,8) +select `pkey`,`val` from `auto_test_remote2`.`tbl_a` where `pkey` = 8 for update +update ignore `auto_test_remote2`.`tbl_a` set `pkey` = 8,`val` = 8 where `pkey` = 8 and `val` = 9 limit 1 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 0 +2 2 +4 4 +6 6 +8 8 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_replace_ddi1.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_replace_ddi1.result new file mode 100644 index 00000000000..d367cbfd0ad --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_replace_ddi1.result @@ -0,0 +1,95 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 1; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +connection child2_2; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +UPDATE tbl_a SET val = val + 1; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' REPLACE INTO TABLE tbl_a; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +replace into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(1,1),(3,3),(5,5),(7,7),(9,9) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +1 1 +3 3 +5 5 +7 7 +9 9 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +replace into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(0,0),(2,2),(4,4),(6,6),(8,8) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 0 +2 2 +4 4 +6 6 +8 8 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_replace_ddi0.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_replace_ddi0.result new file mode 100644 index 00000000000..039a8dd4fad --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_replace_ddi0.result @@ -0,0 +1,123 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 0; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +connection child2_2; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +UPDATE tbl_a SET val = val + 1; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' REPLACE INTO TABLE tbl_a; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(1,1) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 1 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 1,`val` = 1 where `pkey` = 1 and `val` = 2 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(3,3) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 3 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 3,`val` = 3 where `pkey` = 3 and `val` = 4 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(5,5) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 5 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 5,`val` = 5 where `pkey` = 5 and `val` = 6 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(7,7) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 7 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 7,`val` = 7 where `pkey` = 7 and `val` = 8 limit 1 +insert into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(9,9) +select `pkey`,`val` from `auto_test_remote`.`tbl_a` where `pkey` = 9 for update +update ignore `auto_test_remote`.`tbl_a` set `pkey` = 9,`val` = 9 where `pkey` = 9 and `val` = 10 limit 1 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +1 1 +3 3 +5 5 +7 7 +9 9 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +insert into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(0,0) +select `pkey`,`val` from `auto_test_remote2`.`tbl_a` where `pkey` = 0 for update +update ignore `auto_test_remote2`.`tbl_a` set `pkey` = 0,`val` = 0 where `pkey` = 0 and `val` = 1 limit 1 +insert into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(2,2) +select `pkey`,`val` from `auto_test_remote2`.`tbl_a` where `pkey` = 2 for update +update ignore `auto_test_remote2`.`tbl_a` set `pkey` = 2,`val` = 2 where `pkey` = 2 and `val` = 3 limit 1 +insert into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(4,4) +select `pkey`,`val` from `auto_test_remote2`.`tbl_a` where `pkey` = 4 for update +update ignore `auto_test_remote2`.`tbl_a` set `pkey` = 4,`val` = 4 where `pkey` = 4 and `val` = 5 limit 1 +insert into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(6,6) +select `pkey`,`val` from `auto_test_remote2`.`tbl_a` where `pkey` = 6 for update +update ignore `auto_test_remote2`.`tbl_a` set `pkey` = 6,`val` = 6 where `pkey` = 6 and `val` = 7 limit 1 +insert into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(8,8) +select `pkey`,`val` from `auto_test_remote2`.`tbl_a` where `pkey` = 8 for update +update ignore `auto_test_remote2`.`tbl_a` set `pkey` = 8,`val` = 8 where `pkey` = 8 and `val` = 9 limit 1 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 0 +2 2 +4 4 +6 6 +8 8 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_replace_ddi1.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_replace_ddi1.result new file mode 100644 index 00000000000..c8155be9910 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_replace_ddi1.result @@ -0,0 +1,95 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_direct_dup_insert= @@spider_direct_dup_insert; +set session spider_direct_dup_insert= 1; + +this test is for MDEV-18987 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +connection child2_2; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +UPDATE tbl_a SET val = val + 1; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' REPLACE INTO TABLE tbl_a; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +replace into `auto_test_remote`.`tbl_a`(`pkey`,`val`)values(1,1),(3,3),(5,5),(7,7),(9,9) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +1 1 +3 3 +5 5 +7 7 +9 9 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%'; +argument +replace into `auto_test_remote2`.`tbl_a`(`pkey`,`val`)values(0,0),(2,2),(4,4),(6,6),(8,8) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%`tbl_a`%' +SELECT pkey, val FROM tbl_a ORDER BY pkey; +pkey val +0 0 +2 2 +4 4 +6 6 +8 8 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_direct_dup_insert= @old_spider_direct_dup_insert; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part.inc b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part.inc new file mode 100644 index 00000000000..e66550f9a90 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part.inc @@ -0,0 +1,100 @@ +--echo +--echo this test is for MDEV-18987 +--echo +--echo drop and create databases + +--connection master_1 +--disable_warnings +CREATE DATABASE auto_test_local; +USE auto_test_local; + +--connection child2_1 +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; + +--connection child2_2 +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; +--enable_warnings + +--echo +--echo create table and insert + +--connection child2_1 +--disable_query_log +echo CHILD2_1_CREATE_TABLES; +eval $CHILD2_1_CREATE_TABLES; +--enable_query_log +TRUNCATE TABLE mysql.general_log; + +--connection child2_2 +--disable_query_log +echo CHILD2_2_CREATE_TABLES; +eval $CHILD2_2_CREATE_TABLES; +--enable_query_log +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +--disable_query_log +echo CREATE TABLE tbl_a ( + pkey int NOT NULL, + val int NOT NULL, + PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; +eval CREATE TABLE tbl_a ( + pkey int NOT NULL, + val int NOT NULL, + PRIMARY KEY (pkey) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +--enable_query_log +INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +--disable_query_log +--echo SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +eval SELECT pkey,val INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey; +--enable_query_log +eval $COMMAND_BEFORE_LOAD_DATA; + +--echo +--echo select test 1 + +--connection child2_1 +TRUNCATE TABLE mysql.general_log; + +--connection child2_2 +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +--disable_query_log +--echo LOAD DATA $OPTION_LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' $OPTION_WORD INTO TABLE tbl_a; +eval LOAD DATA $OPTION_LOCAL INFILE '$MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' $OPTION_WORD INTO TABLE tbl_a; +--enable_query_log +--remove_file $MYSQLTEST_VARDIR/tmp/spider_outfile.tsv + +--connection child2_1 +eval $CHILD2_1_SELECT_ARGUMENT1; +eval $CHILD2_1_SELECT_TABLES; + +--connection child2_2 +eval $CHILD2_2_SELECT_ARGUMENT1; +eval $CHILD2_2_SELECT_TABLES; + +--echo +--echo deinit +--disable_warnings + +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; + +--connection child2_1 +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; + +--connection child2_2 +DROP DATABASE IF EXISTS auto_test_remote2; +SET GLOBAL log_output = @old_log_output; + +--enable_warnings diff --git a/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_ddi0.test b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_ddi0.test new file mode 100644 index 00000000000..b78529095a4 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_ddi0.test @@ -0,0 +1,8 @@ +--source ../include/load_data_part_ddi0_init.inc +--let COMMAND_BEFORE_LOAD_DATA= TRUNCATE tbl_a +--let OPTION_LOCAL= +--let OPTION_WORD= +--source load_data_part.inc +--source ../include/load_data_part_ddi0_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_ddi1.test b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_ddi1.test new file mode 100644 index 00000000000..a2540077639 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_ddi1.test @@ -0,0 +1,8 @@ +--source ../include/load_data_part_ddi1_init.inc +--let COMMAND_BEFORE_LOAD_DATA= TRUNCATE tbl_a +--let OPTION_LOCAL= +--let OPTION_WORD= +--source load_data_part.inc +--source ../include/load_data_part_ddi1_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_ignore_ddi0.test b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_ignore_ddi0.test new file mode 100644 index 00000000000..a6fb58d69d1 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_ignore_ddi0.test @@ -0,0 +1,8 @@ +--source ../include/load_data_part_ddi0_init.inc +--let COMMAND_BEFORE_LOAD_DATA= UPDATE tbl_a SET val = val + 1 +--let OPTION_LOCAL= +--let OPTION_WORD= IGNORE +--source load_data_part.inc +--source ../include/load_data_part_ddi0_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_ignore_ddi1.test b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_ignore_ddi1.test new file mode 100644 index 00000000000..b9f75894c60 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_ignore_ddi1.test @@ -0,0 +1,8 @@ +--source ../include/load_data_part_ddi1_init.inc +--let COMMAND_BEFORE_LOAD_DATA= UPDATE tbl_a SET val = val + 1 +--let OPTION_LOCAL= +--let OPTION_WORD= IGNORE +--source load_data_part.inc +--source ../include/load_data_part_ddi1_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_local_ddi0.test b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_local_ddi0.test new file mode 100644 index 00000000000..f44f7ae936d --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_local_ddi0.test @@ -0,0 +1,8 @@ +--source ../include/load_data_part_ddi0_init.inc +--let COMMAND_BEFORE_LOAD_DATA= TRUNCATE tbl_a +--let OPTION_LOCAL= LOCAL +--let OPTION_WORD= +--source load_data_part.inc +--source ../include/load_data_part_ddi0_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_local_ddi1.test b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_local_ddi1.test new file mode 100644 index 00000000000..4c806096ad1 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_local_ddi1.test @@ -0,0 +1,8 @@ +--source ../include/load_data_part_ddi1_init.inc +--let COMMAND_BEFORE_LOAD_DATA= TRUNCATE tbl_a +--let OPTION_LOCAL= LOCAL +--let OPTION_WORD= +--source load_data_part.inc +--source ../include/load_data_part_ddi1_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_local_ignore_ddi0.test b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_local_ignore_ddi0.test new file mode 100644 index 00000000000..179bab5b4aa --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_local_ignore_ddi0.test @@ -0,0 +1,8 @@ +--source ../include/load_data_part_ddi0_init.inc +--let COMMAND_BEFORE_LOAD_DATA= UPDATE tbl_a SET val = val + 1 +--let OPTION_LOCAL= LOCAL +--let OPTION_WORD= IGNORE +--source load_data_part.inc +--source ../include/load_data_part_ddi0_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_local_ignore_ddi1.test b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_local_ignore_ddi1.test new file mode 100644 index 00000000000..cd7d8215b7a --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_local_ignore_ddi1.test @@ -0,0 +1,8 @@ +--source ../include/load_data_part_ddi1_init.inc +--let COMMAND_BEFORE_LOAD_DATA= UPDATE tbl_a SET val = val + 1 +--let OPTION_LOCAL= LOCAL +--let OPTION_WORD= IGNORE +--source load_data_part.inc +--source ../include/load_data_part_ddi1_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_local_replace_ddi0.test b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_local_replace_ddi0.test new file mode 100644 index 00000000000..5df3f420e09 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_local_replace_ddi0.test @@ -0,0 +1,8 @@ +--source ../include/load_data_part_ddi0_init.inc +--let COMMAND_BEFORE_LOAD_DATA= UPDATE tbl_a SET val = val + 1 +--let OPTION_LOCAL= LOCAL +--let OPTION_WORD= REPLACE +--source load_data_part.inc +--source ../include/load_data_part_ddi0_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_local_replace_ddi1.test b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_local_replace_ddi1.test new file mode 100644 index 00000000000..bf3c7c93be8 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_local_replace_ddi1.test @@ -0,0 +1,8 @@ +--source ../include/load_data_part_ddi1_init.inc +--let COMMAND_BEFORE_LOAD_DATA= UPDATE tbl_a SET val = val + 1 +--let OPTION_LOCAL= LOCAL +--let OPTION_WORD= REPLACE +--source load_data_part.inc +--source ../include/load_data_part_ddi1_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_replace_ddi0.test b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_replace_ddi0.test new file mode 100644 index 00000000000..910b7e813da --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_replace_ddi0.test @@ -0,0 +1,8 @@ +--source ../include/load_data_part_ddi0_init.inc +--let COMMAND_BEFORE_LOAD_DATA= UPDATE tbl_a SET val = val + 1 +--let OPTION_LOCAL= +--let OPTION_WORD= REPLACE +--source load_data_part.inc +--source ../include/load_data_part_ddi0_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_replace_ddi1.test b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_replace_ddi1.test new file mode 100644 index 00000000000..fc84bf14487 --- /dev/null +++ b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part_replace_ddi1.test @@ -0,0 +1,8 @@ +--source ../include/load_data_part_ddi1_init.inc +--let COMMAND_BEFORE_LOAD_DATA= UPDATE tbl_a SET val = val + 1 +--let OPTION_LOCAL= +--let OPTION_WORD= REPLACE +--source load_data_part.inc +--source ../include/load_data_part_ddi1_deinit.inc +--echo +--echo end of test