提交 e3d9054f 编写于 作者: H Haojun Liao

[td-1373]

上级 18f646b7
...@@ -82,6 +82,7 @@ typedef struct SJoinSupporter { ...@@ -82,6 +82,7 @@ typedef struct SJoinSupporter {
char* pIdTagList; // result of first stage tags char* pIdTagList; // result of first stage tags
int32_t totalLen; int32_t totalLen;
int32_t num; int32_t num;
SArray* pVgroupTables;
} SJoinSupporter; } SJoinSupporter;
typedef struct SVgroupTableInfo { typedef struct SVgroupTableInfo {
......
...@@ -4048,7 +4048,7 @@ static void ts_comp_function_f(SQLFunctionCtx *pCtx, int32_t index) { ...@@ -4048,7 +4048,7 @@ static void ts_comp_function_f(SQLFunctionCtx *pCtx, int32_t index) {
STSBuf *pTSbuf = pInfo->pTSBuf; STSBuf *pTSbuf = pInfo->pTSBuf;
tsBufAppend(pTSbuf, 0, &pCtx->tag, pData, TSDB_KEYSIZE); tsBufAppend(pTSbuf, pCtx->param[0].i64Key, &pCtx->tag, pData, TSDB_KEYSIZE);
SET_VAL(pCtx, pCtx->size, 1); SET_VAL(pCtx, pCtx->size, 1);
pResInfo->hasResult = DATA_SET_FLAG; pResInfo->hasResult = DATA_SET_FLAG;
......
...@@ -324,7 +324,8 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) { ...@@ -324,7 +324,8 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) {
tscFieldInfoUpdateOffset(pNewQueryInfo); tscFieldInfoUpdateOffset(pNewQueryInfo);
STableMetaInfo *pTableMetaInfo = tscGetMetaInfo(pNewQueryInfo, 0); STableMetaInfo *pTableMetaInfo = tscGetMetaInfo(pNewQueryInfo, 0);
pTableMetaInfo->pVgroupTables = pSupporter->pVgroupTables;
/* /*
* When handling the projection query, the offset value will be modified for table-table join, which is changed * When handling the projection query, the offset value will be modified for table-table join, which is changed
* during the timestamp intersection. * during the timestamp intersection.
...@@ -384,6 +385,7 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) { ...@@ -384,6 +385,7 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) {
} }
assert(taosArrayGetSize(pTableMetaInfo->pVgroupTables) > 0); assert(taosArrayGetSize(pTableMetaInfo->pVgroupTables) > 0);
TSDB_QUERY_SET_TYPE(pQueryInfo->type, TSDB_QUERY_TYPE_MULTITABLE_QUERY);
} else { // TODO remove unnecessarily accessed vnode } else { // TODO remove unnecessarily accessed vnode
// pTableMetaInfo->vgroupList-> // pTableMetaInfo->vgroupList->
// for(int32_t k = 0; k < taosArrayGetSize(pTableMetaInfo->pVgroupTables);) { // for(int32_t k = 0; k < taosArrayGetSize(pTableMetaInfo->pVgroupTables);) {
...@@ -750,6 +752,12 @@ static void tidTagRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow ...@@ -750,6 +752,12 @@ static void tidTagRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow
STableMetaInfo* pTableMetaInfo2 = tscGetMetaInfo(pQueryInfo2, 0); STableMetaInfo* pTableMetaInfo2 = tscGetMetaInfo(pQueryInfo2, 0);
tscBuildVgroupTableInfo(pParentSql, pTableMetaInfo2, s2); tscBuildVgroupTableInfo(pParentSql, pTableMetaInfo2, s2);
SSqlObj* psub1 = pParentSql->pSubs[0];
((SJoinSupporter*)psub1->param)->pVgroupTables = tscCloneVgroupTableInfo(pTableMetaInfo1->pVgroupTables);
SSqlObj* psub2 = pParentSql->pSubs[1];
((SJoinSupporter*)psub2->param)->pVgroupTables = tscCloneVgroupTableInfo(pTableMetaInfo2->pVgroupTables);
pParentSql->subState.numOfSub = 2; pParentSql->subState.numOfSub = 2;
pParentSql->subState.numOfRemain = pParentSql->subState.numOfSub; pParentSql->subState.numOfRemain = pParentSql->subState.numOfSub;
......
...@@ -1710,8 +1710,6 @@ void tscRemoveVgroupTableGroup(SArray* pVgroupTable, int32_t index) { ...@@ -1710,8 +1710,6 @@ void tscRemoveVgroupTableGroup(SArray* pVgroupTable, int32_t index) {
} }
taosArrayDestroy(pInfo->itemList); taosArrayDestroy(pInfo->itemList);
taosArrayRemove(pVgroupTable, index); taosArrayRemove(pVgroupTable, index);
} }
...@@ -1726,14 +1724,15 @@ SArray* tscCloneVgroupTableInfo(SArray* pVgroupTables) { ...@@ -1726,14 +1724,15 @@ SArray* tscCloneVgroupTableInfo(SArray* pVgroupTables) {
for (size_t i = 0; i < num; i++) { for (size_t i = 0; i < num; i++) {
SVgroupTableInfo* pInfo = taosArrayGet(pVgroupTables, i); SVgroupTableInfo* pInfo = taosArrayGet(pVgroupTables, i);
SVgroupTableInfo info = {0};
info.vgInfo = pInfo->vgInfo;
for(int32_t j = 0; j < pInfo->vgInfo.numOfEps; ++j) { for(int32_t j = 0; j < pInfo->vgInfo.numOfEps; ++j) {
taosTFree(pInfo->vgInfo.epAddr[j].fqdn); info.vgInfo.epAddr[j].fqdn = strdup(pInfo->vgInfo.epAddr[j].fqdn);
} }
SVgroupTableInfo info = {0};
info.vgInfo = pInfo->vgInfo;
info.itemList = taosArrayClone(pInfo->itemList);
info.itemList = taosArrayClone(pInfo->itemList);
taosArrayPush(pa, &info); taosArrayPush(pa, &info);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册