fix TD-33219 2
This commit is contained in:
parent
290f870016
commit
e0c4cdf664
|
@ -137,8 +137,6 @@ int32_t qResetStmtDataBlock(STableDataCxt* block, bool keepBuf);
|
|||
int32_t qCloneStmtDataBlock(STableDataCxt** pDst, STableDataCxt* pSrc, bool reset);
|
||||
int32_t qRebuildStmtDataBlock(STableDataCxt** pDst, STableDataCxt* pSrc, uint64_t uid, uint64_t suid, int32_t vgId,
|
||||
bool rebuildCreateTb);
|
||||
int32_t qRebuildStmt2DataBlock(STableDataCxt** pDst, STableDataCxt* pSrc, uint64_t uid, uint64_t suid, int32_t vgId,
|
||||
bool rebuildCreateTb, const char* tName, const char* sTableName);
|
||||
void qDestroyStmtDataBlock(STableDataCxt* pBlock);
|
||||
STableMeta* qGetTableMetaInDataBlock(STableDataCxt* pDataBlock);
|
||||
int32_t qCloneCurrentTbData(STableDataCxt* pDataBlock, SSubmitTbData** pData);
|
||||
|
|
|
@ -2182,6 +2182,11 @@ int taos_stmt2_bind_param(TAOS_STMT2 *stmt, TAOS_STMT2_BINDV *bindv, int32_t col
|
|||
if (code) {
|
||||
return code;
|
||||
}
|
||||
} else {
|
||||
code = stmtSetTbTags2(stmt, NULL);
|
||||
if (code) {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
||||
if (bindv->bind_cols && bindv->bind_cols[i]) {
|
||||
|
|
|
@ -488,8 +488,7 @@ static int32_t stmtTryAddTableVgroupInfo(STscStmt2* pStmt, int32_t* vgId) {
|
|||
static int32_t stmtRebuildDataBlock(STscStmt2* pStmt, STableDataCxt* pDataBlock, STableDataCxt** newBlock, uint64_t uid,
|
||||
uint64_t suid, int32_t vgId) {
|
||||
STMT_ERR_RET(stmtTryAddTableVgroupInfo(pStmt, &vgId));
|
||||
STMT_ERR_RET(qRebuildStmt2DataBlock(newBlock, pDataBlock, uid, suid, vgId, pStmt->sql.autoCreateTbl, pStmt->bInfo.sname.tname,
|
||||
pStmt->bInfo.stbFName));
|
||||
STMT_ERR_RET(qRebuildStmtDataBlock(newBlock, pDataBlock, uid, suid, vgId, pStmt->sql.autoCreateTbl));
|
||||
|
||||
STMT_DLOG("tableDataCxt rebuilt, uid:%" PRId64 ", vgId:%d", uid, vgId);
|
||||
|
||||
|
@ -1013,10 +1012,10 @@ int stmtSetTbTags2(TAOS_STMT2* stmt, TAOS_STMT2_BIND* tags) {
|
|||
}
|
||||
|
||||
SBoundColInfo* tags_info = (SBoundColInfo*)pStmt->bInfo.boundTags;
|
||||
if (tags_info->numOfBound <= 0 || tags_info->numOfCols <= 0) {
|
||||
tscWarn("no tags or cols bound in sql, will not bound tags");
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
// if (tags_info->numOfBound <= 0 || tags_info->numOfCols <= 0) {
|
||||
// tscWarn("no tags or cols bound in sql, will not bound tags");
|
||||
// return TSDB_CODE_SUCCESS;
|
||||
// }
|
||||
|
||||
STableDataCxt** pDataBlock =
|
||||
(STableDataCxt**)taosHashGet(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName));
|
||||
|
|
|
@ -1212,48 +1212,6 @@ int32_t qRebuildStmtDataBlock(STableDataCxt** pDst, STableDataCxt* pSrc, uint64_
|
|||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t qRebuildStmt2DataBlock(STableDataCxt** pDst, STableDataCxt* pSrc, uint64_t uid, uint64_t suid, int32_t vgId,
|
||||
bool rebuildCreateTb, const char* tName, const char* sTableName) {
|
||||
int32_t code = qCloneStmtDataBlock(pDst, pSrc, false);
|
||||
if (code) {
|
||||
return code;
|
||||
}
|
||||
|
||||
STableDataCxt* pBlock = (STableDataCxt*)*pDst;
|
||||
if (pBlock->pMeta) {
|
||||
pBlock->pMeta->uid = uid;
|
||||
pBlock->pMeta->vgId = vgId;
|
||||
pBlock->pMeta->suid = suid;
|
||||
}
|
||||
|
||||
pBlock->pData->suid = suid;
|
||||
pBlock->pData->uid = uid;
|
||||
|
||||
if (rebuildCreateTb && NULL == pBlock->pData->pCreateTbReq) {
|
||||
pBlock->pData->pCreateTbReq = taosMemoryCalloc(1, sizeof(SVCreateTbReq));
|
||||
if (NULL == pBlock->pData->pCreateTbReq) {
|
||||
return terrno;
|
||||
}
|
||||
SArray* pTagArray = taosArrayInit(0, sizeof(STagVal));
|
||||
SArray* tagName = taosArrayInit(0, TSDB_COL_NAME_LEN);
|
||||
|
||||
STag* tag = NULL;
|
||||
code = tTagNew(pTagArray, 1, false, &tag);
|
||||
|
||||
code = insBuildCreateTbReq(pBlock->pData->pCreateTbReq, tName, tag, suid, sTableName, tagName, 0,
|
||||
TSDB_DEFAULT_TABLE_TTL);
|
||||
|
||||
taosArrayDestroy(pTagArray);
|
||||
taosArrayDestroy(tagName);
|
||||
taosMemoryFree(tag);
|
||||
if (code) {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
STableMeta* qGetTableMetaInDataBlock(STableDataCxt* pDataBlock) { return ((STableDataCxt*)pDataBlock)->pMeta; }
|
||||
|
||||
void qDestroyStmtDataBlock(STableDataCxt* pBlock) {
|
||||
|
|
Loading…
Reference in New Issue