diff --git a/mysql-test/suite/innodb/t/truncate_debug.opt b/mysql-test/suite/innodb/t/truncate_debug.opt new file mode 100644 index 0000000000000000000000000000000000000000..658bd901f4700b22832a72143ee4724d84d762c7 --- /dev/null +++ b/mysql-test/suite/innodb/t/truncate_debug.opt @@ -0,0 +1 @@ +--innodb-safe-truncate=0 diff --git a/mysql-test/suite/innodb/t/truncate_inject.opt b/mysql-test/suite/innodb/t/truncate_inject.opt new file mode 100644 index 0000000000000000000000000000000000000000..658bd901f4700b22832a72143ee4724d84d762c7 --- /dev/null +++ b/mysql-test/suite/innodb/t/truncate_inject.opt @@ -0,0 +1 @@ +--innodb-safe-truncate=0 diff --git a/mysql-test/suite/innodb/t/truncate_purge_debug.opt b/mysql-test/suite/innodb/t/truncate_purge_debug.opt index 8bed7e46166b36fdf5f467da1c6532575078eb52..4cb238c6e539af1acdf91751325c2f5a0245e14f 100644 --- a/mysql-test/suite/innodb/t/truncate_purge_debug.opt +++ b/mysql-test/suite/innodb/t/truncate_purge_debug.opt @@ -1,3 +1,4 @@ --innodb-purge-threads=1 --innodb-purge-batch-size=1 --innodb-stats-persistent=OFF +--innodb-safe-truncate=0 diff --git a/mysql-test/suite/innodb/t/truncate_restart.opt b/mysql-test/suite/innodb/t/truncate_restart.opt new file mode 100644 index 0000000000000000000000000000000000000000..658bd901f4700b22832a72143ee4724d84d762c7 --- /dev/null +++ b/mysql-test/suite/innodb/t/truncate_restart.opt @@ -0,0 +1 @@ +--innodb-safe-truncate=0 diff --git a/mysql-test/suite/innodb_zip/t/wl6501_1.opt b/mysql-test/suite/innodb_zip/t/wl6501_1.opt new file mode 100644 index 0000000000000000000000000000000000000000..658bd901f4700b22832a72143ee4724d84d762c7 --- /dev/null +++ b/mysql-test/suite/innodb_zip/t/wl6501_1.opt @@ -0,0 +1 @@ +--innodb-safe-truncate=0 diff --git a/mysql-test/suite/innodb_zip/t/wl6501_crash_3.opt b/mysql-test/suite/innodb_zip/t/wl6501_crash_3.opt new file mode 100644 index 0000000000000000000000000000000000000000..658bd901f4700b22832a72143ee4724d84d762c7 --- /dev/null +++ b/mysql-test/suite/innodb_zip/t/wl6501_crash_3.opt @@ -0,0 +1 @@ +--innodb-safe-truncate=0 diff --git a/mysql-test/suite/innodb_zip/t/wl6501_crash_4.opt b/mysql-test/suite/innodb_zip/t/wl6501_crash_4.opt new file mode 100644 index 0000000000000000000000000000000000000000..658bd901f4700b22832a72143ee4724d84d762c7 --- /dev/null +++ b/mysql-test/suite/innodb_zip/t/wl6501_crash_4.opt @@ -0,0 +1 @@ +--innodb-safe-truncate=0 diff --git a/mysql-test/suite/innodb_zip/t/wl6501_crash_5.opt b/mysql-test/suite/innodb_zip/t/wl6501_crash_5.opt new file mode 100644 index 0000000000000000000000000000000000000000..658bd901f4700b22832a72143ee4724d84d762c7 --- /dev/null +++ b/mysql-test/suite/innodb_zip/t/wl6501_crash_5.opt @@ -0,0 +1 @@ +--innodb-safe-truncate=0 diff --git a/mysql-test/suite/innodb_zip/t/wl6501_scale_1.opt b/mysql-test/suite/innodb_zip/t/wl6501_scale_1.opt new file mode 100644 index 0000000000000000000000000000000000000000..658bd901f4700b22832a72143ee4724d84d762c7 --- /dev/null +++ b/mysql-test/suite/innodb_zip/t/wl6501_scale_1.opt @@ -0,0 +1 @@ +--innodb-safe-truncate=0 diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index a2b82df3dbcb28c73a367e44e1dd6c98b84d8f06..995f21dccf45a1bd15e8797fd4ffa1a5adc24a58 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -2402,12 +2402,12 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME INNODB_SAFE_TRUNCATE SESSION_VALUE NULL -GLOBAL_VALUE OFF +GLOBAL_VALUE ON GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE OFF +DEFAULT_VALUE ON VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BOOLEAN -VARIABLE_COMMENT Use backup-safe TRUNCATE TABLE and crash-safe RENAME (incompatible with older MariaDB 10.2; OFF by default) +VARIABLE_COMMENT Use backup-safe TRUNCATE TABLE and crash-safe RENAME (incompatible with older MariaDB 10.2; ON by default) NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index e7ec8488d45ffb2e399a8a77432665597c3750f7..84253d88983fa74a616b4d06f599b5f4d5984e9a 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -20696,8 +20696,8 @@ static MYSQL_SYSVAR_BOOL(read_only, srv_read_only_mode, static MYSQL_SYSVAR_BOOL(safe_truncate, srv_safe_truncate, PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY, - "Use backup-safe TRUNCATE TABLE and crash-safe RENAME (incompatible with older MariaDB 10.2; OFF by default)", - NULL, NULL, FALSE); + "Use backup-safe TRUNCATE TABLE and crash-safe RENAME (incompatible with older MariaDB 10.2; ON by default)", + NULL, NULL, TRUE); static MYSQL_SYSVAR_BOOL(cmp_per_index_enabled, srv_cmp_per_index_enabled, PLUGIN_VAR_OPCMDARG,