From: Brian Aker Date: Sun, 29 Jan 2012 00:29:40 +0000 (-0800) Subject: Update get to not check the grouping key. X-Git-Tag: 1.0.5~86 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=2759aa4142bba88f6dec856178cb5cd628806abb;p=awesomized%2Flibmemcached Update get to not check the grouping key. --- diff --git a/libmemcached/get.cc b/libmemcached/get.cc index a6fe4034..9ed7296f 100644 --- a/libmemcached/get.cc +++ b/libmemcached/get.cc @@ -237,11 +237,6 @@ static memcached_return_t memcached_mget_by_key_real(memcached_st *ptr, bool is_group_key_set= false; if (group_key and group_key_length) { - if (memcached_failed(memcached_key_test(*ptr, (const char * const *)&group_key, &group_key_length, 1))) - { - return memcached_set_error(*ptr, MEMCACHED_BAD_KEY_PROVIDED, MEMCACHED_AT, memcached_literal_param("A bad group key was provided.")); - } - master_server_key= memcached_generate_hash_with_redistribution(ptr, group_key, group_key_length); is_group_key_set= true; } @@ -254,8 +249,7 @@ static memcached_return_t memcached_mget_by_key_real(memcached_st *ptr, */ for (uint32_t x= 0; x < memcached_server_count(ptr); x++) { - memcached_server_write_instance_st instance= - memcached_server_instance_fetch(ptr, x); + memcached_server_write_instance_st instance= memcached_server_instance_fetch(ptr, x); if (memcached_server_response_count(instance)) { @@ -273,7 +267,7 @@ static memcached_return_t memcached_mget_by_key_real(memcached_st *ptr, } } - if (ptr->flags.binary_protocol) + if (memcached_is_binary(ptr)) { return binary_mget_by_key(ptr, master_server_key, is_group_key_set, keys, key_length, number_of_keys, mget_mode); diff --git a/tests/libmemcached-1.0/mem_functions.cc b/tests/libmemcached-1.0/mem_functions.cc index f5545836..dfd7d21e 100644 --- a/tests/libmemcached-1.0/mem_functions.cc +++ b/tests/libmemcached-1.0/mem_functions.cc @@ -922,7 +922,8 @@ static test_return_t bad_key_test(memcached_st *memc) test_compare(query_id +1, memcached_query_id(memc_clone)); query_id= memcached_query_id(memc_clone); - test_compare(MEMCACHED_BAD_KEY_PROVIDED, + // Grouping keys are not required to follow normal key behaviors + test_compare(MEMCACHED_SUCCESS, memcached_mget_by_key(memc_clone, "foo daddy", 9, keys, key_lengths, 1)); test_compare(query_id +1, memcached_query_id(memc_clone));