Expected behaviour
When running a redis scan command, I expect the iterator to be the same value as the redis cursor.
Actual behaviour
The cursor is being converted to a signed int, while redis returns an unsigned int. So any cursor over the signed int max value is set to the signed int max value before the next scan iteration.
I'm seeing this behaviour on
-OS: Linux
- Redis: 8.1
- PHP: 8.2
- phpredis: 6.0.2
Steps to reproduce, backtrace or example script
When redis scan command returns a cursor larger than the signed int max value,
$iter will be 9223372036854775807, which is sent to redis for the next iteration.
do {
$arr_keys = $redis->scan($iter, $server, $pattern, $count);
if($arr_keys !== FALSE){
foreach($arr_keys as $str_key){
echo "key";
}
}
echo $iter;
}
while($iter > 0);
This is using RedisCluster with a targeted node in the scan parameters
I've checked
Expected behaviour
When running a redis scan command, I expect the iterator to be the same value as the redis cursor.
Actual behaviour
The cursor is being converted to a signed int, while redis returns an unsigned int. So any cursor over the signed int max value is set to the signed int max value before the next scan iteration.
I'm seeing this behaviour on
-OS: Linux
Steps to reproduce, backtrace or example script
When redis scan command returns a cursor larger than the signed int max value,
$iter will be 9223372036854775807, which is sent to redis for the next iteration.
This is using RedisCluster with a targeted node in the scan parameters
I've checked
developbranch