diff options
author | Rucha Deodhar <rucha.deodhar@mariadb.com> | 2020-12-08 16:05:07 +0530 |
---|---|---|
committer | Rucha Deodhar <rucha.deodhar@mariadb.com> | 2020-12-08 16:05:07 +0530 |
commit | df3e06f194c2306ff55d74776c171dc814d881cf (patch) | |
tree | 0de77cb03de1a0ce6826887037a57bbaccd2a377 | |
parent | 2db6eb142956cd1744cf5c452bca66b20067d73e (diff) | |
download | mariadb-git-bb-10.2-MDEV-23786.tar.gz |
MDEV-23786: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())'bb-10.2-MDEV-23786
failed for TokuDB engine CREATE TABLE
Analysis: Assertion failure happens because the database doesn't exist to
create the table but ha_tokudb::create() still returns false.
So error is not reported.
Fix: Store the error state and report the error.
-rw-r--r-- | storage/tokudb/ha_tokudb.cc | 4 | ||||
-rw-r--r-- | storage/tokudb/mysql-test/tokudb/r/bug-23786.result | 10 | ||||
-rw-r--r-- | storage/tokudb/mysql-test/tokudb/t/bug-23786.test | 14 |
3 files changed, 26 insertions, 2 deletions
diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc index 39bc286a617..66a8ad126cf 100644 --- a/storage/tokudb/ha_tokudb.cc +++ b/storage/tokudb/ha_tokudb.cc @@ -7260,7 +7260,7 @@ int ha_tokudb::create( // in the database directory, so automatic filename-based // discover_table_names() doesn't work either. So, it must force .frm // file to disk. - form->s->write_frm_image(); + error= form->s->write_frm_image(); #endif #if defined(TOKU_INCLUDE_OPTION_STRUCTS) && TOKU_INCLUDE_OPTION_STRUCTS @@ -7292,8 +7292,8 @@ int ha_tokudb::create( #endif // defined(TOKU_INCLUDE_OPTION_STRUCTS) && TOKU_INCLUDE_OPTION_STRUCTS const toku_compression_method compression_method = row_format_to_toku_compression_method(row_format); - bool create_from_engine = (create_info->table_options & HA_OPTION_CREATE_FROM_ENGINE); + if (error) { goto cleanup; } if (create_from_engine) { // table already exists, nothing to do error = 0; diff --git a/storage/tokudb/mysql-test/tokudb/r/bug-23786.result b/storage/tokudb/mysql-test/tokudb/r/bug-23786.result new file mode 100644 index 00000000000..1b21758b85a --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb/r/bug-23786.result @@ -0,0 +1,10 @@ +# +# 10.2 Test +# +# MDEV-23786: Assertion `!is_set() || (m_status == DA_OK_BULK && +# is_bulk_op())'failed for TokuDB engine CREATE TABLE +# +set default_storage_engine='tokudb'; +CREATE TABLE _uppercase.t (a INT) ENGINE=TokuDB; +ERROR 42000: Unknown database '_uppercase' +# End of 10.2 Test diff --git a/storage/tokudb/mysql-test/tokudb/t/bug-23786.test b/storage/tokudb/mysql-test/tokudb/t/bug-23786.test new file mode 100644 index 00000000000..a8a0c4a1577 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb/t/bug-23786.test @@ -0,0 +1,14 @@ +source include/have_tokudb.inc; + +--echo # +--echo # 10.2 Test +--echo # +--echo # MDEV-23786: Assertion `!is_set() || (m_status == DA_OK_BULK && +--echo # is_bulk_op())'failed for TokuDB engine CREATE TABLE +--echo # + +set default_storage_engine='tokudb'; +--error ER_BAD_DB_ERROR +CREATE TABLE _uppercase.t (a INT) ENGINE=TokuDB; + +--echo # End of 10.2 Test |