add compress
This commit is contained in:
parent
07008747ed
commit
a461b24ac9
|
@ -1610,13 +1610,9 @@ int32_t valueDecode(void* value, int32_t vlen, int64_t* ttl, char** dest) {
|
||||||
code = 0;
|
code = 0;
|
||||||
goto _EXCEPT;
|
goto _EXCEPT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vlen == (sizeof(key.unixTimestamp) + sizeof(key.len) + key.len)) {
|
if (vlen == (sizeof(key.unixTimestamp) + sizeof(key.len) + key.len)) {
|
||||||
// compatiable with previous data
|
// compatiable with previous data
|
||||||
if (dest != NULL) {
|
p = taosDecodeBinary(p, (void**)&pOutput, key.len);
|
||||||
p = taosDecodeBinary(p, (void**)dest, key.len);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
p = taosDecodeFixedI32(p, &key.rawLen);
|
p = taosDecodeFixedI32(p, &key.rawLen);
|
||||||
p = taosDecodeFixedI8(p, &key.compress);
|
p = taosDecodeFixedI8(p, &key.compress);
|
||||||
|
@ -1633,23 +1629,20 @@ int32_t valueDecode(void* value, int32_t vlen, int64_t* ttl, char** dest) {
|
||||||
goto _EXCEPT;
|
goto _EXCEPT;
|
||||||
}
|
}
|
||||||
key.len = rawLen;
|
key.len = rawLen;
|
||||||
|
|
||||||
if (dest) {
|
|
||||||
*dest = pOutput;
|
|
||||||
pOutput = NULL;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (dest != NULL) {
|
p = taosDecodeBinary(p, (void**)&pOutput, key.len);
|
||||||
p = taosDecodeBinary(p, (void**)dest, key.len);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ttl != NULL) *ttl = key.unixTimestamp == 0 ? 0 : key.unixTimestamp - taosGetTimestampMs();
|
if (ttl != NULL) *ttl = key.unixTimestamp == 0 ? 0 : key.unixTimestamp - taosGetTimestampMs();
|
||||||
code = 0;
|
|
||||||
|
|
||||||
taosMemoryFree(pOutput);
|
code = 0;
|
||||||
|
if (dest) {
|
||||||
|
*dest = pOutput;
|
||||||
|
pOutput = NULL;
|
||||||
|
}
|
||||||
taosMemoryFree(pCompressData);
|
taosMemoryFree(pCompressData);
|
||||||
|
taosMemoryFree(pOutput);
|
||||||
return key.len;
|
return key.len;
|
||||||
|
|
||||||
_EXCEPT:
|
_EXCEPT:
|
||||||
|
|
Loading…
Reference in New Issue