diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index b6c7d7cb7a1..d4bc05311f9 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -1114,9 +1114,9 @@ static MYSQL_THDVAR_ULONG(parallel_read_threads, PLUGIN_VAR_RQCMDARG, static MYSQL_THDVAR_ULONG(ddl_buffer_size, PLUGIN_VAR_RQCMDARG, "Maximum size of memory to use (in bytes) for DDL.", - nullptr, nullptr, 1048576, /* Default. */ - 65536, /* Minimum. */ - 4294967295, 0); /* Maximum. */ + nullptr, nullptr, 3 * 1048576, /* Default. */ + 65536, /* Minimum. */ + 4294967295, 0); /* Maximum. */ static MYSQL_THDVAR_ULONG(ddl_threads, PLUGIN_VAR_RQCMDARG, "Maximum number of threads to use for DDL.", nullptr, diff --git a/storage/innobase/include/ddl0impl-buffer.h b/storage/innobase/include/ddl0impl-buffer.h index ab8e2fe19b2..c8561eb317b 100644 --- a/storage/innobase/include/ddl0impl-buffer.h +++ b/storage/innobase/include/ddl0impl-buffer.h @@ -109,12 +109,10 @@ struct Key_sort_buffer : private ut::Non_copyable { @param[in] n Number of bytes to check. @return true if n bytes will fit in the buffer. */ bool will_fit(size_t n) const noexcept { - /* Reserve one byte for the end marker and adjust for meta-data overhead. */ - return m_total_size + n + - (sizeof(std::remove_pointer< - decltype(m_dtuples)::value_type>::type) * - (m_n_tuples + 1)) <= - m_buffer_size - 1; + /* Reserve one byte for the end marker and adjust for meta-data overhead. + In order to fully utilize Buffer, the memory consumption of 'dfield_t' + objects is not considered */ + return m_total_size + n <= m_buffer_size - 1; } /** Deep copy the field data starting from the back.