Merge pull request #25864 from taosdata/fix/TS-4817-3.0
fix:[TS-4817] check primary key(timestamp) in raw data
This commit is contained in:
commit
aa1165a73e
|
@ -732,6 +732,7 @@ int rawBlockBindData(SQuery* query, STableMeta* pTableMeta, void* data, SVCreate
|
|||
}
|
||||
}
|
||||
} else {
|
||||
bool hasTs = false;
|
||||
for (int i = 0; i < numFields; i++) {
|
||||
for (int j = 0; j < boundInfo->numOfBound; j++) {
|
||||
SSchema* pColSchema = &pSchema[j];
|
||||
|
@ -743,6 +744,10 @@ int rawBlockBindData(SQuery* query, STableMeta* pTableMeta, void* data, SVCreate
|
|||
goto end;
|
||||
}
|
||||
|
||||
if (pColSchema->colId == PRIMARYKEY_TIMESTAMP_COL_ID) {
|
||||
hasTs = true;
|
||||
}
|
||||
|
||||
int8_t* offset = pStart;
|
||||
if (IS_VAR_DATA_TYPE(pColSchema->type)) {
|
||||
pStart += numOfRows * sizeof(int32_t);
|
||||
|
@ -768,6 +773,12 @@ int rawBlockBindData(SQuery* query, STableMeta* pTableMeta, void* data, SVCreate
|
|||
}
|
||||
}
|
||||
|
||||
if(!hasTs){
|
||||
if (errstr != NULL) snprintf(errstr, errstrLen, "timestamp column(primary key) not found in raw data");
|
||||
ret = TSDB_CODE_INVALID_PARA;
|
||||
goto end;
|
||||
}
|
||||
|
||||
for (int c = 0; c < boundInfo->numOfBound; ++c) {
|
||||
if (boundInfo->pColIndex[c] != -1) {
|
||||
SColData* pCol = taosArrayGet(pTableCxt->pData->aCol, c);
|
||||
|
|
Loading…
Reference in New Issue