Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
GlimmerBase
DataBaseContest
Commits
e79c10d1
Commit
e79c10d1
authored
9 months ago
by
liam
Browse files
Options
Download
Patches
Plain Diff
comment on the Transaction
parent
8de08679
main
liam_debug
noah_debug
push_branch
zyw
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/rmdb.cpp
+6
-6
src/rmdb.cpp
src/test/insert_test1.sql
+20
-1
src/test/insert_test1.sql
with
26 additions
and
7 deletions
+26
-7
src/rmdb.cpp
+
6
−
6
View file @
e79c10d1
...
...
@@ -116,7 +116,7 @@ void *client_handler(void *sock_fd) {
// 开启事务,初始化系统所需的上下文信息(包括事务对象指针、锁管理器指针、日志管理器指针、存放结果的buffer、记录结果长度的变量)
Context
*
context
=
new
Context
(
lock_manager
.
get
(),
log_manager
.
get
(),
nullptr
,
data_send
,
&
offset
);
SetTransaction
(
&
txn_id
,
context
);
//
SetTransaction(&txn_id, context);
// 用于判断是否已经调用了yy_delete_buffer来删除buf
bool
finish_analyze
=
false
;
...
...
@@ -177,11 +177,11 @@ void *client_handler(void *sock_fd) {
if
(
write
(
fd
,
data_send
,
offset
+
1
)
==
-
1
)
{
break
;
}
// 如果是单挑语句,需要按照一个完整的事务来执行,所以执行完当前语句后,自动提交事务
if
(
context
->
txn_
->
get_txn_mode
()
==
false
)
{
txn_manager
->
commit
(
context
->
txn_
,
context
->
log_mgr_
);
}
//
//
如果是单挑语句,需要按照一个完整的事务来执行,所以执行完当前语句后,自动提交事务
//
if(context->txn_->get_txn_mode() == false)
//
{
//
txn_manager->commit(context->txn_, context->log_mgr_);
//
}
}
// Clear
...
...
This diff is collapsed.
Click to expand it.
src/test/insert_test1.sql
+
20
−
1
View file @
e79c10d1
...
...
@@ -57,4 +57,23 @@ select * from t, d , e;
select
t
.
id
,
t_name
,
d_name
from
t
,
d
where
t
.
id
=
d
.
id
;
select
t
.
id
,
t_name
,
d_name
from
t
join
d
where
t
.
id
=
d
.
id
;
drop
table
t
;
drop
table
d
;
\ No newline at end of file
drop
table
d
;
drop
table
e
;
create
table
t
(
id
int
,
t_name
char
(
3
));
create
table
d
(
d_name
char
(
5
),
id
int
);
create
table
e
(
e_name
char
(
10
),
id
int
);
insert
into
t
values
(
1
,
'aaa'
);
insert
into
t
values
(
2
,
'baa'
);
insert
into
t
values
(
3
,
'bba'
);
insert
into
d
values
(
'12345'
,
1
);
insert
into
d
values
(
'23456'
,
2
);
insert
into
e
values
(
'abcde'
,
1
);
insert
into
e
values
(
'fghijk'
,
2
);
select
*
from
t
,
d
,
e
;
select
t
.
id
,
t_name
,
d_name
from
t
,
d
where
t
.
id
=
d
.
id
;
select
t
.
id
,
t_name
,
d_name
,
e_name
from
t
,
d
,
e
where
t
.
id
=
d
.
id
AND
t
.
id
=
e
.
id
;
drop
table
t
;
drop
table
d
;
drop
table
e
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets