Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
139dabf1
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看板
提交
139dabf1
编写于
9月 03, 2020
作者:
B
Bomin Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
td-804: fix infinite SQL parse retry
上级
6d7509c7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
8 deletion
+6
-8
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+1
-0
src/client/src/tscAsync.c
src/client/src/tscAsync.c
+1
-0
src/client/src/tscParseInsert.c
src/client/src/tscParseInsert.c
+4
-8
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
139dabf1
...
@@ -348,6 +348,7 @@ typedef struct SSqlObj {
...
@@ -348,6 +348,7 @@ typedef struct SSqlObj {
void
*
pStream
;
void
*
pStream
;
void
*
pSubscription
;
void
*
pSubscription
;
char
*
sqlstr
;
char
*
sqlstr
;
char
parseRetry
;
char
retry
;
char
retry
;
char
maxRetry
;
char
maxRetry
;
SRpcEpSet
epSet
;
SRpcEpSet
epSet
;
...
...
src/client/src/tscAsync.c
浏览文件 @
139dabf1
...
@@ -43,6 +43,7 @@ void doAsyncQuery(STscObj* pObj, SSqlObj* pSql, void (*fp)(), void* param, const
...
@@ -43,6 +43,7 @@ void doAsyncQuery(STscObj* pObj, SSqlObj* pSql, void (*fp)(), void* param, const
pSql
->
signature
=
pSql
;
pSql
->
signature
=
pSql
;
pSql
->
param
=
param
;
pSql
->
param
=
param
;
pSql
->
pTscObj
=
pObj
;
pSql
->
pTscObj
=
pObj
;
pSql
->
parseRetry
=
0
;
pSql
->
maxRetry
=
TSDB_MAX_REPLICA
;
pSql
->
maxRetry
=
TSDB_MAX_REPLICA
;
pSql
->
fp
=
fp
;
pSql
->
fp
=
fp
;
pSql
->
fetchFp
=
fp
;
pSql
->
fetchFp
=
fp
;
...
...
src/client/src/tscParseInsert.c
浏览文件 @
139dabf1
...
@@ -1335,13 +1335,13 @@ int tsParseSql(SSqlObj *pSql, bool initial) {
...
@@ -1335,13 +1335,13 @@ int tsParseSql(SSqlObj *pSql, bool initial) {
// make a backup as tsParseInsertSql may modify the string
// make a backup as tsParseInsertSql may modify the string
char
*
sqlstr
=
strdup
(
pSql
->
sqlstr
);
char
*
sqlstr
=
strdup
(
pSql
->
sqlstr
);
ret
=
tsParseInsertSql
(
pSql
);
ret
=
tsParseInsertSql
(
pSql
);
if
(
sqlstr
==
NULL
||
pSql
->
r
etry
>=
1
||
ret
!=
TSDB_CODE_TSC_INVALID_SQL
)
{
if
(
sqlstr
==
NULL
||
pSql
->
parseR
etry
>=
1
||
ret
!=
TSDB_CODE_TSC_INVALID_SQL
)
{
free
(
sqlstr
);
free
(
sqlstr
);
}
else
{
}
else
{
tscResetSqlCmdObj
(
pCmd
,
true
);
tscResetSqlCmdObj
(
pCmd
,
true
);
free
(
pSql
->
sqlstr
);
free
(
pSql
->
sqlstr
);
pSql
->
sqlstr
=
sqlstr
;
pSql
->
sqlstr
=
sqlstr
;
pSql
->
r
etry
++
;
pSql
->
parseR
etry
++
;
if
((
ret
=
tsInsertInitialCheck
(
pSql
))
==
TSDB_CODE_SUCCESS
)
{
if
((
ret
=
tsInsertInitialCheck
(
pSql
))
==
TSDB_CODE_SUCCESS
)
{
ret
=
tsParseInsertSql
(
pSql
);
ret
=
tsParseInsertSql
(
pSql
);
}
}
...
@@ -1349,18 +1349,14 @@ int tsParseSql(SSqlObj *pSql, bool initial) {
...
@@ -1349,18 +1349,14 @@ int tsParseSql(SSqlObj *pSql, bool initial) {
}
else
{
}
else
{
SSqlInfo
SQLInfo
=
qSQLParse
(
pSql
->
sqlstr
);
SSqlInfo
SQLInfo
=
qSQLParse
(
pSql
->
sqlstr
);
ret
=
tscToSQLCmd
(
pSql
,
&
SQLInfo
);
ret
=
tscToSQLCmd
(
pSql
,
&
SQLInfo
);
if
(
ret
==
TSDB_CODE_TSC_INVALID_SQL
&&
pSql
->
r
etry
==
0
&&
SQLInfo
.
type
==
TSDB_SQL_NULL
)
{
if
(
ret
==
TSDB_CODE_TSC_INVALID_SQL
&&
pSql
->
parseR
etry
==
0
&&
SQLInfo
.
type
==
TSDB_SQL_NULL
)
{
tscResetSqlCmdObj
(
pCmd
,
true
);
tscResetSqlCmdObj
(
pCmd
,
true
);
pSql
->
r
etry
++
;
pSql
->
parseR
etry
++
;
ret
=
tscToSQLCmd
(
pSql
,
&
SQLInfo
);
ret
=
tscToSQLCmd
(
pSql
,
&
SQLInfo
);
}
}
SQLInfoDestroy
(
&
SQLInfo
);
SQLInfoDestroy
(
&
SQLInfo
);
}
}
if
(
ret
==
TSDB_CODE_SUCCESS
)
{
pSql
->
retry
=
0
;
}
/*
/*
* the pRes->code may be modified or released by another thread in tscTableMetaCallBack function,
* the pRes->code may be modified or released by another thread in tscTableMetaCallBack function,
* so do NOT use pRes->code to determine if the getTableMeta function
* so do NOT use pRes->code to determine if the getTableMeta function
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录