Merge branch 'develop' into hotfix/sangshuduo/add-case-to-test-insert-then-import
This commit is contained in:
commit
1b2e921047
|
@ -427,27 +427,25 @@ void tdMergeTwoDataCols(SDataCols *target, SDataCols *src1, int *iter1, SDataCol
|
|||
TSKEY key1 = (*iter1 >= src1->numOfPoints) ? INT64_MAX : ((TSKEY *)(src1->cols[0].pData))[*iter1];
|
||||
TSKEY key2 = (*iter2 >= src2->numOfPoints) ? INT64_MAX : ((TSKEY *)(src2->cols[0].pData))[*iter2];
|
||||
|
||||
if (key1 < key2) {
|
||||
if (key1 <= key2) {
|
||||
for (int i = 0; i < src1->numOfCols; i++) {
|
||||
ASSERT(target->cols[i].type == src1->cols[i].type);
|
||||
dataColAppendVal(target->cols[i].pData, tdGetColDataOfRow(src1->cols + i, *iter1), target->numOfPoints,
|
||||
dataColAppendVal(&(target->cols[i]), tdGetColDataOfRow(src1->cols + i, *iter1), target->numOfPoints,
|
||||
target->maxPoints);
|
||||
}
|
||||
|
||||
target->numOfPoints++;
|
||||
(*iter1)++;
|
||||
} else if (key1 > key2) {
|
||||
if (key1 == key2) (*iter2)++;
|
||||
} else {
|
||||
for (int i = 0; i < src2->numOfCols; i++) {
|
||||
ASSERT(target->cols[i].type == src2->cols[i].type);
|
||||
dataColAppendVal(target->cols[i].pData, tdGetColDataOfRow(src2->cols + i, *iter2), target->numOfPoints,
|
||||
dataColAppendVal(&(target->cols[i]), tdGetColDataOfRow(src2->cols + i, *iter2), target->numOfPoints,
|
||||
target->maxPoints);
|
||||
}
|
||||
|
||||
target->numOfPoints++;
|
||||
(*iter2)++;
|
||||
} else {
|
||||
// TODO: deal with duplicate keys
|
||||
ASSERT(false);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -500,6 +500,7 @@ int tsdbLoadCompInfo(SRWHelper *pHelper, void *target);
|
|||
int tsdbLoadCompData(SRWHelper *pHelper, SCompBlock *pCompBlock, void *target);
|
||||
int tsdbLoadBlockDataCols(SRWHelper *pHelper, SDataCols *pDataCols, int blkIdx, int16_t *colIds, int numOfColIds);
|
||||
int tsdbLoadBlockData(SRWHelper *pHelper, SCompBlock *pCompBlock, SDataCols *target);
|
||||
// void tsdbGetDataStatis(SRWHelper *pHelper, SDataStatis *pStatis, int numOfCols);
|
||||
|
||||
// --------- For write operations
|
||||
int tsdbWriteDataBlock(SRWHelper *pHelper, SDataCols *pDataCols);
|
||||
|
|
|
@ -289,6 +289,13 @@ int tsdbCreateTable(TsdbRepoT *repo, STableCfg *pCfg) {
|
|||
|
||||
if (tsdbCheckTableCfg(pCfg) < 0) return -1;
|
||||
|
||||
STable *pTable = tsdbGetTableByUid(pMeta, pCfg->tableId.uid);
|
||||
if (pTable != NULL) {
|
||||
tsdbError("vgId:%d table %s already exists, tid %d uid %" PRId64, pRepo->config.tsdbId, varDataVal(pTable->name),
|
||||
pTable->tableId.tid, pTable->tableId.uid);
|
||||
return TSDB_CODE_TABLE_ALREADY_EXIST;
|
||||
}
|
||||
|
||||
STable *super = NULL;
|
||||
int newSuper = 0;
|
||||
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue