oceanbase

Форк
0
63 строки · 1.1 Кб
1
--disable_query_log
2
set @@session.explicit_defaults_for_timestamp=off;
3
--enable_query_log
4

5
#owner: linlin.xll
6
#owner group: SQL1
7
#description: OUR GOAL: Make all this simple and effective!
8
#tags: trx
9

10
--disable_warnings
11
drop table if exists t2;
12
--enable_warnings
13
--disable_warnings
14
drop table if exists t3;
15
--enable_warnings
16

17
create table t2 (i int primary key, j int);
18
insert into t2 values (1,1);
19
set autocommit = 1;
20
insert into t2 values (2,2);
21
commit;
22
rollback;
23
select * from t2;
24

25
set autocommit = 0;
26
insert into t2 values (3,3);
27
rollback;
28
insert into t2 values (3,3);
29
commit;
30
--error 1062
31
insert into t2 values (3,3);
32
rollback;
33
commit;
34

35

36
set autocommit = 0;
37
insert into t2 values (4,4);
38
create table t3 (i int primary key, j int);
39
select * from t2;
40
rollback;
41
select * from t2;
42

43
# 测试ac从0变成1时的自动提交
44
set autocommit = 0;
45
insert into t2 values (5,5);
46
set autocommit = 1;
47
rollback;
48
select * from t2;
49

50
# 测试ac=0时调用begin的自动提交
51
set autocommit = 0;
52
insert into t2 values (6,6);
53
begin;
54
rollback;
55
select * from t2;
56

57

58
--disable_warnings
59
drop table if exists t2;
60
--enable_warnings
61
--disable_warnings
62
drop table if exists t3;
63
--enable_warnings
64

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.