fix compile err
This commit is contained in:
parent
a43b96f860
commit
c329bb4d0b
|
@ -1163,15 +1163,10 @@ int tscSortRemoveDataBlockDupRows(STableDataBlocks *dataBuf, SBlockKeyInfo *pBlk
|
||||||
pBlkKeyTuple->skey = payloadKey(pBlockData);
|
pBlkKeyTuple->skey = payloadKey(pBlockData);
|
||||||
pBlkKeyTuple->payloadAddr = pBlockData;
|
pBlkKeyTuple->payloadAddr = pBlockData;
|
||||||
payloadTLen = payloadTLen(pBlockData);
|
payloadTLen = payloadTLen(pBlockData);
|
||||||
|
#if 0
|
||||||
ASSERT(payloadNCols(pBlockData) <= 4096);
|
ASSERT(payloadNCols(pBlockData) <= 4096);
|
||||||
ASSERT(payloadTLen(pBlockData) < 65536);
|
ASSERT(payloadTLen(pBlockData) < 65536);
|
||||||
ASSERT(pBlkKeyTuple->payloadAddr != NULL);
|
#endif
|
||||||
|
|
||||||
ASSERT((pBlkKeyTuple->skey < 1627747200000000 && pBlkKeyTuple->skey > 1498838400000000) ||
|
|
||||||
(pBlkKeyTuple->skey < 1627747200000 && pBlkKeyTuple->skey > 1498838400000) ||
|
|
||||||
(pBlkKeyTuple->skey < 1627747200 && pBlkKeyTuple->skey > 1498838400));
|
|
||||||
|
|
||||||
totolPayloadTLen += payloadTLen;
|
totolPayloadTLen += payloadTLen;
|
||||||
// next loop
|
// next loop
|
||||||
pBlockData += payloadTLen;
|
pBlockData += payloadTLen;
|
||||||
|
@ -1205,19 +1200,6 @@ int tscSortRemoveDataBlockDupRows(STableDataBlocks *dataBuf, SBlockKeyInfo *pBlk
|
||||||
|
|
||||||
dataBuf->ordered = true;
|
dataBuf->ordered = true;
|
||||||
pBlocks->numOfRows = i + 1;
|
pBlocks->numOfRows = i + 1;
|
||||||
|
|
||||||
ASSERT(pBlocks->numOfRows <= nRows);
|
|
||||||
|
|
||||||
int tt = 0;
|
|
||||||
pBlkKeyTuple = pBlkKeyInfo->pKeyTuple;
|
|
||||||
while (tt < pBlocks->numOfRows) {
|
|
||||||
ASSERT(pBlkKeyTuple->payloadAddr != NULL);
|
|
||||||
ASSERT((pBlkKeyTuple->skey < 1627747200000000 && pBlkKeyTuple->skey > 1498838400000000) ||
|
|
||||||
(pBlkKeyTuple->skey < 1627747200000 && pBlkKeyTuple->skey > 1498838400000) ||
|
|
||||||
(pBlkKeyTuple->skey < 1627747200 && pBlkKeyTuple->skey > 1498838400));
|
|
||||||
++pBlkKeyTuple;
|
|
||||||
++tt;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dataBuf->size = sizeof(SSubmitBlk) + totolPayloadTLen;
|
dataBuf->size = sizeof(SSubmitBlk) + totolPayloadTLen;
|
||||||
|
|
|
@ -274,41 +274,7 @@ void dataColSetOffset(SDataCol *pCol, int nEle);
|
||||||
bool isNEleNull(SDataCol *pCol, int nEle);
|
bool isNEleNull(SDataCol *pCol, int nEle);
|
||||||
void dataColSetNEleNull(SDataCol *pCol, int nEle, int maxPoints);
|
void dataColSetNEleNull(SDataCol *pCol, int nEle, int maxPoints);
|
||||||
|
|
||||||
FORCE_INLINE const void *tdGetNullVal(int8_t type) {
|
const void *tdGetNullVal(int8_t type);
|
||||||
switch (type) {
|
|
||||||
case TSDB_DATA_TYPE_BOOL:
|
|
||||||
return &BoolNull;
|
|
||||||
case TSDB_DATA_TYPE_TINYINT:
|
|
||||||
return &TinyintNull;
|
|
||||||
case TSDB_DATA_TYPE_SMALLINT:
|
|
||||||
return &SmallintNull;
|
|
||||||
case TSDB_DATA_TYPE_INT:
|
|
||||||
return &IntNull;
|
|
||||||
case TSDB_DATA_TYPE_BIGINT:
|
|
||||||
return &BigintNull;
|
|
||||||
case TSDB_DATA_TYPE_FLOAT:
|
|
||||||
return &FloatNull;
|
|
||||||
case TSDB_DATA_TYPE_DOUBLE:
|
|
||||||
return &DoubleNull;
|
|
||||||
case TSDB_DATA_TYPE_BINARY:
|
|
||||||
return &BinaryNull;
|
|
||||||
case TSDB_DATA_TYPE_TIMESTAMP:
|
|
||||||
return &TimestampNull;
|
|
||||||
case TSDB_DATA_TYPE_NCHAR:
|
|
||||||
return &NcharNull;
|
|
||||||
case TSDB_DATA_TYPE_UTINYINT:
|
|
||||||
return &UTinyintNull;
|
|
||||||
case TSDB_DATA_TYPE_USMALLINT:
|
|
||||||
return &USmallintNull;
|
|
||||||
case TSDB_DATA_TYPE_UINT:
|
|
||||||
return &UIntNull;
|
|
||||||
case TSDB_DATA_TYPE_UBIGINT:
|
|
||||||
return &UBigintNull;
|
|
||||||
default:
|
|
||||||
ASSERT(0);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the data pointer from a column-wised data
|
// Get the data pointer from a column-wised data
|
||||||
static FORCE_INLINE void *tdGetColDataOfRow(SDataCol *pCol, int row) {
|
static FORCE_INLINE void *tdGetColDataOfRow(SDataCol *pCol, int row) {
|
||||||
|
@ -562,9 +528,10 @@ typedef void *SMemRow;
|
||||||
#define memRowDataLen(r) (*(TDRowLenT *)memRowDataBody(r)) // 0~65535
|
#define memRowDataLen(r) (*(TDRowLenT *)memRowDataBody(r)) // 0~65535
|
||||||
#define memRowKvLen(r) (*(TDRowLenT *)memRowKvBody(r)) // 0~65535
|
#define memRowKvLen(r) (*(TDRowLenT *)memRowKvBody(r)) // 0~65535
|
||||||
|
|
||||||
#define memRowDataTLen(r) (memRowDataLen(r) + TD_MEM_ROW_TYPE_SIZE) // using uint32_t/int32_t to store the TLen
|
#define memRowDataTLen(r) \
|
||||||
|
((TDRowTLenT)(memRowDataLen(r) + TD_MEM_ROW_TYPE_SIZE)) // using uint32_t/int32_t to store the TLen
|
||||||
|
|
||||||
#define memRowKvTLen(r) (memRowKvLen(r) + TD_MEM_ROW_KV_TYPE_VER_SIZE)
|
#define memRowKvTLen(r) ((TDRowTLenT)(memRowKvLen(r) + TD_MEM_ROW_KV_TYPE_VER_SIZE))
|
||||||
|
|
||||||
#define memRowLen(r) (isDataRow(r) ? memRowDataLen(r) : memRowKvLen(r))
|
#define memRowLen(r) (isDataRow(r) ? memRowDataLen(r) : memRowKvLen(r))
|
||||||
#define memRowTLen(r) (isDataRow(r) ? memRowDataTLen(r) : memRowKvTLen(r)) // using uint32_t/int32_t to store the TLen
|
#define memRowTLen(r) (isDataRow(r) ? memRowDataTLen(r) : memRowKvTLen(r)) // using uint32_t/int32_t to store the TLen
|
||||||
|
|
|
@ -785,3 +785,38 @@ SKVRow tdGetKVRowFromBuilder(SKVRowBuilder *pBuilder) {
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const void *tdGetNullVal(int8_t type) {
|
||||||
|
switch (type) {
|
||||||
|
case TSDB_DATA_TYPE_BOOL:
|
||||||
|
return &BoolNull;
|
||||||
|
case TSDB_DATA_TYPE_TINYINT:
|
||||||
|
return &TinyintNull;
|
||||||
|
case TSDB_DATA_TYPE_SMALLINT:
|
||||||
|
return &SmallintNull;
|
||||||
|
case TSDB_DATA_TYPE_INT:
|
||||||
|
return &IntNull;
|
||||||
|
case TSDB_DATA_TYPE_BIGINT:
|
||||||
|
return &BigintNull;
|
||||||
|
case TSDB_DATA_TYPE_FLOAT:
|
||||||
|
return &FloatNull;
|
||||||
|
case TSDB_DATA_TYPE_DOUBLE:
|
||||||
|
return &DoubleNull;
|
||||||
|
case TSDB_DATA_TYPE_BINARY:
|
||||||
|
return &BinaryNull;
|
||||||
|
case TSDB_DATA_TYPE_TIMESTAMP:
|
||||||
|
return &TimestampNull;
|
||||||
|
case TSDB_DATA_TYPE_NCHAR:
|
||||||
|
return &NcharNull;
|
||||||
|
case TSDB_DATA_TYPE_UTINYINT:
|
||||||
|
return &UTinyintNull;
|
||||||
|
case TSDB_DATA_TYPE_USMALLINT:
|
||||||
|
return &USmallintNull;
|
||||||
|
case TSDB_DATA_TYPE_UINT:
|
||||||
|
return &UIntNull;
|
||||||
|
case TSDB_DATA_TYPE_UBIGINT:
|
||||||
|
return &UBigintNull;
|
||||||
|
default:
|
||||||
|
ASSERT(0);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -767,7 +767,7 @@ static int tsdbCopyRowToMem(STsdbRepo *pRepo, SMemRow row, STable *pTable, void
|
||||||
|
|
||||||
void *pRow = tsdbAllocBytes(pRepo, memRowTLen(row));
|
void *pRow = tsdbAllocBytes(pRepo, memRowTLen(row));
|
||||||
if (pRow == NULL) {
|
if (pRow == NULL) {
|
||||||
tsdbError("vgId:%d failed to insert row with key %" PRId64 " to table %s while allocate %" PRIu64 " bytes since %s",
|
tsdbError("vgId:%d failed to insert row with key %" PRId64 " to table %s while allocate %" PRIu32 " bytes since %s",
|
||||||
REPO_ID(pRepo), key, TABLE_CHAR_NAME(pTable), memRowTLen(row), tstrerror(terrno));
|
REPO_ID(pRepo), key, TABLE_CHAR_NAME(pTable), memRowTLen(row), tstrerror(terrno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue