Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5ade893f
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
5ade893f
编写于
5月 21, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225]fix bugs found by regression test.
上级
e655a68f
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
78 addition
and
82 deletion
+78
-82
src/client/inc/tscUtil.h
src/client/inc/tscUtil.h
+2
-0
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+3
-3
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+11
-6
src/client/src/tscServer.c
src/client/src/tscServer.c
+7
-26
src/client/src/tscSql.c
src/client/src/tscSql.c
+2
-2
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+14
-23
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+36
-20
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+1
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+1
-1
src/util/inc/hash.h
src/util/inc/hash.h
+1
-0
未找到文件。
src/client/inc/tscUtil.h
浏览文件 @
5ade893f
...
...
@@ -321,6 +321,8 @@ CChildTableMeta* tscCreateChildMeta(STableMeta* pTableMeta);
uint32_t
tscGetTableMetaMaxSize
();
int32_t
tscCreateTableMetaFromCChildMeta
(
STableMeta
*
pChild
,
const
char
*
name
,
void
*
buf
);
STableMeta
*
tscTableMetaDup
(
STableMeta
*
pTableMeta
);
SVgroupsInfo
*
tscVgroupsInfoDup
(
SVgroupsInfo
*
pVgroupsInfo
);
int32_t
tscCreateQueryFromQueryInfo
(
SQueryInfo
*
pQueryInfo
,
SQueryAttr
*
pQueryAttr
,
void
*
addr
);
void
tsCreateSQLFunctionCtx
(
SQueryInfo
*
pQueryInfo
,
SQLFunctionCtx
*
pCtx
,
SSchema
*
pSchema
);
...
...
src/client/inc/tsclient.h
浏览文件 @
5ade893f
...
...
@@ -83,10 +83,10 @@ typedef struct STableMeta {
}
STableMeta
;
typedef
struct
STableMetaInfo
{
STableMeta
*
pTableMeta
;
// table meta, cached in client side and acquired by name
STableMeta
*
pTableMeta
;
// table meta, cached in client side and acquired by name
uint32_t
tableMetaSize
;
SVgroupsInfo
*
vgroupList
;
SArray
*
pVgroupTables
;
// SArray<SVgroupTableInfo>
SVgroupsInfo
*
vgroupList
;
SArray
*
pVgroupTables
;
// SArray<SVgroupTableInfo>
/*
* 1. keep the vgroup index during the multi-vnode super table projection query
...
...
src/client/src/tscSQLParser.c
浏览文件 @
5ade893f
...
...
@@ -7241,7 +7241,6 @@ int32_t loadAllTableMeta(SSqlObj* pSql, struct SSqlInfo* pInfo) {
}
STableMeta
*
pMeta
=
tscTableMetaDup
(
pTableMeta
);
STableMetaVgroupInfo
p
=
{
.
pTableMeta
=
pMeta
};
const
char
*
px
=
tNameGetTableName
(
pname
);
...
...
@@ -7279,10 +7278,15 @@ static int32_t doLoadAllTableMeta(SSqlObj* pSql, SQueryInfo* pQueryInfo, SSqlNod
const
char
*
msg1
=
"invalid table name"
;
const
char
*
msg2
=
"invalid table alias name"
;
const
char
*
msg3
=
"alias name too long"
;
const
char
*
msg4
=
"self join not allowed"
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
if
(
numOfTables
>
taosHashGetSize
(
pCmd
->
pTableMetaMap
))
{
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg4
);
}
for
(
int32_t
i
=
0
;
i
<
numOfTables
;
++
i
)
{
if
(
pQueryInfo
->
numOfTables
<=
i
)
{
// more than one table
tscAddEmptyMetaInfo
(
pQueryInfo
);
...
...
@@ -7325,11 +7329,13 @@ static int32_t doLoadAllTableMeta(SSqlObj* pSql, SQueryInfo* pQueryInfo, SSqlNod
const
char
*
name
=
tNameGetTableName
(
&
pTableMetaInfo
->
name
);
STableMetaVgroupInfo
*
p
=
taosHashGet
(
pCmd
->
pTableMetaMap
,
name
,
strlen
(
name
));
pTableMetaInfo
->
pTableMeta
=
p
->
pTableMeta
;
pTableMetaInfo
->
vgroupList
=
p
->
pVgroupInfo
;
pTableMetaInfo
->
pTableMeta
=
tscTableMetaDup
(
p
->
pTableMeta
);
assert
(
pTableMetaInfo
->
pTableMeta
!=
NULL
);
if
(
p
->
pVgroupInfo
!=
NULL
)
{
pTableMetaInfo
->
vgroupList
=
tscVgroupsInfoDup
(
p
->
pVgroupInfo
);
}
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
...
...
@@ -7556,7 +7562,6 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf
*/
if
(
isSTable
)
{
tscTansformFuncForSTableQuery
(
pQueryInfo
);
if
(
hasUnsupportFunctionsForSTableQuery
(
pCmd
,
pQueryInfo
))
{
return
TSDB_CODE_TSC_INVALID_SQL
;
}
...
...
src/client/src/tscServer.c
浏览文件 @
5ade893f
...
...
@@ -1722,23 +1722,6 @@ int tscBuildTableMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
int
tscBuildMultiTableMetaMsg
(
SSqlObj
*
pSql
,
SSqlInfo
*
pInfo
)
{
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
// copy payload content to temp buf
// char *tmpData = 0;
// if (pCmd->payloadLen > 0) {
// if ((tmpData = calloc(1, pCmd->payloadLen + 1)) == NULL) return -1;
// memcpy(tmpData, pCmd->payload, pCmd->payloadLen);
// }
// SMultiTableInfoMsg *pInfoMsg = (SMultiTableInfoMsg *)(pCmd->payload);
// pInfoMsg->numOfTables = htonl((int32_t)pCmd->count);
//
// if (pCmd->payloadLen > 0) {
// memcpy(pInfoMsg->tableIds, tmpData, pCmd->payloadLen);
// }
//
// tfree(tmpData);
// pCmd->payloadLen += sizeof(SMgmtHead) + sizeof(SMultiTableInfoMsg);
pCmd
->
msgType
=
TSDB_MSG_TYPE_CM_TABLES_META
;
assert
(
pCmd
->
payloadLen
+
minMsgSize
()
<=
pCmd
->
allocSize
);
...
...
@@ -1885,7 +1868,7 @@ static void doUpdateVgroupInfo(STableMeta *pTableMeta, SVgroupMsg *pVgroupMsg) {
}
}
static
void
doAddTableMetaLocalBuf
(
STableMeta
*
pTableMeta
,
STableMetaMsg
*
pMetaMsg
,
bool
updateSTable
)
{
static
void
doAddTableMeta
To
LocalBuf
(
STableMeta
*
pTableMeta
,
STableMetaMsg
*
pMetaMsg
,
bool
updateSTable
)
{
if
(
pTableMeta
->
tableType
==
TSDB_CHILD_TABLE
)
{
// add or update the corresponding super table meta data info
int32_t
len
=
(
int32_t
)
strnlen
(
pTableMeta
->
sTableName
,
TSDB_TABLE_FNAME_LEN
);
...
...
@@ -1928,7 +1911,7 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) {
tNameExtractFullName
(
&
pTableMetaInfo
->
name
,
name
);
assert
(
strncmp
(
pMetaMsg
->
tableFname
,
name
,
tListLen
(
pMetaMsg
->
tableFname
))
==
0
);
doAddTableMetaLocalBuf
(
pTableMeta
,
pMetaMsg
,
true
);
doAddTableMeta
To
LocalBuf
(
pTableMeta
,
pMetaMsg
,
true
);
doUpdateVgroupInfo
(
pTableMeta
,
&
pMetaMsg
->
vgroup
);
tscDebug
(
"0x%"
PRIx64
" recv table meta, uid:%"
PRIu64
", tid:%d, name:%s"
,
pSql
->
self
,
pTableMeta
->
id
.
uid
,
pTableMeta
->
id
.
tid
,
...
...
@@ -2039,7 +2022,7 @@ int tscProcessMultiTableMetaRsp(SSqlObj *pSql) {
}
// create the tableMeta and add it into the TableMeta map
doAddTableMetaLocalBuf
(
pTableMeta
,
pMetaMsg
,
addToBuf
);
doAddTableMeta
To
LocalBuf
(
pTableMeta
,
pMetaMsg
,
addToBuf
);
// if the vgroup is not updated in current process, update it.
int64_t
vgId
=
pMetaMsg
->
vgroup
.
vgId
;
...
...
@@ -2051,7 +2034,7 @@ int tscProcessMultiTableMetaRsp(SSqlObj *pSql) {
pMsg
+=
pMetaMsg
->
contLen
;
}
if
(
pMultiMeta
->
numOfVgroup
>
0
)
{
for
(
int32_t
i
=
0
;
i
<
pMultiMeta
->
numOfVgroup
;
++
i
)
{
char
*
name
=
pMsg
;
pMsg
+=
TSDB_TABLE_NAME_LEN
;
...
...
@@ -2059,15 +2042,13 @@ int tscProcessMultiTableMetaRsp(SSqlObj *pSql) {
assert
(
p
!=
NULL
);
int32_t
size
=
0
;
SVgroupsInfo
*
pVgroupInfo
=
createVgroupInfoFromMsg
(
pMsg
,
&
size
,
pSql
->
self
);
p
->
pVgroupInfo
=
pVgroupInfo
;
p
->
pVgroupInfo
=
createVgroupInfoFromMsg
(
pMsg
,
&
size
,
pSql
->
self
);
pMsg
+=
size
;
}
pSql
->
res
.
code
=
TSDB_CODE_SUCCESS
;
pSql
->
res
.
numOfTotal
=
pMultiMeta
->
numOfTables
;
tscDebug
(
"0x%"
PRIx64
" load multi-tableMeta
resp from complete
numOfTables:%d"
,
pSql
->
self
,
pMultiMeta
->
numOfTables
);
tscDebug
(
"0x%"
PRIx64
" load multi-tableMeta
from mnode,
numOfTables:%d"
,
pSql
->
self
,
pMultiMeta
->
numOfTables
);
taosHashCleanup
(
pSet
);
taosReleaseRef
(
tscObjRef
,
pParentSql
->
self
);
...
...
@@ -2471,7 +2452,7 @@ int32_t getMultiTableMetaFromMnode(SSqlObj *pSql, SArray* pNameList, SArray* pVg
for
(
int32_t
i
=
0
;
i
<
numOfVgroupList
;
++
i
)
{
char
*
name
=
taosArrayGetP
(
pVgroupNameList
,
i
);
if
(
i
<
numOfVgroupList
-
1
)
{
len
=
sprintf
(
start
,
"%s,
"
,
name
);
len
=
sprintf
(
start
,
"%s,"
,
name
);
}
else
{
len
=
sprintf
(
start
,
"%s"
,
name
);
}
...
...
src/client/src/tscSql.c
浏览文件 @
5ade893f
...
...
@@ -833,9 +833,9 @@ int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields)
case
TSDB_DATA_TYPE_NCHAR
:
{
int32_t
charLen
=
varDataLen
((
char
*
)
row
[
i
]
-
VARSTR_HEADER_SIZE
);
if
(
fields
[
i
].
type
==
TSDB_DATA_TYPE_BINARY
)
{
assert
(
charLen
<=
fields
[
i
].
bytes
);
assert
(
charLen
<=
fields
[
i
].
bytes
&&
charLen
>=
0
);
}
else
{
assert
(
charLen
<=
fields
[
i
].
bytes
*
TSDB_NCHAR_SIZE
);
assert
(
charLen
<=
fields
[
i
].
bytes
*
TSDB_NCHAR_SIZE
&&
charLen
>=
0
);
}
memcpy
(
str
+
len
,
row
[
i
],
charLen
);
...
...
src/client/src/tscSubquery.c
浏览文件 @
5ade893f
...
...
@@ -587,7 +587,7 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) {
pTableMetaInfo
->
pVgroupTables
=
pSupporter
->
pVgroupTables
;
pSupporter
->
exprList
=
NULL
;
pSupporter
->
colList
=
NULL
;
pSupporter
->
colList
=
NULL
;
pSupporter
->
pVgroupTables
=
NULL
;
memset
(
&
pSupporter
->
fieldsInfo
,
0
,
sizeof
(
SFieldInfo
));
memset
(
&
pSupporter
->
groupInfo
,
0
,
sizeof
(
SGroupbyExpr
));
...
...
@@ -597,8 +597,6 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) {
* during the timestamp intersection.
*/
pSupporter
->
limit
=
pQueryInfo
->
limit
;
// pQueryInfo->limit = pSupporter->limit;
SColumnIndex
index
=
{.
tableIndex
=
0
,
.
columnIndex
=
PRIMARYKEY_TIMESTAMP_COL_INDEX
};
SSchema
*
s
=
tscGetTableColumnSchema
(
pTableMetaInfo
->
pTableMeta
,
0
);
...
...
@@ -606,6 +604,7 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) {
int16_t
funcId
=
pExpr
->
base
.
functionId
;
// add the invisible timestamp column
printf
(
"--------read:%p
\n
"
,
pExpr
);
if
((
pExpr
->
base
.
colInfo
.
colId
!=
PRIMARYKEY_TIMESTAMP_COL_INDEX
)
||
(
funcId
!=
TSDB_FUNC_TS
&&
funcId
!=
TSDB_FUNC_TS_DUMMY
&&
funcId
!=
TSDB_FUNC_PRJ
))
{
...
...
@@ -645,11 +644,11 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) {
}
}
subquerySetState
(
p
PrevSub
,
&
pSql
->
subState
,
i
,
0
);
subquerySetState
(
p
New
,
&
pSql
->
subState
,
i
,
0
);
size_t
numOfCols
=
taosArrayGetSize
(
pQueryInfo
->
colList
);
tscDebug
(
"0x%"
PRIx64
" subquery:
%p
tableIndex:%d, vgroupIndex:%d, type:%d, exprInfo:%"
PRIzu
", colList:%"
PRIzu
", fieldsInfo:%d, name:%s"
,
pSql
->
self
,
pNew
,
0
,
pTableMetaInfo
->
vgroupIndex
,
pQueryInfo
->
type
,
taosArrayGetSize
(
pQueryInfo
->
exprList
),
tscDebug
(
"0x%"
PRIx64
" subquery:
0x%"
PRIx64
"
tableIndex:%d, vgroupIndex:%d, type:%d, exprInfo:%"
PRIzu
", colList:%"
PRIzu
", fieldsInfo:%d, name:%s"
,
pSql
->
self
,
pNew
->
self
,
0
,
pTableMetaInfo
->
vgroupIndex
,
pQueryInfo
->
type
,
taosArrayGetSize
(
pQueryInfo
->
exprList
),
numOfCols
,
pQueryInfo
->
fieldsInfo
.
numOfOutput
,
tNameGetTableName
(
&
pTableMetaInfo
->
name
));
}
...
...
@@ -712,8 +711,6 @@ static int32_t quitAllSubquery(SSqlObj* pSqlSub, SSqlObj* pSqlObj, SJoinSupporte
static
void
updateQueryTimeRange
(
SQueryInfo
*
pQueryInfo
,
STimeWindow
*
win
)
{
assert
(
pQueryInfo
->
window
.
skey
<=
win
->
skey
&&
pQueryInfo
->
window
.
ekey
>=
win
->
ekey
);
pQueryInfo
->
window
=
*
win
;
}
int32_t
tidTagsCompar
(
const
void
*
p1
,
const
void
*
p2
)
{
...
...
@@ -809,8 +806,10 @@ static void issueTsCompQuery(SSqlObj* pSql, SJoinSupporter* pSupporter, SSqlObj*
assert
(
pQueryInfo
->
numOfTables
==
1
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
STimeWindow
window
=
pQueryInfo
->
window
;
tscInitQueryInfo
(
pQueryInfo
);
pQueryInfo
->
window
=
window
;
TSDB_QUERY_CLEAR_TYPE
(
pQueryInfo
->
type
,
TSDB_QUERY_TYPE_TAG_FILTER_QUERY
);
TSDB_QUERY_SET_TYPE
(
pQueryInfo
->
type
,
TSDB_QUERY_TYPE_MULTITABLE_QUERY
);
...
...
@@ -1285,7 +1284,6 @@ static void tsCompRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow
if
(
pSupporter
->
f
==
NULL
)
{
tscError
(
"0x%"
PRIx64
" failed to create tmp file:%s, reason:%s"
,
pSql
->
self
,
pSupporter
->
path
,
strerror
(
errno
));
pParentSql
->
res
.
code
=
TAOS_SYSTEM_ERROR
(
errno
);
if
(
quitAllSubquery
(
pSql
,
pParentSql
,
pSupporter
))
{
...
...
@@ -1407,7 +1405,6 @@ static void joinRetrieveFinalResCallback(void* param, TAOS_RES* tres, int numOfR
}
tscAsyncResultOnError
(
pParentSql
);
return
;
}
...
...
@@ -1640,7 +1637,6 @@ void tscFetchDatablockForSubquery(SSqlObj* pSql) {
}
SSqlRes
*
pRes1
=
&
pSql1
->
res
;
if
(
pRes1
->
row
>=
pRes1
->
numOfRows
)
{
subquerySetState
(
pSql1
,
&
pSql
->
subState
,
i
,
0
);
}
...
...
@@ -1726,8 +1722,8 @@ void tscSetupOutputColumnIndex(SSqlObj* pSql) {
}
// restore the offset value for super table query in case of final result.
tscRestoreFuncForSTableQuery
(
pQueryInfo
);
tscFieldInfoUpdateOffset
(
pQueryInfo
);
//
tscRestoreFuncForSTableQuery(pQueryInfo);
//
tscFieldInfoUpdateOffset(pQueryInfo);
}
void
tscJoinQueryCallback
(
void
*
param
,
TAOS_RES
*
tres
,
int
code
)
{
...
...
@@ -1847,12 +1843,6 @@ int32_t tscCreateJoinSubquery(SSqlObj *pSql, int16_t tableIndex, SJoinSupporter
SQueryInfo
*
pNewQueryInfo
=
tscGetQueryInfo
(
&
pNew
->
cmd
);
assert
(
pNewQueryInfo
!=
NULL
);
// update the table index
// size_t num = taosArrayGetSize(pNewQueryInfo->colList);
// for (int32_t i = 0; i < num; ++i) {
// SColumn* pCol = taosArrayGetP(pNewQueryInfo->colList, i);
// }
pSupporter
->
colList
=
pNewQueryInfo
->
colList
;
pNewQueryInfo
->
colList
=
NULL
;
...
...
@@ -1882,8 +1872,11 @@ int32_t tscCreateJoinSubquery(SSqlObj *pSql, int16_t tableIndex, SJoinSupporter
// backup the data and clear it in the sqlcmd object
memset
(
&
pNewQueryInfo
->
groupbyExpr
,
0
,
sizeof
(
SGroupbyExpr
));
STimeWindow
range
=
pNewQueryInfo
->
window
;
tscInitQueryInfo
(
pNewQueryInfo
);
pNewQueryInfo
->
window
=
range
;
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pNewQueryInfo
,
0
);
if
(
UTIL_TABLE_IS_SUPER_TABLE
(
pTableMetaInfo
))
{
// return the tableId & tag
...
...
@@ -3270,7 +3263,7 @@ static void doBuildResFromSubqueries(SSqlObj* pSql) {
return
;
}
tscRestoreFuncForSTableQuery
(
pQueryInfo
);
//
tscRestoreFuncForSTableQuery(pQueryInfo);
int32_t
rowSize
=
tscGetResRowLength
(
pQueryInfo
->
exprList
);
assert
(
numOfRes
*
rowSize
>
0
);
...
...
@@ -3362,8 +3355,6 @@ void tscBuildResFromSubqueries(SSqlObj *pSql) {
tscAsyncResultOnError
(
pSql
);
return
;
}
tscRestoreFuncForSTableQuery
(
pQueryInfo
);
}
assert
(
pRes
->
row
>=
pRes
->
numOfRows
);
...
...
src/client/src/tscUtil.c
浏览文件 @
5ade893f
...
...
@@ -1077,16 +1077,16 @@ void tscFreeQueryInfo(SSqlCmd* pCmd, bool removeMeta) {
int32_t
numOfUpstream
=
taosArrayGetSize
(
pQueryInfo
->
pUpstream
);
for
(
int32_t
i
=
0
;
i
<
numOfUpstream
;
++
i
)
{
SQueryInfo
*
pUp
=
taosArrayGetP
(
pQueryInfo
->
pUpstream
,
i
);
freeQueryInfoImpl
(
pUp
);
SQueryInfo
*
pUp
QueryInfo
=
taosArrayGetP
(
pQueryInfo
->
pUpstream
,
i
);
freeQueryInfoImpl
(
pUp
QueryInfo
);
clearAllTableMetaInfo
(
pUp
,
removeMeta
);
if
(
pUp
->
pQInfo
!=
NULL
)
{
qDestroyQueryInfo
(
pUp
->
pQInfo
);
pUp
->
pQInfo
=
NULL
;
clearAllTableMetaInfo
(
pUp
QueryInfo
,
removeMeta
);
if
(
pUp
QueryInfo
->
pQInfo
!=
NULL
)
{
qDestroyQueryInfo
(
pUp
QueryInfo
->
pQInfo
);
pUp
QueryInfo
->
pQInfo
=
NULL
;
}
tfree
(
pUp
);
tfree
(
pUp
QueryInfo
);
}
freeQueryInfoImpl
(
pQueryInfo
);
...
...
@@ -1134,8 +1134,17 @@ void tscResetSqlCmd(SSqlCmd* pCmd, bool removeMeta) {
pCmd
->
pDataBlocks
=
tscDestroyBlockArrayList
(
pCmd
->
pDataBlocks
);
tscFreeQueryInfo
(
pCmd
,
removeMeta
);
taosHashCleanup
(
pCmd
->
pTableMetaMap
);
pCmd
->
pTableMetaMap
=
NULL
;
if
(
pCmd
->
pTableMetaMap
!=
NULL
)
{
STableMetaVgroupInfo
*
p
=
taosHashIterate
(
pCmd
->
pTableMetaMap
,
NULL
);
while
(
p
)
{
tfree
(
p
->
pVgroupInfo
);
tfree
(
p
->
pTableMeta
);
p
=
taosHashIterate
(
pCmd
->
pTableMetaMap
,
p
);
}
taosHashCleanup
(
pCmd
->
pTableMetaMap
);
pCmd
->
pTableMetaMap
=
NULL
;
}
}
void
tscFreeSqlResult
(
SSqlObj
*
pSql
)
{
...
...
@@ -1189,7 +1198,6 @@ void tscFreeRegisteredSqlObj(void *pSql) {
tscDebug
(
"0x%"
PRIx64
" free SqlObj, total in tscObj:%d, total:%d"
,
p
->
self
,
num
,
total
);
tscFreeSqlObj
(
p
);
taosReleaseRef
(
tscRefId
,
pTscObj
->
rid
);
}
void
tscFreeMetaSqlObj
(
int64_t
*
rid
){
...
...
@@ -1725,16 +1733,14 @@ SInternalField* tscFieldInfoInsert(SFieldInfo* pFieldInfo, int32_t index, TAOS_F
}
void
tscFieldInfoUpdateOffset
(
SQueryInfo
*
pQueryInfo
)
{
int32_t
offset
=
0
;
size_t
numOfExprs
=
tscNumOfExprs
(
pQueryInfo
);
SExprInfo
*
pExpr
=
taosArrayGetP
(
pQueryInfo
->
exprList
,
0
);
pExpr
->
base
.
offset
=
0
;
for
(
int32_t
i
=
1
;
i
<
numOfExprs
;
++
i
)
{
SExprInfo
*
prev
=
taosArrayGetP
(
pQueryInfo
->
exprList
,
i
-
1
);
for
(
int32_t
i
=
0
;
i
<
numOfExprs
;
++
i
)
{
SExprInfo
*
p
=
taosArrayGetP
(
pQueryInfo
->
exprList
,
i
);
p
->
base
.
offset
=
prev
->
base
.
offset
+
prev
->
base
.
resBytes
;
p
->
base
.
offset
=
offset
;
offset
+=
p
->
base
.
resBytes
;
}
}
...
...
@@ -1842,6 +1848,7 @@ void* sqlExprDestroy(SExprInfo* pExpr) {
tExprTreeDestroy
(
pExpr
->
pExpr
,
NULL
);
}
printf
(
"free---------------%p
\n
"
,
pExpr
);
tfree
(
pExpr
);
return
NULL
;
}
...
...
@@ -1911,6 +1918,7 @@ SExprInfo* tscExprCreate(SQueryInfo* pQueryInfo, int16_t functionId, SColumnInde
return
NULL
;
}
printf
(
"malloc======================%p
\n
"
,
pExpr
);
SSqlExpr
*
p
=
&
pExpr
->
base
;
p
->
functionId
=
functionId
;
...
...
@@ -2056,7 +2064,7 @@ int32_t tscExprCopy(SArray* dst, const SArray* src, uint64_t uid, bool deepcopy)
size_t
size
=
taosArrayGetSize
(
src
);
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
SExprInfo
*
pExpr
=
taosArrayGetP
(
src
,
i
);
if
(
pExpr
->
base
.
uid
==
uid
)
{
if
(
deepcopy
)
{
SExprInfo
*
p1
=
calloc
(
1
,
sizeof
(
SExprInfo
));
...
...
@@ -2066,8 +2074,6 @@ int32_t tscExprCopy(SArray* dst, const SArray* src, uint64_t uid, bool deepcopy)
}
else
{
taosArrayPush
(
dst
,
&
pExpr
);
}
}
else
{
taosArrayPush
(
dst
,
&
pExpr
);
}
}
...
...
@@ -3953,12 +3959,22 @@ uint32_t tscGetTableMetaMaxSize() {
STableMeta
*
tscTableMetaDup
(
STableMeta
*
pTableMeta
)
{
assert
(
pTableMeta
!=
NULL
);
uint32_t
size
=
tscGetTableMetaSize
(
pTableMeta
);
size_t
size
=
tscGetTableMetaSize
(
pTableMeta
);
STableMeta
*
p
=
calloc
(
1
,
size
);
memcpy
(
p
,
pTableMeta
,
size
);
return
p
;
}
SVgroupsInfo
*
tscVgroupsInfoDup
(
SVgroupsInfo
*
pVgroupsInfo
)
{
assert
(
pVgroupsInfo
!=
NULL
);
size_t
size
=
sizeof
(
SVgroupInfo
)
*
pVgroupsInfo
->
numOfVgroups
+
sizeof
(
SVgroupsInfo
);
SVgroupsInfo
*
pInfo
=
calloc
(
1
,
size
);
memcpy
(
pInfo
,
pVgroupsInfo
,
size
);
return
pInfo
;
}
int32_t
createProjectionExpr
(
SQueryInfo
*
pQueryInfo
,
STableMetaInfo
*
pTableMetaInfo
,
SExprInfo
***
pExpr
,
int32_t
*
num
)
{
if
(
!
pQueryInfo
->
arithmeticOnAgg
)
{
return
TSDB_CODE_SUCCESS
;
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
5ade893f
...
...
@@ -2922,7 +2922,7 @@ static int32_t mnodeProcessMultiTableMetaMsg(SMnodeMsg *pMsg) {
char
*
msg
=
(
char
*
)
pMultiMeta
+
pMultiMeta
->
contLen
;
// add the additional super table names that needs the vgroup info
for
(;
t
<
pInfo
->
numOfVgroups
;
++
t
)
{
for
(;
t
<
num
;
++
t
)
{
taosArrayPush
(
pList
,
&
nameList
[
t
]);
}
...
...
src/query/src/qExecutor.c
浏览文件 @
5ade893f
...
...
@@ -7135,7 +7135,7 @@ void* destroyQueryFuncExpr(SExprInfo* pExprInfo, int32_t numOfExpr) {
void
*
freeColumnInfo
(
SColumnInfo
*
pColumnInfo
,
int32_t
numOfCols
)
{
if
(
pColumnInfo
!=
NULL
)
{
assert
(
numOfCols
>
0
);
assert
(
numOfCols
>
=
0
);
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
i
++
)
{
freeColumnFilterInfo
(
pColumnInfo
[
i
].
flist
.
filterInfo
,
pColumnInfo
[
i
].
flist
.
numOfFilters
);
...
...
src/util/inc/hash.h
浏览文件 @
5ade893f
...
...
@@ -148,6 +148,7 @@ int32_t taosHashGetMaxOverflowLinkLength(const SHashObj *pHashObj);
size_t
taosHashGetMemSize
(
const
SHashObj
*
pHashObj
);
void
*
taosHashIterate
(
SHashObj
*
pHashObj
,
void
*
p
);
void
taosHashCancelIterate
(
SHashObj
*
pHashObj
,
void
*
p
);
#ifdef __cplusplus
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录