Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
89d87300
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看板
提交
89d87300
编写于
9月 01, 2020
作者:
B
Bomin Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix td-804
上级
ab625d55
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
29 addition
and
13 deletion
+29
-13
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+1
-1
src/client/src/tscAsync.c
src/client/src/tscAsync.c
+1
-1
src/client/src/tscParseInsert.c
src/client/src/tscParseInsert.c
+20
-4
src/client/src/tscSql.c
src/client/src/tscSql.c
+1
-1
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+6
-6
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
89d87300
...
...
@@ -416,7 +416,7 @@ void tscRestoreSQLFuncForSTableQuery(SQueryInfo *pQueryInfo);
int32_t
tscCreateResPointerInfo
(
SSqlRes
*
pRes
,
SQueryInfo
*
pQueryInfo
);
void
tscDestroyResPointerInfo
(
SSqlRes
*
pRes
);
void
tscResetSqlCmdObj
(
SSqlCmd
*
pCmd
);
void
tscResetSqlCmdObj
(
SSqlCmd
*
pCmd
,
bool
removeFromCache
);
/**
* free query result of the sql object
...
...
src/client/src/tscAsync.c
浏览文件 @
89d87300
...
...
@@ -482,7 +482,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
if
(
pCmd
->
command
==
TSDB_SQL_INSERT
||
pCmd
->
command
==
TSDB_SQL_SELECT
)
{
tscDebug
(
"%p redo parse sql string and proceed"
,
pSql
);
pCmd
->
parseFinished
=
false
;
tscResetSqlCmdObj
(
pCmd
);
tscResetSqlCmdObj
(
pCmd
,
false
);
code
=
tsParseSql
(
pSql
,
true
);
...
...
src/client/src/tscParseInsert.c
浏览文件 @
89d87300
...
...
@@ -1328,14 +1328,30 @@ int tsParseSql(SSqlObj *pSql, bool initial) {
pSql
->
fp
=
(
void
(
*
)())
tscHandleMultivnodeInsert
;
}
if
(
initial
&&
((
ret
=
tsInsertInitialCheck
(
pSql
))
!=
TSDB_CODE_SUCCESS
))
{
return
ret
;
for
(
int
i
=
0
;
true
;
i
++
)
{
if
(
initial
&&
((
ret
=
tsInsertInitialCheck
(
pSql
))
!=
TSDB_CODE_SUCCESS
))
{
return
ret
;
}
// make a backup as tsParseInsertSql may modify the string
char
*
sqlstr
=
strdup
(
pSql
->
sqlstr
);
ret
=
tsParseInsertSql
(
pSql
);
if
(
sqlstr
==
NULL
||
i
>=
2
||
ret
!=
TSDB_CODE_TSC_INVALID_SQL
)
{
free
(
sqlstr
);
break
;
}
tscResetSqlCmdObj
(
pCmd
,
true
);
pCmd
->
pQueryInfo
=
NULL
;
free
(
pSql
->
sqlstr
);
pSql
->
sqlstr
=
sqlstr
;
}
ret
=
tsParseInsertSql
(
pSql
);
}
else
{
SSqlInfo
SQLInfo
=
qSQLParse
(
pSql
->
sqlstr
);
ret
=
tscToSQLCmd
(
pSql
,
&
SQLInfo
);
if
(
ret
==
TSDB_CODE_TSC_INVALID_SQL
)
{
tscResetSqlCmdObj
(
pCmd
,
true
);
ret
=
tscToSQLCmd
(
pSql
,
&
SQLInfo
);
}
SQLInfoDestroy
(
&
SQLInfo
);
}
...
...
src/client/src/tscSql.c
浏览文件 @
89d87300
...
...
@@ -817,7 +817,7 @@ int taos_validate_sql(TAOS *taos, const char *sql) {
static
int
tscParseTblNameList
(
SSqlObj
*
pSql
,
const
char
*
tblNameList
,
int32_t
tblListLen
)
{
// must before clean the sqlcmd object
tscResetSqlCmdObj
(
&
pSql
->
cmd
);
tscResetSqlCmdObj
(
&
pSql
->
cmd
,
false
);
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
...
...
src/client/src/tscUtil.c
浏览文件 @
89d87300
...
...
@@ -33,7 +33,7 @@
static
void
freeQueryInfoImpl
(
SQueryInfo
*
pQueryInfo
);
static
void
clearAllTableMetaInfo
(
SQueryInfo
*
pQueryInfo
,
const
char
*
address
,
bool
removeFromCache
);
SCond
*
tsGetSTableQueryCond
(
STagCond
*
pTagCond
,
uint64_t
uid
)
{
SCond
*
tsGetSTableQueryCond
(
STagCond
*
pTagCond
,
uint64_t
uid
)
{
if
(
pTagCond
->
pCond
==
NULL
)
{
return
NULL
;
}
...
...
@@ -296,7 +296,7 @@ void tscDestroyResPointerInfo(SSqlRes* pRes) {
pRes
->
data
=
NULL
;
// pRes->data points to the buffer of pRsp, no need to free
}
static
void
tscFreeQueryInfo
(
SSqlCmd
*
pCmd
)
{
static
void
tscFreeQueryInfo
(
SSqlCmd
*
pCmd
,
bool
removeFromCache
)
{
if
(
pCmd
==
NULL
||
pCmd
->
numOfClause
==
0
)
{
return
;
}
...
...
@@ -306,7 +306,7 @@ static void tscFreeQueryInfo(SSqlCmd* pCmd) {
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
i
);
freeQueryInfoImpl
(
pQueryInfo
);
clearAllTableMetaInfo
(
pQueryInfo
,
(
const
char
*
)
addr
,
fals
e
);
clearAllTableMetaInfo
(
pQueryInfo
,
(
const
char
*
)
addr
,
removeFromCach
e
);
taosTFree
(
pQueryInfo
);
}
...
...
@@ -314,7 +314,7 @@ static void tscFreeQueryInfo(SSqlCmd* pCmd) {
taosTFree
(
pCmd
->
pQueryInfo
);
}
void
tscResetSqlCmdObj
(
SSqlCmd
*
pCmd
)
{
void
tscResetSqlCmdObj
(
SSqlCmd
*
pCmd
,
bool
removeFromCache
)
{
pCmd
->
command
=
0
;
pCmd
->
numOfCols
=
0
;
pCmd
->
count
=
0
;
...
...
@@ -328,7 +328,7 @@ void tscResetSqlCmdObj(SSqlCmd* pCmd) {
pCmd
->
pDataBlocks
=
tscDestroyBlockArrayList
(
pCmd
->
pDataBlocks
);
tscFreeQueryInfo
(
pCmd
);
tscFreeQueryInfo
(
pCmd
,
removeFromCache
);
}
void
tscFreeSqlResult
(
SSqlObj
*
pSql
)
{
...
...
@@ -366,7 +366,7 @@ void tscPartiallyFreeSqlObj(SSqlObj* pSql) {
taosTFree
(
pSql
->
pSubs
);
pSql
->
numOfSubs
=
0
;
tscResetSqlCmdObj
(
pCmd
);
tscResetSqlCmdObj
(
pCmd
,
false
);
}
void
tscFreeSqlObj
(
SSqlObj
*
pSql
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录