Merge pull request #28600 from taosdata/fix/TD-32733

fix tsdb compress possible crash
This commit is contained in:
Shengliang Guan 2024-11-01 18:06:03 +08:00 committed by GitHub
commit 3e4dddaed8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View File

@ -1619,7 +1619,10 @@ int32_t tsDecompressBigint(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int
uTrace("encode:%s, compress:%s, level:%d, type:%s, l1:%d", compressL1Dict[l1].name, compressL2Dict[l2].name, \
lvl, tDataTypes[type].name, l1); \
int32_t len = compressL1Dict[l1].comprFn(pIn, nEle, pBuf, type); \
int8_t alvl = tsGetCompressL2Level(l2, lvl); \
if (len < 0) { \
return len; \
} \
int8_t alvl = tsGetCompressL2Level(l2, lvl); \
return compressL2Dict[l2].comprFn(pBuf, len, pOut, nOut, type, alvl); \
} else { \
uTrace("dencode:%s, decompress:%s, level:%d, type:%s", compressL1Dict[l1].name, compressL2Dict[l2].name, lvl, \

View File

@ -20,7 +20,7 @@ sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bi
$count = 0
while $count < $N
$ms = 1591200000000 + $count
sql insert into $tb values( $ms , 1, 0, $count , $count , $count ,'it is a string')
sql insert into $tb values( $ms , 10, 0, $count , $count , $count ,'it is a string')
$count = $count + 1
endw
@ -29,6 +29,13 @@ if $rows != $N then
return -1
endi
sql flush database $db
sql select * from $tb
if $rows != $N then
return -1
endi
print =============== step2
$i = 1
$db = $dbPrefix . $i