Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichael-grunder <michael.grunder@gmail.com>2022-11-04 00:10:18 +0300
committerMichael Grunder <michael.grunder@gmail.com>2022-11-04 00:32:07 +0300
commit854f3aa4262b43e0ea5a27b2eb394b882db06f0a (patch)
treebfc257d9cbe3df7504e7be8091150b5f95e98b15 /redis_commands.c
parentb8679d7af1c7337f0132bfd60924846412b03081 (diff)
Documentation: Stream doc blocks and xtrim fix
- XTRIM needs to take the `$threshold` arg as a string since MINID is not a number.
Diffstat (limited to 'redis_commands.c')
-rw-r--r--redis_commands.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/redis_commands.c b/redis_commands.c
index 332351eb..e75b1892 100644
--- a/redis_commands.c
+++ b/redis_commands.c
@@ -6076,15 +6076,15 @@ int redis_xinfo_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
int redis_xtrim_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
char **cmd, int *cmd_len, short *slot, void **ctx)
{
- zend_long threshold = 0, limit = -1;
+ zend_string *key = NULL, *threshold = NULL;
zend_bool approx = 0, minid = 0;
smart_string cmdstr = {0};
- zend_string *key = NULL;
+ zend_long limit = -1;
int argc;
ZEND_PARSE_PARAMETERS_START(2, 5)
Z_PARAM_STR(key)
- Z_PARAM_LONG(threshold)
+ Z_PARAM_STR(threshold)
Z_PARAM_OPTIONAL
Z_PARAM_BOOL(approx)
Z_PARAM_BOOL(minid)
@@ -6108,7 +6108,7 @@ int redis_xtrim_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
REDIS_CMD_APPEND_SSTR_STATIC(&cmdstr, "=");
}
- redis_cmd_append_sstr_long(&cmdstr, threshold);
+ redis_cmd_append_sstr_zstr(&cmdstr, threshold);
if (limit > -1 && approx) {
REDIS_CMD_APPEND_SSTR_STATIC(&cmdstr, "LIMIT");