Commit b0d9dc43 authored by Aleksey Midenkov's avatar Aleksey Midenkov

SQL: system_versioning_transaction_registry default OFF

parent db13dbc7
--system-versioning-hide=implicit
--system-versioning-transaction-registry=1
--plugin-load=versioning
......@@ -284,11 +284,13 @@ rollback to a;
commit;
call verify_vtq;
No A B C D
set global transaction_registry= off;
set global system_versioning_transaction_registry= off;
insert into t2(x) values (1);
insert into t1(x) values (1);
ERROR HY000: Temporal operation requires `mysql.transaction_registry` (@@system_versioning_transaction_registry).
set global transaction_registry= on;
set global system_versioning_transaction_registry= on;
Warnings:
Warning 4145 Transaction-based system versioning is EXPERIMENTAL and is subject to change in future.
create or replace table t1 (
x int,
y int as (x) virtual,
......
select @@system_versioning_transaction_registry;
@@system_versioning_transaction_registry
0
create or replace table t1 (
x int,
sys_trx_start bigint(20) unsigned generated always as row start,
sys_trx_end bigint(20) unsigned generated always as row end,
period for system_time (sys_trx_start, sys_trx_end)
) with system versioning engine innodb;
ERROR HY000: Temporal operation requires `mysql.transaction_registry` (@@system_versioning_transaction_registry).
set global system_versioning_transaction_registry= 1;
Warnings:
Warning 4145 Transaction-based system versioning is EXPERIMENTAL and is subject to change in future.
create or replace table t1 (
x int,
sys_trx_start bigint(20) unsigned generated always as row start,
sys_trx_end bigint(20) unsigned generated always as row end,
period for system_time (sys_trx_start, sys_trx_end)
) with system versioning engine innodb;
insert into t1 (x) values (1);
set global system_versioning_transaction_registry= 0;
insert into t1 (x) values (2);
ERROR HY000: Temporal operation requires `mysql.transaction_registry` (@@system_versioning_transaction_registry).
delete from t1;
ERROR HY000: Temporal operation requires `mysql.transaction_registry` (@@system_versioning_transaction_registry).
update t1 set x= 3;
ERROR HY000: Temporal operation requires `mysql.transaction_registry` (@@system_versioning_transaction_registry).
drop table t1;
......@@ -188,11 +188,11 @@ rollback to a;
commit;
call verify_vtq;
set global transaction_registry= off;
set global system_versioning_transaction_registry= off;
insert into t2(x) values (1);
--error ER_VERS_TRT_IS_DISABLED
insert into t1(x) values (1);
set global transaction_registry= on;
set global system_versioning_transaction_registry= on;
# virtual columns
create or replace table t1 (
......
-- source include/have_innodb.inc
select @@system_versioning_transaction_registry;
--error ER_VERS_TRT_IS_DISABLED
create or replace table t1 (
x int,
sys_trx_start bigint(20) unsigned generated always as row start,
sys_trx_end bigint(20) unsigned generated always as row end,
period for system_time (sys_trx_start, sys_trx_end)
) with system versioning engine innodb;
set global system_versioning_transaction_registry= 1;
create or replace table t1 (
x int,
sys_trx_start bigint(20) unsigned generated always as row start,
sys_trx_end bigint(20) unsigned generated always as row end,
period for system_time (sys_trx_start, sys_trx_end)
) with system versioning engine innodb;
insert into t1 (x) values (1);
set global system_versioning_transaction_registry= 0;
--error ER_VERS_TRT_IS_DISABLED
insert into t1 (x) values (2);
--error ER_VERS_TRT_IS_DISABLED
delete from t1;
--error ER_VERS_TRT_IS_DISABLED
update t1 set x= 3;
drop table t1;
......@@ -7928,3 +7928,6 @@ ER_VERS_DUPLICATE_ROW_START_END
ER_VERS_ALREADY_VERSIONED
eng "Table %`s is already system-versioned"
WARN_VERS_TRT_EXPERIMENTAL
eng "Transaction-based system versioning is EXPERIMENTAL and is subject to change in future."
......@@ -426,14 +426,19 @@ static Sys_var_enum Sys_vers_alter_history(
static bool update_transaction_registry(sys_var *self, THD *thd, enum_var_type type)
{
use_transaction_registry= opt_transaction_registry;
if (use_transaction_registry)
{
push_warning(thd, Sql_condition::WARN_LEVEL_WARN, WARN_VERS_TRT_EXPERIMENTAL,
ER_THD(thd, WARN_VERS_TRT_EXPERIMENTAL));
}
return false;
}
static Sys_var_mybool Sys_transaction_registry(
"transaction_registry",
"Enable or disable update of transaction_registry",
static Sys_var_mybool Sys_vers_transaction_registry(
"system_versioning_transaction_registry",
"Enable or disable update of `mysql`.`transaction_registry`",
GLOBAL_VAR(opt_transaction_registry), CMD_LINE(OPT_ARG),
DEFAULT(TRUE), NO_MUTEX_GUARD, NOT_IN_BINLOG,
DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG,
0, ON_UPDATE(update_transaction_registry));
static Sys_var_ulonglong Sys_binlog_cache_size(
......
......@@ -1499,7 +1499,6 @@ struct TABLE
int update_virtual_field(Field *vf);
int update_virtual_fields(handler *h, enum_vcol_update_mode update_mode);
int update_default_fields(bool update, bool ignore_errors);
void vers_update_fields();
void reset_default_fields();
inline ha_rows stat_records() { return used_stat_records; }
......@@ -1558,6 +1557,7 @@ struct TABLE
ulonglong vers_end_id() const;
int delete_row();
void vers_update_fields();
/** Number of additional fields used in versioned tables */
#define VERSIONING_FIELDS 2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment