summaryrefslogtreecommitdiff
path: root/storage/mroonga
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-09-25 17:29:43 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-09-25 17:29:43 +0300
commit304857764b7a79740644f533968f9aa6d4285798 (patch)
treea31b29165c21fba259c23a89bf290a0c1af963d3 /storage/mroonga
parentd913f6611cb8d42d551f65a0940b478662ed58df (diff)
parentfc34e4c067ff6c043ff15a2b7ddd4bb0e2c1ca13 (diff)
downloadmariadb-git-304857764b7a79740644f533968f9aa6d4285798.tar.gz
MDEV-13564 Mariabackup does not work with TRUNCATE
Implement undo tablespace truncation via normal redo logging. Implement TRUNCATE TABLE as a combination of RENAME to #sql-ib name, CREATE, and DROP.
Diffstat (limited to 'storage/mroonga')
-rw-r--r--storage/mroonga/ha_mroonga.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/storage/mroonga/ha_mroonga.cpp b/storage/mroonga/ha_mroonga.cpp
index c03f1258bb8..7737c2af6fc 100644
--- a/storage/mroonga/ha_mroonga.cpp
+++ b/storage/mroonga/ha_mroonga.cpp
@@ -12859,13 +12859,22 @@ int ha_mroonga::delete_all_rows()
int ha_mroonga::wrapper_truncate()
{
int error = 0;
+ MRN_SHARE *tmp_share;
MRN_DBUG_ENTER_METHOD();
+
+ if (!(tmp_share = mrn_get_share(table->s->table_name.str, table, &error)))
+ DBUG_RETURN(error);
+
MRN_SET_WRAP_SHARE_KEY(share, table->s);
MRN_SET_WRAP_TABLE_KEY(this, table);
- error = wrap_handler->ha_truncate();
+ error = parse_engine_table_options(ha_thd(), tmp_share->hton, table->s)
+ ? MRN_GET_ERROR_NUMBER
+ : wrap_handler->ha_truncate();
MRN_SET_BASE_SHARE_KEY(share, table->s);
MRN_SET_BASE_TABLE_KEY(this, table);
+ mrn_free_share(tmp_share);
+
if (!error && wrapper_have_target_index()) {
error = wrapper_truncate_index();
}