summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
Diffstat (limited to 'storage')
-rw-r--r--storage/connect/mysql-test/connect/r/mysql.result11
-rw-r--r--storage/connect/mysql-test/connect/t/mysql.test15
-rw-r--r--storage/connect/myutil.cpp2
-rw-r--r--storage/innobase/buf/buf0flu.cc4
-rw-r--r--storage/innobase/buf/buf0lru.cc9
-rw-r--r--storage/innobase/fil/fil0fil.cc12
-rw-r--r--storage/innobase/fsp/fsp0file.cc2
-rw-r--r--storage/innobase/fsp/fsp0sysspace.cc2
-rw-r--r--storage/innobase/handler/ha_innodb.cc44
-rw-r--r--storage/innobase/handler/i_s.cc8
-rw-r--r--storage/innobase/include/os0file.h15
-rw-r--r--storage/innobase/include/srv0srv.h3
-rw-r--r--storage/innobase/log/log0recv.cc11
-rw-r--r--storage/innobase/os/os0file.cc37
-rw-r--r--storage/innobase/page/page0zip.cc5
-rw-r--r--storage/innobase/rem/rem0cmp.cc3
-rw-r--r--storage/innobase/rem/rem0rec.cc6
-rw-r--r--storage/innobase/row/row0import.cc1
-rw-r--r--storage/innobase/row/row0vers.cc28
-rw-r--r--storage/innobase/srv/srv0start.cc13
-rw-r--r--storage/maria/ha_maria.cc2
-rw-r--r--storage/perfschema/pfs.cc3
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/include/restart_mysqld_with_option.inc4
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/t/allow_to_start_after_corruption.test1
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/t/persistent_cache.test4
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test4
-rw-r--r--storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_rate_limiter_bytes_per_sec_basic.test4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/include/restart_spider.inc8
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_29352.result1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_29904.result4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29352.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29904.test6
-rw-r--r--storage/spider/spd_table.cc3
33 files changed, 147 insertions, 130 deletions
diff --git a/storage/connect/mysql-test/connect/r/mysql.result b/storage/connect/mysql-test/connect/r/mysql.result
index d3c244b277a..1dcbca88a7b 100644
--- a/storage/connect/mysql-test/connect/r/mysql.result
+++ b/storage/connect/mysql-test/connect/r/mysql.result
@@ -364,5 +364,16 @@ hex(col)
DROP TABLE t2;
DROP TABLE t1;
#
+# MDEV-29782 CONNECT engine converted YEAR to DATETIME, causing INSERT to fail
+#
+CREATE TABLE t1 (id year);
+CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL DBNAME='test' TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=PORT';
+INSERT INTO t2 VALUES (1999);
+SELECT * FROM t2;
+id
+1999
+DROP TABLE t2;
+DROP TABLE t1;
+#
# End of 10.3 tests
#
diff --git a/storage/connect/mysql-test/connect/t/mysql.test b/storage/connect/mysql-test/connect/t/mysql.test
index a50db4a6457..cd52f78fb30 100644
--- a/storage/connect/mysql-test/connect/t/mysql.test
+++ b/storage/connect/mysql-test/connect/t/mysql.test
@@ -534,5 +534,20 @@ DROP TABLE t1;
--echo #
+--echo # MDEV-29782 CONNECT engine converted YEAR to DATETIME, causing INSERT to fail
+--echo #
+
+CREATE TABLE t1 (id year);
+
+--replace_result $PORT PORT
+--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL DBNAME='test' TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
+
+INSERT INTO t2 VALUES (1999);
+SELECT * FROM t2;
+
+DROP TABLE t2;
+DROP TABLE t1;
+
+--echo #
--echo # End of 10.3 tests
--echo #
diff --git a/storage/connect/myutil.cpp b/storage/connect/myutil.cpp
index c49db48bfb3..45b2c46e217 100644
--- a/storage/connect/myutil.cpp
+++ b/storage/connect/myutil.cpp
@@ -183,6 +183,7 @@ int MYSQLtoPLG(int mytype, char *var)
switch (mytype) {
case MYSQL_TYPE_SHORT:
+ case MYSQL_TYPE_YEAR:
type = TYPE_SHORT;
break;
case MYSQL_TYPE_LONG:
@@ -209,7 +210,6 @@ int MYSQLtoPLG(int mytype, char *var)
case MYSQL_TYPE_TIMESTAMP:
case MYSQL_TYPE_DATE:
case MYSQL_TYPE_DATETIME:
- case MYSQL_TYPE_YEAR:
case MYSQL_TYPE_TIME:
type = TYPE_DATE;
break;
diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc
index 031055d7cfd..32f39ea08de 100644
--- a/storage/innobase/buf/buf0flu.cc
+++ b/storage/innobase/buf/buf0flu.cc
@@ -2265,7 +2265,7 @@ static void buf_flush_page_cleaner()
if (!recv_recovery_is_on() &&
!srv_startup_is_before_trx_rollback_phase &&
- srv_operation == SRV_OPERATION_NORMAL)
+ srv_operation <= SRV_OPERATION_EXPORT_RESTORED)
log_checkpoint();
}
while (false);
@@ -2437,7 +2437,7 @@ static void buf_flush_page_cleaner()
ATTRIBUTE_COLD void buf_flush_page_cleaner_init()
{
ut_ad(!buf_page_cleaner_is_active);
- ut_ad(srv_operation == SRV_OPERATION_NORMAL ||
+ ut_ad(srv_operation <= SRV_OPERATION_EXPORT_RESTORED ||
srv_operation == SRV_OPERATION_RESTORE ||
srv_operation == SRV_OPERATION_RESTORE_EXPORT);
buf_flush_async_lsn= 0;
diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc
index 1947dfaeeb4..844e288843b 100644
--- a/storage/innobase/buf/buf0lru.cc
+++ b/storage/innobase/buf/buf0lru.cc
@@ -1114,17 +1114,8 @@ static bool buf_LRU_block_remove_hashed(buf_page_t *bpage, const page_id_t id,
break;
case FIL_PAGE_TYPE_ZBLOB:
case FIL_PAGE_TYPE_ZBLOB2:
- break;
case FIL_PAGE_INDEX:
case FIL_PAGE_RTREE:
-#if defined UNIV_ZIP_DEBUG && defined BTR_CUR_HASH_ADAPT
- /* During recovery, we only update the
- compressed page, not the uncompressed one. */
- ut_a(recv_recovery_is_on()
- || page_zip_validate(
- &bpage->zip, page,
- ((buf_block_t*) bpage)->index));
-#endif /* UNIV_ZIP_DEBUG && BTR_CUR_HASH_ADAPT */
break;
default:
ib::error() << "The compressed page to be"
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index 63df46c3817..eee4bd3eb58 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -2106,6 +2106,10 @@ func_exit:
must_validate = true;
}
+ const bool operation_not_for_export =
+ srv_operation != SRV_OPERATION_RESTORE_EXPORT
+ && srv_operation != SRV_OPERATION_EXPORT_RESTORED;
+
/* Always look for a file at the default location. But don't log
an error if the tablespace is already open in remote or dict. */
ut_a(df_default.filepath());
@@ -2116,6 +2120,7 @@ func_exit:
drop_garbage_tables_after_restore() a little later. */
const bool strict = validate && !tablespaces_found
+ && operation_not_for_export
&& !(srv_operation == SRV_OPERATION_NORMAL
&& srv_start_after_restore
&& srv_force_recovery < SRV_FORCE_NO_BACKGROUND
@@ -2164,7 +2169,11 @@ func_exit:
goto corrupted;
}
- os_file_get_last_error(true);
+ os_file_get_last_error(operation_not_for_export,
+ !operation_not_for_export);
+ if (!operation_not_for_export) {
+ goto corrupted;
+ }
sql_print_error("InnoDB: Could not find a valid tablespace"
" file for %.*s. %s",
static_cast<int>(name.size()), name.data(),
@@ -2331,6 +2340,7 @@ fil_ibd_discover(
case SRV_OPERATION_RESTORE:
break;
case SRV_OPERATION_NORMAL:
+ case SRV_OPERATION_EXPORT_RESTORED:
size_t len= strlen(db);
if (len <= 4 || strcmp(db + len - 4, dot_ext[IBD])) {
break;
diff --git a/storage/innobase/fsp/fsp0file.cc b/storage/innobase/fsp/fsp0file.cc
index ccf751cbf92..c38c506cc08 100644
--- a/storage/innobase/fsp/fsp0file.cc
+++ b/storage/innobase/fsp/fsp0file.cc
@@ -766,7 +766,7 @@ the double write buffer.
bool
Datafile::restore_from_doublewrite()
{
- if (srv_operation != SRV_OPERATION_NORMAL) {
+ if (srv_operation > SRV_OPERATION_EXPORT_RESTORED) {
return true;
}
diff --git a/storage/innobase/fsp/fsp0sysspace.cc b/storage/innobase/fsp/fsp0sysspace.cc
index c9d09e31313..497e4100557 100644
--- a/storage/innobase/fsp/fsp0sysspace.cc
+++ b/storage/innobase/fsp/fsp0sysspace.cc
@@ -581,7 +581,7 @@ SysTablespace::read_lsn_and_check_flags(lsn_t* flushed_lsn)
ut_a(it->order() == 0);
- if (srv_operation == SRV_OPERATION_NORMAL) {
+ if (srv_operation <= SRV_OPERATION_EXPORT_RESTORED) {
buf_dblwr.init_or_load_pages(it->handle(), it->filepath());
}
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 3f62a09045d..04a857ecd0c 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -2146,7 +2146,7 @@ static void innodb_ddl_recovery_done(handlerton*)
{
ut_ad(!ddl_recovery_done);
ut_d(ddl_recovery_done= true);
- if (!srv_read_only_mode && srv_operation == SRV_OPERATION_NORMAL &&
+ if (!srv_read_only_mode && srv_operation <= SRV_OPERATION_EXPORT_RESTORED &&
srv_force_recovery < SRV_FORCE_NO_BACKGROUND)
{
if (srv_start_after_restore && !high_level_read_only)
@@ -18009,44 +18009,6 @@ exit:
return;
}
-/** Validate SET GLOBAL innodb_buffer_pool_filename.
-On Windows, file names with colon (:) are not allowed.
-@param thd connection
-@param save &srv_buf_dump_filename
-@param value new value to be validated
-@return 0 for valid name */
-static int innodb_srv_buf_dump_filename_validate(THD *thd, st_mysql_sys_var*,
- void *save,
- st_mysql_value *value)
-{
- char buff[OS_FILE_MAX_PATH];
- int len= sizeof buff;
-
- if (const char *buf_name= value->val_str(value, buff, &len))
- {
-#ifdef _WIN32
- if (!is_filename_allowed(buf_name, len, FALSE))
- {
- push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
- ER_WRONG_ARGUMENTS,
- "InnoDB: innodb_buffer_pool_filename "
- "cannot have colon (:) in the file name.");
- return 1;
- }
-#endif /* _WIN32 */
- if (buf_name == buff)
- {
- ut_ad(static_cast<size_t>(len) < sizeof buff);
- buf_name= thd_strmake(thd, buf_name, len);
- }
-
- *static_cast<const char**>(save)= buf_name;
- return 0;
- }
-
- return 1;
-}
-
#ifdef UNIV_DEBUG
static char* srv_buffer_pool_evict;
@@ -19129,9 +19091,9 @@ static MYSQL_SYSVAR_ULONG(buffer_pool_chunk_size, srv_buf_pool_chunk_unit,
128 * 1024 * 1024, 1024 * 1024, LONG_MAX, 1024 * 1024);
static MYSQL_SYSVAR_STR(buffer_pool_filename, srv_buf_dump_filename,
- PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Filename to/from which to dump/load the InnoDB buffer pool",
- innodb_srv_buf_dump_filename_validate, NULL, SRV_BUF_DUMP_FILENAME_DEFAULT);
+ NULL, NULL, SRV_BUF_DUMP_FILENAME_DEFAULT);
static MYSQL_SYSVAR_BOOL(buffer_pool_dump_now, innodb_buffer_pool_dump_now,
PLUGIN_VAR_RQCMDARG,
diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc
index 366ef38cc07..e393bed6d9f 100644
--- a/storage/innobase/handler/i_s.cc
+++ b/storage/innobase/handler/i_s.cc
@@ -5163,10 +5163,10 @@ static ST_FIELD_INFO innodb_sysindex_fields_info[]=
Column("N_FIELDS", SLong(), NOT_NULL),
#define SYS_INDEX_PAGE_NO 5
- Column("PAGE_NO", SLong(), NOT_NULL),
+ Column("PAGE_NO", SLong(), NULLABLE),
#define SYS_INDEX_SPACE 6
- Column("SPACE", SLong(), NOT_NULL),
+ Column("SPACE", SLong(), NULLABLE),
#define SYS_INDEX_MERGE_THRESHOLD 7
Column("MERGE_THRESHOLD", SLong(), NOT_NULL),
@@ -5218,12 +5218,14 @@ i_s_dict_fill_sys_indexes(
if (index->page == FIL_NULL) {
fields[SYS_INDEX_PAGE_NO]->set_null();
} else {
+ fields[SYS_INDEX_PAGE_NO]->set_notnull();
OK(fields[SYS_INDEX_PAGE_NO]->store(index->page, true));
}
- if (space_id == ULINT_UNDEFINED) {
+ if (space_id == FIL_NULL) {
fields[SYS_INDEX_SPACE]->set_null();
} else {
+ fields[SYS_INDEX_SPACE]->set_notnull();
OK(fields[SYS_INDEX_SPACE]->store(space_id, true));
}
diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h
index d64ad9feb87..934b30d9515 100644
--- a/storage/innobase/include/os0file.h
+++ b/storage/innobase/include/os0file.h
@@ -943,13 +943,14 @@ os_file_flush_func(
/** Retrieves the last error number if an error occurs in a file io function.
The number should be retrieved before any other OS calls (because they may
overwrite the error number). If the number is not known to this program,
-the OS error number + 100 is returned.
-@param[in] report true if we want an error message printed
- for all errors
-@return error number, or OS error number + 100 */
-ulint
-os_file_get_last_error(
- bool report);
+the OS error number + OS_FILE_ERROR_MAX is returned.
+@param[in] report_all_errors true if we want an error message
+ printed of all errors
+@param[in] on_error_silent true then don't print any diagnostic
+ to the log
+@return error number, or OS error number + OS_FILE_ERROR_MAX */
+ulint os_file_get_last_error(bool report_all_errors,
+ bool on_error_silent= false);
/** NOTE! Use the corresponding macro os_file_read(), not directly this
function!
diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
index 90d3a21f761..96cfe886c02 100644
--- a/storage/innobase/include/srv0srv.h
+++ b/storage/innobase/include/srv0srv.h
@@ -389,6 +389,9 @@ extern my_bool srv_immediate_scrub_data_uncompressed;
enum srv_operation_mode {
/** Normal mode (MariaDB Server) */
SRV_OPERATION_NORMAL,
+ /** Mariabackup is executing server to export already restored
+ tablespaces */
+ SRV_OPERATION_EXPORT_RESTORED,
/** Mariabackup taking a backup */
SRV_OPERATION_BACKUP,
/** Mariabackup restoring a backup for subsequent --copy-back */
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index d3d55a2138c..44b7e5b2a92 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -1241,7 +1241,7 @@ static void fil_name_process(const char *name, ulint len, uint32_t space_id,
return;
}
- ut_ad(srv_operation == SRV_OPERATION_NORMAL
+ ut_ad(srv_operation <= SRV_OPERATION_EXPORT_RESTORED
|| srv_operation == SRV_OPERATION_RESTORE
|| srv_operation == SRV_OPERATION_RESTORE_EXPORT);
@@ -3223,7 +3223,7 @@ static void log_sort_flush_list()
@param last_batch whether it is possible to write more redo log */
void recv_sys_t::apply(bool last_batch)
{
- ut_ad(srv_operation == SRV_OPERATION_NORMAL ||
+ ut_ad(srv_operation <= SRV_OPERATION_EXPORT_RESTORED ||
srv_operation == SRV_OPERATION_RESTORE ||
srv_operation == SRV_OPERATION_RESTORE_EXPORT);
@@ -4104,7 +4104,7 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn)
byte* buf;
dberr_t err = DB_SUCCESS;
- ut_ad(srv_operation == SRV_OPERATION_NORMAL
+ ut_ad(srv_operation <= SRV_OPERATION_EXPORT_RESTORED
|| srv_operation == SRV_OPERATION_RESTORE
|| srv_operation == SRV_OPERATION_RESTORE_EXPORT);
ut_d(mysql_mutex_lock(&buf_pool.flush_list_mutex));
@@ -4315,7 +4315,7 @@ completed:
recv_sys.parse_start_lsn = checkpoint_lsn;
- if (srv_operation == SRV_OPERATION_NORMAL) {
+ if (srv_operation <= SRV_OPERATION_EXPORT_RESTORED) {
deferred_spaces.deferred_dblwr();
buf_dblwr.recover();
}
@@ -4380,7 +4380,8 @@ completed:
log_sys.last_checkpoint_lsn = checkpoint_lsn;
- if (!srv_read_only_mode && srv_operation == SRV_OPERATION_NORMAL
+ if (!srv_read_only_mode
+ && srv_operation <= SRV_OPERATION_EXPORT_RESTORED
&& (~log_t::FORMAT_ENCRYPTED & log_sys.log.format)
== log_t::FORMAT_10_5) {
/* Write a FILE_CHECKPOINT marker as the first thing,
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index 44783f72972..e3de49f4432 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -735,22 +735,16 @@ os_file_punch_hole_posix(
return(DB_IO_NO_PUNCH_HOLE);
}
-
-
/** Retrieves the last error number if an error occurs in a file io function.
The number should be retrieved before any other OS calls (because they may
overwrite the error number). If the number is not known to this program,
the OS error number + 100 is returned.
@param[in] report_all_errors true if we want an error message
- printed of all errors
+ printed of all errors
@param[in] on_error_silent true then don't print any diagnostic
to the log
@return error number, or OS error number + 100 */
-static
-ulint
-os_file_get_last_error_low(
- bool report_all_errors,
- bool on_error_silent)
+ulint os_file_get_last_error(bool report_all_errors, bool on_error_silent)
{
int err = errno;
@@ -1740,16 +1734,13 @@ bool os_file_flush_func(os_file_t file)
The number should be retrieved before any other OS calls (because they may
overwrite the error number). If the number is not known to this program,
then OS error number + OS_FILE_ERROR_MAX is returned.
-@param[in] report_all_errors true if we want an error message printed
- of all errors
+@param[in] report_all_errors true if we want an error message
+printed of all errors
@param[in] on_error_silent true then don't print any diagnostic
to the log
@return error number, or OS error number + OS_FILE_ERROR_MAX */
-static
-ulint
-os_file_get_last_error_low(
- bool report_all_errors,
- bool on_error_silent)
+ulint os_file_get_last_error(bool report_all_errors, bool on_error_silent)
+
{
ulint err = (ulint) GetLastError();
@@ -2952,20 +2943,6 @@ os_file_read_func(
return err ? err : DB_IO_ERROR;
}
-/** Retrieves the last error number if an error occurs in a file io function.
-The number should be retrieved before any other OS calls (because they may
-overwrite the error number). If the number is not known to this program,
-the OS error number + 100 is returned.
-@param[in] report_all_errors true if we want an error printed
- for all errors
-@return error number, or OS error number + 100 */
-ulint
-os_file_get_last_error(
- bool report_all_errors)
-{
- return(os_file_get_last_error_low(report_all_errors, false));
-}
-
/** Handle errors for file operations.
@param[in] name name of a file or NULL
@param[in] operation operation
@@ -2982,7 +2959,7 @@ os_file_handle_error_cond_exit(
{
ulint err;
- err = os_file_get_last_error_low(false, on_error_silent);
+ err = os_file_get_last_error(false, on_error_silent);
switch (err) {
case OS_FILE_DISK_FULL:
diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc
index eda7140f7db..36624f43d10 100644
--- a/storage/innobase/page/page0zip.cc
+++ b/storage/innobase/page/page0zip.cc
@@ -3372,7 +3372,7 @@ page_zip_validate_low(
differed. Let us ignore it. */
page_zip_fail(("page_zip_validate:"
" min_rec_flag"
- " (%s" ULINTPF "," ULINTPF
+ " (%s" UINT32PF "," UINT32PF
",0x%02x)\n",
sloppy ? "ignored, " : "",
page_get_space_id(page),
@@ -3417,7 +3417,8 @@ page_zip_validate_low(
page + PAGE_NEW_INFIMUM, TRUE);
trec = page_rec_get_next_low(
temp_page + PAGE_NEW_INFIMUM, TRUE);
- const ulint n_core = page_is_leaf(page) ? index->n_fields : 0;
+ const ulint n_core = (index && page_is_leaf(page))
+ ? index->n_fields : 0;
do {
if (page_offset(rec) != page_offset(trec)) {
diff --git a/storage/innobase/rem/rem0cmp.cc b/storage/innobase/rem/rem0cmp.cc
index 7fb6fdac1ba..536ea224d18 100644
--- a/storage/innobase/rem/rem0cmp.cc
+++ b/storage/innobase/rem/rem0cmp.cc
@@ -289,7 +289,8 @@ static int cmp_data(ulint mtype, ulint prtype, const byte *data1, ulint len1,
DBUG_ASSERT(is_strnncoll_compatible(prtype & DATA_MYSQL_TYPE_MASK));
if (CHARSET_INFO *cs= all_charsets[dtype_get_charset_coll(prtype)])
return cs->coll->strnncollsp_nchars(cs, data1, len1, data2, len2,
- std::max(len1, len2));
+ std::max(len1, len2),
+ MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES);
goto no_collation;
case DATA_VARCHAR:
case DATA_CHAR:
diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc
index 98cf2dda900..d743ef9aa5c 100644
--- a/storage/innobase/rem/rem0rec.cc
+++ b/storage/innobase/rem/rem0rec.cc
@@ -291,7 +291,9 @@ rec_init_offsets_comp_ordinary(
!= n_core)
? UT_BITS_IN_BYTES(unsigned(index->get_n_nullable(n_core)))
: (redundant_temp
- ? UT_BITS_IN_BYTES(index->n_nullable)
+ ? (index->is_instant()
+ ? UT_BITS_IN_BYTES(index->get_n_nullable(n_core))
+ : UT_BITS_IN_BYTES(index->n_nullable))
: index->n_core_null_bytes);
if (mblob) {
@@ -448,7 +450,7 @@ start:
continue;
}
- len = offs += len;
+ len = offs += static_cast<rec_offs>(len);
} else {
len = offs += field->fixed_len;
}
diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc
index 6a2ee565b9e..4afe9e874bb 100644
--- a/storage/innobase/row/row0import.cc
+++ b/storage/innobase/row/row0import.cc
@@ -3901,6 +3901,7 @@ page_corrupted:
block->page.zip.data = src;
frame_changed = true;
} else if (!page_compressed
+ && type != FIL_PAGE_TYPE_XDES
&& !block->page.zip.data) {
block->page.frame = src;
frame_changed = true;
diff --git a/storage/innobase/row/row0vers.cc b/storage/innobase/row/row0vers.cc
index 372d30149f0..a4fc32cc5a8 100644
--- a/storage/innobase/row/row0vers.cc
+++ b/storage/innobase/row/row0vers.cc
@@ -844,6 +844,30 @@ row_vers_build_cur_vrow(
return(cur_vrow);
}
+/** Find out whether data tuple has missing data type
+for indexed virtual column.
+@param tuple data tuple
+@param index virtual index
+@return true if tuple has missing column type */
+static bool dtuple_vcol_data_missing(const dtuple_t &tuple,
+ dict_index_t *index)
+{
+ for (ulint i= 0; i < index->n_uniq; i++)
+ {
+ dict_col_t *col= index->fields[i].col;
+ if (!col->is_virtual())
+ continue;
+ dict_v_col_t *vcol= reinterpret_cast<dict_v_col_t*>(col);
+ for (ulint j= 0; j < index->table->n_v_cols; j++)
+ {
+ if (vcol == &index->table->v_cols[j]
+ && tuple.v_fields[j].type.mtype == DATA_MISSING)
+ return true;
+ }
+ }
+ return false;
+}
+
/** Finds out if a version of the record, where the version >= the current
purge_sys.view, should have ientry as its secondary index entry. We check
if there is any not delete marked version of the record where the trx
@@ -1053,6 +1077,9 @@ unsafe_to_purge:
if (dict_index_has_virtual(index)) {
if (vrow) {
+ if (dtuple_vcol_data_missing(*vrow, index)) {
+ goto nochange_index;
+ }
/* Keep the virtual row info for the next
version, unless it is changed */
mem_heap_empty(v_heap);
@@ -1063,6 +1090,7 @@ unsafe_to_purge:
if (!cur_vrow) {
/* Nothing for this index has changed,
continue */
+nochange_index:
version = prev_version;
continue;
}
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index a881ae0ad6a..872f1fc7e9c 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -702,7 +702,7 @@ srv_undo_tablespaces_init(bool create_new_db)
srv_undo_tablespaces_open= 0;
ut_a(srv_undo_tablespaces <= TRX_SYS_N_RSEGS);
- ut_a(!create_new_db || srv_operation == SRV_OPERATION_NORMAL);
+ ut_a(!create_new_db || srv_operation <= SRV_OPERATION_EXPORT_RESTORED);
if (srv_undo_tablespaces == 1)
srv_undo_tablespaces= 0;
@@ -1056,7 +1056,7 @@ dberr_t srv_start(bool create_new_db)
bool srv_log_file_found = true;
mtr_t mtr;
- ut_ad(srv_operation == SRV_OPERATION_NORMAL
+ ut_ad(srv_operation <= SRV_OPERATION_RESTORE_EXPORT
|| srv_operation == SRV_OPERATION_RESTORE
|| srv_operation == SRV_OPERATION_RESTORE_EXPORT);
@@ -1453,7 +1453,8 @@ file_checked:
}
switch (srv_operation) {
- case SRV_OPERATION_NORMAL:
+ case SRV_OPERATION_NORMAL:
+ case SRV_OPERATION_EXPORT_RESTORED:
case SRV_OPERATION_RESTORE_EXPORT:
/* Initialize the change buffer. */
err = dict_boot();
@@ -1849,7 +1850,8 @@ skip_monitors:
return(srv_init_abort(err));
}
- if (!srv_read_only_mode && srv_operation == SRV_OPERATION_NORMAL) {
+ if (!srv_read_only_mode
+ && srv_operation <= SRV_OPERATION_EXPORT_RESTORED) {
/* Initialize the innodb_temporary tablespace and keep
it open until shutdown. */
err = srv_open_tmp_tablespace(create_new_db);
@@ -1931,7 +1933,7 @@ void innodb_preshutdown()
if (srv_read_only_mode)
return;
- if (!srv_fast_shutdown && srv_operation == SRV_OPERATION_NORMAL)
+ if (!srv_fast_shutdown && srv_operation <= SRV_OPERATION_EXPORT_RESTORED)
{
/* Because a slow shutdown must empty the change buffer, we had
better prevent any further changes from being buffered. */
@@ -1971,6 +1973,7 @@ void innodb_shutdown()
mysql_mutex_unlock(&buf_pool.flush_list_mutex);
break;
case SRV_OPERATION_NORMAL:
+ case SRV_OPERATION_EXPORT_RESTORED:
/* Shut down the persistent files. */
logs_empty_and_mark_files_at_shutdown();
}
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index 7302ed36f75..7f79a5c81aa 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -188,7 +188,7 @@ static MYSQL_SYSVAR_BOOL(page_checksum, maria_page_checksums, 0,
/* It is only command line argument */
static MYSQL_SYSVAR_CONST_STR(log_dir_path, maria_data_root,
- PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Path to the directory where to store transactional log",
NULL, NULL, mysql_real_data_home);
diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc
index 244b11a30fc..ec8225d9e01 100644
--- a/storage/perfschema/pfs.cc
+++ b/storage/perfschema/pfs.cc
@@ -3068,7 +3068,8 @@ pfs_start_table_io_wait_v1(PSI_table_locker_state *state,
PFS_table_share *share= pfs_table->m_share;
wait->m_thread_internal_id= pfs_thread->m_thread_internal_id;
- wait->m_class= &global_table_io_class;
+ if (wait->m_class == NULL || wait->m_class->m_type != PFS_CLASS_TABLE_LOCK)
+ wait->m_class= &global_table_io_class;
wait->m_timer_start= timer_start;
wait->m_timer_end= 0;
wait->m_object_instance_addr= pfs_table->m_identity;
diff --git a/storage/rocksdb/mysql-test/rocksdb/include/restart_mysqld_with_option.inc b/storage/rocksdb/mysql-test/rocksdb/include/restart_mysqld_with_option.inc
index 81cd2200ae0..a87fe01b3a1 100644
--- a/storage/rocksdb/mysql-test/rocksdb/include/restart_mysqld_with_option.inc
+++ b/storage/rocksdb/mysql-test/rocksdb/include/restart_mysqld_with_option.inc
@@ -9,8 +9,8 @@ if ($rpl_inited)
# Write file to make mysql-test-run.pl expect the "crash", but don't start
# it until it's told to
---let $_server_id= `SELECT @@server_id`
---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo "wait" > $_expect_file_name
# Send shutdown to the connected server and give
diff --git a/storage/rocksdb/mysql-test/rocksdb/t/allow_to_start_after_corruption.test b/storage/rocksdb/mysql-test/rocksdb/t/allow_to_start_after_corruption.test
index e084b57fbda..88a02c469bb 100644
--- a/storage/rocksdb/mysql-test/rocksdb/t/allow_to_start_after_corruption.test
+++ b/storage/rocksdb/mysql-test/rocksdb/t/allow_to_start_after_corruption.test
@@ -16,6 +16,7 @@
# restart server to change error log and ignore corruptopn on startup
--let $_mysqld_option=--log-error=$LOG --rocksdb_allow_to_start_after_corruption=1
--source include/restart_mysqld_with_option.inc
+--let $_server_id= `SELECT @@server_id`
--echo #
--echo # Test server crashes on corrupted data and restarts
diff --git a/storage/rocksdb/mysql-test/rocksdb/t/persistent_cache.test b/storage/rocksdb/mysql-test/rocksdb/t/persistent_cache.test
index 49e5e5c1172..da9d8602c01 100644
--- a/storage/rocksdb/mysql-test/rocksdb/t/persistent_cache.test
+++ b/storage/rocksdb/mysql-test/rocksdb/t/persistent_cache.test
@@ -4,8 +4,8 @@
DROP TABLE IF EXISTS t1;
--enable_warnings
---let $_server_id= `SELECT @@server_id`
---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--let $_cache_file_name= $MYSQLTEST_VARDIR/tmp/persistent_cache
--exec echo "wait" >$_expect_file_name
diff --git a/storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test b/storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test
index e7ab37d2658..b2647b38e08 100644
--- a/storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test
+++ b/storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test
@@ -17,8 +17,8 @@ CREATE TABLE t2 (pk int primary key) ENGINE=ROCKSDB PARTITION BY KEY(pk) PARTITI
# Write file to make mysql-test-run.pl expect the "crash", but don't restart the
# server until it is told to
---let $_server_id= `SELECT @@server_id`
---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--let LOG=$MYSQLTEST_VARDIR/tmp/validate_datadic.err
--exec echo "wait" >$_expect_file_name
diff --git a/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_rate_limiter_bytes_per_sec_basic.test b/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_rate_limiter_bytes_per_sec_basic.test
index 743f942af9c..1daa9898c1a 100644
--- a/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_rate_limiter_bytes_per_sec_basic.test
+++ b/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_rate_limiter_bytes_per_sec_basic.test
@@ -7,8 +7,8 @@ SET @@global.rocksdb_rate_limiter_bytes_per_sec = 10000;
# Write file to make mysql-test-run.pl expect the "crash", but don't restart the
# server until it is told to
---let $_server_id= `SELECT @@server_id`
---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo "wait" >$_expect_file_name
# Send shutdown to the connected server and give it 10 seconds to die before
diff --git a/storage/spider/mysql-test/spider/bugfix/include/restart_spider.inc b/storage/spider/mysql-test/spider/bugfix/include/restart_spider.inc
deleted file mode 100644
index a5446a6188d..00000000000
--- a/storage/spider/mysql-test/spider/bugfix/include/restart_spider.inc
+++ /dev/null
@@ -1,8 +0,0 @@
---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.1.expect
-
---exec echo "wait" > $_expect_file_name
---shutdown_server
---source include/wait_until_disconnected.inc
---exec echo "restart" > $_expect_file_name
---enable_reconnect
---source include/wait_until_connected_again.inc
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29352.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29352.result
index 5715edf2bd6..975d3834d42 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_29352.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29352.result
@@ -9,4 +9,5 @@ CREATE FUNCTION spider_bg_direct_sql RETURNS INT SONAME 'ha_spider.so';
ERROR HY000: Can't execute the query because you have a conflicting read lock
SELECT * FROM t;
c
+# restart
DROP TABLE t;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29904.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29904.result
new file mode 100644
index 00000000000..c89309a514d
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29904.result
@@ -0,0 +1,4 @@
+#
+# MDEV-29904 SPIDER plugin initialization fails upon startup
+#
+# restart: --plugin-load-add=ha_spider
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29352.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_29352.test
index 00d8ee73ebc..626364efb99 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_29352.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29352.test
@@ -6,6 +6,6 @@ FLUSH TABLES WITH READ LOCK;
CREATE FUNCTION spider_bg_direct_sql RETURNS INT SONAME 'ha_spider.so';
SELECT * FROM t;
---source include/restart_spider.inc
+--source include/restart_mysqld.inc
DROP TABLE t;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29904.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_29904.test
new file mode 100644
index 00000000000..d3dcb363890
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29904.test
@@ -0,0 +1,6 @@
+--echo #
+--echo # MDEV-29904 SPIDER plugin initialization fails upon startup
+--echo #
+
+--let $restart_parameters=--plugin-load-add=ha_spider
+--source include/restart_mysqld.inc
diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc
index ec12dbdb5da..054de0030a7 100644
--- a/storage/spider/spd_table.cc
+++ b/storage/spider/spd_table.cc
@@ -10464,6 +10464,8 @@ void *spider_table_bg_sts_action(
thd->mysys_var->current_cond = &thread->cond;
thd->mysys_var->current_mutex = &thread->mutex;
}
+ bool spd_wsrep_on = thd->variables.wsrep_on;
+ thd->variables.wsrep_on = false;
while (spider_init_queries[i].length && !thd->killed && !thread->killed &&
thread->init_command)
{
@@ -10477,6 +10479,7 @@ void *spider_table_bg_sts_action(
}
++i;
}
+ thd->variables.wsrep_on = spd_wsrep_on;
thd->mysys_var->current_cond = &thread->cond;
thd->mysys_var->current_mutex = &thread->mutex;
thd->client_capabilities -= CLIENT_MULTI_RESULTS;