Skip to content

Commit edc724e

Browse files
aolleymichael-grunder
authored andcommitted
Pass compression flag when performing HMGET (phpredis#1945)
Without this, performing a HMGET call fails to decompress the data before returning it to php.
1 parent 9dbd3c5 commit edc724e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

cluster_library.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2112,6 +2112,7 @@ PHP_REDIS_API void cluster_gen_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS,
21122112
if (c->reply_len > 0) {
21132113
/* Push serialization settings from the cluster into our socket */
21142114
c->cmd_sock->serializer = c->flags->serializer;
2115+
c->cmd_sock->compression = c->flags->compression;
21152116

21162117
/* Call our specified callback */
21172118
if (cb(c->cmd_sock, &z_result, c->reply_len, ctx) == FAILURE) {

tests/RedisTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4610,6 +4610,10 @@ private function checkCompression($mode, $level)
46104610
$this->assertEquals($val, $this->redis->get('key'));
46114611
}
46124612
}
4613+
4614+
// Issue 1945. Ensure we decompress data with hmget.
4615+
$this->redis->hset('hkey', 'data', 'abc');
4616+
$this->assertEquals('abc', current($this->redis->hmget('hkey', ['data'])));
46134617
}
46144618

46154619
public function testDumpRestore() {

0 commit comments

Comments
 (0)