Skip to content

Commit

Permalink
cleanup: remove a pretty formatting function from a test
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Feb 23, 2018
1 parent 9fa715b commit 45e1c9b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 25 deletions.
28 changes: 12 additions & 16 deletions mysql-test/suite/versioning/r/trx_id.result
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ period for system_time (sys_trx_start, sys_trx_end)
) with system versioning engine innodb;
insert into t1 (x) values (1);
# ALTER ADD SYSTEM VERSIONING should write to mysql.transaction_registry
create function check_result (cond boolean)
returns char(50) deterministic
return if(cond = 1, '[CORRECT]', '[INCORRECT]');
set @@system_versioning_alter_history=keep;
create or replace table t1 (x int) engine innodb;
insert into t1 values (1);
Expand All @@ -19,9 +16,9 @@ add period for system_time(s, e),
add system versioning,
algorithm=inplace;
select s from t1 into @trx_start;
select check_result(count(*) = 1) from mysql.transaction_registry where transaction_id = @trx_start;
check_result(count(*) = 1)
[CORRECT]
select count(*) = 1 from mysql.transaction_registry where transaction_id = @trx_start;
count(*) = 1
1
create or replace table t1 (x int) engine innodb;
select count(*) from mysql.transaction_registry into @tmp;
alter table t1
Expand All @@ -30,9 +27,9 @@ add column e bigint unsigned as row end,
add period for system_time(s, e),
add system versioning,
algorithm=inplace;
select check_result(count(*) = @tmp) from mysql.transaction_registry;
check_result(count(*) = @tmp)
[CORRECT]
select count(*) = @tmp from mysql.transaction_registry;
count(*) = @tmp
1
create or replace table t1 (x int) engine innodb;
insert into t1 values (1);
alter table t1
Expand All @@ -42,9 +39,9 @@ add period for system_time(s, e),
add system versioning,
algorithm=copy;
select s from t1 into @trx_start;
select check_result(count(*) = 1) from mysql.transaction_registry where transaction_id = @trx_start;
check_result(count(*) = 1)
[CORRECT]
select count(*) = 1 from mysql.transaction_registry where transaction_id = @trx_start;
count(*) = 1
1
create or replace table t1 (x int) engine innodb;
select count(*) from mysql.transaction_registry into @tmp;
alter table t1
Expand All @@ -53,9 +50,9 @@ add column e bigint unsigned as row end,
add period for system_time(s, e),
add system versioning,
algorithm=copy;
select check_result(count(*) = @tmp + 1) from mysql.transaction_registry;
check_result(count(*) = @tmp + 1)
[CORRECT]
select count(*) = @tmp + 1 from mysql.transaction_registry;
count(*) = @tmp + 1
1
# TRX_ID to TIMESTAMP versioning switch
create or replace table t1 (
x int,
Expand All @@ -69,4 +66,3 @@ select row_end = 18446744073709551615 as transaction_based from t1 for system_ti
transaction_based
1
drop table t1;
drop function check_result;
13 changes: 4 additions & 9 deletions mysql-test/suite/versioning/t/trx_id.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ create or replace table t1 (
insert into t1 (x) values (1);

--echo # ALTER ADD SYSTEM VERSIONING should write to mysql.transaction_registry
create function check_result (cond boolean)
returns char(50) deterministic
return if(cond = 1, '[CORRECT]', '[INCORRECT]');

set @@system_versioning_alter_history=keep;

create or replace table t1 (x int) engine innodb;
Expand All @@ -26,7 +22,7 @@ alter table t1
add system versioning,
algorithm=inplace;
select s from t1 into @trx_start;
select check_result(count(*) = 1) from mysql.transaction_registry where transaction_id = @trx_start;
select count(*) = 1 from mysql.transaction_registry where transaction_id = @trx_start;

create or replace table t1 (x int) engine innodb;
select count(*) from mysql.transaction_registry into @tmp;
Expand All @@ -36,7 +32,7 @@ alter table t1
add period for system_time(s, e),
add system versioning,
algorithm=inplace;
select check_result(count(*) = @tmp) from mysql.transaction_registry;
select count(*) = @tmp from mysql.transaction_registry;

create or replace table t1 (x int) engine innodb;
insert into t1 values (1);
Expand All @@ -47,7 +43,7 @@ alter table t1
add system versioning,
algorithm=copy;
select s from t1 into @trx_start;
select check_result(count(*) = 1) from mysql.transaction_registry where transaction_id = @trx_start;
select count(*) = 1 from mysql.transaction_registry where transaction_id = @trx_start;

create or replace table t1 (x int) engine innodb;
select count(*) from mysql.transaction_registry into @tmp;
Expand All @@ -58,7 +54,7 @@ alter table t1
add system versioning,
algorithm=copy;
# With MDEV-14511 the transaction will be registered even for empty tables.
select check_result(count(*) = @tmp + 1) from mysql.transaction_registry;
select count(*) = @tmp + 1 from mysql.transaction_registry;

--echo # TRX_ID to TIMESTAMP versioning switch
create or replace table t1 (
Expand All @@ -72,4 +68,3 @@ alter table t1 drop column sys_start, drop column sys_end;
select row_end = 18446744073709551615 as transaction_based from t1 for system_time all;

drop table t1;
drop function check_result;

0 comments on commit 45e1c9b

Please sign in to comment.