diff --git a/src/client/src/tscParseInsert.c b/src/client/src/tscParseInsert.c index bf786e3817..b7a2320b07 100644 --- a/src/client/src/tscParseInsert.c +++ b/src/client/src/tscParseInsert.c @@ -463,16 +463,9 @@ int tsParseOneRow(char **str, STableDataBlocks *pDataBlocks, int16_t timePrec, i int32_t dataLen = pBuilder->dataRowInitLen; int32_t kvLen = pBuilder->kvRowInitLen; bool isParseBindParam = false; - // void * rowBody = memRowDataBody(row); initSMemRow(row, pBuilder->memRowType, pDataBlocks, spd->numOfBound); - // FPAppendColVal fpAppendColVal = tscAppendDataRowColValEx; - // if (isKvRowT(pBuilder->memRowType)) { - // rowBody = memRowKvBody(row); - // fpAppendColVal = tscAppendKvRowColValEx; - // } - // 1. set the parsed value from sql string for (int i = 0; i < spd->numOfBound; ++i) { // the start position in data block buffer of current value in sql @@ -543,7 +536,6 @@ int tsParseOneRow(char **str, STableDataBlocks *pDataBlocks, int16_t timePrec, i bool isPrimaryKey = (colIndex == PRIMARYKEY_TIMESTAMP_COL_INDEX); int32_t toffset = -1; int16_t colId = -1; - // TODO: Can we put colId from param? tscGetMemRowAppendInfo(schema, pBuilder->memRowType, spd, i, &toffset, &colId); int32_t ret = tsParseOneColumnKV(pSchema, &sToken, row, pInsertParam->msg, str, isPrimaryKey, timePrec, toffset, @@ -552,9 +544,12 @@ int tsParseOneRow(char **str, STableDataBlocks *pDataBlocks, int16_t timePrec, i return ret; } - if (isPrimaryKey && tsCheckTimestamp(pDataBlocks, memRowTuple(row)) != TSDB_CODE_SUCCESS) { - tscInvalidOperationMsg(pInsertParam->msg, "client time/server time can not be mixed up", sToken.z); - return TSDB_CODE_TSC_INVALID_TIME_STAMP; + if (isPrimaryKey) { + TSKEY tsKey = memRowKey(row); + if (tsCheckTimestamp(pDataBlocks, (const char *)&tsKey) != TSDB_CODE_SUCCESS) { + tscInvalidOperationMsg(pInsertParam->msg, "client time/server time can not be mixed up", sToken.z); + return TSDB_CODE_TSC_INVALID_TIME_STAMP; + } } }