summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2020-02-11 14:40:35 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2020-02-11 14:40:35 +0100
commit646d1ec83a57d9a5b380079afc3612c1d9acadd5 (patch)
treeb46ec54915361f3baa221bcd01b4308a55c59c48 /storage
parentc1eaa385ffb44bdf6264d2cc4b4cc0e10284c88a (diff)
parent58b70dc13630d2f2f0244359d6351085d70fd5dd (diff)
downloadmariadb-git-646d1ec83a57d9a5b380079afc3612c1d9acadd5.tar.gz
Merge branch '10.3' into 10.4
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/buf/buf0buf.cc8
-rw-r--r--storage/innobase/buf/buf0lru.cc8
-rw-r--r--storage/innobase/dict/dict0dict.cc7
-rw-r--r--storage/innobase/fil/fil0crypt.cc71
-rw-r--r--storage/innobase/fts/fts0opt.cc2
-rw-r--r--storage/innobase/handler/i_s.cc23
-rw-r--r--storage/innobase/include/hash0hash.h12
-rw-r--r--storage/innobase/include/mem0mem.h11
-rw-r--r--storage/innobase/include/mem0mem.ic28
-rw-r--r--storage/innobase/include/rem0rec.ic6
-rw-r--r--storage/innobase/mem/mem0mem.cc9
-rw-r--r--storage/innobase/row/row0mysql.cc21
-rw-r--r--storage/innobase/srv/srv0srv.cc6
-rw-r--r--storage/tokudb/CMakeLists.txt2
-rw-r--r--storage/tokudb/man/CMakeLists.txt2
-rw-r--r--storage/tokudb/man/tokuft_logprint.116
-rw-r--r--storage/tokudb/man/tokuftdump.1237
-rw-r--r--storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_5_tokudb.result12
18 files changed, 340 insertions, 141 deletions
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 4c5046ed763..4556411015c 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -2235,8 +2235,8 @@ buf_page_realloc(
ut_d(block->page.in_page_hash = FALSE);
ulint fold = block->page.id.fold();
ut_ad(fold == new_block->page.id.fold());
- HASH_DELETE(buf_page_t, hash, buf_pool->page_hash, fold, (&block->page));
- HASH_INSERT(buf_page_t, hash, buf_pool->page_hash, fold, (&new_block->page));
+ HASH_REPLACE(buf_page_t, hash, buf_pool->page_hash, fold,
+ &block->page, &new_block->page);
ut_ad(new_block->page.in_page_hash);
@@ -3349,8 +3349,8 @@ buf_relocate(
/* relocate buf_pool->page_hash */
ulint fold = bpage->id.fold();
ut_ad(fold == dpage->id.fold());
- HASH_DELETE(buf_page_t, hash, buf_pool->page_hash, fold, bpage);
- HASH_INSERT(buf_page_t, hash, buf_pool->page_hash, fold, dpage);
+ HASH_REPLACE(buf_page_t, hash, buf_pool->page_hash, fold, bpage,
+ dpage);
}
/** Hazard Pointer implementation. */
diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc
index 79fafa68c4c..f2a475e2046 100644
--- a/storage/innobase/buf/buf0lru.cc
+++ b/storage/innobase/buf/buf0lru.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2019, MariaDB Corporation.
+Copyright (c) 2017, 2020, 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
@@ -59,6 +59,7 @@ static const ulint BUF_LRU_OLD_TOLERANCE = 20;
@see buf_LRU_old_adjust_len */
#define BUF_LRU_NON_OLD_MIN_LEN 5
+#ifdef BTR_CUR_HASH_ADAPT
/** When dropping the search hash index entries before deleting an ibd
file, we build a local array of pages belonging to that tablespace
in the buffer pool. Following is the size of that array.
@@ -67,6 +68,7 @@ flush_list when dropping a table. This is to ensure that other threads
are not blocked for extended period of time when using very large
buffer pools. */
static const ulint BUF_LRU_DROP_SEARCH_SIZE = 1024;
+#endif /* BTR_CUR_HASH_ADAPT */
/** We scan these many blocks when looking for a clean page to evict
during LRU eviction. */
@@ -376,7 +378,6 @@ drop_ahi:
return true;
}
-#endif /* BTR_CUR_HASH_ADAPT */
/******************************************************************//**
While flushing (or removing dirty) pages from a tablespace we don't
@@ -465,6 +466,7 @@ buf_flush_try_yield(
return(false);
}
+#endif /* BTR_CUR_HASH_ADAPT */
/******************************************************************//**
Removes a single page from a given tablespace inside a specific
@@ -640,6 +642,7 @@ rescan:
goto rescan;
}
+#ifdef BTR_CUR_HASH_ADAPT
++processed;
/* Yield if we have hogged the CPU and mutexes for too long. */
@@ -649,6 +652,7 @@ rescan:
processed = 0;
}
+#endif /* BTR_CUR_HASH_ADAPT */
/* The check for trx is interrupted is expensive, we want
to check every N iterations. */
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index 3b05814c45a..af6e45e3ad3 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -2,7 +2,7 @@
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2013, 2019, MariaDB Corporation.
+Copyright (c) 2013, 2020, 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
@@ -355,7 +355,10 @@ dict_table_close(
mutex_exit(&dict_sys.mutex);
- if (drop_aborted) {
+ /* dict_table_try_drop_aborted() can generate undo logs.
+ So it should be avoided after shutdown of background
+ threads */
+ if (drop_aborted && !srv_undo_sources) {
dict_table_try_drop_aborted(NULL, table_id, 0);
}
}
diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc
index 2e5f56b87dc..bd22e78c5b2 100644
--- a/storage/innobase/fil/fil0crypt.cc
+++ b/storage/innobase/fil/fil0crypt.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (C) 2013, 2015, Google Inc. All Rights Reserved.
-Copyright (c) 2014, 2019, MariaDB Corporation.
+Copyright (c) 2014, 2020, 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
@@ -753,74 +753,11 @@ fil_space_encrypt(
return (src_frame);
}
- fil_space_crypt_t* crypt_data = space->crypt_data;
- const ulint zip_size = space->zip_size();
ut_ad(space->pending_io());
- const bool full_crc32 = space->full_crc32();
-
- byte* tmp = fil_encrypt_buf(crypt_data, space->id, offset, lsn,
- src_frame, zip_size, dst_frame,
- full_crc32);
-
-#ifdef UNIV_DEBUG
- if (tmp) {
- /* Verify that encrypted buffer is not corrupted */
- dberr_t err = DB_SUCCESS;
- byte* src = src_frame;
- byte tmp_mem[UNIV_PAGE_SIZE_MAX];
-
- if (full_crc32) {
- bool compressed = false, corrupted = false;
- uint size = buf_page_full_crc32_size(
- tmp, &compressed, &corrupted);
- ut_ad(!corrupted);
- ut_ad(!compressed == (size == srv_page_size));
- ut_ad(fil_space_decrypt(space->id, crypt_data, tmp_mem,
- size, space->flags, tmp,
- &err));
- ut_ad(err == DB_SUCCESS);
- memcpy(tmp_mem, src, FIL_PAGE_OFFSET);
- ut_ad(!memcmp(src, tmp_mem,
- (size - FIL_PAGE_FCRC32_CHECKSUM)));
- } else {
- bool page_compressed_encrypted =
- (mach_read_from_2(tmp+FIL_PAGE_TYPE)
- == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED);
- byte uncomp_mem[UNIV_PAGE_SIZE_MAX];
-
- if (page_compressed_encrypted) {
- memcpy(uncomp_mem, src, srv_page_size);
- ulint unzipped1 = fil_page_decompress(
- tmp_mem, uncomp_mem, space->flags);
- ut_ad(unzipped1);
- if (unzipped1 != srv_page_size) {
- src = uncomp_mem;
- }
- }
-
- ut_ad(!buf_page_is_corrupted(true, src, space->flags));
-
- ut_ad(fil_space_decrypt(space->id, crypt_data, tmp_mem,
- space->physical_size(),
- space->flags, tmp, &err));
- ut_ad(err == DB_SUCCESS);
-
- if (page_compressed_encrypted) {
- memcpy(tmp_mem, uncomp_mem, srv_page_size);
- ulint unzipped2 = fil_page_decompress(
- uncomp_mem, tmp_mem, space->flags);
- ut_ad(unzipped2);
- }
-
- memcpy(tmp_mem + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION,
- src + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION, 8);
- ut_ad(!memcmp(src, tmp_mem, space->physical_size()));
- }
- }
-#endif /* UNIV_DEBUG */
-
- return tmp;
+ return fil_encrypt_buf(space->crypt_data, space->id, offset, lsn,
+ src_frame, space->zip_size(),
+ dst_frame, space->full_crc32());
}
/** Decrypt a page for full checksum format.
diff --git a/storage/innobase/fts/fts0opt.cc b/storage/innobase/fts/fts0opt.cc
index d21107b4728..cd44ef7f67e 100644
--- a/storage/innobase/fts/fts0opt.cc
+++ b/storage/innobase/fts/fts0opt.cc
@@ -2645,8 +2645,6 @@ fts_optimize_request_sync_table(
ib_wqueue_add(fts_optimize_wq, msg, msg->heap, true);
- table->fts->in_queue = true;
-
mutex_exit(&fts_optimize_wq->mutex);
}
diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc
index 5698346b279..05592fa9584 100644
--- a/storage/innobase/handler/i_s.cc
+++ b/storage/innobase/handler/i_s.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2014, 2019, MariaDB Corporation.
+Copyright (c) 2014, 2020, 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
@@ -9058,6 +9058,8 @@ i_s_innodb_mutexes_fill_table(
~Locking() { mutex_exit(&rw_lock_list_mutex); }
} locking;
+ char lock_name[sizeof "buf0dump.cc:12345"];
+
for (lock = UT_LIST_GET_FIRST(rw_lock_list); lock != NULL;
lock = UT_LIST_GET_NEXT(list, lock)) {
if (lock->count_os_wait == 0) {
@@ -9070,11 +9072,16 @@ i_s_innodb_mutexes_fill_table(
continue;
}
- //OK(field_store_string(fields[MUTEXES_NAME],
- // lock->lock_name));
- OK(field_store_string(
- fields[MUTEXES_CREATE_FILE],
- innobase_basename(lock->cfile_name)));
+ const char* basename = innobase_basename(
+ lock->cfile_name);
+
+ snprintf(lock_name, sizeof lock_name, "%s:%u",
+ basename, lock->cline);
+
+ OK(field_store_string(fields[MUTEXES_NAME],
+ lock_name));
+ OK(field_store_string(fields[MUTEXES_CREATE_FILE],
+ basename));
OK(fields[MUTEXES_CREATE_LINE]->store(lock->cline,
true));
fields[MUTEXES_CREATE_LINE]->set_notnull();
@@ -9090,8 +9097,8 @@ i_s_innodb_mutexes_fill_table(
snprintf(buf1, sizeof buf1, "combined %s",
innobase_basename(block_lock->cfile_name));
- //OK(field_store_string(fields[MUTEXES_NAME],
- // block_lock->lock_name));
+ OK(field_store_string(fields[MUTEXES_NAME],
+ "buf_block_t::lock"));
OK(field_store_string(fields[MUTEXES_CREATE_FILE],
buf1));
OK(fields[MUTEXES_CREATE_LINE]->store(block_lock->cline,
diff --git a/storage/innobase/include/hash0hash.h b/storage/innobase/include/hash0hash.h
index 5d317a23d4e..4f55b051d80 100644
--- a/storage/innobase/include/hash0hash.h
+++ b/storage/innobase/include/hash0hash.h
@@ -184,6 +184,18 @@ do {\
HASH_INVALIDATE(DATA, NAME);\
} while (0)
+#define HASH_REPLACE(TYPE, NAME, TABLE, FOLD, DATA_OLD, DATA_NEW) \
+ do { \
+ (DATA_NEW)->NAME = (DATA_OLD)->NAME; \
+ \
+ hash_cell_t& cell3333 \
+ = TABLE->array[hash_calc_hash(FOLD, TABLE)]; \
+ TYPE** struct3333 = (TYPE**)&cell3333.node; \
+ while (*struct3333 != DATA_OLD) { \
+ struct3333 = &((*struct3333)->NAME); \
+ } \
+ *struct3333 = DATA_NEW; \
+ } while (0)
/*******************************************************************//**
Gets the first struct in a hash chain, NULL if none. */
diff --git a/storage/innobase/include/mem0mem.h b/storage/innobase/include/mem0mem.h
index fa22b3d3086..18ae845955a 100644
--- a/storage/innobase/include/mem0mem.h
+++ b/storage/innobase/include/mem0mem.h
@@ -291,13 +291,6 @@ mem_heap_printf(
const char* format, /*!< in: format string */
...) MY_ATTRIBUTE ((format (printf, 2, 3)));
-/** Checks that an object is a memory heap (or a block of it)
-@param[in] heap Memory heap to check */
-UNIV_INLINE
-void
-mem_block_validate(
- const mem_heap_t* heap);
-
#ifdef UNIV_DEBUG
/** Validates the contents of a memory heap.
Asserts that the memory heap is consistent
@@ -312,7 +305,6 @@ mem_heap_validate(
/** The info structure stored at the beginning of a heap block */
struct mem_block_info_t {
- ulint magic_n;/* magic number for debugging */
#ifdef UNIV_DEBUG
char file_name[8];/* file name where the mem heap was created */
unsigned line; /*!< line number where the mem heap was created */
@@ -347,9 +339,6 @@ struct mem_block_info_t {
otherwise, this is NULL */
};
-#define MEM_BLOCK_MAGIC_N 764741555
-#define MEM_FREED_BLOCK_MAGIC_N 547711122
-
/* Header size for a memory heap block */
#define MEM_BLOCK_HEADER_SIZE UT_CALC_ALIGN(sizeof(mem_block_info_t),\
UNIV_MEM_ALIGNMENT)
diff --git a/storage/innobase/include/mem0mem.ic b/storage/innobase/include/mem0mem.ic
index fae2aaf4d04..2a88c0f1065 100644
--- a/storage/innobase/include/mem0mem.ic
+++ b/storage/innobase/include/mem0mem.ic
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2014, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2019, MariaDB Corporation.
+Copyright (c) 2017, 2020, 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
@@ -144,16 +144,6 @@ mem_block_get_start(mem_block_t* block)
return(block->start);
}
-/** Checks that an object is a memory heap block
-@param[in] block Memory block to check. */
-UNIV_INLINE
-void
-mem_block_validate(
- const mem_block_t* block)
-{
- ut_a(block->magic_n == MEM_BLOCK_MAGIC_N);
-}
-
/** Allocates and zero-fills n bytes of memory from a memory heap.
@param[in] heap memory heap
@param[in] n number of bytes; if the heap is allowed to grow into
@@ -186,8 +176,6 @@ mem_heap_alloc(
byte* buf;
ulint free;
- ut_d(mem_block_validate(heap));
-
block = UT_LIST_GET_LAST(heap->base);
n += REDZONE_SIZE;
@@ -230,8 +218,6 @@ mem_heap_get_heap_top(
mem_block_t* block;
byte* buf;
- ut_d(mem_block_validate(heap));
-
block = UT_LIST_GET_LAST(heap->base);
buf = (byte*) block + mem_block_get_free(block);
@@ -322,8 +308,6 @@ mem_heap_get_top(
mem_block_t* block;
byte* buf;
- ut_d(mem_block_validate(heap));
-
block = UT_LIST_GET_LAST(heap->base);
buf = (byte*) block + mem_block_get_free(block) - MEM_SPACE_NEEDED(n);
@@ -343,8 +327,6 @@ mem_heap_free_top(
{
mem_block_t* block;
- ut_d(mem_block_validate(heap));
-
n += REDZONE_SIZE;
block = UT_LIST_GET_LAST(heap->base);
@@ -420,8 +402,6 @@ mem_heap_free(
mem_block_t* block;
mem_block_t* prev_block;
- ut_d(mem_block_validate(heap));
-
block = UT_LIST_GET_LAST(heap->base);
if (heap->free_block) {
@@ -448,11 +428,7 @@ mem_heap_get_size(
/*==============*/
mem_heap_t* heap) /*!< in: heap */
{
- ulint size = 0;
-
- ut_d(mem_block_validate(heap));
-
- size = heap->total_size;
+ ulint size = heap->total_size;
if (heap->free_block) {
size += srv_page_size;
diff --git a/storage/innobase/include/rem0rec.ic b/storage/innobase/include/rem0rec.ic
index c440850cf13..d2f36845e53 100644
--- a/storage/innobase/include/rem0rec.ic
+++ b/storage/innobase/include/rem0rec.ic
@@ -1390,7 +1390,11 @@ rec_get_converted_size(
data_size = dtuple_get_data_size(dtuple, 0);
- ut_ad(n_ext == dtuple_get_n_ext(dtuple));
+ /* If primary key is being updated then the new record inherits
+ externally stored fields from the delete-marked old record.
+ In that case, n_ext may be less value than
+ dtuple_get_n_ext(tuple). */
+ ut_ad(n_ext <= dtuple_get_n_ext(dtuple));
extra_size = rec_get_converted_extra_size(
data_size, dtuple_get_n_fields(dtuple), n_ext);
diff --git a/storage/innobase/mem/mem0mem.cc b/storage/innobase/mem/mem0mem.cc
index a298a7c0b2f..15dee37cc1f 100644
--- a/storage/innobase/mem/mem0mem.cc
+++ b/storage/innobase/mem/mem0mem.cc
@@ -210,8 +210,6 @@ mem_heap_validate(
block != NULL;
block = UT_LIST_GET_NEXT(list, block)) {
- mem_block_validate(block);
-
switch (block->type) {
case MEM_HEAP_DYNAMIC:
break;
@@ -266,7 +264,6 @@ mem_heap_create_block_func(
|| (type == MEM_HEAP_BUFFER + MEM_HEAP_BTR_SEARCH));
if (heap != NULL) {
- mem_block_validate(heap);
ut_d(mem_heap_validate(heap));
}
@@ -308,7 +305,6 @@ mem_heap_create_block_func(
block->buf_block = buf_block;
block->free_block = NULL;
- block->magic_n = MEM_BLOCK_MAGIC_N;
ut_d(ut_strlcpy_rev(block->file_name, file_name,
sizeof(block->file_name)));
ut_d(block->line = line);
@@ -356,8 +352,6 @@ mem_heap_add_block(
mem_block_t* new_block;
ulint new_size;
- ut_d(mem_block_validate(heap));
-
block = UT_LIST_GET_LAST(heap->base);
/* We have to allocate a new block. The size is always at least
@@ -410,8 +404,6 @@ mem_heap_block_free(
buf_block = static_cast<buf_block_t*>(block->buf_block);
- mem_block_validate(block);
-
UT_LIST_REMOVE(heap->base, block);
ut_ad(heap->total_size >= block->len);
@@ -419,7 +411,6 @@ mem_heap_block_free(
type = heap->type;
len = block->len;
- block->magic_n = MEM_FREED_BLOCK_MAGIC_N;
if (type == MEM_HEAP_DYNAMIC || len < srv_page_size / 2) {
ut_ad(!buf_block);
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index bcc877d3d1f..2a239ca3f23 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2015, 2019, MariaDB Corporation.
+Copyright (c) 2015, 2020, 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
@@ -3132,6 +3132,16 @@ row_discard_tablespace_for_mysql(
} else {
ut_ad(!table->n_foreign_key_checks_running);
+ bool fts_exist = (dict_table_has_fts_index(table)
+ || DICT_TF2_FLAG_IS_SET(
+ table, DICT_TF2_FTS_HAS_DOC_ID));
+
+ if (fts_exist) {
+ row_mysql_unlock_data_dictionary(trx);
+ fts_optimize_remove_table(table);
+ row_mysql_lock_data_dictionary(trx);
+ }
+
/* Do foreign key constraint checks. */
err = row_discard_tablespace_foreign_key_checks(trx, table);
@@ -3145,6 +3155,10 @@ row_discard_tablespace_for_mysql(
dropping all indexes of the table. */
err = row_discard_tablespace(trx, table);
}
+
+ if (fts_exist && err != DB_SUCCESS) {
+ fts_optimize_add_table(table);
+ }
}
return(row_discard_tablespace_end(trx, table, err));
@@ -3836,6 +3850,11 @@ funct_exit_all_freed:
trx_commit_for_mysql(trx);
}
+ /* Add the table to fts queue if drop table fails */
+ if (err != DB_SUCCESS && table->fts) {
+ fts_optimize_add_table(table);
+ }
+
row_mysql_unlock_data_dictionary(trx);
}
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index 1852bc5deb6..d7f7e127fea 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -3,7 +3,7 @@
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
-Copyright (c) 2013, 2019, MariaDB Corporation.
+Copyright (c) 2013, 2020, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -480,7 +480,9 @@ current_time % 60 == 0 and no tasks will be performed when
current_time % 5 != 0. */
# define SRV_MASTER_CHECKPOINT_INTERVAL (7)
-# define SRV_MASTER_PURGE_INTERVAL (10)
+#ifdef MEM_PERIODIC_CHECK
+# define SRV_MASTER_MEM_VALIDATE_INTERVAL (13)
+#endif /* MEM_PERIODIC_CHECK */
# define SRV_MASTER_DICT_LRU_INTERVAL (47)
/** Simulate compression failures. */
diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt
index f22f7c1d6b5..088a24f827b 100644
--- a/storage/tokudb/CMakeLists.txt
+++ b/storage/tokudb/CMakeLists.txt
@@ -168,3 +168,5 @@ TARGET_LINK_LIBRARIES(tokudb tokufractaltree_static tokuportability_static
SET(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -flto -fuse-linker-plugin")
SET(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO} -flto -fuse-linker-plugin")
+
+ADD_SUBDIRECTORY(man)
diff --git a/storage/tokudb/man/CMakeLists.txt b/storage/tokudb/man/CMakeLists.txt
new file mode 100644
index 00000000000..192d8117119
--- /dev/null
+++ b/storage/tokudb/man/CMakeLists.txt
@@ -0,0 +1,2 @@
+SET(MAN1_TOKUDB tokuftdump.1 tokuft_logprint.1)
+INSTALL(FILES ${MAN1_TOKUDB} DESTINATION ${INSTALL_MANDIR}/man1 COMPONENT tokudb-engine)
diff --git a/storage/tokudb/man/tokuft_logprint.1 b/storage/tokudb/man/tokuft_logprint.1
new file mode 100644
index 00000000000..c97f7e19f69
--- /dev/null
+++ b/storage/tokudb/man/tokuft_logprint.1
@@ -0,0 +1,16 @@
+'\" t
+.\"
+.TH "\FBTOKUFT_LOGPRINT\FR" "1" "28 March 2019" "MariaDB 10\&.4" "MariaDB Database System"
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.SH NAME
+tokuft_logprint \- Dump the log from stdin to stdout
+.SH DESCRIPTION
+Use: Dump the log from stdin to stdout\. Use \fBtokuft_logprint \-\-help\fR for details on usage\.
+.PP
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
diff --git a/storage/tokudb/man/tokuftdump.1 b/storage/tokudb/man/tokuftdump.1
new file mode 100644
index 00000000000..a9c900e0045
--- /dev/null
+++ b/storage/tokudb/man/tokuftdump.1
@@ -0,0 +1,237 @@
+'\" t
+.\"
+.TH "\FBTOKUFTDUMP\FR" "1" "28 March 2019" "MariaDB 10\&.4" "MariaDB Database System"
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.\" tokuftdump
+.\" upgrading MySQL
+.SH "NAME"
+tokuftdump \- look into the fractal tree file
+.SH "SYNOPSIS"
+.HP \w'\fBtokuftdump\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u
+\fBtokuftdump [\fR\fB\fIoptions\fR\fR\fB]\fR
+.SH "DESCRIPTION"
+.PP
+\fBtokuftdump\fR
+Investigates and diagnoses the fractal tree\&.
+.PP
+\fBtokuftdump\fR
+supports the following options for processing option files\&.
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" tokuftdump: interactive option
+.\" interactive option: tokuftdump
+\fB\-\-interactive\fR
+.sp
+Interactive\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" tokuftdump: support option
+.\" support option: tokuftdump
+\fB\-\-support \fI/path/to/fractal-tree/file\fR
+.sp
+An interactive way to see what messages and/or switch between FTs\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" tokuftdump: json option
+.\" json option: tokuftdump
+\fB\-\-json \fI/path/to/fractal-tree/file [output_json_file]\fR
+.sp
+If the output json file is left empty, FT\&.json will be created automatically\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" tokuftdump: nodata option
+.\" nodata option: tokuftdump
+\fB\-\-nodata\fR
+.sp
+Nodata\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" tokuftdump: dumpdata option
+.\" dumpdata option: tokuftdump
+\fB\-\-dumpdata = \fR\fB\fI0|1\fR\fR
+.sp
+Dumpdata\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" tokuftdump: header option
+.\" header option: tokuftdump
+\fB\-\-header\fR
+.sp
+Header\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" tokuftdump: rootnode option
+.\" rootnode option: tokuftdump
+\fB\-\-rootnode\fR
+.sp
+Rootnode\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" tokuftdump: node option
+.\" node option: tokuftdump
+\fB\-\-node \fIN\fR
+.sp
+Node\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" tokuftdump: fragmentation option
+.\" fragmentation option: tokuftdump
+\fB\-\-fragmentation\fR
+.sp
+Fragmentation\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" tokuftdump: garbage option
+.\" garbage option: tokuftdump
+\fB\-\-garbage\fR
+.sp
+Garbage\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" tokuftdump: tsv option
+.\" tsv option: tokuftdump
+\fB\-\-tsv\fR
+.sp
+TSV\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" tokuftdump: translation-table option
+.\" translation-table option: tokuftdump
+\fB\-\-translation\-table\fR
+.sp
+Translation table\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" tokuftdump: summary option
+.\" summary option: tokuftdump
+\fB\-\-summary\fR
+.sp
+Provide summary info\&.
+.RE
+.SH "COPYRIGHT"
+.br
+.PP
+Copyright 2016 MariaDB Foundation
+.PP
+This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
+.PP
+This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+.PP
+You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA or see http://www.gnu.org/licenses/.
+.sp
+.SH "SEE ALSO"
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
+.SH AUTHOR
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_5_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_5_tokudb.result
index 03ef0ed2c09..2e31fc57dd4 100644
--- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_5_tokudb.result
+++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_5_tokudb.result
@@ -10,8 +10,8 @@ current_user()
test1@localhost
SHOW GRANTS FOR CURRENT_USER;
Grants for test1@localhost
-GRANT USAGE ON *.* TO 'test1'@'localhost'
-GRANT SELECT, INSERT, CREATE, DROP ON `test`.* TO 'test1'@'localhost'
+GRANT USAGE ON *.* TO `test1`@`localhost`
+GRANT SELECT, INSERT, CREATE, DROP ON `test`.* TO `test1`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: ALTER command denied to user 'test1'@'localhost' for table 'tp'
disconnect test1;
@@ -22,8 +22,8 @@ current_user()
test2@localhost
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
-GRANT USAGE ON *.* TO 'test2'@'localhost'
-GRANT SELECT, INSERT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO 'test2'@'localhost'
+GRANT USAGE ON *.* TO `test2`@`localhost`
+GRANT SELECT, INSERT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO `test2`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
SELECT * FROM t_10;
a b
@@ -80,8 +80,8 @@ current_user()
test2@localhost
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
-GRANT USAGE ON *.* TO 'test2'@'localhost'
-GRANT SELECT, INSERT, UPDATE, CREATE, DROP ON `test`.* TO 'test2'@'localhost'
+GRANT USAGE ON *.* TO `test2`@`localhost`
+GRANT SELECT, INSERT, UPDATE, CREATE, DROP ON `test`.* TO `test2`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: ALTER command denied to user 'test2'@'localhost' for table 'tp'
SELECT * FROM tp WHERE a BETWEEN 0 AND 10;