Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
2a107511
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看板
提交
2a107511
编写于
7月 14, 2021
作者:
Y
yihaoDeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-5134]<fix> fix runtime error
上级
3050211e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
11 deletion
+28
-11
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+15
-8
src/client/src/tscServer.c
src/client/src/tscServer.c
+5
-0
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+8
-3
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
2a107511
...
@@ -4812,7 +4812,7 @@ int32_t validateWhereNode(SQueryInfo* pQueryInfo, tSqlExpr** pExpr, SSqlObj* pSq
...
@@ -4812,7 +4812,7 @@ int32_t validateWhereNode(SQueryInfo* pQueryInfo, tSqlExpr** pExpr, SSqlObj* pSq
int32_t
type
=
0
;
int32_t
type
=
0
;
if
((
ret
=
getQueryCondExpr
(
&
pSql
->
cmd
,
pQueryInfo
,
pExpr
,
&
condExpr
,
&
type
,
(
*
pExpr
)
->
tokenId
))
!=
TSDB_CODE_SUCCESS
)
{
if
((
ret
=
getQueryCondExpr
(
&
pSql
->
cmd
,
pQueryInfo
,
pExpr
,
&
condExpr
,
&
type
,
(
*
pExpr
)
->
tokenId
))
!=
TSDB_CODE_SUCCESS
)
{
return
ret
;
goto
PARSE_WHERE_EXIT
;
}
}
tSqlExprCompact
(
pExpr
);
tSqlExprCompact
(
pExpr
);
...
@@ -4822,17 +4822,17 @@ int32_t validateWhereNode(SQueryInfo* pQueryInfo, tSqlExpr** pExpr, SSqlObj* pSq
...
@@ -4822,17 +4822,17 @@ int32_t validateWhereNode(SQueryInfo* pQueryInfo, tSqlExpr** pExpr, SSqlObj* pSq
// 1. check if it is a join query
// 1. check if it is a join query
if
((
ret
=
validateJoinExpr
(
&
pSql
->
cmd
,
pQueryInfo
,
&
condExpr
))
!=
TSDB_CODE_SUCCESS
)
{
if
((
ret
=
validateJoinExpr
(
&
pSql
->
cmd
,
pQueryInfo
,
&
condExpr
))
!=
TSDB_CODE_SUCCESS
)
{
return
ret
;
goto
PARSE_WHERE_EXIT
;
}
}
// 2. get the query time range
// 2. get the query time range
if
((
ret
=
getTimeRangeFromExpr
(
&
pSql
->
cmd
,
pQueryInfo
,
condExpr
.
pTimewindow
))
!=
TSDB_CODE_SUCCESS
)
{
if
((
ret
=
getTimeRangeFromExpr
(
&
pSql
->
cmd
,
pQueryInfo
,
condExpr
.
pTimewindow
))
!=
TSDB_CODE_SUCCESS
)
{
return
ret
;
goto
PARSE_WHERE_EXIT
;
}
}
// 3. get the tag query condition
// 3. get the tag query condition
if
((
ret
=
getTagQueryCondExpr
(
&
pSql
->
cmd
,
pQueryInfo
,
&
condExpr
,
pExpr
))
!=
TSDB_CODE_SUCCESS
)
{
if
((
ret
=
getTagQueryCondExpr
(
&
pSql
->
cmd
,
pQueryInfo
,
&
condExpr
,
pExpr
))
!=
TSDB_CODE_SUCCESS
)
{
return
ret
;
goto
PARSE_WHERE_EXIT
;
}
}
// 4. get the table name query condition
// 4. get the table name query condition
...
@@ -7707,11 +7707,18 @@ int32_t loadAllTableMeta(SSqlObj* pSql, struct SSqlInfo* pInfo) {
...
@@ -7707,11 +7707,18 @@ int32_t loadAllTableMeta(SSqlObj* pSql, struct SSqlInfo* pInfo) {
taosArrayPush
(
pVgroupList
,
&
t
);
taosArrayPush
(
pVgroupList
,
&
t
);
}
}
STableMeta
*
pMeta
=
tscTableMetaDup
(
pTableMeta
);
//
STableMeta* pMeta = tscTableMetaDup(pTableMeta);
STableMetaVgroupInfo
p
=
{
.
pTableMeta
=
pMeta
};
//
STableMetaVgroupInfo p = { .pTableMeta = pMeta };
//const char* px = tNameGetTableName(pname);
//taosHashPut(pCmd->pTableMetaMap, px, strlen(px), &p, sizeof(STableMetaVgroupInfo));
// avoid mem leak, may should update pTableMeta
const
char
*
px
=
tNameGetTableName
(
pname
);
const
char
*
px
=
tNameGetTableName
(
pname
);
taosHashPut
(
pCmd
->
pTableMetaMap
,
px
,
strlen
(
px
),
&
p
,
sizeof
(
STableMetaVgroupInfo
));
if
(
taosHashGet
(
pCmd
->
pTableMetaMap
,
px
,
strlen
(
px
))
==
NULL
)
{
STableMeta
*
pMeta
=
tscTableMetaDup
(
pTableMeta
);
STableMetaVgroupInfo
p
=
{
.
pTableMeta
=
pMeta
,
.
pVgroupInfo
=
NULL
};
taosHashPut
(
pCmd
->
pTableMetaMap
,
px
,
strlen
(
px
),
&
p
,
sizeof
(
STableMetaVgroupInfo
));
}
}
else
{
// add to the retrieve table meta array list.
}
else
{
// add to the retrieve table meta array list.
char
*
t
=
strdup
(
name
);
char
*
t
=
strdup
(
name
);
taosArrayPush
(
plist
,
&
t
);
taosArrayPush
(
plist
,
&
t
);
...
@@ -8161,7 +8168,7 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf
...
@@ -8161,7 +8168,7 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf
// in case of join query, time range is required.
// in case of join query, time range is required.
if
(
QUERY_IS_JOIN_QUERY
(
pQueryInfo
->
type
))
{
if
(
QUERY_IS_JOIN_QUERY
(
pQueryInfo
->
type
))
{
int64_t
timeRange
=
ABS
(
pQueryInfo
->
window
.
skey
-
pQueryInfo
->
window
.
ekey
)
;
uint64_t
timeRange
=
(
uint64_t
)
pQueryInfo
->
window
.
ekey
-
pQueryInfo
->
window
.
skey
;
if
(
timeRange
==
0
&&
pQueryInfo
->
window
.
skey
==
0
)
{
if
(
timeRange
==
0
&&
pQueryInfo
->
window
.
skey
==
0
)
{
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg3
);
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg3
);
}
}
...
...
src/client/src/tscServer.c
浏览文件 @
2a107511
...
@@ -2064,6 +2064,7 @@ int tscProcessMultiTableMetaRsp(SSqlObj *pSql) {
...
@@ -2064,6 +2064,7 @@ int tscProcessMultiTableMetaRsp(SSqlObj *pSql) {
STableMeta
*
pTableMeta
=
tscCreateTableMetaFromMsg
(
pMetaMsg
);
STableMeta
*
pTableMeta
=
tscCreateTableMetaFromMsg
(
pMetaMsg
);
if
(
!
tIsValidSchema
(
pTableMeta
->
schema
,
pTableMeta
->
tableInfo
.
numOfColumns
,
pTableMeta
->
tableInfo
.
numOfTags
))
{
if
(
!
tIsValidSchema
(
pTableMeta
->
schema
,
pTableMeta
->
tableInfo
.
numOfColumns
,
pTableMeta
->
tableInfo
.
numOfTags
))
{
tscError
(
"0x%"
PRIx64
" invalid table meta from mnode, name:%s"
,
pSql
->
self
,
pMetaMsg
->
tableFname
);
tscError
(
"0x%"
PRIx64
" invalid table meta from mnode, name:%s"
,
pSql
->
self
,
pMetaMsg
->
tableFname
);
tfree
(
pTableMeta
);
taosHashCleanup
(
pSet
);
taosHashCleanup
(
pSet
);
taosReleaseRef
(
tscObjRef
,
pParentSql
->
self
);
taosReleaseRef
(
tscObjRef
,
pParentSql
->
self
);
return
TSDB_CODE_TSC_INVALID_VALUE
;
return
TSDB_CODE_TSC_INVALID_VALUE
;
...
@@ -2105,6 +2106,10 @@ int tscProcessMultiTableMetaRsp(SSqlObj *pSql) {
...
@@ -2105,6 +2106,10 @@ int tscProcessMultiTableMetaRsp(SSqlObj *pSql) {
assert
(
p
!=
NULL
);
assert
(
p
!=
NULL
);
int32_t
size
=
0
;
int32_t
size
=
0
;
if
(
p
->
pVgroupInfo
!=
NULL
)
{
tscVgroupInfoClear
(
p
->
pVgroupInfo
);
//tfree(p->pTableMeta);
}
p
->
pVgroupInfo
=
createVgroupInfoFromMsg
(
pMsg
,
&
size
,
pSql
->
self
);
p
->
pVgroupInfo
=
createVgroupInfoFromMsg
(
pMsg
,
&
size
,
pSql
->
self
);
pMsg
+=
size
;
pMsg
+=
size
;
}
}
...
...
src/client/src/tscSubquery.c
浏览文件 @
2a107511
...
@@ -419,7 +419,9 @@ static void tscDestroyJoinSupporter(SJoinSupporter* pSupporter) {
...
@@ -419,7 +419,9 @@ static void tscDestroyJoinSupporter(SJoinSupporter* pSupporter) {
}
}
// tscFieldInfoClear(&pSupporter->fieldsInfo);
// tscFieldInfoClear(&pSupporter->fieldsInfo);
if
(
pSupporter
->
fieldsInfo
.
internalField
!=
NULL
)
{
taosArrayDestroy
(
pSupporter
->
fieldsInfo
.
internalField
);
}
if
(
pSupporter
->
pTSBuf
!=
NULL
)
{
if
(
pSupporter
->
pTSBuf
!=
NULL
)
{
tsBufDestroy
(
pSupporter
->
pTSBuf
);
tsBufDestroy
(
pSupporter
->
pTSBuf
);
pSupporter
->
pTSBuf
=
NULL
;
pSupporter
->
pTSBuf
=
NULL
;
...
@@ -433,7 +435,8 @@ static void tscDestroyJoinSupporter(SJoinSupporter* pSupporter) {
...
@@ -433,7 +435,8 @@ static void tscDestroyJoinSupporter(SJoinSupporter* pSupporter) {
}
}
if
(
pSupporter
->
pVgroupTables
!=
NULL
)
{
if
(
pSupporter
->
pVgroupTables
!=
NULL
)
{
taosArrayDestroy
(
pSupporter
->
pVgroupTables
);
//taosArrayDestroy(pSupporter->pVgroupTables);
tscFreeVgroupTableInfo
(
pSupporter
->
pVgroupTables
);
pSupporter
->
pVgroupTables
=
NULL
;
pSupporter
->
pVgroupTables
=
NULL
;
}
}
...
@@ -892,7 +895,9 @@ static int32_t getIntersectionOfTableTuple(SQueryInfo* pQueryInfo, SSqlObj* pPar
...
@@ -892,7 +895,9 @@ static int32_t getIntersectionOfTableTuple(SQueryInfo* pQueryInfo, SSqlObj* pPar
tscDebug
(
"Join %d - num:%d"
,
i
,
p
->
num
);
tscDebug
(
"Join %d - num:%d"
,
i
,
p
->
num
);
// sort according to the tag valu
// sort according to the tag valu
qsort
(
p
->
pIdTagList
,
p
->
num
,
p
->
tagSize
,
tagValCompar
);
if
(
p
->
pIdTagList
!=
NULL
)
{
qsort
(
p
->
pIdTagList
,
p
->
num
,
p
->
tagSize
,
tagValCompar
);
}
if
(
!
checkForDuplicateTagVal
(
pColSchema
,
p
,
pParentSql
))
{
if
(
!
checkForDuplicateTagVal
(
pColSchema
,
p
,
pParentSql
))
{
for
(
int32_t
j
=
0
;
j
<=
i
;
j
++
)
{
for
(
int32_t
j
=
0
;
j
<=
i
;
j
++
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录