fix some format
This commit is contained in:
parent
e9feec94b3
commit
aa3c79100b
|
@ -388,7 +388,6 @@ void taos_free_result(TAOS_RES *res) {
|
|||
tDeleteMqBatchMetaRsp(&pRsp->batchMetaRsp);
|
||||
}
|
||||
taosMemoryFree(pRsp);
|
||||
|
||||
}
|
||||
|
||||
void taos_kill_query(TAOS *taos) {
|
||||
|
@ -2082,7 +2081,7 @@ int taos_stmt2_is_insert(TAOS_STMT2 *stmt, int *insert) {
|
|||
}
|
||||
|
||||
int taos_stmt2_get_fields(TAOS_STMT2 *stmt, TAOS_FIELD_T field_type, int *count, TAOS_FIELD_E **fields) {
|
||||
if (stmt == NULL || NULL == count) {
|
||||
if (stmt == NULL || count == NULL) {
|
||||
tscError("NULL parameter for %s", __FUNCTION__);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return terrno;
|
||||
|
@ -2104,7 +2103,7 @@ int taos_stmt2_get_fields(TAOS_STMT2 *stmt, TAOS_FIELD_T field_type, int *count,
|
|||
}
|
||||
|
||||
int taos_stmt2_get_all_fields(TAOS_STMT2 *stmt, int *count, TAOS_FIELD_E **fields) {
|
||||
if (stmt == NULL || NULL == count) {
|
||||
if (stmt == NULL || count == NULL) {
|
||||
tscError("NULL parameter for %s", __FUNCTION__);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return terrno;
|
||||
|
|
|
@ -1076,7 +1076,7 @@ static int stmtFetchFields2(STscStmt2* pStmt, int32_t* fieldNum, TAOS_FIELD_E**
|
|||
return TSDB_CODE_INVALID_PARA;
|
||||
}
|
||||
|
||||
if (fields) {
|
||||
if (fields != NULL) {
|
||||
*fields = taosMemoryCalloc(tags->numOfBound, sizeof(TAOS_FIELD_E));
|
||||
if (NULL == *fields) {
|
||||
return terrno;
|
||||
|
@ -1088,21 +1088,21 @@ static int stmtFetchFields2(STscStmt2* pStmt, int32_t* fieldNum, TAOS_FIELD_E**
|
|||
int16_t idx = tags->pColIndex[i];
|
||||
if (idx == tbnameIdx) {
|
||||
(*fields)[i].field_type = TAOS_FIELD_TBNAME;
|
||||
strcpy((*fields)[i].name, "tbname");
|
||||
tstrncpy((*fields)[i].name, "tbname", sizeof((*fields)[i].name));
|
||||
continue;
|
||||
} else if (idx < meta->tableInfo.numOfColumns) {
|
||||
(*fields)[i].field_type = TAOS_FIELD_COL;
|
||||
} else {
|
||||
(*fields)[i].field_type = TAOS_FIELD_TAG;
|
||||
}
|
||||
SSchema schema = pSchema[tags->pColIndex[i]];
|
||||
if (TSDB_DATA_TYPE_TIMESTAMP == schema.type) {
|
||||
|
||||
if (TSDB_DATA_TYPE_TIMESTAMP == pSchema[tags->pColIndex[i]].type) {
|
||||
(*fields)[i].precision = meta->tableInfo.precision;
|
||||
}
|
||||
|
||||
tstrncpy((*fields)[i].name, schema.name, sizeof((*fields)[i].name));
|
||||
(*fields)[i].type = schema.type;
|
||||
(*fields)[i].bytes = schema.bytes;
|
||||
tstrncpy((*fields)[i].name, pSchema[tags->pColIndex[i]].name, sizeof((*fields)[i].name));
|
||||
(*fields)[i].type = pSchema[tags->pColIndex[i]].type;
|
||||
(*fields)[i].bytes = pSchema[tags->pColIndex[i]].bytes;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2179,8 +2179,8 @@ static int32_t parseCsvFile(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt
|
|||
if (code == TSDB_CODE_SUCCESS) {
|
||||
SStbRowsDataContext* pStbRowsCxt = rowsDataCxt.pStbRowsCxt;
|
||||
void* pData = pTableDataCxt;
|
||||
code = taosHashPut(pStmt->pTableCxtHashObj, &pStbRowsCxt->pCtbMeta->uid, sizeof(pStbRowsCxt->pCtbMeta->uid), &pData,
|
||||
POINTER_BYTES);
|
||||
code = taosHashPut(pStmt->pTableCxtHashObj, &pStbRowsCxt->pCtbMeta->uid, sizeof(pStbRowsCxt->pCtbMeta->uid),
|
||||
&pData, POINTER_BYTES);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
break;
|
||||
}
|
||||
|
@ -2366,8 +2366,7 @@ static int32_t constructStbRowsDataContext(SVnodeModifyOpStmt* pStmt, SStbRowsDa
|
|||
if (TSDB_CODE_SUCCESS == code) {
|
||||
// col values and bound cols info of STableDataContext is not used
|
||||
pStbRowsCxt->aColVals = taosArrayInit(getNumOfColumns(pStbRowsCxt->pStbMeta), sizeof(SColVal));
|
||||
if (!pStbRowsCxt->aColVals)
|
||||
code = terrno;
|
||||
if (!pStbRowsCxt->aColVals) code = terrno;
|
||||
}
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
code = insInitColValues(pStbRowsCxt->pStbMeta, pStbRowsCxt->aColVals);
|
||||
|
@ -2528,7 +2527,8 @@ static int32_t checkTableClauseFirstToken(SInsertParseContext* pCxt, SVnodeModif
|
|||
if (pCxt->isStmtBind) {
|
||||
if (TK_NK_ID == pTbName->type || (tbNameAfterDbName != NULL && *(tbNameAfterDbName + 1) != '?')) {
|
||||
// In SQL statements, the table name has already been specified.
|
||||
parserWarn("0x%" PRIx64 " table name is specified in sql, ignore the table name in bind param", pCxt->pComCxt->requestId);
|
||||
parserWarn("0x%" PRIx64 " table name is specified in sql, ignore the table name in bind param",
|
||||
pCxt->pComCxt->requestId);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3084,7 +3084,11 @@ int32_t parseInsertSql(SParseContext* pCxt, SQuery** pQuery, SCatalogReq* pCatal
|
|||
context.tags.numOfCols = pStmt->pStbRowsCxt->boundColsInfo.numOfCols;
|
||||
context.tags.hasBoundCols = pStmt->pStbRowsCxt->boundColsInfo.hasBoundCols;
|
||||
context.tags.pColIndex = taosMemoryMalloc(sizeof(int16_t) * context.tags.numOfBound);
|
||||
memcpy(context.tags.pColIndex, pStmt->pStbRowsCxt->boundColsInfo.pColIndex,
|
||||
if (NULL == context.tags.pColIndex) {
|
||||
return terrno;
|
||||
}
|
||||
|
||||
(void)memcpy(context.tags.pColIndex, pStmt->pStbRowsCxt->boundColsInfo.pColIndex,
|
||||
sizeof(int16_t) * pStmt->pStbRowsCxt->boundColsInfo.numOfBound);
|
||||
code = setStmtInfo(&context, pStmt);
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
|
@ -3094,7 +3098,6 @@ int32_t parseInsertSql(SParseContext* pCxt, SQuery** pQuery, SCatalogReq* pCatal
|
|||
}
|
||||
|
||||
insDestroyBoundColInfo(&context.tags);
|
||||
|
||||
// if no data to insert, set emptyMode to avoid request server
|
||||
if (!context.needRequest) {
|
||||
(*pQuery)->execMode = QUERY_EXEC_MODE_EMPTY_RESULT;
|
||||
|
|
|
@ -886,7 +886,7 @@ _return:
|
|||
|
||||
int32_t buildBoundFields(int32_t numOfBound, int16_t* boundColumns, SSchema* pSchema, int32_t* fieldNum,
|
||||
TAOS_FIELD_E** fields, uint8_t timePrec, TAOS_FIELD_T fieldType) {
|
||||
if (fields) {
|
||||
if (fields != NULL) {
|
||||
*fields = taosMemoryCalloc(numOfBound, sizeof(TAOS_FIELD_E));
|
||||
if (NULL == *fields) {
|
||||
return terrno;
|
||||
|
@ -940,7 +940,7 @@ int32_t qBuildStmtColFields(void* pBlock, int32_t* fieldNum, TAOS_FIELD_E** fiel
|
|||
SSchema* pSchema = getTableColumnSchema(pDataBlock->pMeta);
|
||||
if (pDataBlock->boundColsInfo.numOfBound <= 0) {
|
||||
*fieldNum = 0;
|
||||
if (fields) {
|
||||
if (fields != NULL) {
|
||||
*fields = NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue