summaryrefslogtreecommitdiff
path: root/storage/innobase/row
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-12-13 18:01:49 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2022-12-13 18:01:49 +0200
commit25b91c3f13affc1b58169240894b206ff34b1db3 (patch)
tree4042ba02c9777eabc030c80f376cd6e25114ac6d /storage/innobase/row
parentdbcbee10176dde410867a3762385a9e5ee63e1d3 (diff)
parenta8a5c8a1b8ac566241d43a85de90c11f5d1568d9 (diff)
downloadmariadb-git-25b91c3f13affc1b58169240894b206ff34b1db3.tar.gz
Merge 10.6 into 10.7
Diffstat (limited to 'storage/innobase/row')
-rw-r--r--storage/innobase/row/row0import.cc24
-rw-r--r--storage/innobase/row/row0ins.cc6
-rw-r--r--storage/innobase/row/row0log.cc3
-rw-r--r--storage/innobase/row/row0quiesce.cc15
4 files changed, 35 insertions, 13 deletions
diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc
index 65c17a4e4b1..18a39a41a18 100644
--- a/storage/innobase/row/row0import.cc
+++ b/storage/innobase/row/row0import.cc
@@ -43,6 +43,7 @@ Created 2012-02-08 by Sunny Bains.
#include "lock0lock.h"
#include "lzo/lzo1x.h"
#include "snappy-c.h"
+#include "log.h"
#include "scope.h"
@@ -583,6 +584,18 @@ protected:
uint32_t m_space_flags;
};
+ATTRIBUTE_COLD static dberr_t invalid_space_flags(uint32_t 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%" PRIx32, 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.
@@ -598,7 +611,7 @@ AbstractCallback::init(
if (!fil_space_t::is_valid_flags(m_space_flags, true)) {
uint32_t cflags = fsp_flags_convert_from_101(m_space_flags);
if (cflags == UINT32_MAX) {
- return(DB_CORRUPTION);
+ return DB_CORRUPTION;
}
m_space_flags = cflags;
}
@@ -3078,7 +3091,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); });
@@ -3097,10 +3110,7 @@ static dberr_t handle_instant_metadata(dict_table_t *table,
{
auto cflags= fsp_flags_convert_from_101(space_flags);
if (cflags == UINT32_MAX)
- {
- 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);
}
@@ -4394,7 +4404,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 427fdedee60..dbf2b24dc80 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);
}