Skip to content

Commit 335bfb3

Browse files
committed
Tests: view.test combinations
1 parent 7ebd12e commit 335bfb3

File tree

3 files changed

+28
-24
lines changed

3 files changed

+28
-24
lines changed

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

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ prepare stmt from concat(a, b, c);
7373
execute stmt;
7474
deallocate prepare stmt;
7575
end~~
76-
create or replace table t1 (x int) with system versioning engine innodb;
76+
create or replace table t1 (x int) with system versioning;
7777
insert into t1 values (1);
7878
select now(6) into @t1;
7979
update t1 set x= 2;
@@ -98,7 +98,7 @@ x
9898
create or replace view vt1 as select * from t1;
9999
show create view vt1;
100100
View Create View character_set_client collation_connection
101-
vt1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vt1` AS select `t1`.`x` AS `x`,`t1`.`sys_trx_start` AS `sys_trx_start`,`t1`.`sys_trx_end` AS `sys_trx_end` from `t1` FOR SYSTEM_TIME ALL where `t1`.`sys_trx_end` = 18446744073709551615latin1 latin1_swedish_ci
101+
vt1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vt1` AS select `t1`.`x` AS `x`,`t1`.`sys_trx_start` AS `sys_trx_start`,`t1`.`sys_trx_end` AS `sys_trx_end` from `t1` FOR SYSTEM_TIME ALL where `t1`.`sys_trx_end` = MAX_RESULTlatin1 latin1_swedish_ci
102102
drop view vt1;
103103
drop view vt2;
104104
create view vt1 as select * from t1 for system_time all;
@@ -173,9 +173,12 @@ x
173173
# VIEW with parameters [#151]
174174
create or replace table t1 (x int) with system versioning;
175175
create or replace view vt1(c) as select x from t1;
176+
show create view vt1;
177+
View Create View character_set_client collation_connection
178+
vt1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vt1` AS select `t1`.`x` AS `c`,`t1`.`sys_trx_start` AS `sys_trx_start`,`t1`.`sys_trx_end` AS `sys_trx_end` from `t1` FOR SYSTEM_TIME ALL where `t1`.`sys_trx_end` = MAX_RESULT latin1 latin1_swedish_ci
176179
# VIEW over JOIN of versioned tables [#153]
177-
create or replace table t1 (a int) with system versioning engine innodb;
178-
create or replace table t2 (b int) with system versioning engine innodb;
180+
create or replace table t1 (a int) with system versioning;
181+
create or replace table t2 (b int) with system versioning;
179182
insert into t1 values (1);
180183
insert into t2 values (2);
181184
create or replace view vt12 as select * from t1 cross join t2;
@@ -194,28 +197,21 @@ create or replace table t3 (x int);
194197
create or replace view vt1 as select * from t1, t2, t3;
195198
show create view vt1;
196199
View Create View character_set_client collation_connection
197-
vt1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vt1` AS select `t1`.`a` AS `a`,`t2`.`b` AS `b`,`t3`.`x` AS `x`,`t1`.`sys_trx_start` AS `sys_trx_start`,`t1`.`sys_trx_end` AS `sys_trx_end` from ((`t1` FOR SYSTEM_TIME ALL join `t2` FOR SYSTEM_TIME ALL) join `t3`) where `t1`.`sys_trx_end` = 18446744073709551615 and `t2`.`sys_trx_end` = 18446744073709551615latin1 latin1_swedish_ci
200+
vt1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vt1` AS select `t1`.`a` AS `a`,`t2`.`b` AS `b`,`t3`.`x` AS `x`,`t1`.`sys_trx_start` AS `sys_trx_start`,`t1`.`sys_trx_end` AS `sys_trx_end` from ((`t1` FOR SYSTEM_TIME ALL join `t2` FOR SYSTEM_TIME ALL) join `t3`) where `t1`.`sys_trx_end` = MAX_RESULT and `t2`.`sys_trx_end` = MAX_RESULTlatin1 latin1_swedish_ci
198201
create or replace view vt1 as select * from t3, t2, t1;
199202
show create view vt1;
200203
View Create View character_set_client collation_connection
201-
vt1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vt1` AS select `t3`.`x` AS `x`,`t2`.`b` AS `b`,`t1`.`a` AS `a`,`t2`.`sys_trx_start` AS `sys_trx_start`,`t2`.`sys_trx_end` AS `sys_trx_end` from ((`t3` join `t2` FOR SYSTEM_TIME ALL) join `t1` FOR SYSTEM_TIME ALL) where `t2`.`sys_trx_end` = 18446744073709551615 and `t1`.`sys_trx_end` = 18446744073709551615latin1 latin1_swedish_ci
204+
vt1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vt1` AS select `t3`.`x` AS `x`,`t2`.`b` AS `b`,`t1`.`a` AS `a`,`t2`.`sys_trx_start` AS `sys_trx_start`,`t2`.`sys_trx_end` AS `sys_trx_end` from ((`t3` join `t2` FOR SYSTEM_TIME ALL) join `t1` FOR SYSTEM_TIME ALL) where `t2`.`sys_trx_end` = MAX_RESULT and `t1`.`sys_trx_end` = MAX_RESULTlatin1 latin1_swedish_ci
202205
create or replace view vt1 as select a, t2.sys_trx_end as endo from t3, t1, t2;
203206
show create view vt1;
204207
View Create View character_set_client collation_connection
205-
vt1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vt1` AS select `t1`.`a` AS `a`,`t2`.`sys_trx_end` AS `endo`,`t2`.`sys_trx_start` AS `sys_trx_start` from ((`t3` join `t1` FOR SYSTEM_TIME ALL) join `t2` FOR SYSTEM_TIME ALL) where `t1`.`sys_trx_end` = 18446744073709551615 and `t2`.`sys_trx_end` = 18446744073709551615latin1 latin1_swedish_ci
208+
vt1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vt1` AS select `t1`.`a` AS `a`,`t2`.`sys_trx_end` AS `endo`,`t2`.`sys_trx_start` AS `sys_trx_start` from ((`t3` join `t1` FOR SYSTEM_TIME ALL) join `t2` FOR SYSTEM_TIME ALL) where `t1`.`sys_trx_end` = MAX_RESULT and `t2`.`sys_trx_end` = MAX_RESULTlatin1 latin1_swedish_ci
206209
# VIEW over UNION [#269]
207210
create or replace view vt1 as select * from t1 union select * from t1;
208211
select * from vt1;
209212
a
210213
1
211214
create or replace view vvt1 as select * from t1, t2, vt1;
212215
ERROR HY000: Creating VIEW `vvt1` is prohibited: versioned VIEW `vt1` in query!
213-
drop view vt1, vt12;
214-
drop table t1, t2, t3;
215-
drop procedure verify_vtq;
216-
drop procedure innodb_verify_vtq;
217-
drop function default_engine;
218-
drop function sys_commit_ts;
219-
drop function sys_datatype;
220-
drop procedure concat_exec2;
221-
drop procedure concat_exec3;
216+
drop database test;
217+
create database test;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[innodb]
2+
default-storage-engine=innodb
3+
4+
[myisam]
5+
default-storage-engine=myisam

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
-- source include/have_innodb.inc
21
-- source suite/versioning/common.inc
32

4-
create or replace table t1 (x int) with system versioning engine innodb;
3+
create or replace table t1 (x int) with system versioning;
54
insert into t1 values (1);
65

76
select now(6) into @t1;
@@ -21,6 +20,7 @@ select * from vt2 for system_time all;
2120
select * from t1;
2221

2322
create or replace view vt1 as select * from t1;
23+
--replace_result 18446744073709551615 MAX_RESULT "TIMESTAMP'2038-01-19 03:14:07.999999'" MAX_RESULT
2424
show create view vt1;
2525

2626
drop view vt1;
@@ -63,10 +63,12 @@ select * from vt1 for system_time all;
6363
--echo # VIEW with parameters [#151]
6464
create or replace table t1 (x int) with system versioning;
6565
create or replace view vt1(c) as select x from t1;
66+
--replace_result 18446744073709551615 MAX_RESULT "TIMESTAMP'2038-01-19 03:14:07.999999'" MAX_RESULT
67+
show create view vt1;
6668

6769
--echo # VIEW over JOIN of versioned tables [#153]
68-
create or replace table t1 (a int) with system versioning engine innodb;
69-
create or replace table t2 (b int) with system versioning engine innodb;
70+
create or replace table t1 (a int) with system versioning;
71+
create or replace table t2 (b int) with system versioning;
7072
insert into t1 values (1);
7173
insert into t2 values (2);
7274
create or replace view vt12 as select * from t1 cross join t2;
@@ -82,10 +84,13 @@ create or replace view vt1 as select a, t1.sys_trx_end, t2.sys_trx_end from t1,
8284

8385
create or replace table t3 (x int);
8486
create or replace view vt1 as select * from t1, t2, t3;
87+
--replace_result 18446744073709551615 MAX_RESULT "TIMESTAMP'2038-01-19 03:14:07.999999'" MAX_RESULT
8588
show create view vt1;
8689
create or replace view vt1 as select * from t3, t2, t1;
90+
--replace_result 18446744073709551615 MAX_RESULT "TIMESTAMP'2038-01-19 03:14:07.999999'" MAX_RESULT
8791
show create view vt1;
8892
create or replace view vt1 as select a, t2.sys_trx_end as endo from t3, t1, t2;
93+
--replace_result 18446744073709551615 MAX_RESULT "TIMESTAMP'2038-01-19 03:14:07.999999'" MAX_RESULT
8994
show create view vt1;
9095

9196
--echo # VIEW over UNION [#269]
@@ -95,7 +100,5 @@ select * from vt1;
95100
--error ER_VERS_VIEW_PROHIBITED
96101
create or replace view vvt1 as select * from t1, t2, vt1;
97102

98-
drop view vt1, vt12;
99-
drop table t1, t2, t3;
100-
101-
-- source suite/versioning/common_finish.inc
103+
drop database test;
104+
create database test;

0 commit comments

Comments
 (0)