add compress
This commit is contained in:
parent
1d9b65226e
commit
0f629bebda
|
@ -1601,9 +1601,14 @@ int32_t valueDecode(void* value, int32_t vlen, int64_t* ttl, char** dest) {
|
|||
}
|
||||
p = taosDecodeFixedI64(p, &key.unixTimestamp);
|
||||
p = taosDecodeFixedI32(p, &key.len);
|
||||
|
||||
if (vlen == (sizeof(key.unixTimestamp) + sizeof(key.len) + key.len)) {
|
||||
// compatiable with previous data
|
||||
if (key.len != 0 && dest != NULL) p = taosDecodeBinary(p, (void**)dest, key.len);
|
||||
|
||||
} else {
|
||||
p = taosDecodeFixedI32(p, &key.rawLen);
|
||||
p = taosDecodeFixedI8(p, &key.compress);
|
||||
|
||||
if (vlen != (sizeof(key.unixTimestamp) + sizeof(key.len) + sizeof(key.rawLen) + sizeof(key.compress) + key.len)) {
|
||||
stError("vlen: %d, read len: %d", vlen, key.len);
|
||||
goto _EXCEPT;
|
||||
|
@ -1624,6 +1629,8 @@ int32_t valueDecode(void* value, int32_t vlen, int64_t* ttl, char** dest) {
|
|||
}
|
||||
|
||||
if (ttl != NULL) *ttl = key.unixTimestamp == 0 ? 0 : key.unixTimestamp - taosGetTimestampMs();
|
||||
}
|
||||
|
||||
return key.len;
|
||||
|
||||
_EXCEPT:
|
||||
|
|
Loading…
Reference in New Issue