Commit e79c10d1 authored by liam's avatar liam
Browse files

comment on the Transaction

No related merge requests found
Showing with 26 additions and 7 deletions
+26 -7
......@@ -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
......
......@@ -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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment