Skip to content

Commit f13f9b7

Browse files
victoryatsukhnenko
victor
authored andcommitted
During scan build the command using long type for iterator instead of int. Shall resolve issues with Redis Enterprise which uses big 64 bit numbers for cursor.
Conflicts: redis.c
1 parent 3ceb410 commit f13f9b7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

redis.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -3402,7 +3402,7 @@ PHP_METHOD(Redis, command) {
34023402
/* Helper to format any combination of SCAN arguments */
34033403
PHP_REDIS_API int
34043404
redis_build_scan_cmd(char **cmd, REDIS_SCAN_TYPE type, char *key, int key_len,
3405-
int iter, char *pattern, int pattern_len, int count,
3405+
long iter, char *pattern, int pattern_len, int count,
34063406
zend_string *match_type)
34073407
{
34083408
smart_string cmdstr = {0};
@@ -3433,7 +3433,7 @@ redis_build_scan_cmd(char **cmd, REDIS_SCAN_TYPE type, char *key, int key_len,
34333433
/* Start the command */
34343434
redis_cmd_init_sstr(&cmdstr, argc, keyword, strlen(keyword));
34353435
if (key_len) redis_cmd_append_sstr(&cmdstr, key, key_len);
3436-
redis_cmd_append_sstr_int(&cmdstr, iter);
3436+
redis_cmd_append_sstr_long(&cmdstr, iter);
34373437

34383438
/* Append COUNT if we've got it */
34393439
if(count) {
@@ -3543,7 +3543,7 @@ generic_scan_cmd(INTERNAL_FUNCTION_PARAMETERS, REDIS_SCAN_TYPE type) {
35433543
}
35443544

35453545
// Format our SCAN command
3546-
cmd_len = redis_build_scan_cmd(&cmd, type, key, key_len, (int)iter,
3546+
cmd_len = redis_build_scan_cmd(&cmd, type, key, key_len, (long)iter,
35473547
pattern, pattern_len, count, match_type);
35483548

35493549
/* Execute our command getting our new iterator value */

0 commit comments

Comments
 (0)