Fix Memcached::setOption for OPT_LIBKETAMA_COMPATIBLE
commit7eb91d4f186154f862b53d0e3103891a9cda882e
authorAdam Saponara <saponara@gmail.com>
Thu, 18 Dec 2014 05:30:25 +0000 (17 21:30 -0800)
committerhhvm-bot <hhvm-bot@fb.com>
Thu, 18 Dec 2014 06:00:35 +0000 (17 22:00 -0800)
tree7bd1ead76d4acc86c7e5cb9741c88792f8719049
parentd34e519b4deabe119746943925117dcda9b3aabf
Fix Memcached::setOption for OPT_LIBKETAMA_COMPATIBLE

Summary: The current implementation is missing an if-statement which causes
the option to be unset even when a truthy value is passed in. The comment
directly above this block describes the correct behavior. See the original PHP
implementation for reference: http://goo.gl/7p7WqP. A new constant
Memcached::DISTRIBUTION_CONSISTENT_KETAMA is added for the sake of testing.

Closes https://github.com/facebook/hhvm/pull/4364

Reviewed By: @paulbiss

Differential Revision: D1710109

Signature: t1:1710109:1418880558:9a97113ad941927c06ca0ed8389f2208b18eca86
hphp/runtime/ext/memcached/ext_memcached.cpp
hphp/test/slow/ext_memcached/ketama_opt.php [new file with mode: 0644]
hphp/test/slow/ext_memcached/ketama_opt.php.expect [new file with mode: 0644]
hphp/test/slow/ext_memcached/ketama_opt.php.skipif [new file with mode: 0644]