summaryrefslogtreecommitdiff
path: root/storage/mroonga
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-09-07 22:15:06 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-09-07 22:15:06 +0300
commit5a1868b58d26b286b6ad433096e7184895953311 (patch)
tree9cee54b5852a4e33897d4fdf22c8c85619d12662 /storage/mroonga
parent4901f31c13f91e130f077f2f77b32c40b0036e32 (diff)
parent980d1bf1a921a270423ab36bd5d1ce2a1cd7590b (diff)
downloadmariadb-git-5a1868b58d26b286b6ad433096e7184895953311.tar.gz
MDEV-13564 Mariabackup does not work with TRUNCATE
This is a merge from 10.2, but the 10.2 version of this will not be pushed into 10.2 yet, because the 10.2 version would include backports of MDEV-14717 and MDEV-14585, which would introduce a crash recovery regression: Tables could be lost on table-rebuilding DDL operations, such as ALTER TABLE, OPTIMIZE TABLE or this new backup-friendly TRUNCATE TABLE. The test innodb.truncate_crash occasionally loses the table due to the following bug: MDEV-17158 log_write_up_to() sometimes fails
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 55c6b5d330e..624232f0130 100644
--- a/storage/mroonga/ha_mroonga.cpp
+++ b/storage/mroonga/ha_mroonga.cpp
@@ -12874,13 +12874,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();
}