Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
18fd1c6c
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看板
提交
18fd1c6c
编写于
1月 15, 2020
作者:
H
hjxilinx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix memory leaks
上级
c5dc9a1d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
14 addition
and
11 deletion
+14
-11
src/client/src/tscFunctionImpl.c
src/client/src/tscFunctionImpl.c
+2
-1
src/inc/ttypes.h
src/inc/ttypes.h
+1
-1
src/system/detail/src/vnodeQueryImpl.c
src/system/detail/src/vnodeQueryImpl.c
+10
-8
src/util/src/ttypes.c
src/util/src/ttypes.c
+1
-1
未找到文件。
src/client/src/tscFunctionImpl.c
浏览文件 @
18fd1c6c
...
@@ -3282,12 +3282,13 @@ char *arithmetic_callback_function(void *param, char *name, int32_t colId) {
...
@@ -3282,12 +3282,13 @@ char *arithmetic_callback_function(void *param, char *name, int32_t colId) {
static
void
arithmetic_function
(
SQLFunctionCtx
*
pCtx
)
{
static
void
arithmetic_function
(
SQLFunctionCtx
*
pCtx
)
{
GET_RES_INFO
(
pCtx
)
->
numOfRes
+=
pCtx
->
size
;
GET_RES_INFO
(
pCtx
)
->
numOfRes
+=
pCtx
->
size
;
SArithmeticSupport
*
sas
=
(
SArithmeticSupport
*
)
pCtx
->
param
[
0
].
pz
;
SArithmeticSupport
*
sas
=
(
SArithmeticSupport
*
)
pCtx
->
param
[
1
].
pz
;
tSQLBinaryExprCalcTraverse
(
sas
->
pExpr
->
pBinExprInfo
.
pBinExpr
,
pCtx
->
size
,
pCtx
->
aOutputBuf
,
sas
,
pCtx
->
order
,
tSQLBinaryExprCalcTraverse
(
sas
->
pExpr
->
pBinExprInfo
.
pBinExpr
,
pCtx
->
size
,
pCtx
->
aOutputBuf
,
sas
,
pCtx
->
order
,
arithmetic_callback_function
);
arithmetic_callback_function
);
pCtx
->
aOutputBuf
+=
pCtx
->
outputBytes
*
pCtx
->
size
*
GET_FORWARD_DIRECTION_FACTOR
(
pCtx
->
order
);
pCtx
->
aOutputBuf
+=
pCtx
->
outputBytes
*
pCtx
->
size
*
GET_FORWARD_DIRECTION_FACTOR
(
pCtx
->
order
);
pCtx
->
param
[
1
].
pz
=
NULL
;
}
}
static
void
arithmetic_function_f
(
SQLFunctionCtx
*
pCtx
,
int32_t
index
)
{
static
void
arithmetic_function_f
(
SQLFunctionCtx
*
pCtx
,
int32_t
index
)
{
...
...
src/inc/ttypes.h
浏览文件 @
18fd1c6c
...
@@ -73,7 +73,7 @@ void tVariantCreateFromBinary(tVariant *pVar, char *pz, uint32_t len, uint32_t t
...
@@ -73,7 +73,7 @@ void tVariantCreateFromBinary(tVariant *pVar, char *pz, uint32_t len, uint32_t t
void
tVariantDestroy
(
tVariant
*
pV
);
void
tVariantDestroy
(
tVariant
*
pV
);
void
tVariantAssign
(
tVariant
*
pDst
,
tVariant
*
pSrc
);
void
tVariantAssign
(
tVariant
*
pDst
,
const
tVariant
*
pSrc
);
int32_t
tVariantToString
(
tVariant
*
pVar
,
char
*
dst
);
int32_t
tVariantToString
(
tVariant
*
pVar
,
char
*
dst
);
...
...
src/system/detail/src/vnodeQueryImpl.c
浏览文件 @
18fd1c6c
...
@@ -2092,7 +2092,7 @@ void setExecParams(SQuery *pQuery, SQLFunctionCtx *pCtx, int64_t startQueryTimes
...
@@ -2092,7 +2092,7 @@ void setExecParams(SQuery *pQuery, SQLFunctionCtx *pCtx, int64_t startQueryTimes
pCtx
->
ptsList
=
(
int64_t
*
)(
primaryColumnData
+
startOffset
*
TSDB_KEYSIZE
);
pCtx
->
ptsList
=
(
int64_t
*
)(
primaryColumnData
+
startOffset
*
TSDB_KEYSIZE
);
}
else
if
(
functionId
==
TSDB_FUNC_ARITHM
)
{
}
else
if
(
functionId
==
TSDB_FUNC_ARITHM
)
{
pCtx
->
param
[
0
].
pz
=
param
;
pCtx
->
param
[
1
].
pz
=
param
;
}
}
pCtx
->
startOffset
=
startOffset
;
pCtx
->
startOffset
=
startOffset
;
...
@@ -2180,15 +2180,17 @@ static int32_t setupQueryRuntimeEnv(SMeterObj *pMeterObj, SQuery *pQuery, SQuery
...
@@ -2180,15 +2180,17 @@ static int32_t setupQueryRuntimeEnv(SMeterObj *pMeterObj, SQuery *pQuery, SQuery
pCtx
->
order
=
pQuery
->
order
.
order
;
pCtx
->
order
=
pQuery
->
order
.
order
;
pCtx
->
functionId
=
pSqlFuncMsg
->
functionId
;
pCtx
->
functionId
=
pSqlFuncMsg
->
functionId
;
/*
* tricky: in case of char array parameters, we employ the shallow copy
* method and get the ownership of the char array, it later release the allocated memory if exists
*/
pCtx
->
numOfParams
=
pSqlFuncMsg
->
numOfParams
;
pCtx
->
numOfParams
=
pSqlFuncMsg
->
numOfParams
;
for
(
int32_t
j
=
0
;
j
<
pCtx
->
numOfParams
;
++
j
)
{
for
(
int32_t
j
=
0
;
j
<
pCtx
->
numOfParams
;
++
j
)
{
pCtx
->
param
[
j
].
nType
=
pSqlFuncMsg
->
arg
[
j
].
argType
;
if
(
pSqlFuncMsg
->
arg
[
j
].
argType
==
TSDB_DATA_TYPE_BINARY
||
pCtx
->
param
[
j
].
i64Key
=
pSqlFuncMsg
->
arg
[
j
].
argValue
.
i64
;
pSqlFuncMsg
->
arg
[
j
].
argType
==
TSDB_DATA_TYPE_NCHAR
)
{
tVariantCreateFromBinary
(
&
pCtx
->
param
[
j
],
pSqlFuncMsg
->
arg
[
j
].
argValue
.
pz
,
pSqlFuncMsg
->
arg
[
j
].
argBytes
,
pSqlFuncMsg
->
arg
[
j
].
argType
);
}
else
{
tVariantCreateFromBinary
(
&
pCtx
->
param
[
j
],
(
char
*
)
&
pSqlFuncMsg
->
arg
[
j
].
argValue
.
d
,
pSqlFuncMsg
->
arg
[
j
].
argBytes
,
pSqlFuncMsg
->
arg
[
j
].
argType
);
}
}
}
// set the order information for top/bottom query
// set the order information for top/bottom query
...
...
src/util/src/ttypes.c
浏览文件 @
18fd1c6c
...
@@ -169,7 +169,7 @@ void tVariantDestroy(tVariant *pVar) {
...
@@ -169,7 +169,7 @@ void tVariantDestroy(tVariant *pVar) {
}
}
}
}
void
tVariantAssign
(
tVariant
*
pDst
,
tVariant
*
pSrc
)
{
void
tVariantAssign
(
tVariant
*
pDst
,
const
tVariant
*
pSrc
)
{
if
(
pSrc
==
NULL
||
pDst
==
NULL
)
return
;
if
(
pSrc
==
NULL
||
pDst
==
NULL
)
return
;
*
pDst
=
*
pSrc
;
*
pDst
=
*
pSrc
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录