Description:
Trying to create a tablespace in another engine than Innodb on a debug compiled MySQL Server will cause a DBUG_ASSERT() to fire in store(handlerton *hton, const MYSQL_LEX_CSTRING &sdi, const Tablespace *tablespace) of the file sdi_tablespace.cc. This seems to be caused by the assumption that only Inodb can have tablespaces. If commenting out the first DBUG_ASSERT, you will hit a second DBUG_ASSERT requiring that the hton->sdi_set callback is installed.
diff --git a/sql/dd/impl/sdi_tablespace.cc b/sql/dd/impl/sdi_tablespace.cc
index d731633..28f7418 100644
--- a/sql/dd/impl/sdi_tablespace.cc
+++ b/sql/dd/impl/sdi_tablespace.cc
@@ -216,7 +216,13 @@ bool store(handlerton *hton, const MYSQL_LEX_CSTRING &sdi,
const Tablespace *tablespace)
{
DBUG_ASSERT(hton->db_type == DB_TYPE_INNODB);
+ // ^^^^^^^^^^^^^^
+ // Also other engines support tablespaces
DBUG_ASSERT(hton->sdi_set != nullptr);
+ // ^^^^^^^
+ // If it is a requirement to have the sdi_set callback installed
+ // please check that requirement after handlerton->init(); instead of
+ // at random places in the code
if (!tablespace->se_private_data().exists("id"))
{
How to repeat:
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 1M
UNDO_BUFFER_SIZE = 1M
ENGINE=NDB;
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 1M
ENGINE NDB;
Suggested fix:
Remove the DBUG_ASSERT checking that hton is Innodb.
Remove the DBUG_ASSERT which check that hton->sdi_set callback function is set. If it need to be set, such a check should be done after the handlerton::init() function has been called and produce a proper error message.