diff options
Diffstat (limited to 'storage/innobase/row')
-rw-r--r-- | storage/innobase/row/row0import.cc | 24 | ||||
-rw-r--r-- | storage/innobase/row/row0ins.cc | 6 | ||||
-rw-r--r-- | storage/innobase/row/row0log.cc | 3 | ||||
-rw-r--r-- | storage/innobase/row/row0quiesce.cc | 15 |
4 files changed, 35 insertions, 13 deletions
diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc index 590f9d73990..45c35bc6995 100644 --- a/storage/innobase/row/row0import.cc +++ b/storage/innobase/row/row0import.cc @@ -47,6 +47,7 @@ Created 2012-02-08 by Sunny Bains. #ifdef HAVE_SNAPPY #include "snappy-c.h" #endif +#include "log.h" #include "scope.h" @@ -593,6 +594,18 @@ protected: ulint m_space_flags; }; +ATTRIBUTE_COLD static dberr_t invalid_space_flags(ulint flags) +{ + if (fsp_flags_is_incompatible_mysql(flags)) + { + sql_print_error("InnoDB: unsupported MySQL tablespace"); + return DB_UNSUPPORTED; + } + + sql_print_error("InnoDB: Invalid FSP_SPACE_FLAGS=0x%zx", flags); + return DB_CORRUPTION; +} + /** Determine the page size to use for traversing the tablespace @param file_size size of the tablespace file in bytes @param block contents of the first page in the tablespace file. @@ -608,7 +621,7 @@ AbstractCallback::init( if (!fil_space_t::is_valid_flags(m_space_flags, true)) { ulint cflags = fsp_flags_convert_from_101(m_space_flags); if (cflags == ULINT_UNDEFINED) { - return(DB_CORRUPTION); + return DB_CORRUPTION; } m_space_flags = cflags; } @@ -3092,7 +3105,7 @@ static dberr_t handle_instant_metadata(dict_table_t *table, if (!success) return DB_IO_ERROR; - if (os_file_get_size(file) < srv_page_size * 4) + if (os_file_get_size(file) < srv_page_size) return DB_CORRUPTION; SCOPE_EXIT([&file]() { os_file_close(file); }); @@ -3111,10 +3124,7 @@ static dberr_t handle_instant_metadata(dict_table_t *table, { auto cflags= fsp_flags_convert_from_101(space_flags); if (cflags == ULINT_UNDEFINED) - { - ib::error() << "Invalid FSP_SPACE_FLAGS=" << ib::hex(space_flags); - return DB_CORRUPTION; - } + return invalid_space_flags(space_flags); space_flags= static_cast<decltype(space_flags)>(cflags); } @@ -4412,7 +4422,7 @@ row_import_for_mysql( ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_INTERNAL_ERROR, - "Cannot reset LSNs in table %s : %s", + "Error importing tablespace for table %s : %s", table_name, ut_strerr(err)); } diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index 9b1d9a8b57f..469c3e0498c 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -899,11 +899,7 @@ row_ins_foreign_fill_virtual( &ext, update->heap); n_diff = update->n_fields; - if (index->table->vc_templ == NULL) { - /** This can occur when there is a cascading - delete or update after restart. */ - innobase_init_vc_templ(index->table); - } + ut_ad(index->table->vc_templ != NULL); ib_vcol_row vc(NULL); uchar *record = vc.record(thd, index, &mysql_table); diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc index 42e09ffd180..94d69d88fb5 100644 --- a/storage/innobase/row/row0log.cc +++ b/storage/innobase/row/row0log.cc @@ -2093,6 +2093,9 @@ func_exit_committed: index->set_modified(mtr); pcur.btr_cur.page_cur.index = index; + ut_free(pcur.old_rec_buf); + pcur.old_rec_buf = nullptr; + if (ROW_FOUND != row_search_index_entry( entry, BTR_MODIFY_TREE, &pcur, &mtr)) { ut_ad(0); diff --git a/storage/innobase/row/row0quiesce.cc b/storage/innobase/row/row0quiesce.cc index 0d941feb0a1..a4d634f2d14 100644 --- a/storage/innobase/row/row0quiesce.cc +++ b/storage/innobase/row/row0quiesce.cc @@ -105,11 +105,17 @@ row_quiesce_write_indexes( FILE* file, /*!< in: file to write to */ THD* thd) /*!< in/out: session */ { + ulint n_indexes = 0; + for (const dict_index_t* index = UT_LIST_GET_FIRST(table->indexes); + index; index = UT_LIST_GET_NEXT(indexes, index)) { + n_indexes += index->is_committed(); + } + { byte row[sizeof(ib_uint32_t)]; /* Write the number of indexes in the table. */ - mach_write_to_4(row, UT_LIST_GET_LEN(table->indexes)); + mach_write_to_4(row, n_indexes); DBUG_EXECUTE_IF("ib_export_io_write_failure_11", close(fileno(file));); @@ -131,6 +137,12 @@ row_quiesce_write_indexes( index != 0 && err == DB_SUCCESS; index = UT_LIST_GET_NEXT(indexes, index)) { + if (!index->is_committed()) { + continue; + } + + ut_ad(n_indexes); ut_d(n_indexes--); + byte* ptr; byte row[sizeof(index_id_t) + sizeof(ib_uint32_t) * 8]; @@ -201,6 +213,7 @@ row_quiesce_write_indexes( err = row_quiesce_write_index_fields(index, file, thd); } + ut_ad(!n_indexes); return(err); } |