summaryrefslogtreecommitdiff
path: root/storage/innobase
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-02-05 12:48:02 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-02-05 12:48:02 +0200
commite80bcd7f64fc8ff6f46c1fc0d01e9c0b0fd03064 (patch)
tree0716fe20a806adbe55581d9e996f29dcb3a5ab0b /storage/innobase
parent7075d7fce626ee915c9ae9308cfb4a8120e83e44 (diff)
parentab2458c61fab2d8e6ead63577af434738874f1cf (diff)
downloadmariadb-git-e80bcd7f64fc8ff6f46c1fc0d01e9c0b0fd03064.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'storage/innobase')
-rw-r--r--storage/innobase/buf/buf0buf.cc7
-rw-r--r--storage/innobase/fil/fil0fil.cc2
-rw-r--r--storage/innobase/handler/ha_innodb.cc25
-rw-r--r--storage/innobase/handler/handler0alter.cc3
-rw-r--r--storage/innobase/include/fsp0file.h19
-rw-r--r--storage/innobase/log/log0recv.cc30
6 files changed, 80 insertions, 6 deletions
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index dd2e45791f6..b707761354e 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -1064,6 +1064,13 @@ buf_page_is_corrupted(
if (srv_checksum_algorithm
== SRV_CHECKSUM_ALGORITHM_CRC32) {
+ DBUG_EXECUTE_IF(
+ "page_intermittent_checksum_mismatch", {
+ static int page_counter;
+ if (page_counter++ == 2) {
+ checksum_field2++;
+ }
+ });
crc32 = buf_calc_page_crc32(read_buf);
crc32_inited = true;
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index 9abbc4a540a..e891c5bcdf8 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -910,7 +910,7 @@ fil_space_extend_must_retry(
we have set the node->being_extended flag. */
mutex_exit(&fil_system.mutex);
- ut_ad(size > space->size);
+ ut_ad(size >= space->size);
ulint last_page_no = space->size;
const ulint file_start_page_no = last_page_no - node->size;
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 683a6417747..153390dbc2d 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -190,6 +190,11 @@ static char* innobase_reset_all_monitor_counter;
static ulong innodb_flush_method;
+/** Deprecated; no effect other than issuing a deprecation warning. */
+static char* innodb_file_format;
+/** Deprecated; no effect other than issuing a deprecation warning. */
+static char* innodb_large_prefix;
+
/* This variable can be set in the server configure file, specifying
stopword table to be used */
static char* innobase_server_stopword_table;
@@ -3689,6 +3694,17 @@ static int innodb_init_params()
char *default_path;
ulong num_pll_degree;
+ if (innodb_large_prefix || innodb_file_format) {
+ const char* p = innodb_file_format
+ ? "file_format"
+ : "large_prefix";
+ sql_print_warning("The parameter innodb_%s is deprecated"
+ " and has no effect."
+ " It may be removed in future releases."
+ " See https://mariadb.com/kb/en/library/"
+ "xtradbinnodb-file-format/", p);
+ }
+
/* Check that values don't overflow on 32-bit systems. */
if (sizeof(ulint) == 4) {
if (innobase_buffer_pool_size > UINT_MAX32) {
@@ -18859,6 +18875,13 @@ static MYSQL_SYSVAR_ENUM(flush_method, innodb_flush_method,
NULL, NULL, IF_WIN(SRV_ALL_O_DIRECT_FSYNC, SRV_FSYNC),
&innodb_flush_method_typelib);
+static MYSQL_SYSVAR_STR(file_format, innodb_file_format,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ "Deprecated parameter with no effect.", NULL, NULL, NULL);
+static MYSQL_SYSVAR_STR(large_prefix, innodb_large_prefix,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ "Deprecated parameter with no effect.", NULL, NULL, NULL);
+
static MYSQL_SYSVAR_BOOL(force_load_corrupted, srv_load_corrupted,
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
"Force InnoDB to load metadata of corrupted table.",
@@ -19903,6 +19926,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(read_io_threads),
MYSQL_SYSVAR(write_io_threads),
MYSQL_SYSVAR(file_per_table),
+ MYSQL_SYSVAR(file_format), /* deprecated in MariaDB 10.2; no effect */
MYSQL_SYSVAR(flush_log_at_timeout),
MYSQL_SYSVAR(flush_log_at_trx_commit),
MYSQL_SYSVAR(flush_method),
@@ -19916,6 +19940,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(ft_min_token_size),
MYSQL_SYSVAR(ft_num_word_optimize),
MYSQL_SYSVAR(ft_sort_pll_degree),
+ MYSQL_SYSVAR(large_prefix), /* deprecated in MariaDB 10.2; no effect */
MYSQL_SYSVAR(force_load_corrupted),
MYSQL_SYSVAR(lock_schedule_algorithm),
MYSQL_SYSVAR(locks_unsafe_for_binlog),
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index a3e2349b10d..51d0042e011 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -106,7 +106,8 @@ static const alter_table_operations INNOBASE_INPLACE_IGNORE
| ALTER_COLUMN_STORAGE_TYPE
| ALTER_VIRTUAL_GCOL_EXPR
| ALTER_DROP_CHECK_CONSTRAINT
- | ALTER_RENAME;
+ | ALTER_RENAME
+ | ALTER_COLUMN_INDEX_LENGTH;
/** Operations on foreign key definitions (changing the schema only) */
static const alter_table_operations INNOBASE_FOREIGN_OPERATIONS
diff --git a/storage/innobase/include/fsp0file.h b/storage/innobase/include/fsp0file.h
index 72810a25191..ec1ba699502 100644
--- a/storage/innobase/include/fsp0file.h
+++ b/storage/innobase/include/fsp0file.h
@@ -314,6 +314,25 @@ public:
return(m_last_os_error);
}
+ /** Check whether the file is empty.
+ @return true if file is empty */
+ bool is_empty_file() const
+ {
+#ifdef _WIN32
+ os_offset_t offset =
+ (os_offset_t) m_file_info.nFileSizeLow
+ | ((os_offset_t) m_file_info.nFileSizeHigh << 32);
+
+ return (offset == 0);
+#else
+ return (m_file_info.st_size == 0);
+#endif
+ }
+
+ /** Check if the file exist.
+ @return true if file exists. */
+ bool exists() const { return m_exists; }
+
/** Test if the filepath provided looks the same as this filepath
by string comparison. If they are two different paths to the same
file, same_as() will be used to show that after the files are opened.
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index 26f747a5037..9f6b9243070 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -151,9 +151,13 @@ struct file_name_t {
/** Status of the tablespace */
fil_status status;
+ /** FSP_SIZE of tablespace */
+ ulint size;
+
/** Constructor */
file_name_t(std::string name_, bool deleted) :
- name(name_), space(NULL), status(deleted ? DELETED: NORMAL) {}
+ name(name_), space(NULL), status(deleted ? DELETED: NORMAL),
+ size(0) {}
};
/** Map of dirty tablespaces during recovery */
@@ -321,6 +325,11 @@ fil_name_process(
ut_ad(space != NULL);
if (f.space == NULL || f.space == space) {
+
+ if (f.size && f.space == NULL) {
+ fil_space_set_recv_size(space->id, f.size);
+ }
+
f.name = fname.name;
f.space = space;
f.status = file_name_t::NORMAL;
@@ -2249,11 +2258,24 @@ recv_parse_log_rec(
}
if (*page_no == 0 && *type == MLOG_4BYTES
+ && apply
&& mach_read_from_2(old_ptr) == FSP_HEADER_OFFSET + FSP_SIZE) {
old_ptr += 2;
- fil_space_set_recv_size(*space,
- mach_parse_compressed(&old_ptr,
- end_ptr));
+
+ ulint size = mach_parse_compressed(&old_ptr, end_ptr);
+
+ recv_spaces_t::iterator it = recv_spaces.find(*space);
+
+ ut_ad(!recv_sys->mlog_checkpoint_lsn
+ || *space == TRX_SYS_SPACE
+ || srv_is_undo_tablespace(*space)
+ || it != recv_spaces.end());
+
+ if (it != recv_spaces.end() && !it->second.space) {
+ it->second.size = size;
+ }
+
+ fil_space_set_recv_size(*space, size);
}
return ulint(new_ptr - ptr);