328 Commits

Author SHA1 Message Date
michael-grunder 4336df3fee Fix bug in random key cluster test 2016-06-02 09:14:01 -07:00
michael-grunder 3012052849 More IPv6 additions
* Modified RedisArray to support IPv6
* Updated general test suite to take an override host
* Updated make-cluster.sh to take an override host
2016-02-12 18:10:50 -08:00
michael-grunder 7175aee5e2 Don't double define constant (rebase/merge fail) 2015-05-08 15:31:40 -07:00
michael-grunder 622709f311 Added a test for 'raw' commands 2015-05-07 18:12:52 -07:00
michael-grunder fb0597992a Merge remote 2015-05-07 16:30:11 -07:00
michael-grunder ab8fa7dad7 Use a static variable for our nodemap file and only open it once
to avoid blowing file descriptors.
2015-05-07 15:52:55 -07:00
michael-grunder ed7e10d621 Added cluster specific test for SCAN 2015-05-05 15:19:30 -07:00
michael-grunder 1725fccf40 Properly handle CLIENT variants :-) 2015-05-05 15:19:29 -07:00
michael-grunder 260852f562 Fix INFO command so it works in a MULTi EXEC block 2015-05-05 15:18:02 -07:00
michael-grunder 08ecec92a3 Unit test suite improvements and cluster failover test
* Added a test specifically for RedisCluster to test slave failover
  settings.
* Added an option to specifically disable colorization, as well as
  a mechanism to determine if the output is being piped, such that
  we can turn colorization off in that case as well.
2015-05-05 15:18:02 -07:00
michael-grunder 97c9edc3aa Sorted a memory leak in RedisArray and retabbed unit tests 2015-05-05 15:18:01 -07:00
michael-grunder 7ef7d07854 A few minor cluster and unit test fixes
* Fixed getLastError() to look at redisCluster->err, rather than flags
* Fixed serialization bug for zipstr multibulk processing
* Added specific RedisClusterTest tests for SCRIPT and EVALSHA commands

All unit tests passing now!  \o/
2015-05-05 15:16:50 -07:00
michael-grunder 366363e4fa Properly handle MULTI lines within a MULTI-BULK of -1 (nil) 2015-05-05 15:16:50 -07:00
michael-grunder 2f8a2fc35e Fix variant reply handling in MULTI mode 2015-05-05 15:16:50 -07:00
michael-grunder 7a106d51d6 Response handler fixes
* Fixed serialization for various multi-bulk responses
* Properly handle NULL BULK replies for variant replies
2015-05-05 15:16:50 -07:00
michael-grunder 54a521e227 Cluster fixes
* STRLEN should use cluster_long_response
* Updated multibulk processing to return an empty array on *-1
2015-05-05 15:16:50 -07:00
michael-grunder 469e8e9377 Various cluster fixes and Unit test updates
* Updated the unit test suite to print each unit test method name we're
  running as we do so, and also with fancy colors :-)
* Added functionality to handle failed transactions, where Redis will send
  us a multi bulk length of -1.  This can happen because of an EXECABORT
  error, or because a watched key was modified during the transaction
* Initialize serialized return value to NULL to avoid segfault
* use strtol not atoi in our long response handler, to handle large values
* Fixed our return value in multi responses
* Fiexed type() command as cluster doesn't still have the '+' prefix when
  checking for what TYPE returns
* Exists should return a BOOLEAN not 1/0
* Fixed sRandMember to work in the context of a MULTI block
* Use "LINDEX" not "LGET" as "LGET" isn't a valid Redis command
* Properly set our slot for the PFCOUNT command
* Many unit test changes such that Redis and RedisCluster are happy using
  mostly the same ones.
2015-05-05 15:16:49 -07:00
michael-grunder 47b05f13b9 Even more unit test integration, mset fix
* Continuing to hammer through Redis unit tests such that the
  tests will work for both Redis and RedisCluster objects
* Fixed mset so we return the RedisCluster object when it's
  executed in multi mode.
2015-05-05 15:16:49 -07:00
michael-grunder 9b68c33f7a More unit test cleanup and key consolidation for multiple key commands 2015-05-05 15:16:49 -07:00
michael-grunder 88530eed4a Add cluster specific testInfo() method 2015-05-05 15:16:49 -07:00
michael-grunder 501561b255 More unit test formatting, and key renaming so tests work in cluster 2015-05-05 15:16:49 -07:00
michael-grunder 6205504405 Unit test formatting, change to actual Redis commands. 2015-05-05 15:16:49 -07:00
michael-grunder 968ba49fa7 More unit test integration with cluster 2015-05-05 15:16:49 -07:00
michael-grunder 0b269cbb72 More RedisCluster fixes
* Properly handle single array as well as variadic arguments for
  things like RedisCluster::del
* Wrapping keys in {} such that Redis and RedisCluster tests can
  use the same methods (avoiding CROSSSLOT).
