+
+ max_keylen= 250;
+
+ /* The following test should be moved to the end of this function when the
+ memcached server is updated to allow max size length of the keys in the
+ binary protocol
+ */
+ rc= memcached_callback_set(clone, MEMCACHED_CALLBACK_PREFIX_KEY, NULL);
+ assert(rc == MEMCACHED_SUCCESS);
+
+ char *longkey= malloc(max_keylen + 1);
+ if (longkey != NULL)
+ {
+ memset(longkey, 'a', max_keylen + 1);
+ string= memcached_get(clone, longkey, max_keylen,
+ &string_length, &flags, &rc);
+ assert(rc == MEMCACHED_NOTFOUND);
+ assert(string_length == 0);
+ assert(!string);
+
+ string= memcached_get(clone, longkey, max_keylen + 1,
+ &string_length, &flags, &rc);
+ assert(rc == MEMCACHED_BAD_KEY_PROVIDED);
+ assert(string_length == 0);
+ assert(!string);
+
+ free(longkey);
+ }