Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小楼昨夜-听风雨
TDengine
提交
bd85ab3c
T
TDengine
项目概览
小楼昨夜-听风雨
/
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
bd85ab3c
编写于
4月 04, 2020
作者:
S
slguan
提交者:
GitHub
4月 04, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1513 from taosdata/feature/query
[TD-98] cleanup resources when execution failed
上级
398f68f5
d8c8f197
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
15 deletion
+17
-15
src/client/src/tscSql.c
src/client/src/tscSql.c
+4
-0
src/query/src/queryExecutor.c
src/query/src/queryExecutor.c
+13
-15
未找到文件。
src/client/src/tscSql.c
浏览文件 @
bd85ab3c
...
...
@@ -298,6 +298,10 @@ int taos_query(TAOS *taos, const char *sqlstr) {
// wait for the callback function to post the semaphore
sem_wait
(
&
pSql
->
rspSem
);
if
(
pSql
->
res
.
code
!=
TSDB_CODE_SUCCESS
)
{
tscFreeSqlCmdData
(
&
pSql
->
cmd
);
}
return
pSql
->
res
.
code
;
}
...
...
src/query/src/queryExecutor.c
浏览文件 @
bd85ab3c
...
...
@@ -87,8 +87,6 @@ typedef enum {
static
void
setQueryStatus
(
SQuery
*
pQuery
,
int8_t
status
);
bool
isIntervalQuery
(
SQuery
*
pQuery
)
{
return
pQuery
->
intervalTime
>
0
;
}
int32_t
setQueryCtxForTableQuery
(
void
*
pReadMsg
,
SQInfo
**
pQInfo
)
{}
enum
{
TS_JOIN_TS_EQUAL
=
0
,
TS_JOIN_TS_NOT_EQUALS
=
1
,
...
...
@@ -1021,7 +1019,7 @@ static int32_t setGroupResultOutputBuf(SQueryRuntimeEnv *pRuntimeEnv, char *pDat
return
TSDB_CODE_SUCCESS
;
}
static
char
*
getGroupbyColumnData
(
SQuery
*
pQuery
,
SData
**
data
,
int16_t
*
type
,
int16_t
*
bytes
)
{
static
UNUSED_FUNC
char
*
getGroupbyColumnData
(
SQuery
*
pQuery
,
SData
**
data
,
int16_t
*
type
,
int16_t
*
bytes
)
{
char
*
groupbyColumnData
=
NULL
;
SSqlGroupbyExpr
*
pGroupbyExpr
=
pQuery
->
pGroupbyExpr
;
...
...
@@ -1295,7 +1293,7 @@ static int32_t rowwiseApplyAllFunctions(SQueryRuntimeEnv *pRuntimeEnv, SDataStat
return
num
;
}
static
int32_t
reviseForwardSteps
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
int32_t
forwardStep
)
{
static
UNUSED_FUNC
int32_t
reviseForwardSteps
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
int32_t
forwardStep
)
{
/*
* 1. If value filter exists, we try all data in current block, and do not set the QUERY_RESBUF_FULL flag.
*
...
...
@@ -1719,7 +1717,7 @@ void doGetAlignedIntervalQueryRangeImpl(SQuery *pQuery, int64_t key, int64_t key
}
}
static
bool
doGetQueryPos
(
TSKEY
key
,
SQInfo
*
pQInfo
,
SPointInterpoSupporter
*
pPointInterpSupporter
)
{
static
UNUSED_FUNC
bool
doGetQueryPos
(
TSKEY
key
,
SQInfo
*
pQInfo
,
SPointInterpoSupporter
*
pPointInterpSupporter
)
{
#if 0
SQueryRuntimeEnv *pRuntimeEnv = &pQInfo->runtimeEnv;
SQuery * pQuery = pRuntimeEnv->pQuery;
...
...
@@ -1742,7 +1740,7 @@ static bool doGetQueryPos(TSKEY key, SQInfo *pQInfo, SPointInterpoSupporter *pPo
#endif
}
static
bool
doSetDataInfo
(
SQInfo
*
pQInfo
,
SPointInterpoSupporter
*
pPointInterpSupporter
,
void
*
pMeterObj
,
static
UNUSED_FUNC
bool
doSetDataInfo
(
SQInfo
*
pQInfo
,
SPointInterpoSupporter
*
pPointInterpSupporter
,
void
*
pMeterObj
,
TSKEY
nextKey
)
{
SQueryRuntimeEnv
*
pRuntimeEnv
=
&
pQInfo
->
runtimeEnv
;
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
...
...
@@ -2175,7 +2173,7 @@ void pointInterpSupporterDestroy(SPointInterpoSupporter *pPointInterpSupport) {
pPointInterpSupport
->
numOfCols
=
0
;
}
static
void
allocMemForInterpo
(
SQInfo
*
pQInfo
,
SQuery
*
pQuery
,
void
*
pMeterObj
)
{
static
UNUSED_FUNC
void
allocMemForInterpo
(
SQInfo
*
pQInfo
,
SQuery
*
pQuery
,
void
*
pMeterObj
)
{
#if 0
if (pQuery->interpoType != TSDB_INTERPO_NONE) {
assert(isIntervalQuery(pQuery) || (pQuery->intervalTime == 0 && isPointInterpoQuery(pQuery)));
...
...
@@ -2767,7 +2765,7 @@ static void doMerge(SQueryRuntimeEnv *pRuntimeEnv, int64_t timestamp, SWindowRes
}
}
static
void
printBinaryData
(
int32_t
functionId
,
char
*
data
,
int32_t
srcDataType
)
{
static
UNUSED_FUNC
void
printBinaryData
(
int32_t
functionId
,
char
*
data
,
int32_t
srcDataType
)
{
if
(
functionId
==
TSDB_FUNC_FIRST_DST
||
functionId
==
TSDB_FUNC_LAST_DST
)
{
switch
(
srcDataType
)
{
case
TSDB_DATA_TYPE_BINARY
:
...
...
@@ -4037,7 +4035,7 @@ bool vnodeHasRemainResults(void *handle) {
}
}
static
int32_t
resultInterpolate
(
SQInfo
*
pQInfo
,
tFilePage
**
data
,
tFilePage
**
pDataSrc
,
int32_t
numOfRows
,
static
UNUSED_FUNC
int32_t
resultInterpolate
(
SQInfo
*
pQInfo
,
tFilePage
**
data
,
tFilePage
**
pDataSrc
,
int32_t
numOfRows
,
int32_t
outputRows
)
{
#if 0
SQueryRuntimeEnv *pRuntimeEnv = &pQInfo->runtimeEnv;
...
...
@@ -4129,6 +4127,8 @@ int32_t vnodeQueryResultInterpolate(SQInfo *pQInfo, tFilePage **pDst, tFilePage
}
}
#endif
return
0
;
}
void
vnodePrintQueryStatistics
(
SQInfo
*
pQInfo
)
{
...
...
@@ -4299,7 +4299,7 @@ int32_t doInitializeQInfo(SQInfo *pQInfo, void *param, void* tsdb, bool isSTable
return
TSDB_CODE_SUCCESS
;
}
static
bool
isGroupbyEachTable
(
SSqlGroupbyExpr
*
pGroupbyExpr
,
tSidSet
*
pSidset
)
{
static
UNUSED_FUNC
bool
isGroupbyEachTable
(
SSqlGroupbyExpr
*
pGroupbyExpr
,
tSidSet
*
pSidset
)
{
if
(
pGroupbyExpr
==
NULL
||
pGroupbyExpr
->
numOfGroupCols
==
0
)
{
return
false
;
}
...
...
@@ -4315,7 +4315,7 @@ static bool isGroupbyEachTable(SSqlGroupbyExpr *pGroupbyExpr, tSidSet *pSidset)
return
false
;
}
static
bool
doCheckWithPrevQueryRange
(
SQuery
*
pQuery
,
TSKEY
nextKey
)
{
static
UNUSED_FUNC
bool
doCheckWithPrevQueryRange
(
SQuery
*
pQuery
,
TSKEY
nextKey
)
{
if
((
nextKey
>
pQuery
->
window
.
ekey
&&
QUERY_IS_ASC_QUERY
(
pQuery
))
||
(
nextKey
<
pQuery
->
window
.
ekey
&&
!
QUERY_IS_ASC_QUERY
(
pQuery
)))
{
return
false
;
...
...
@@ -4324,7 +4324,7 @@ static bool doCheckWithPrevQueryRange(SQuery *pQuery, TSKEY nextKey) {
return
true
;
}
static
void
enableExecutionForNextTable
(
SQueryRuntimeEnv
*
pRuntimeEnv
)
{
static
UNUSED_FUNC
void
enableExecutionForNextTable
(
SQueryRuntimeEnv
*
pRuntimeEnv
)
{
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
for
(
int32_t
i
=
0
;
i
<
pQuery
->
numOfOutputCols
;
++
i
)
{
...
...
@@ -4442,7 +4442,7 @@ static bool multimeterMultioutputHelper(SQInfo *pQInfo, bool *dataInDisk, bool *
return
true
;
}
static
int64_t
doCheckMetersInGroup
(
SQInfo
*
pQInfo
,
int32_t
index
,
int32_t
start
)
{
static
UNUSED_FUNC
int64_t
doCheckMetersInGroup
(
SQInfo
*
pQInfo
,
int32_t
index
,
int32_t
start
)
{
SQueryRuntimeEnv
*
pRuntimeEnv
=
&
pQInfo
->
runtimeEnv
;
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
...
...
@@ -5526,8 +5526,6 @@ static int32_t createSqlFunctionExprFromMsg(SQueryTableMsg *pQueryMsg, SSqlFunct
int16_t
type
=
0
;
int16_t
bytes
=
0
;
SColIndexEx
*
pColumnIndexExInfo
=
&
pExprs
[
i
].
pBase
.
colInfo
;
// parse the arithmetic expression
if
(
pExprs
[
i
].
pBase
.
functionId
==
TSDB_FUNC_ARITHM
)
{
code
=
buildAirthmeticExprFromMsg
(
&
pExprs
[
i
],
pQueryMsg
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录