* Fixed a double-free scenerio in redis_array_impl.c
2015-05-05 15:16:49 -07:00
michael-grunder 42b81c4f1c Allow del/mget to either take one array or be treated as variadic 2015-05-05 15:16:49 -07:00
michael-grunder cceb49c5a9 Kill more tabs with fire 2015-05-05 15:16:49 -07:00
michael-grunder b251c18730 Kill tabs with fire :-) 2015-05-05 15:15:57 -07:00
michael-grunder 892a322f53 Free the correct values in hset 2015-05-05 15:11:46 -07:00
michael-grunder 0a36429ee7 Add simple options to limit which tests are run 2015-05-05 15:11:46 -07:00
michael-grunder 55084a8ed9 Update tests to reflect that ZSCAN will return float scores 2015-05-05 15:11:17 -07:00
michael-grunder 2937b2b228 Adds 'quicklist' as a valid encoding type (new list type) 2015-05-05 15:11:17 -07:00
michael-grunder 92f620bcad Incorporate formalized multi-bulk proessing from develop
This commit just backports the newer and improved multi-bulk
processing for various commands (e.g. zrange, hmget,etc) from
develop into feature/redis_cluster

Also modified getbit to treat the value as a long
2015-05-05 15:11:16 -07:00
michael-grunder 4529e6ec12 Reintroduce the ability to pass an optional long argument to incr/decr
It's easy to not break backward compatibility here, so I've
reintroduced logic such that INCR and DECR proper can be called
with an optional increment value, in which case the call actually
made is INCRBY or DECRBY, respectively.
2015-05-05 15:07:43 -07:00
michael-grunder 7453c885ef Remove empty diff/union tests
Empty sUnionStore/sDiffStore/etc type commands are protected from
empty arguments and will throw warnings so those have been removed.
2015-05-05 15:07:43 -07:00
michael-grunder b809bd8a47 More multiple argument 'incr'/'decr' commands removed from tests 2015-05-05 15:07:43 -07:00
michael-grunder 113ceae78c Update tests to stop calling 'incr' and 'decr' with an argument. 2015-05-05 15:07:43 -07:00
michael-grunder 79cb6a8905 Initial commit reworking unit tests
This commit reworks the unit tests such that all three classes
(Redis, RedisArray, and RedisCluster) can be tested using the
TestRedis.php script.

Now, when running TestRedis.php an option can be passed for which
part of phpredis we would like to test (defaults to Redis).
2015-05-05 15:07:43 -07:00
michael-grunder 479487e66c Initial commit of a simple script to create a redis cluster 2015-05-05 15:05:31 -07:00
michael-grunder f37574e959 Fix some simple leaks in RedisArray
* Make sure we always free our allocated key when extracting
* Don't copy z_fun and z_dist twice and only free one
* Free outer array for z_zadd_args
2015-01-29 15:17:18 -08:00
michael-grunder 6dc2405f1a Add empty limit string in array-tests.php 2015-01-29 12:13:44 -08:00
michael-grunder 2336477e10 Allow for pfcount to take multiple keys
When first creating the pfCount function, I simply allowed for one
string value for the key.  Either Redis changed since then, or I
just missed it initially, but the PFCOUNT command can take one or
more keys.

This change doesn't break the API (in case anyone is using it under
develop now) as it can still take a single string argument, or can
take an array.
2014-12-17 17:42:08 -08:00
michael-grunder 590c753bc1 Capture error for multibulk responses
Addresses #540
2014-12-17 12:35:07 -08:00
michael-grunder 243cca9cde Merge branch 'multibulk-serialize' into develop
Conflicts:
	redis.c

References #538
2014-12-16 11:22:14 -08:00
michael-grunder a302564c4c Fix parsing of 'zipped' replies for various uses
As discovered in issue #523, phpredis was attempting to unserialize
both the keys *and* scores for commands like zRangeByScore.  This
had to do with the logic around deserialization in the response.

In addition, this same bug would have caused issues when running
commands like $r->config('get'), because that too, would have tried
to unserialize the values, which we don't want to do.

This commit reworks parsing and zipping up replies by allowing the
call to be configured to unseraialize any combination of keys or
values (or none or both).
2014-10-31 15:00:59 -07:00
michael-grunder b1ad5435ff ZRANGEBYLEX command
This commit adds the command ZRANGEBYLEX to phpredis, which was
introduced in 2.8.9.  Like with most commands, phpredis will do
some simple validation on the client side, to avoid sending
calls which are not correct (e.g. min/max that aren't valid
for the call, etc).

Addresses #498 and #465
2014-08-30 11:45:09 -07:00
michael-grunder f78c9f4a15 Merge branch 'hotfix/debug_object' into develop 2014-07-21 12:51:01 -07:00
michael-grunder 96374a9105 Implement DEBUG OBJECT
Addresses #342
2014-07-21 12:50:29 -07:00
michael-grunder 0f1f5f444f Merge branch 'hotfix/win32-fixes' into develop
Conflicts:
	redis.c
2014-07-06 11:04:55 -07:00
michael-grunder 7a80c10905 Remove duplicate pubsub test 2014-07-06 10:58:22 -07:00
Anatol Belski 4d2533706a Merge remote-tracking branch 'vostok4/master'
Conflicts:
	CREDITS
	README.markdown
	config.w32
	library.c
	library.h
	package.xml
	redis.c
	redis_array.c
	redis_array.h
	redis_array_impl.c
	redis_array_impl.h
	tests/TestRedis.php
2014-07-01 16:45:09 +02:00