Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
e2706d79
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看板
未验证
提交
e2706d79
编写于
4月 06, 2020
作者:
S
slguan
提交者:
GitHub
4月 06, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1530 from taosdata/feature/query
Feature/query
上级
67acb1f3
fd722069
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
21 deletion
+20
-21
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+3
-0
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+16
-14
src/rpc/src/rpcMain.c
src/rpc/src/rpcMain.c
+1
-7
未找到文件。
src/client/src/tscSubquery.c
浏览文件 @
e2706d79
...
@@ -1512,6 +1512,9 @@ static void multiVnodeInsertMerge(void* param, TAOS_RES* tres, int numOfRows) {
...
@@ -1512,6 +1512,9 @@ static void multiVnodeInsertMerge(void* param, TAOS_RES* tres, int numOfRows) {
tscTrace
(
"%p Async insertion completed, total inserted:%d"
,
pParentObj
,
pParentObj
->
res
.
numOfRows
);
tscTrace
(
"%p Async insertion completed, total inserted:%d"
,
pParentObj
,
pParentObj
->
res
.
numOfRows
);
tfree
(
pState
);
tfree
(
pSupporter
);
// release data block data
// release data block data
pParentCmd
->
pDataBlocks
=
tscDestroyBlockArrayList
(
pParentCmd
->
pDataBlocks
);
pParentCmd
->
pDataBlocks
=
tscDestroyBlockArrayList
(
pParentCmd
->
pDataBlocks
);
...
...
src/client/src/tscUtil.c
浏览文件 @
e2706d79
...
@@ -587,7 +587,7 @@ int32_t tscCopyDataBlockToPayload(SSqlObj* pSql, STableDataBlocks* pDataBlock) {
...
@@ -587,7 +587,7 @@ int32_t tscCopyDataBlockToPayload(SSqlObj* pSql, STableDataBlocks* pDataBlock) {
assert
(
pCmd
->
numOfClause
==
1
);
assert
(
pCmd
->
numOfClause
==
1
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
pCmd
,
pCmd
->
clauseIndex
,
0
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
pCmd
,
pCmd
->
clauseIndex
,
0
);
// set the correct
metermeta object, the meter
meta has been locked in pDataBlocks, so it must be in the cache
// set the correct
table meta object, the table
meta has been locked in pDataBlocks, so it must be in the cache
if
(
pTableMetaInfo
->
pTableMeta
!=
pDataBlock
->
pTableMeta
)
{
if
(
pTableMetaInfo
->
pTableMeta
!=
pDataBlock
->
pTableMeta
)
{
strcpy
(
pTableMetaInfo
->
name
,
pDataBlock
->
tableId
);
strcpy
(
pTableMetaInfo
->
name
,
pDataBlock
->
tableId
);
taosCacheRelease
(
tscCacheHandle
,
(
void
**
)
&
(
pTableMetaInfo
->
pTableMeta
),
false
);
taosCacheRelease
(
tscCacheHandle
,
(
void
**
)
&
(
pTableMetaInfo
->
pTableMeta
),
false
);
...
@@ -599,7 +599,7 @@ int32_t tscCopyDataBlockToPayload(SSqlObj* pSql, STableDataBlocks* pDataBlock) {
...
@@ -599,7 +599,7 @@ int32_t tscCopyDataBlockToPayload(SSqlObj* pSql, STableDataBlocks* pDataBlock) {
/*
/*
* the submit message consists of : [RPC header|message body|digest]
* the submit message consists of : [RPC header|message body|digest]
* the dataBlock only includes the RPC Header buffer and actual submit mess
s
age body, space for digest needs
* the dataBlock only includes the RPC Header buffer and actual submit message body, space for digest needs
* additional space.
* additional space.
*/
*/
int
ret
=
tscAllocPayload
(
pCmd
,
pDataBlock
->
nAllocSize
+
100
);
int
ret
=
tscAllocPayload
(
pCmd
,
pDataBlock
->
nAllocSize
+
100
);
...
@@ -1277,7 +1277,7 @@ void tscSqlExprInfoDestroy(SSqlExprInfo* pExprInfo) {
...
@@ -1277,7 +1277,7 @@ void tscSqlExprInfoDestroy(SSqlExprInfo* pExprInfo) {
void
tscSqlExprCopy
(
SSqlExprInfo
*
dst
,
const
SSqlExprInfo
*
src
,
uint64_t
tableuid
,
bool
deepcopy
)
{
void
tscSqlExprCopy
(
SSqlExprInfo
*
dst
,
const
SSqlExprInfo
*
src
,
uint64_t
tableuid
,
bool
deepcopy
)
{
if
(
src
==
NULL
)
{
if
(
src
==
NULL
||
src
->
numOfExprs
==
0
)
{
return
;
return
;
}
}
...
@@ -1983,22 +1983,24 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, void (*fp)(), void
...
@@ -1983,22 +1983,24 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, void (*fp)(), void
return
NULL
;
return
NULL
;
}
}
memcpy
(
&
pNew
->
cmd
,
pCmd
,
sizeof
(
SSqlCmd
));
SSqlCmd
*
pnCmd
=
&
pNew
->
cmd
;
memcpy
(
pnCmd
,
pCmd
,
sizeof
(
SSqlCmd
));
pNew
->
cmd
.
command
=
cmd
;
pNew
->
cmd
.
payload
=
NULL
;
pnCmd
->
command
=
cmd
;
pNew
->
cmd
.
allocSize
=
0
;
pnCmd
->
payload
=
NULL
;
pnCmd
->
allocSize
=
0
;
pNew
->
cmd
.
pQueryInfo
=
NULL
;
pnCmd
->
pQueryInfo
=
NULL
;
pNew
->
cmd
.
numOfClause
=
0
;
pnCmd
->
numOfClause
=
0
;
pNew
->
cmd
.
clauseIndex
=
0
;
pnCmd
->
clauseIndex
=
0
;
pnCmd
->
pDataBlocks
=
NULL
;
if
(
tscAddSubqueryInfo
(
&
pNew
->
c
md
)
!=
TSDB_CODE_SUCCESS
)
{
if
(
tscAddSubqueryInfo
(
pnC
md
)
!=
TSDB_CODE_SUCCESS
)
{
tscFreeSqlObj
(
pNew
);
tscFreeSqlObj
(
pNew
);
return
NULL
;
return
NULL
;
}
}
SQueryInfo
*
pNewQueryInfo
=
tscGetQueryInfoDetail
(
&
pNew
->
c
md
,
0
);
SQueryInfo
*
pNewQueryInfo
=
tscGetQueryInfoDetail
(
pnC
md
,
0
);
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
pCmd
->
clauseIndex
);
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
pCmd
->
clauseIndex
);
memcpy
(
pNewQueryInfo
,
pQueryInfo
,
sizeof
(
SQueryInfo
));
memcpy
(
pNewQueryInfo
,
pQueryInfo
,
sizeof
(
SQueryInfo
));
...
@@ -2018,7 +2020,7 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, void (*fp)(), void
...
@@ -2018,7 +2020,7 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, void (*fp)(), void
memcpy
(
pNewQueryInfo
->
defaultVal
,
pQueryInfo
->
defaultVal
,
pQueryInfo
->
fieldsInfo
.
numOfOutputCols
*
sizeof
(
int64_t
));
memcpy
(
pNewQueryInfo
->
defaultVal
,
pQueryInfo
->
defaultVal
,
pQueryInfo
->
fieldsInfo
.
numOfOutputCols
*
sizeof
(
int64_t
));
}
}
if
(
tscAllocPayload
(
&
pNew
->
c
md
,
TSDB_DEFAULT_PAYLOAD_SIZE
)
!=
TSDB_CODE_SUCCESS
)
{
if
(
tscAllocPayload
(
pnC
md
,
TSDB_DEFAULT_PAYLOAD_SIZE
)
!=
TSDB_CODE_SUCCESS
)
{
tscError
(
"%p new subquery failed, tableIndex:%d, vnodeIndex:%d"
,
pSql
,
tableIndex
,
pTableMetaInfo
->
vnodeIndex
);
tscError
(
"%p new subquery failed, tableIndex:%d, vnodeIndex:%d"
,
pSql
,
tableIndex
,
pTableMetaInfo
->
vnodeIndex
);
tscFreeSqlObj
(
pNew
);
tscFreeSqlObj
(
pNew
);
return
NULL
;
return
NULL
;
...
...
src/rpc/src/rpcMain.c
浏览文件 @
e2706d79
...
@@ -24,7 +24,6 @@
...
@@ -24,7 +24,6 @@
#include "lz4.h"
#include "lz4.h"
#include "taoserror.h"
#include "taoserror.h"
#include "tsocket.h"
#include "tsocket.h"
#include "shash.h"
#include "taosmsg.h"
#include "taosmsg.h"
#include "rpcUdp.h"
#include "rpcUdp.h"
#include "rpcCache.h"
#include "rpcCache.h"
...
@@ -263,7 +262,6 @@ void *rpcOpen(SRpcInit *pInit) {
...
@@ -263,7 +262,6 @@ void *rpcOpen(SRpcInit *pInit) {
}
}
if
(
pRpc
->
connType
==
TAOS_CONN_SERVER
)
{
if
(
pRpc
->
connType
==
TAOS_CONN_SERVER
)
{
// pRpc->hash = taosInitStrHash(pRpc->sessions, sizeof(pRpc), taosHashString);
pRpc
->
hash
=
taosHashInit
(
pRpc
->
sessions
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
true
);
pRpc
->
hash
=
taosHashInit
(
pRpc
->
sessions
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
true
);
if
(
pRpc
->
hash
==
NULL
)
{
if
(
pRpc
->
hash
==
NULL
)
{
tError
(
"%s failed to init string hash"
,
pRpc
->
label
);
tError
(
"%s failed to init string hash"
,
pRpc
->
label
);
...
@@ -298,7 +296,6 @@ void rpcClose(void *param) {
...
@@ -298,7 +296,6 @@ void rpcClose(void *param) {
}
}
}
}
// taosCleanUpStrHash(pRpc->hash);
taosHashCleanup
(
pRpc
->
hash
);
taosHashCleanup
(
pRpc
->
hash
);
taosTmrCleanUp
(
pRpc
->
tmrCtrl
);
taosTmrCleanUp
(
pRpc
->
tmrCtrl
);
taosIdPoolCleanUp
(
pRpc
->
idPool
);
taosIdPoolCleanUp
(
pRpc
->
idPool
);
...
@@ -535,8 +532,7 @@ static void rpcCloseConn(void *thandle) {
...
@@ -535,8 +532,7 @@ static void rpcCloseConn(void *thandle) {
if
(
pRpc
->
connType
==
TAOS_CONN_SERVER
)
{
if
(
pRpc
->
connType
==
TAOS_CONN_SERVER
)
{
char
hashstr
[
40
]
=
{
0
};
char
hashstr
[
40
]
=
{
0
};
size_t
size
=
sprintf
(
hashstr
,
"%x:%x:%x:%d"
,
pConn
->
peerIp
,
pConn
->
linkUid
,
pConn
->
peerId
,
pConn
->
connType
);
size_t
size
=
sprintf
(
hashstr
,
"%x:%x:%x:%d"
,
pConn
->
peerIp
,
pConn
->
linkUid
,
pConn
->
peerId
,
pConn
->
connType
);
// taosDeleteStrHash(pRpc->hash, hashstr);
taosHashRemove
(
pRpc
->
hash
,
hashstr
,
size
);
// taosHashRemove(pRpc->hash, hashstr, size);
rpcFreeMsg
(
pConn
->
pRspMsg
);
// it may have a response msg saved, but not request msg
rpcFreeMsg
(
pConn
->
pRspMsg
);
// it may have a response msg saved, but not request msg
pConn
->
pRspMsg
=
NULL
;
pConn
->
pRspMsg
=
NULL
;
...
@@ -588,7 +584,6 @@ static SRpcConn *rpcAllocateServerConn(SRpcInfo *pRpc, SRecvInfo *pRecv) {
...
@@ -588,7 +584,6 @@ static SRpcConn *rpcAllocateServerConn(SRpcInfo *pRpc, SRecvInfo *pRecv) {
size_t
size
=
sprintf
(
hashstr
,
"%x:%x:%x:%d"
,
pRecv
->
ip
,
pHead
->
linkUid
,
pHead
->
sourceId
,
pRecv
->
connType
);
size_t
size
=
sprintf
(
hashstr
,
"%x:%x:%x:%d"
,
pRecv
->
ip
,
pHead
->
linkUid
,
pHead
->
sourceId
,
pRecv
->
connType
);
// check if it is already allocated
// check if it is already allocated
// SRpcConn **ppConn = (SRpcConn **)(taosGetStrHashData(pRpc->hash, hashstr));
SRpcConn
**
ppConn
=
(
SRpcConn
**
)(
taosHashGet
(
pRpc
->
hash
,
hashstr
,
size
));
SRpcConn
**
ppConn
=
(
SRpcConn
**
)(
taosHashGet
(
pRpc
->
hash
,
hashstr
,
size
));
if
(
ppConn
)
pConn
=
*
ppConn
;
if
(
ppConn
)
pConn
=
*
ppConn
;
if
(
pConn
)
return
pConn
;
if
(
pConn
)
return
pConn
;
...
@@ -621,7 +616,6 @@ static SRpcConn *rpcAllocateServerConn(SRpcInfo *pRpc, SRecvInfo *pRecv) {
...
@@ -621,7 +616,6 @@ static SRpcConn *rpcAllocateServerConn(SRpcInfo *pRpc, SRecvInfo *pRecv) {
pConn
->
localPort
=
(
pRpc
->
localPort
+
pRpc
->
index
);
pConn
->
localPort
=
(
pRpc
->
localPort
+
pRpc
->
index
);
}
}
// taosAddStrHash(pRpc->hash, hashstr, (char *)&pConn);
taosHashPut
(
pRpc
->
hash
,
hashstr
,
size
,
(
char
*
)
&
pConn
,
POINTER_BYTES
);
taosHashPut
(
pRpc
->
hash
,
hashstr
,
size
,
(
char
*
)
&
pConn
,
POINTER_BYTES
);
tTrace
(
"%s %p, rpc connection is allocated, sid:%d id:%s port:%u"
,
tTrace
(
"%s %p, rpc connection is allocated, sid:%d id:%s port:%u"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录