diff options
author | Nicolas Favre-Felix <n.favrefelix@gmail.com> | 2011-11-09 17:33:27 +0400 |
---|---|---|
committer | Nicolas Favre-Felix <n.favrefelix@gmail.com> | 2011-11-09 17:33:27 +0400 |
commit | 90a82d3d9cfe2f46d586a220195fc75d52aa3f0e (patch) | |
tree | 87ab500b8be3d1b569feee9b9334c29159d00862 /library.c | |
parent | f367bde6044c23ce96da17ccc3703b02be0e7186 (diff) |
Fixed issue with ZSCORE in MULTI/EXEC context.
This addresses GiHub issue #78.
Diffstat (limited to 'library.c')
-rw-r--r-- | library.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -344,13 +344,18 @@ PHPAPI void redis_bulk_double_response(INTERNAL_FUNCTION_PARAMETERS, RedisSock * double ret; if ((response = redis_sock_read(redis_sock, &response_len TSRMLS_CC)) == NULL) { - RETURN_FALSE; + IF_MULTI_OR_PIPELINE() { + add_next_index_bool(z_tab, 0); + } else { + RETURN_FALSE; + } + return; } ret = atof(response); efree(response); IF_MULTI_OR_PIPELINE() { - add_next_index_double(z_tab, ret); + add_next_index_double(z_tab, ret); } else { RETURN_DOUBLE(ret); } @@ -362,7 +367,11 @@ PHPAPI void redis_type_response(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_s long l; if ((response = redis_sock_read(redis_sock, &response_len TSRMLS_CC)) == NULL) { - RETURN_FALSE; + IF_MULTI_OR_PIPELINE() { + add_next_index_bool(z_tab, 0); + } else { + RETURN_FALSE; + } } if (strncmp(response, "+string", 7) == 0) { |