replace ts related to ddl with scn.

This commit is contained in:
obdev
2022-11-28 02:21:13 +00:00
committed by ob-robot
parent bbec6aff49
commit 8a4d14122f
539 changed files with 17685 additions and 173434 deletions

View File

@ -1,261 +0,0 @@
SET @@session.transaction_isolation='READ-COMMITTED';
SELECT @@session.transaction_isolation;
@@session.transaction_isolation
READ-COMMITTED
drop table if exists t1;
drop table if exists t2;
create table t1 (c1 int primary key, c2 int);
create table t2 (c1 int primary key, c2 int);
desc t1;
Field Type Null Key Default Extra
c1 int(11) NO PRI NULL
c2 int(11) YES NULL
desc t2;
Field Type Null Key Default Extra
c1 int(11) NO PRI NULL
c2 int(11) YES NULL
insert into t1 values(1,1);
insert into t1 values(2,1);
insert into t2 values(2,1);
select * from t1;
c1 c2
1 1
2 1
select * from t2;
c1 c2
2 1
set autocommit=1;
select /*+read_consistency(weak)+*/ * from t1;
c1 c2
1 1
2 1
select /*+read_consistency(weak)+*/ * from t1 where c1 = 1;
c1 c2
1 1
select /*+read_consistency(weak)+*/ * from t2;
c1 c2
2 1
select /*+read_consistency(weak)+*/ * from t2 where c1 = 2;
c1 c2
2 1
select /*+read_consistency(weak)+*/ * from t1 as l join t1 as r where l.c1 = r.c1;
c1 c2 c1 c2
1 1 1 1
2 1 2 1
select /*+read_consistency(weak)+*/ * from t1 join t2 where t1.c1 = t2.c1;
c1 c2 c1 c2
2 1 2 1
set autocommit=0;
select /*+read_consistency(weak)+*/ * from t1 as l join t1 as r where l.c1 = r.c1;
c1 c2 c1 c2
1 1 1 1
2 1 2 1
select /*+read_consistency(weak)+*/ * from t1 join t2 where t1.c1 = t2.c1;
c1 c2 c1 c2
2 1 2 1
select /*+read_consistency(weak)+*/* from t1;
c1 c2
1 1
2 1
select /*+read_consistency(weak)+*/* from t2;
c1 c2
2 1
commit;
begin;
insert into t1 values(3, 1);
insert into t2 values(3, 1);
select /*+read_consistency(weak)+*/* from t1;
c1 c2
1 1
2 1
3 1
select /*+read_consistency(weak)+*/* from t2;
c1 c2
2 1
3 1
commit;
begin;
select /*+read_consistency(weak)+*/* from t1;
c1 c2
1 1
2 1
3 1
select /*+read_consistency(weak)+*/* from t2;
c1 c2
2 1
3 1
insert into t1 values(4, 1);
ERROR 0A000: different consistency type in one transaction not supported
select * from t1;
c1 c2
1 1
2 1
3 1
insert into t2 values(4, 1);
ERROR 0A000: different consistency type in one transaction not supported
select * from t2;
c1 c2
2 1
3 1
commit;
begin;
select /*+read_consistency(weak)+*/* from t1 for update;
c1 c2
1 1
2 1
3 1
select /*+read_consistency(weak)+*/* from t2;
c1 c2
2 1
3 1
insert into t1 values(5, 1);
select * from t1;
c1 c2
1 1
2 1
3 1
5 1
insert into t2 values(5, 1);
select * from t2;
c1 c2
2 1
3 1
5 1
commit;
begin;
select /*+read_consistency(weak)+*/* from t2;
c1 c2
2 1
3 1
5 1
select /*+read_consistency(weak)+*/* from t1 for update;
ERROR 0A000: different consistency type in one transaction not supported
insert into t1 values(6, 1);
ERROR 0A000: different consistency type in one transaction not supported
select * from t1;
c1 c2
1 1
2 1
3 1
5 1
insert into t2 values(6, 1);
ERROR 0A000: different consistency type in one transaction not supported
select * from t2;
c1 c2
2 1
3 1
5 1
commit;
begin;
select /*+read_consistency(strong)*/* from t1;
c1 c2
1 1
2 1
3 1
5 1
select /*+read_consistency(weak)*/* from t1;
c1 c2
1 1
2 1
3 1
5 1
commit;
begin;
select /*+read_consistency(weak)*/* from t1;
c1 c2
1 1
2 1
3 1
5 1
select * from t1;
c1 c2
1 1
2 1
3 1
5 1
commit;
drop table t1;
set autocommit=1;
create table t1(a int primary key, b int, c int) partition by hash(a) partitions 5;
insert into t1 values(1, 1, 1), (2, 2, 2), (3, 3, 3), (4, 4, 4), (5, 5, 5);
insert into t1 values(6, 6, 6), (7, 7, 7), (8, 8, 8), (9, 9, 9), (10, 10, 10);
select /*+read_consistency(WEAK)*/ * from t1;
a b c
create index i1 on t1(b) local;
select /*+read_consistency(WEAK), index(t1, i1)*/ a, b from t1;
a b
1 1
10 10
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
select /*+read_consistency(WEAK), index(t1, i1)*/ * from t1;
a b c
1 1 1
10 10 10
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
drop index i1 on t1;
create index i1 on t1(b) global;
select /*+read_consistency(WEAK), index(t1, i1)*/ a, b from t1;
a b
1 1
10 10
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
select /*+read_consistency(WEAK), index(t1, i1)*/ * from t1;
a b c
1 1 1
10 10 10
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
drop index i1 on t1;
create index i1 on t1(b) global partition by hash(b) partitions 2;
select /*+read_consistency(WEAK), index(t1, i1)*/ a, b from t1;
a b
1 1
10 10
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
select /*+read_consistency(WEAK), index(t1, i1)*/ * from t1;
a b c
1 1 1
10 10 10
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
drop table t1;