Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
3e5aec67
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看板
提交
3e5aec67
编写于
4月 25, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225]fix memory leak.
上级
7bc4a2ef
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
12 addition
and
9 deletion
+12
-9
src/client/src/tscServer.c
src/client/src/tscServer.c
+1
-1
src/query/inc/qSqlparser.h
src/query/inc/qSqlparser.h
+1
-6
src/query/inc/sql.y
src/query/inc/sql.y
+2
-0
src/query/src/qSqlParser.c
src/query/src/qSqlParser.c
+2
-2
src/query/src/sql.c
src/query/src/sql.c
+6
-0
未找到文件。
src/client/src/tscServer.c
浏览文件 @
3e5aec67
...
@@ -2155,7 +2155,7 @@ int tscProcessShowRsp(SSqlObj *pSql) {
...
@@ -2155,7 +2155,7 @@ int tscProcessShowRsp(SSqlObj *pSql) {
uint64_t
uid
=
pTableMetaInfo
->
pTableMeta
->
id
.
uid
;
uint64_t
uid
=
pTableMetaInfo
->
pTableMeta
->
id
.
uid
;
for
(
int16_t
i
=
0
;
i
<
pMetaMsg
->
numOfColumns
;
++
i
,
++
pSchema
)
{
for
(
int16_t
i
=
0
;
i
<
pMetaMsg
->
numOfColumns
;
++
i
,
++
pSchema
)
{
index
.
columnIndex
=
i
;
index
.
columnIndex
=
i
;
tscColumnListInsert
(
pQueryInfo
->
colList
,
i
,
uid
,
&
pSchema
[
i
]
);
tscColumnListInsert
(
pQueryInfo
->
colList
,
i
,
uid
,
pSchema
);
TAOS_FIELD
f
=
tscCreateField
(
pSchema
->
type
,
pSchema
->
name
,
pSchema
->
bytes
);
TAOS_FIELD
f
=
tscCreateField
(
pSchema
->
type
,
pSchema
->
name
,
pSchema
->
bytes
);
SInternalField
*
pInfo
=
tscFieldInfoAppend
(
pFieldInfo
,
&
f
);
SInternalField
*
pInfo
=
tscFieldInfoAppend
(
pFieldInfo
,
&
f
);
...
...
src/query/inc/qSqlparser.h
浏览文件 @
3e5aec67
...
@@ -106,11 +106,6 @@ typedef struct STableNamePair {
...
@@ -106,11 +106,6 @@ typedef struct STableNamePair {
SStrToken
aliasName
;
SStrToken
aliasName
;
}
STableNamePair
;
}
STableNamePair
;
//typedef struct SSubclauseInfo { // "UNION" multiple select sub-clause
// SSqlNode **pClause;
// int32_t numOfClause;
//} SSubclauseInfo;
typedef
struct
SRelationInfo
{
typedef
struct
SRelationInfo
{
int32_t
type
;
// nested query|table name list
int32_t
type
;
// nested query|table name list
SArray
*
list
;
// SArray<STableNamePair>|SArray<SSqlNode*>
SArray
*
list
;
// SArray<STableNamePair>|SArray<SSqlNode*>
...
@@ -253,7 +248,7 @@ SArray *tVariantListAppendToken(SArray *pList, SStrToken *pAliasToken, uint8_t s
...
@@ -253,7 +248,7 @@ SArray *tVariantListAppendToken(SArray *pList, SStrToken *pAliasToken, uint8_t s
SRelationInfo
*
setTableNameList
(
SRelationInfo
*
pFromInfo
,
SStrToken
*
pName
,
SStrToken
*
pAlias
);
SRelationInfo
*
setTableNameList
(
SRelationInfo
*
pFromInfo
,
SStrToken
*
pName
,
SStrToken
*
pAlias
);
SRelationInfo
*
setSubquery
(
SRelationInfo
*
pFromInfo
,
SArray
*
pSqlNode
);
SRelationInfo
*
setSubquery
(
SRelationInfo
*
pFromInfo
,
SArray
*
pSqlNode
);
void
*
destroyFrom
Info
(
SRelationInfo
*
pFromInfo
);
void
*
destroyRelation
Info
(
SRelationInfo
*
pFromInfo
);
// sql expr leaf node
// sql expr leaf node
tSqlExpr
*
tSqlExprCreateIdValue
(
SStrToken
*
pToken
,
int32_t
optrType
);
tSqlExpr
*
tSqlExprCreateIdValue
(
SStrToken
*
pToken
,
int32_t
optrType
);
...
...
src/query/inc/sql.y
浏览文件 @
3e5aec67
...
@@ -506,10 +506,12 @@ distinct(X) ::= . { X.n = 0;}
...
@@ -506,10 +506,12 @@ distinct(X) ::= . { X.n = 0;}
// A complete FROM clause.
// A complete FROM clause.
%type from {SRelationInfo*}
%type from {SRelationInfo*}
%destructor from {destroyRelationInfo($$);}
from(A) ::= FROM tablelist(X). {A = X;}
from(A) ::= FROM tablelist(X). {A = X;}
from(A) ::= FROM LP union(Y) RP. {A = setSubquery(NULL, Y);}
from(A) ::= FROM LP union(Y) RP. {A = setSubquery(NULL, Y);}
%type tablelist {SRelationInfo*}
%type tablelist {SRelationInfo*}
%destructor tablelist {destroyRelationInfo($$);}
tablelist(A) ::= ids(X) cpxName(Y). {
tablelist(A) ::= ids(X) cpxName(Y). {
X.n += Y.n;
X.n += Y.n;
A = setTableNameList(NULL, &X, NULL);
A = setTableNameList(NULL, &X, NULL);
...
...
src/query/src/qSqlParser.c
浏览文件 @
3e5aec67
...
@@ -552,7 +552,7 @@ SRelationInfo* setSubquery(SRelationInfo* pRelationInfo, SArray* pList) {
...
@@ -552,7 +552,7 @@ SRelationInfo* setSubquery(SRelationInfo* pRelationInfo, SArray* pList) {
return
pRelationInfo
;
return
pRelationInfo
;
}
}
void
*
destroy
From
Info
(
SRelationInfo
*
pRelationInfo
)
{
void
*
destroy
Relation
Info
(
SRelationInfo
*
pRelationInfo
)
{
if
(
pRelationInfo
==
NULL
)
{
if
(
pRelationInfo
==
NULL
)
{
return
NULL
;
return
NULL
;
}
}
...
@@ -799,7 +799,7 @@ void destroySqlNode(SSqlNode *pSqlNode) {
...
@@ -799,7 +799,7 @@ void destroySqlNode(SSqlNode *pSqlNode) {
taosArrayDestroyEx
(
pSqlNode
->
pGroupby
,
freeVariant
);
taosArrayDestroyEx
(
pSqlNode
->
pGroupby
,
freeVariant
);
pSqlNode
->
pGroupby
=
NULL
;
pSqlNode
->
pGroupby
=
NULL
;
pSqlNode
->
from
=
destroy
From
Info
(
pSqlNode
->
from
);
pSqlNode
->
from
=
destroy
Relation
Info
(
pSqlNode
->
from
);
taosArrayDestroyEx
(
pSqlNode
->
fillType
,
freeVariant
);
taosArrayDestroyEx
(
pSqlNode
->
fillType
,
freeVariant
);
pSqlNode
->
fillType
=
NULL
;
pSqlNode
->
fillType
=
NULL
;
...
...
src/query/src/sql.c
浏览文件 @
3e5aec67
...
@@ -1433,6 +1433,12 @@ destroySqlNode((yypminor->yy116));
...
@@ -1433,6 +1433,12 @@ destroySqlNode((yypminor->yy116));
case
261
:
/* exprlist */
case
261
:
/* exprlist */
{
{
tSqlExprListDestroy
((
yypminor
->
yy159
));
tSqlExprListDestroy
((
yypminor
->
yy159
));
}
break
;
case
238
:
/* from */
case
254
:
/* tablelist */
{
destroyRelationInfo
((
yypminor
->
yy236
));
}
}
break
;
break
;
case
239
:
/* where_opt */
case
239
:
/* where_opt */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录