Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e5885caf
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e5885caf
编写于
1月 21, 2022
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
code optimization
上级
fa4f5297
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
4 addition
and
43 deletion
+4
-43
2.0/src/client/inc/tsclient.h
2.0/src/client/inc/tsclient.h
+2
-13
2.0/src/client/src/tscParseInsert.c
2.0/src/client/src/tscParseInsert.c
+0
-6
source/libs/parser/inc/dataBlockMgt.h
source/libs/parser/inc/dataBlockMgt.h
+2
-14
source/libs/parser/src/dataBlockMgt.c
source/libs/parser/src/dataBlockMgt.c
+0
-6
source/libs/parser/src/insertParser.c
source/libs/parser/src/insertParser.c
+0
-4
未找到文件。
2.0/src/client/inc/tsclient.h
浏览文件 @
e5885caf
...
@@ -125,21 +125,10 @@ typedef struct SParsedDataColInfo {
...
@@ -125,21 +125,10 @@ typedef struct SParsedDataColInfo {
#define IS_DATA_COL_ORDERED(spd) ((spd->orderStatus) == (int8_t)ORDER_STATUS_ORDERED)
#define IS_DATA_COL_ORDERED(spd) ((spd->orderStatus) == (int8_t)ORDER_STATUS_ORDERED)
typedef
struct
{
typedef
struct
{
int32_t
dataLen
;
// len of SDataRow
uint8_t
memRowType
;
// default is 0, that is SDataRow
int32_t
kvLen
;
// len of SKVRow
int32_t
rowSize
;
}
SMemRowInfo
;
typedef
struct
{
uint8_t
memRowType
;
// default is 0, that is SDataRow
uint8_t
compareStat
;
// 0 no need, 1 need compare
int32_t
rowSize
;
SMemRowInfo
*
rowInfo
;
}
SMemRowBuilder
;
}
SMemRowBuilder
;
typedef
enum
{
ROW_COMPARE_NO_NEED
=
0
,
ROW_COMPARE_NEED
=
1
,
}
ERowCompareStat
;
int
tsParseTime
(
SStrToken
*
pToken
,
int64_t
*
time
,
char
**
next
,
char
*
error
,
int16_t
timePrec
);
int
tsParseTime
(
SStrToken
*
pToken
,
int64_t
*
time
,
char
**
next
,
char
*
error
,
int16_t
timePrec
);
int
initMemRowBuilder
(
SMemRowBuilder
*
pBuilder
,
uint32_t
nRows
,
SParsedDataColInfo
*
pColInfo
);
int
initMemRowBuilder
(
SMemRowBuilder
*
pBuilder
,
uint32_t
nRows
,
SParsedDataColInfo
*
pColInfo
);
...
...
2.0/src/client/src/tscParseInsert.c
浏览文件 @
e5885caf
...
@@ -43,12 +43,6 @@ static int32_t parseBoundColumns(SInsertStatementParam *pInsertParam, SParsedDat
...
@@ -43,12 +43,6 @@ static int32_t parseBoundColumns(SInsertStatementParam *pInsertParam, SParsedDat
char
*
str
,
char
**
end
);
char
*
str
,
char
**
end
);
int
initMemRowBuilder
(
SMemRowBuilder
*
pBuilder
,
uint32_t
nRows
,
SParsedDataColInfo
*
pColInfo
)
{
int
initMemRowBuilder
(
SMemRowBuilder
*
pBuilder
,
uint32_t
nRows
,
SParsedDataColInfo
*
pColInfo
)
{
ASSERT
(
nRows
>=
0
&&
pColInfo
->
numOfCols
>
0
&&
(
pColInfo
->
numOfBound
<=
pColInfo
->
numOfCols
));
ASSERT
(
nRows
>=
0
&&
pColInfo
->
numOfCols
>
0
&&
(
pColInfo
->
numOfBound
<=
pColInfo
->
numOfCols
));
if
(
nRows
>
0
)
{
// already init(bind multiple rows by single column)
if
(
pBuilder
->
compareStat
==
ROW_COMPARE_NEED
&&
(
pBuilder
->
rowInfo
!=
NULL
))
{
return
TSDB_CODE_SUCCESS
;
}
}
uint32_t
dataLen
=
TD_MEM_ROW_DATA_HEAD_SIZE
+
pColInfo
->
allNullLen
;
uint32_t
dataLen
=
TD_MEM_ROW_DATA_HEAD_SIZE
+
pColInfo
->
allNullLen
;
uint32_t
kvLen
=
TD_MEM_ROW_KV_HEAD_SIZE
+
pColInfo
->
numOfBound
*
sizeof
(
SColIdx
)
+
pColInfo
->
boundNullLen
;
uint32_t
kvLen
=
TD_MEM_ROW_KV_HEAD_SIZE
+
pColInfo
->
numOfBound
*
sizeof
(
SColIdx
)
+
pColInfo
->
boundNullLen
;
...
...
source/libs/parser/inc/dataBlockMgt.h
浏览文件 @
e5885caf
...
@@ -34,11 +34,6 @@ typedef enum EValStat {
...
@@ -34,11 +34,6 @@ typedef enum EValStat {
VAL_STAT_NONE
=
0x01
,
// 1 means no val
VAL_STAT_NONE
=
0x01
,
// 1 means no val
}
EValStat
;
}
EValStat
;
typedef
enum
ERowCompareStat
{
ROW_COMPARE_NO_NEED
=
0
,
ROW_COMPARE_NEED
=
1
,
}
ERowCompareStat
;
typedef
struct
SBoundColumn
{
typedef
struct
SBoundColumn
{
int32_t
offset
;
// all column offset value
int32_t
offset
;
// all column offset value
int32_t
toffset
;
// first part offset for SDataRow TODO: get offset from STSchema on future
int32_t
toffset
;
// first part offset for SDataRow TODO: get offset from STSchema on future
...
@@ -64,16 +59,9 @@ typedef struct SParsedDataColInfo {
...
@@ -64,16 +59,9 @@ typedef struct SParsedDataColInfo {
int8_t
orderStatus
;
// bound columns
int8_t
orderStatus
;
// bound columns
}
SParsedDataColInfo
;
}
SParsedDataColInfo
;
typedef
struct
SMemRowInfo
{
int32_t
dataLen
;
// len of SDataRow
int32_t
kvLen
;
// len of SKVRow
}
SMemRowInfo
;
typedef
struct
{
typedef
struct
{
uint8_t
memRowType
;
// default is 0, that is SDataRow
uint8_t
memRowType
;
// default is 0, that is SDataRow
uint8_t
compareStat
;
// 0 no need, 1 need compare
int32_t
rowSize
;
int32_t
rowSize
;
SMemRowInfo
*
rowInfo
;
}
SMemRowBuilder
;
}
SMemRowBuilder
;
typedef
struct
STableDataBlocks
{
typedef
struct
STableDataBlocks
{
...
...
source/libs/parser/src/dataBlockMgt.c
浏览文件 @
e5885caf
...
@@ -572,12 +572,6 @@ int32_t allocateMemIfNeed(STableDataBlocks *pDataBlock, int32_t rowSize, int32_t
...
@@ -572,12 +572,6 @@ int32_t allocateMemIfNeed(STableDataBlocks *pDataBlock, int32_t rowSize, int32_t
int
initMemRowBuilder
(
SMemRowBuilder
*
pBuilder
,
uint32_t
nRows
,
SParsedDataColInfo
*
pColInfo
)
{
int
initMemRowBuilder
(
SMemRowBuilder
*
pBuilder
,
uint32_t
nRows
,
SParsedDataColInfo
*
pColInfo
)
{
ASSERT
(
nRows
>=
0
&&
pColInfo
->
numOfCols
>
0
&&
(
pColInfo
->
numOfBound
<=
pColInfo
->
numOfCols
));
ASSERT
(
nRows
>=
0
&&
pColInfo
->
numOfCols
>
0
&&
(
pColInfo
->
numOfBound
<=
pColInfo
->
numOfCols
));
if
(
nRows
>
0
)
{
// already init(bind multiple rows by single column)
if
(
pBuilder
->
compareStat
==
ROW_COMPARE_NEED
&&
(
pBuilder
->
rowInfo
!=
NULL
))
{
return
TSDB_CODE_SUCCESS
;
}
}
uint32_t
dataLen
=
TD_MEM_ROW_DATA_HEAD_SIZE
+
pColInfo
->
allNullLen
;
uint32_t
dataLen
=
TD_MEM_ROW_DATA_HEAD_SIZE
+
pColInfo
->
allNullLen
;
uint32_t
kvLen
=
TD_MEM_ROW_KV_HEAD_SIZE
+
pColInfo
->
numOfBound
*
sizeof
(
SColIdx
)
+
pColInfo
->
boundNullLen
;
uint32_t
kvLen
=
TD_MEM_ROW_KV_HEAD_SIZE
+
pColInfo
->
numOfBound
*
sizeof
(
SColIdx
)
+
pColInfo
->
boundNullLen
;
...
...
source/libs/parser/src/insertParser.c
浏览文件 @
e5885caf
...
@@ -262,9 +262,6 @@ typedef struct SMemParam {
...
@@ -262,9 +262,6 @@ typedef struct SMemParam {
SMemRow
row
;
SMemRow
row
;
SSchema
*
schema
;
SSchema
*
schema
;
int32_t
toffset
;
int32_t
toffset
;
uint8_t
compareStat
;
int32_t
dataLen
;
int32_t
kvLen
;
}
SMemParam
;
}
SMemParam
;
static
FORCE_INLINE
int32_t
MemRowAppend
(
const
void
*
value
,
int32_t
len
,
void
*
param
)
{
static
FORCE_INLINE
int32_t
MemRowAppend
(
const
void
*
value
,
int32_t
len
,
void
*
param
)
{
...
@@ -426,7 +423,6 @@ static int parseOneRow(SInsertParseContext* pCxt, STableDataBlocks* pDataBlocks,
...
@@ -426,7 +423,6 @@ static int parseOneRow(SInsertParseContext* pCxt, STableDataBlocks* pDataBlocks,
NEXT_TOKEN
(
pCxt
->
pSql
,
sToken
);
NEXT_TOKEN
(
pCxt
->
pSql
,
sToken
);
SSchema
*
pSchema
=
&
schema
[
spd
->
boundedColumns
[
i
]
-
1
];
SSchema
*
pSchema
=
&
schema
[
spd
->
boundedColumns
[
i
]
-
1
];
param
.
schema
=
pSchema
;
param
.
schema
=
pSchema
;
param
.
compareStat
=
pBuilder
->
compareStat
;
getMemRowAppendInfo
(
schema
,
pBuilder
->
memRowType
,
spd
,
i
,
&
param
.
toffset
);
getMemRowAppendInfo
(
schema
,
pBuilder
->
memRowType
,
spd
,
i
,
&
param
.
toffset
);
CHECK_CODE
(
parseValueToken
(
&
pCxt
->
pSql
,
&
sToken
,
pSchema
,
timePrec
,
tmpTokenBuf
,
MemRowAppend
,
&
param
,
&
pCxt
->
msg
));
CHECK_CODE
(
parseValueToken
(
&
pCxt
->
pSql
,
&
sToken
,
pSchema
,
timePrec
,
tmpTokenBuf
,
MemRowAppend
,
&
param
,
&
pCxt
->
msg
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录