code optimization
This commit is contained in:
parent
fd8521a35d
commit
7bc7424dd0
|
@ -463,16 +463,9 @@ int tsParseOneRow(char **str, STableDataBlocks *pDataBlocks, int16_t timePrec, i
|
||||||
int32_t dataLen = pBuilder->dataRowInitLen;
|
int32_t dataLen = pBuilder->dataRowInitLen;
|
||||||
int32_t kvLen = pBuilder->kvRowInitLen;
|
int32_t kvLen = pBuilder->kvRowInitLen;
|
||||||
bool isParseBindParam = false;
|
bool isParseBindParam = false;
|
||||||
// void * rowBody = memRowDataBody(row);
|
|
||||||
|
|
||||||
initSMemRow(row, pBuilder->memRowType, pDataBlocks, spd->numOfBound);
|
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
|
// 1. set the parsed value from sql string
|
||||||
for (int i = 0; i < spd->numOfBound; ++i) {
|
for (int i = 0; i < spd->numOfBound; ++i) {
|
||||||
// the start position in data block buffer of current value in sql
|
// 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);
|
bool isPrimaryKey = (colIndex == PRIMARYKEY_TIMESTAMP_COL_INDEX);
|
||||||
int32_t toffset = -1;
|
int32_t toffset = -1;
|
||||||
int16_t colId = -1;
|
int16_t colId = -1;
|
||||||
// TODO: Can we put colId from param?
|
|
||||||
tscGetMemRowAppendInfo(schema, pBuilder->memRowType, spd, i, &toffset, &colId);
|
tscGetMemRowAppendInfo(schema, pBuilder->memRowType, spd, i, &toffset, &colId);
|
||||||
|
|
||||||
int32_t ret = tsParseOneColumnKV(pSchema, &sToken, row, pInsertParam->msg, str, isPrimaryKey, timePrec, toffset,
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isPrimaryKey && tsCheckTimestamp(pDataBlocks, memRowTuple(row)) != TSDB_CODE_SUCCESS) {
|
if (isPrimaryKey) {
|
||||||
tscInvalidOperationMsg(pInsertParam->msg, "client time/server time can not be mixed up", sToken.z);
|
TSKEY tsKey = memRowKey(row);
|
||||||
return TSDB_CODE_TSC_INVALID_TIME_STAMP;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue