summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--storage/tokudb/ha_tokudb.cc4
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/bug-23786.result10
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/bug-23786.test14
3 files changed, 26 insertions, 2 deletions
diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc
index 12d3a5a060a..6c0e24fc82b 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