Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
82317294
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
82317294
编写于
1月 09, 2020
作者:
L
lihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[#1102]
上级
dfb29f75
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
4 deletion
+8
-4
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+1
-0
src/client/src/tscParseInsert.c
src/client/src/tscParseInsert.c
+6
-4
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+1
-0
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
82317294
...
@@ -239,6 +239,7 @@ typedef struct STableDataBlocks {
...
@@ -239,6 +239,7 @@ typedef struct STableDataBlocks {
int32_t
rowSize
;
// row size for current table
int32_t
rowSize
;
// row size for current table
uint32_t
nAllocSize
;
uint32_t
nAllocSize
;
uint32_t
headerSize
;
// header for metadata (submit metadata)
uint32_t
size
;
uint32_t
size
;
/*
/*
...
...
src/client/src/tscParseInsert.c
浏览文件 @
82317294
...
@@ -579,7 +579,8 @@ int32_t tscAllocateMemIfNeed(STableDataBlocks *pDataBlock, int32_t rowSize, int3
...
@@ -579,7 +579,8 @@ int32_t tscAllocateMemIfNeed(STableDataBlocks *pDataBlock, int32_t rowSize, int3
size_t
remain
=
pDataBlock
->
nAllocSize
-
pDataBlock
->
size
;
size_t
remain
=
pDataBlock
->
nAllocSize
-
pDataBlock
->
size
;
const
int
factor
=
5
;
const
int
factor
=
5
;
uint32_t
nAllocSizeOld
=
pDataBlock
->
nAllocSize
;
uint32_t
nAllocSizeOld
=
pDataBlock
->
nAllocSize
;
assert
(
pDataBlock
->
headerSize
>=
0
);
// expand the allocated size
// expand the allocated size
if
(
remain
<
rowSize
*
factor
)
{
if
(
remain
<
rowSize
*
factor
)
{
while
(
remain
<
rowSize
*
factor
)
{
while
(
remain
<
rowSize
*
factor
)
{
...
@@ -595,12 +596,12 @@ int32_t tscAllocateMemIfNeed(STableDataBlocks *pDataBlock, int32_t rowSize, int3
...
@@ -595,12 +596,12 @@ int32_t tscAllocateMemIfNeed(STableDataBlocks *pDataBlock, int32_t rowSize, int3
//assert(false);
//assert(false);
// do nothing
// do nothing
pDataBlock
->
nAllocSize
=
nAllocSizeOld
;
pDataBlock
->
nAllocSize
=
nAllocSizeOld
;
*
numOfRows
=
(
int32_t
)(
pDataBlock
->
nAllocSize
)
/
rowSize
;
*
numOfRows
=
(
int32_t
)(
pDataBlock
->
nAllocSize
-
pDataBlock
->
headerSize
)
/
rowSize
;
return
TSDB_CODE_CLI_OUT_OF_MEMORY
;
return
TSDB_CODE_CLI_OUT_OF_MEMORY
;
}
}
}
}
*
numOfRows
=
(
int32_t
)(
pDataBlock
->
nAllocSize
)
/
rowSize
;
*
numOfRows
=
(
int32_t
)(
pDataBlock
->
nAllocSize
-
pDataBlock
->
headerSize
)
/
rowSize
;
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -908,6 +909,7 @@ static int32_t tscParseSqlForCreateTableOnDemand(char **sqlstr, SSqlObj *pSql) {
...
@@ -908,6 +909,7 @@ static int32_t tscParseSqlForCreateTableOnDemand(char **sqlstr, SSqlObj *pSql) {
createTable
=
true
;
createTable
=
true
;
code
=
tscGetMeterMetaEx
(
pSql
,
pMeterMetaInfo
->
name
,
true
);
code
=
tscGetMeterMetaEx
(
pSql
,
pMeterMetaInfo
->
name
,
true
);
if
(
TSDB_CODE_ACTION_IN_PROGRESS
==
code
)
return
code
;
}
else
{
}
else
{
if
(
cstart
!=
NULL
)
{
if
(
cstart
!=
NULL
)
{
sql
=
cstart
;
sql
=
cstart
;
...
@@ -1015,7 +1017,7 @@ int doParserInsertSql(SSqlObj *pSql, char *str) {
...
@@ -1015,7 +1017,7 @@ int doParserInsertSql(SSqlObj *pSql, char *str) {
tscTrace
(
"async insert and waiting to get meter meta, then continue parse sql from offset: %"
PRId64
,
pos
);
tscTrace
(
"async insert and waiting to get meter meta, then continue parse sql from offset: %"
PRId64
,
pos
);
return
code
;
return
code
;
}
}
tsc
Trace
(
"async insert parse error, code:%d, %s"
,
code
,
tsError
[
code
]);
tsc
Error
(
"async insert parse error, code:%d, %s"
,
code
,
tsError
[
code
]);
pSql
->
asyncTblPos
=
NULL
;
pSql
->
asyncTblPos
=
NULL
;
goto
_error_clean
;
// TODO: should _clean or _error_clean to async flow ????
goto
_error_clean
;
// TODO: should _clean or _error_clean to async flow ????
}
else
{
}
else
{
...
...
src/client/src/tscUtil.c
浏览文件 @
82317294
...
@@ -598,6 +598,7 @@ int32_t tscCreateDataBlock(size_t initialSize, int32_t rowSize, int32_t startOff
...
@@ -598,6 +598,7 @@ int32_t tscCreateDataBlock(size_t initialSize, int32_t rowSize, int32_t startOff
}
}
dataBuf
->
nAllocSize
=
(
uint32_t
)
initialSize
;
dataBuf
->
nAllocSize
=
(
uint32_t
)
initialSize
;
dataBuf
->
headerSize
=
startOffset
;
// the header size will always be the startOffset value, reserved for the subumit block header
dataBuf
->
pData
=
calloc
(
1
,
dataBuf
->
nAllocSize
);
dataBuf
->
pData
=
calloc
(
1
,
dataBuf
->
nAllocSize
);
dataBuf
->
ordered
=
true
;
dataBuf
->
ordered
=
true
;
dataBuf
->
prevTS
=
INT64_MIN
;
dataBuf
->
prevTS
=
INT64_MIN
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录