Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
687c2681
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
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看板
提交
687c2681
编写于
12月 09, 2021
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
code optimization
上级
2f0b5416
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
12 deletion
+9
-12
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+4
-3
src/client/src/tscParseInsert.c
src/client/src/tscParseInsert.c
+5
-9
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
687c2681
...
...
@@ -529,14 +529,15 @@ static FORCE_INLINE int32_t getExtendedRowSize(STableDataBlocks *pBlock) {
return
pBlock
->
rowSize
+
TD_MEM_ROW_DATA_HEAD_SIZE
+
pBlock
->
boundColumnInfo
.
extendedVarLen
;
}
static
FORCE_INLINE
void
checkAndConvertMemRow
(
SMemRow
row
,
int32_t
dataLen
,
int32_t
kvLen
)
{
static
FORCE_INLINE
bool
checkAndConvertMemRow
(
SMemRow
row
,
int32_t
dataLen
,
int32_t
kvLen
)
{
if
(
isDataRow
(
row
))
{
if
(
kvLen
<
(
dataLen
*
KVRatioConvert
))
{
memRowSetConvert
(
row
)
;
return
true
;
}
}
else
if
(
kvLen
>
dataLen
)
{
memRowSetConvert
(
row
)
;
return
true
;
}
return
false
;
}
static
FORCE_INLINE
void
initSMemRow
(
SMemRow
row
,
uint8_t
memRowType
,
STableDataBlocks
*
pBlock
,
int16_t
nBoundCols
)
{
...
...
src/client/src/tscParseInsert.c
浏览文件 @
687c2681
...
...
@@ -553,12 +553,13 @@ int tsParseOneRow(char **str, STableDataBlocks *pDataBlocks, int16_t timePrec, b
if
(
!
isParseBindParam
)
{
// 2. check and set convert flag
bool
isNeedConvertRow
=
false
;
if
(
pBuilder
->
compareStat
==
ROW_COMPARE_NEED
)
{
checkAndConvertMemRow
(
row
,
dataLen
,
kvLen
);
isNeedConvertRow
=
checkAndConvertMemRow
(
row
,
dataLen
,
kvLen
);
}
// 3. set the null value for the columns that do not assign values
if
((
spd
->
numOfBound
<
spd
->
numOfCols
)
&&
isDataRow
(
row
)
&&
!
isNeedConvertRow
(
row
)
)
{
if
((
spd
->
numOfBound
<
spd
->
numOfCols
)
&&
isDataRow
(
row
)
&&
!
isNeedConvertRow
)
{
SDataRow
dataRow
=
memRowDataBody
(
row
);
for
(
int32_t
i
=
0
;
i
<
spd
->
numOfCols
;
++
i
)
{
if
(
spd
->
cols
[
i
].
valStat
==
VAL_STAT_NONE
)
{
...
...
@@ -568,14 +569,13 @@ int tsParseOneRow(char **str, STableDataBlocks *pDataBlocks, int16_t timePrec, b
}
// 4. perform the convert
if
(
isNeedConvertRow
(
row
))
{
if
(
isNeedConvertRow
)
{
// put converted row to next location to minimize the memcpy
convertSMemRow
(
row
+
rowSize
,
row
,
pDataBlocks
);
*
isConverted
=
true
;
}
}
// *len = getExtendedRowSize(pDataBlocks);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -652,8 +652,6 @@ int32_t tsParseValues(char **str, STableDataBlocks *pDataBlock, int maxRows, SIn
maxRows
=
tSize
;
}
// int32_t len = 0;
code
=
tsParseOneRow
(
str
,
pDataBlock
,
precision
,
&
isConverted
,
extendedRowSize
,
tmpTokenBuf
,
pInsertParam
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
// error message has been set in tsParseOneRow, return directly
return
TSDB_CODE_TSC_SQL_SYNTAX_ERROR
;
...
...
@@ -1761,8 +1759,6 @@ static void parseFileSendDataBlock(void *param, TAOS_RES *tres, int32_t numOfRow
char
*
lineptr
=
line
;
strtolower
(
line
,
line
);
// int32_t len = 0;
code
=
tsParseOneRow
(
&
lineptr
,
pTableDataBlock
,
tinfo
.
precision
,
&
isConverted
,
extendedRowSize
,
tokenBuf
,
pInsertParam
);
if
(
code
!=
TSDB_CODE_SUCCESS
||
pTableDataBlock
->
numOfParams
>
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录