Compare commits

..

1 Commits

Author SHA1 Message Date
Till Krüss 401abc4315 fix changelog typo 2026-09-10 15:31:07 -07:00
10 changed files with 14 additions and 55 deletions
+4 -1
View File
@@ -1,8 +1,11 @@
## Changelog
## Unreleased
### Added
### Changed
- Changed RESP3 double parsing to return `NAN` for NaN payloads instead of `0.0`
### Fixed
- Fixed RESP3 double parsing returning positive `INF` for `-inf` payloads (#1716)
- Fixed `client_info` connection parameter being ignored (#1722)
## v3.6.0 (2026-08-14)
### Added
@@ -71,10 +71,6 @@ class Resp3Strategy extends Resp2Strategy
return -INF;
}
if (preg_match('/^-?nan(\(.*\))?$/i', $string) === 1) {
return NAN;
}
return (float) $string;
}
@@ -118,11 +118,7 @@ class TDIGESTBYRANK_Test extends PredisCommandTestCase
$actualResponse = $redis->tdigestbyrank('key', 0, 1, 2, 3, 4, 5, 6);
$this->assertEquals($expectedResponse, $actualResponse);
$emptyResponse = $redis->tdigestbyrank('empty_key', 0, 1);
$this->assertCount(2, $emptyResponse);
foreach ($emptyResponse as $value) {
$this->assertNan($value);
}
$this->assertEquals([null, null], $redis->tdigestbyrank('empty_key', 0, 1));
}
/**
@@ -118,11 +118,7 @@ class TDIGESTBYREVRANK_Test extends PredisCommandTestCase
$actualResponse = $redis->tdigestbyrevrank('key', 0, 1, 2, 3, 4, 5, 6);
$this->assertEquals($expectedResponse, $actualResponse);
$emptyResponse = $redis->tdigestbyrevrank('empty_key', 0, 1);
$this->assertCount(2, $emptyResponse);
foreach ($emptyResponse as $value) {
$this->assertNan($value);
}
$this->assertEquals([null, null], $redis->tdigestbyrevrank('empty_key', 0, 1));
}
/**
@@ -118,11 +118,7 @@ class TDIGESTCDF_Test extends PredisCommandTestCase
$actualResponse = $redis->tdigestcdf('key', 0, 1, 2, 3, 4);
$this->assertSameWithPrecision($expectedResponse, $actualResponse, 5);
$emptyResponse = $redis->tdigestcdf('empty_key', 0, 1);
$this->assertCount(2, $emptyResponse);
foreach ($emptyResponse as $value) {
$this->assertNan($value);
}
$this->assertSame([0.0, 0.0], $redis->tdigestcdf('empty_key', 0, 1));
}
/**
@@ -116,7 +116,7 @@ class TDIGESTMAX_Test extends PredisCommandTestCase
$actualResponse = $redis->tdigestmax('key');
$this->assertEquals('5', $actualResponse);
$this->assertNan($redis->tdigestmax('empty_key'));
$this->assertEquals(0, $redis->tdigestmax('empty_key'));
}
/**
@@ -116,7 +116,7 @@ class TDIGESTMIN_Test extends PredisCommandTestCase
$actualResponse = $redis->tdigestmin('key');
$this->assertEquals('1', $actualResponse);
$this->assertNan($redis->tdigestmin('empty_key'));
$this->assertEquals(0, $redis->tdigestmin('empty_key'));
}
/**
@@ -118,11 +118,7 @@ class TDIGESTQUANTILE_Test extends PredisCommandTestCase
$this->assertEquals([1.0, 2.0, 3.0, 3.0, 4.0, 4.0, 4.0, 5.0, 5.0, 5.0, 5.0], $quantileResponse);
$redis->tdigestcreate('empty_key');
$emptyResponse = $redis->tdigestquantile('empty_key', 0.0, 0.1);
$this->assertCount(2, $emptyResponse);
foreach ($emptyResponse as $value) {
$this->assertNan($value);
}
$this->assertEquals([null, null], $redis->tdigestquantile('empty_key', 0.0, 0.1));
}
/**
@@ -129,11 +129,10 @@ class TDIGESTRESET_Test extends PredisCommandTestCase
$this->assertEquals('OK', $actualResponse);
$this->assertSame(500, $info['Compression']);
$resetResponse = $redis->tdigestbyrank('key', 0, 1, 2, 3, 4, 5);
$this->assertCount(6, $resetResponse);
foreach ($resetResponse as $value) {
$this->assertNan($value);
}
$this->assertEquals(
[null, null, null, null, null, null],
$redis->tdigestbyrank('key', 0, 1, 2, 3, 4, 5)
);
}
/**
@@ -67,19 +67,6 @@ class Resp3StrategyTest extends PredisTestCase
$this->assertSame($expectedValue, $actualResponse);
}
/**
* @dataProvider nanProvider
* @group disconnected
* @param string $data
* @return void
*/
public function testParseDataReturnsFloatNanOnNanValue(string $data): void
{
$actualResponse = $this->strategy->parseData($data);
$this->assertNan($actualResponse);
}
/**
* @dataProvider booleanProvider
* @group disconnected
@@ -184,16 +171,6 @@ class Resp3StrategyTest extends PredisTestCase
];
}
public function nanProvider(): array
{
return [
'canonical nan' => [",nan\r\n"],
'negative nan' => [",-nan\r\n"],
'uppercase nan' => [",NAN\r\n"],
'nan with payload' => [",nan(ind)\r\n"],
];
}
public function booleanProvider(): array
{
return [