Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
b514f237
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
b514f237
编写于
7月 05, 2021
作者:
sangshuduo
提交者:
GitHub
7月 05, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-5018]<fix>: taosdemo prompt if the batch is too large to insert data. (#6736)
上级
4cc087ec
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
14 deletion
+19
-14
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+19
-14
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
b514f237
...
...
@@ -4830,7 +4830,7 @@ static int64_t generateStbRowData(
dataLen
+=
snprintf
(
pstr
+
dataLen
,
maxLen
-
dataLen
,
"%"
PRId64
","
,
rand_bigint
());
}
else
{
errorPrint
(
"No support data type: %s
\n
"
,
stbInfo
->
columns
[
i
].
dataType
);
errorPrint
(
"No
t
support data type: %s
\n
"
,
stbInfo
->
columns
[
i
].
dataType
);
return
-
1
;
}
}
...
...
@@ -4838,6 +4838,7 @@ static int64_t generateStbRowData(
dataLen
-=
1
;
dataLen
+=
snprintf
(
pstr
+
dataLen
,
maxLen
-
dataLen
,
")"
);
verbosePrint
(
"%s() LN%d, dataLen:%"
PRId64
"
\n
"
,
__func__
,
__LINE__
,
dataLen
);
verbosePrint
(
"%s() LN%d, recBuf:
\n\t
%s
\n
"
,
__func__
,
__LINE__
,
recBuf
);
return
strlen
(
recBuf
);
...
...
@@ -5090,24 +5091,25 @@ static int32_t generateStbDataTail(
}
else
{
tsRand
=
false
;
}
verbosePrint
(
"%s() LN%d batch=%u
\n
"
,
__func__
,
__LINE__
,
batch
);
verbosePrint
(
"%s() LN%d batch=%u buflen=%"
PRId64
"
\n
"
,
__func__
,
__LINE__
,
batch
,
remainderBufLen
);
int32_t
k
=
0
;
for
(
k
=
0
;
k
<
batch
;)
{
char
data
[
MAX_DATA_SIZE
];
memset
(
data
,
0
,
MAX_DATA_SIZE
);
int64_t
retLen
=
0
;
int64_t
lenOfRow
=
0
;
if
(
tsRand
)
{
retLen
=
generateStbRowData
(
superTblInfo
,
data
,
lenOfRow
=
generateStbRowData
(
superTblInfo
,
data
,
startTime
+
getTSRandTail
(
superTblInfo
->
timeStampStep
,
k
,
superTblInfo
->
disorderRatio
,
superTblInfo
->
disorderRange
)
);
}
else
{
retLen
=
getRowDataFromSample
(
lenOfRow
=
getRowDataFromSample
(
data
,
remainderBufLen
<
MAX_DATA_SIZE
?
remainderBufLen
:
MAX_DATA_SIZE
,
startTime
+
superTblInfo
->
timeStampStep
*
k
,
...
...
@@ -5115,14 +5117,14 @@ static int32_t generateStbDataTail(
pSamplePos
);
}
if
(
retLen
>
remainderBufLen
)
{
if
(
lenOfRow
>
remainderBufLen
)
{
break
;
}
pstr
+=
snprintf
(
pstr
,
retLen
+
1
,
"%s"
,
data
);
pstr
+=
snprintf
(
pstr
,
lenOfRow
+
1
,
"%s"
,
data
);
k
++
;
len
+=
retLen
;
remainderBufLen
-=
retLen
;
len
+=
lenOfRow
;
remainderBufLen
-=
lenOfRow
;
verbosePrint
(
"%s() LN%d len=%"
PRIu64
" k=%u
\n
buffer=%s
\n
"
,
__func__
,
__LINE__
,
len
,
k
,
buffer
);
...
...
@@ -5911,11 +5913,14 @@ static void* syncWriteInterlace(threadInfo *pThreadInfo) {
startTs
=
taosGetTimestampMs
();
if
(
recOfBatch
==
0
)
{
errorPrint
(
"[%d] %s() LN%d try inserting records of batch is %d
\n
"
,
pThreadInfo
->
threadID
,
__func__
,
__LINE__
,
recOfBatch
);
errorPrint
(
"%s
\n
"
,
"
\t
Please check if the batch or the buffer length is proper value!
\n
"
);
goto
free_of_interlace
;
errorPrint
(
"[%d] %s() LN%d Failed to insert records of batch %d
\n
"
,
pThreadInfo
->
threadID
,
__func__
,
__LINE__
,
batchPerTbl
);
errorPrint
(
"
\t
If the batch is %d, the length of the SQL to insert a row must be less then %"
PRId64
"
\n
"
,
batchPerTbl
,
maxSqlLen
/
batchPerTbl
);
errorPrint
(
"
\t
Please check if the buffer length(%"
PRId64
") or batch(%d) is set with proper value!
\n
"
,
maxSqlLen
,
batchPerTbl
);
goto
free_of_interlace
;
}
int64_t
affectedRows
=
execInsert
(
pThreadInfo
,
recOfBatch
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录