Expected behaviour
Calling hmget after setting data with hset should return the same data with or without compression enabled.
Actual behaviour
If compression is enabled, hmget doesn't appear to decompress the data from the fields it fetches.
I'm seeing this behaviour on
- OS: CentOS 7
- Redis: 6.0.8
- PHP: 7.4.12
- phpredis: 5.3.2
Steps to reproduce, backtrace or example script
<?php
$redis = new RedisCluster(null, ['127.0.0.1:6379']);
$redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_IGBINARY);
$redis->hset('a', 'b', ['abc' => 'xyz']);
echo "hget (comp off)\n";
var_export($redis->hget('a', 'b'));
echo "\nhmget (comp off)\n";
var_export($redis->hmget('a', ['b']));
echo "\n\n";
$redis->setOption(Redis::OPT_COMPRESSION, Redis::COMPRESSION_ZSTD);
$redis->hset('c', 'd', ['abc' => 'xyz']);
echo "hget (comp on)\n";
var_export($redis->hget('c', 'd'));
echo "\nhmget (comp on)\n";
var_export($redis->hmget('c', ['d']));
Output:
hget (comp off)
array (
'abc' => 'xyz',
)
hmget (comp off)
array (
'b' =>
array (
'abc' => 'xyz',
),
)
hget (comp on)
array (
'abc' => 'xyz',
)
hmget (comp on)
array (
'd' => '(/ ' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . 'abcxyz',
)
I've checked
Expected behaviour
Calling hmget after setting data with hset should return the same data with or without compression enabled.
Actual behaviour
If compression is enabled, hmget doesn't appear to decompress the data from the fields it fetches.
I'm seeing this behaviour on
Steps to reproduce, backtrace or example script
Output:
I've checked
developbranch