test code
This commit is contained in:
parent
a059e78c6c
commit
e362a045c0
|
@ -158,7 +158,8 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const ch
|
||||||
int32_t qStmtBindParams2(SQuery* pQuery, TAOS_STMT2_BIND* pParams, int32_t colIdx, void* charsetCxt);
|
int32_t qStmtBindParams2(SQuery* pQuery, TAOS_STMT2_BIND* pParams, int32_t colIdx, void* charsetCxt);
|
||||||
int32_t qBindStmtStbColsValue2(void* pBlock, SArray* pCols, TAOS_STMT2_BIND* bind, char* msgBuf, int32_t msgBufLen,
|
int32_t qBindStmtStbColsValue2(void* pBlock, SArray* pCols, TAOS_STMT2_BIND* bind, char* msgBuf, int32_t msgBufLen,
|
||||||
STSchema** pTSchema, SBindInfo2* pBindInfos, void *charsetCxt);
|
STSchema** pTSchema, SBindInfo2* pBindInfos, void *charsetCxt);
|
||||||
int32_t qBindStmtColsValue2(void* pBlock, SArray* pCols, TAOS_STMT2_BIND* bind, char* msgBuf, int32_t msgBufLen, void *charsetCxt);
|
int32_t qBindStmtColsValue2(void* pBlock, SArray* pCols, TAOS_STMT2_BIND* bind, char* msgBuf, int32_t msgBufLen,
|
||||||
|
STSchema** pTSchema, SBindInfo2* pBindInfos, void* charsetCxt);
|
||||||
int32_t qBindStmtSingleColValue2(void* pBlock, SArray* pCols, TAOS_STMT2_BIND* bind, char* msgBuf, int32_t msgBufLen,
|
int32_t qBindStmtSingleColValue2(void* pBlock, SArray* pCols, TAOS_STMT2_BIND* bind, char* msgBuf, int32_t msgBufLen,
|
||||||
int32_t colIdx, int32_t rowNum, void *charsetCxt);
|
int32_t colIdx, int32_t rowNum, void *charsetCxt);
|
||||||
int32_t qBindStmtTagsValue2(void* pBlock, void* boundTags, int64_t suid, const char* sTableName, char* tName,
|
int32_t qBindStmtTagsValue2(void* pBlock, void* boundTags, int64_t suid, const char* sTableName, char* tName,
|
||||||
|
|
|
@ -1414,7 +1414,8 @@ int stmtBindBatch2(TAOS_STMT2* stmt, TAOS_STMT2_BIND* bind, int32_t colIdx) {
|
||||||
pStmt->exec.pRequest->msgBufLen, &pStmt->sql.siInfo.pTSchema, pStmt->sql.pBindInfo, pStmt->taos->optionInfo.charsetCxt);
|
pStmt->exec.pRequest->msgBufLen, &pStmt->sql.siInfo.pTSchema, pStmt->sql.pBindInfo, pStmt->taos->optionInfo.charsetCxt);
|
||||||
} else {
|
} else {
|
||||||
code =
|
code =
|
||||||
qBindStmtColsValue2(*pDataBlock, pCols, bind, pStmt->exec.pRequest->msgBuf, pStmt->exec.pRequest->msgBufLen, pStmt->taos->optionInfo.charsetCxt);
|
qBindStmtColsValue2(*pDataBlock, pCols, bind, pStmt->exec.pRequest->msgBuf, pStmt->exec.pRequest->msgBufLen,
|
||||||
|
&pStmt->sql.siInfo.pTSchema, pStmt->sql.pBindInfo, pStmt->taos->optionInfo.charsetCxt);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (code) {
|
if (code) {
|
||||||
|
|
|
@ -816,7 +816,8 @@ static int32_t convertStmtNcharCol2(SMsgBuf* pMsgBuf, SSchema* pSchema, TAOS_STM
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t qBindStmtColsValue2(void* pBlock, SArray* pCols, TAOS_STMT2_BIND* bind, char* msgBuf, int32_t msgBufLen, void *charsetCxt) {
|
int32_t qBindStmtColsValue2(void* pBlock, SArray* pCols, TAOS_STMT2_BIND* bind, char* msgBuf, int32_t msgBufLen,
|
||||||
|
STSchema** pTSchema, SBindInfo2* pBindInfos, void* charsetCxt) {
|
||||||
STableDataCxt* pDataBlock = (STableDataCxt*)pBlock;
|
STableDataCxt* pDataBlock = (STableDataCxt*)pBlock;
|
||||||
SSchema* pSchema = getTableColumnSchema(pDataBlock->pMeta);
|
SSchema* pSchema = getTableColumnSchema(pDataBlock->pMeta);
|
||||||
SBoundColInfo* boundInfo = &pDataBlock->boundColsInfo;
|
SBoundColInfo* boundInfo = &pDataBlock->boundColsInfo;
|
||||||
|
@ -825,9 +826,21 @@ int32_t qBindStmtColsValue2(void* pBlock, SArray* pCols, TAOS_STMT2_BIND* bind,
|
||||||
TAOS_STMT2_BIND ncharBind = {0};
|
TAOS_STMT2_BIND ncharBind = {0};
|
||||||
TAOS_STMT2_BIND* pBind = NULL;
|
TAOS_STMT2_BIND* pBind = NULL;
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
|
int16_t lastColId = -1;
|
||||||
|
bool colInOrder = true;
|
||||||
|
|
||||||
|
if (NULL == *pTSchema) {
|
||||||
|
*pTSchema = tBuildTSchema(pSchema, pDataBlock->pMeta->tableInfo.numOfColumns, pDataBlock->pMeta->sversion);
|
||||||
|
}
|
||||||
|
|
||||||
for (int c = 0; c < boundInfo->numOfBound; ++c) {
|
for (int c = 0; c < boundInfo->numOfBound; ++c) {
|
||||||
SSchema* pColSchema = &pSchema[boundInfo->pColIndex[c]];
|
SSchema* pColSchema = &pSchema[boundInfo->pColIndex[c]];
|
||||||
|
if (pColSchema->colId <= lastColId) {
|
||||||
|
colInOrder = false;
|
||||||
|
} else {
|
||||||
|
lastColId = pColSchema->colId;
|
||||||
|
}
|
||||||
|
|
||||||
SColData* pCol = taosArrayGet(pCols, c);
|
SColData* pCol = taosArrayGet(pCols, c);
|
||||||
if (pCol == NULL || pColSchema == NULL) {
|
if (pCol == NULL || pColSchema == NULL) {
|
||||||
code = buildInvalidOperationMsg(&pBuf, "get column schema or column data failed");
|
code = buildInvalidOperationMsg(&pBuf, "get column schema or column data failed");
|
||||||
|
@ -852,17 +865,21 @@ int32_t qBindStmtColsValue2(void* pBlock, SArray* pCols, TAOS_STMT2_BIND* bind,
|
||||||
}
|
}
|
||||||
pBind = &ncharBind;
|
pBind = &ncharBind;
|
||||||
} else {
|
} else {
|
||||||
pBind = bind + c;
|
pBindInfos[c].bind = bind + c;
|
||||||
}
|
}
|
||||||
|
|
||||||
code = tColDataAddValueByBind2(pCol, pBind,
|
pBindInfos[c].columnId = pColSchema->colId;
|
||||||
IS_VAR_DATA_TYPE(pColSchema->type) ? pColSchema->bytes - VARSTR_HEADER_SIZE : -1,
|
pBindInfos[c].type = pColSchema->type;
|
||||||
initCtxAsText, checkWKB);
|
pBindInfos[c].bytes = pColSchema->bytes;
|
||||||
if (code) {
|
|
||||||
goto _return;
|
// code = tColDataAddValueByBind2(pCol, pBind,
|
||||||
}
|
// IS_VAR_DATA_TYPE(pColSchema->type) ? pColSchema->bytes - VARSTR_HEADER_SIZE : -1,
|
||||||
|
// initCtxAsText, checkWKB);
|
||||||
|
if (code) {
|
||||||
|
goto _return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
code = tRowBuildFromBind2(pBindInfos, boundInfo->numOfBound, colInOrder, *pTSchema, pCols, &pDataBlock->ordered, &pDataBlock->duplicateTs);
|
||||||
qDebug("stmt all %d columns bind %d rows data", boundInfo->numOfBound, rowNum);
|
qDebug("stmt all %d columns bind %d rows data", boundInfo->numOfBound, rowNum);
|
||||||
|
|
||||||
_return:
|
_return:
|
||||||
|
|
Loading…
Reference in New Issue