Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
miniob
提交
7779cc28
M
miniob
项目概览
oceanbase
/
miniob
1 年多 前同步成功
通知
74
Star
1521
Fork
537
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
M
miniob
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
提交
7779cc28
编写于
7月 11, 2022
作者:
羽飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
compiled by gcc
上级
55b614bb
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
9 addition
and
42 deletion
+9
-42
src/observer/sql/stmt/delete_stmt.cpp
src/observer/sql/stmt/delete_stmt.cpp
+1
-1
src/observer/sql/stmt/filter_stmt.cpp
src/observer/sql/stmt/filter_stmt.cpp
+4
-4
src/observer/sql/stmt/filter_stmt.h
src/observer/sql/stmt/filter_stmt.h
+2
-2
src/observer/sql/stmt/select_stmt.cpp
src/observer/sql/stmt/select_stmt.cpp
+1
-1
src/observer/storage/common/record.h
src/observer/storage/common/record.h
+1
-0
src/observer/storage/default/default_storage_stage.cpp
src/observer/storage/default/default_storage_stage.cpp
+0
-34
未找到文件。
src/observer/sql/stmt/delete_stmt.cpp
浏览文件 @
7779cc28
...
...
@@ -46,7 +46,7 @@ RC DeleteStmt::create(Db *db, const Deletes &delete_sql, Stmt *&stmt)
return
RC
::
SCHEMA_TABLE_NOT_EXIST
;
}
std
::
unordered_map
<
std
::
string
_view
,
Table
*>
table_map
;
std
::
unordered_map
<
std
::
string
,
Table
*>
table_map
;
table_map
.
insert
(
std
::
pair
<
std
::
string_view
,
Table
*>
(
std
::
string_view
(
table_name
),
table
));
FilterStmt
*
filter_stmt
=
nullptr
;
...
...
src/observer/sql/stmt/filter_stmt.cpp
浏览文件 @
7779cc28
...
...
@@ -27,7 +27,7 @@ FilterStmt::~FilterStmt()
filter_units_
.
clear
();
}
RC
FilterStmt
::
create
(
Db
*
db
,
Table
*
default_table
,
std
::
unordered_map
<
std
::
string
_view
,
Table
*>
*
tables
,
RC
FilterStmt
::
create
(
Db
*
db
,
Table
*
default_table
,
std
::
unordered_map
<
std
::
string
,
Table
*>
*
tables
,
const
Condition
*
conditions
,
int
condition_num
,
FilterStmt
*&
stmt
)
{
...
...
@@ -50,13 +50,13 @@ RC FilterStmt::create(Db *db, Table *default_table, std::unordered_map<std::stri
return
rc
;
}
RC
get_table_and_field
(
Db
*
db
,
Table
*
default_table
,
std
::
unordered_map
<
std
::
string
_view
,
Table
*>
*
tables
,
RC
get_table_and_field
(
Db
*
db
,
Table
*
default_table
,
std
::
unordered_map
<
std
::
string
,
Table
*>
*
tables
,
const
RelAttr
&
attr
,
Table
*&
table
,
const
FieldMeta
*&
field
)
{
if
(
common
::
is_blank
(
attr
.
relation_name
))
{
table
=
default_table
;
}
else
if
(
nullptr
!=
tables
)
{
auto
iter
=
tables
->
find
(
std
::
string
_view
(
attr
.
relation_name
));
auto
iter
=
tables
->
find
(
std
::
string
(
attr
.
relation_name
));
if
(
iter
!=
tables
->
end
())
{
table
=
iter
->
second
;
}
...
...
@@ -78,7 +78,7 @@ RC get_table_and_field(Db *db, Table *default_table, std::unordered_map<std::str
return
RC
::
SUCCESS
;
}
RC
FilterStmt
::
create_filter_unit
(
Db
*
db
,
Table
*
default_table
,
std
::
unordered_map
<
std
::
string
_view
,
Table
*>
*
tables
,
RC
FilterStmt
::
create_filter_unit
(
Db
*
db
,
Table
*
default_table
,
std
::
unordered_map
<
std
::
string
,
Table
*>
*
tables
,
const
Condition
&
condition
,
FilterUnit
*&
filter_unit
)
{
RC
rc
=
RC
::
SUCCESS
;
...
...
src/observer/sql/stmt/filter_stmt.h
浏览文件 @
7779cc28
...
...
@@ -86,11 +86,11 @@ public:
}
public:
static
RC
create
(
Db
*
db
,
Table
*
default_table
,
std
::
unordered_map
<
std
::
string
_view
,
Table
*>
*
tables
,
static
RC
create
(
Db
*
db
,
Table
*
default_table
,
std
::
unordered_map
<
std
::
string
,
Table
*>
*
tables
,
const
Condition
*
conditions
,
int
condition_num
,
FilterStmt
*&
stmt
);
static
RC
create_filter_unit
(
Db
*
db
,
Table
*
default_table
,
std
::
unordered_map
<
std
::
string
_view
,
Table
*>
*
tables
,
static
RC
create_filter_unit
(
Db
*
db
,
Table
*
default_table
,
std
::
unordered_map
<
std
::
string
,
Table
*>
*
tables
,
const
Condition
&
condition
,
FilterUnit
*&
filter_unit
);
private:
...
...
src/observer/sql/stmt/select_stmt.cpp
浏览文件 @
7779cc28
...
...
@@ -45,7 +45,7 @@ RC SelectStmt::create(Db *db, const Selects &select_sql, Stmt *&stmt)
// collect tables in `from` statement
std
::
vector
<
Table
*>
tables
;
std
::
unordered_map
<
std
::
string
_view
,
Table
*>
table_map
;
std
::
unordered_map
<
std
::
string
,
Table
*>
table_map
;
for
(
int
i
=
0
;
i
<
select_sql
.
relation_num
;
i
++
)
{
const
char
*
table_name
=
select_sql
.
relations
[
i
];
if
(
nullptr
==
table_name
)
{
...
...
src/observer/storage/common/record.h
浏览文件 @
7779cc28
...
...
@@ -16,6 +16,7 @@ See the Mulan PSL v2 for more details. */
#include <stddef.h>
#include <vector>
#include <limits>
#include <sstream>
#include "rc.h"
...
...
src/observer/storage/default/default_storage_stage.cpp
浏览文件 @
7779cc28
...
...
@@ -158,40 +158,6 @@ void DefaultStorageStage::handle_event(StageEvent *event)
char
response
[
256
];
switch
(
sql
->
flag
)
{
case
SCF_INSERT
:
{
// insert into
const
Inserts
&
inserts
=
sql
->
sstr
.
insertion
;
const
char
*
table_name
=
inserts
.
relation_name
;
//rc = handler_->insert_record(current_trx, current_db, table_name, inserts.value_num, inserts.values);
snprintf
(
response
,
sizeof
(
response
),
"%s
\n
"
,
rc
==
RC
::
SUCCESS
?
"SUCCESS"
:
"FAILURE"
);
}
break
;
case
SCF_UPDATE
:
{
const
Updates
&
updates
=
sql
->
sstr
.
update
;
const
char
*
table_name
=
updates
.
relation_name
;
const
char
*
field_name
=
updates
.
attribute_name
;
int
updated_count
=
0
;
#if 0
rc = handler_->update_record(current_trx,
current_db,
table_name,
field_name,
&updates.value,
updates.condition_num,
updates.conditions,
&updated_count);
#endif
snprintf
(
response
,
sizeof
(
response
),
"%s
\n
"
,
rc
==
RC
::
SUCCESS
?
"SUCCESS"
:
"FAILURE"
);
}
break
;
case
SCF_DELETE
:
{
const
Deletes
&
deletes
=
sql
->
sstr
.
deletion
;
const
char
*
table_name
=
deletes
.
relation_name
;
int
deleted_count
=
0
;
#if 0
rc = handler_->delete_record(
current_trx, current_db, table_name, deletes.condition_num, deletes.conditions, &deleted_count);
#endif
snprintf
(
response
,
sizeof
(
response
),
"%s
\n
"
,
rc
==
RC
::
SUCCESS
?
"SUCCESS"
:
"FAILURE"
);
}
break
;
case
SCF_LOAD_DATA
:
{
/*
从文件导入数据,如果做性能测试,需要保持这些代码可以正常工作
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录