Skip to content

Commit 45e1c9b

Browse files
committed
cleanup: remove a pretty formatting function from a test
1 parent 9fa715b commit 45e1c9b

File tree

2 files changed

+16
-25
lines changed

2 files changed

+16
-25
lines changed

mysql-test/suite/versioning/r/trx_id.result

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ period for system_time (sys_trx_start, sys_trx_end)
66
) with system versioning engine innodb;
77
insert into t1 (x) values (1);
88
# ALTER ADD SYSTEM VERSIONING should write to mysql.transaction_registry
9-
create function check_result (cond boolean)
10-
returns char(50) deterministic
11-
return if(cond = 1, '[CORRECT]', '[INCORRECT]');
129
set @@system_versioning_alter_history=keep;
1310
create or replace table t1 (x int) engine innodb;
1411
insert into t1 values (1);
@@ -19,9 +16,9 @@ add period for system_time(s, e),
1916
add system versioning,
2017
algorithm=inplace;
2118
select s from t1 into @trx_start;
22-
select check_result(count(*) = 1) from mysql.transaction_registry where transaction_id = @trx_start;
23-
check_result(count(*) = 1)
24-
[CORRECT]
19+
select count(*) = 1 from mysql.transaction_registry where transaction_id = @trx_start;
20+
count(*) = 1
21+
1
2522
create or replace table t1 (x int) engine innodb;
2623
select count(*) from mysql.transaction_registry into @tmp;
2724
alter table t1
@@ -30,9 +27,9 @@ add column e bigint unsigned as row end,
3027
add period for system_time(s, e),
3128
add system versioning,
3229
algorithm=inplace;
33-
select check_result(count(*) = @tmp) from mysql.transaction_registry;
34-
check_result(count(*) = @tmp)
35-
[CORRECT]
30+
select count(*) = @tmp from mysql.transaction_registry;
31+
count(*) = @tmp
32+
1
3633
create or replace table t1 (x int) engine innodb;
3734
insert into t1 values (1);
3835
alter table t1
@@ -42,9 +39,9 @@ add period for system_time(s, e),
4239
add system versioning,
4340
algorithm=copy;
4441
select s from t1 into @trx_start;
45-
select check_result(count(*) = 1) from mysql.transaction_registry where transaction_id = @trx_start;
46-
check_result(count(*) = 1)
47-
[CORRECT]
42+
select count(*) = 1 from mysql.transaction_registry where transaction_id = @trx_start;
43+
count(*) = 1
44+
1
4845
create or replace table t1 (x int) engine innodb;
4946
select count(*) from mysql.transaction_registry into @tmp;
5047
alter table t1
@@ -53,9 +50,9 @@ add column e bigint unsigned as row end,
5350
add period for system_time(s, e),
5451
add system versioning,
5552
algorithm=copy;
56-
select check_result(count(*) = @tmp + 1) from mysql.transaction_registry;
57-
check_result(count(*) = @tmp + 1)
58-
[CORRECT]
53+
select count(*) = @tmp + 1 from mysql.transaction_registry;
54+
count(*) = @tmp + 1
55+
1
5956
# TRX_ID to TIMESTAMP versioning switch
6057
create or replace table t1 (
6158
x int,
@@ -69,4 +66,3 @@ select row_end = 18446744073709551615 as transaction_based from t1 for system_ti
6966
transaction_based
7067
1
7168
drop table t1;
72-
drop function check_result;

mysql-test/suite/versioning/t/trx_id.test

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ create or replace table t1 (
1111
insert into t1 (x) values (1);
1212

1313
--echo # ALTER ADD SYSTEM VERSIONING should write to mysql.transaction_registry
14-
create function check_result (cond boolean)
15-
returns char(50) deterministic
16-
return if(cond = 1, '[CORRECT]', '[INCORRECT]');
17-
1814
set @@system_versioning_alter_history=keep;
1915

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

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

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

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

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

7470
drop table t1;
75-
drop function check_result;

0 commit comments

Comments
 (0)