chore: sync fix from main
This commit is contained in:
parent
b396cbd33f
commit
0c3dc0867f
|
@ -558,14 +558,15 @@ static int32_t smlGenerateSchemaAction(SSchema *colField, SHashObj *colHash, SSm
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define BOUNDARY 1024
|
||||||
static int32_t smlFindNearestPowerOf2(int32_t length, uint8_t type) {
|
static int32_t smlFindNearestPowerOf2(int32_t length, uint8_t type) {
|
||||||
int32_t result = 1;
|
int32_t result = 1;
|
||||||
if (length < 1024) {
|
if (length >= BOUNDARY){
|
||||||
while (result <= length) {
|
|
||||||
result <<= 1;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
result = length;
|
result = length;
|
||||||
|
}else{
|
||||||
|
while (result <= length) {
|
||||||
|
result << 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == TSDB_DATA_TYPE_BINARY && result > TSDB_MAX_BINARY_LEN - VARSTR_HEADER_SIZE) {
|
if (type == TSDB_DATA_TYPE_BINARY && result > TSDB_MAX_BINARY_LEN - VARSTR_HEADER_SIZE) {
|
||||||
|
|
|
@ -1814,6 +1814,11 @@ int tdbBtreeNext(SBTC *pBtc, void **ppKey, int *kLen, void **ppVal, int *vLen) {
|
||||||
|
|
||||||
*ppVal = pVal;
|
*ppVal = pVal;
|
||||||
*vLen = cd.vLen;
|
*vLen = cd.vLen;
|
||||||
|
} else {
|
||||||
|
if (TDB_CELLDECODER_FREE_VAL(&cd)) {
|
||||||
|
tdbTrace("tdb/btree-next2 decoder: %p pVal free: %p", &cd, cd.pVal);
|
||||||
|
tdbFree(cd.pVal);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = tdbBtcMoveToNext(pBtc);
|
ret = tdbBtcMoveToNext(pBtc);
|
||||||
|
|
Loading…
Reference in New Issue