{
return (
rc != MEMCACHED_BUFFERED &&
+ rc != MEMCACHED_CLIENT_ERROR &&
rc != MEMCACHED_DATA_EXISTS &&
rc != MEMCACHED_DELETED &&
rc != MEMCACHED_E2BIG &&
{
assert_msg(rc != MEMCACHED_ERRNO, "Programmer error, MEMCACHED_ERRNO was set to be returned to client");
assert_msg(rc != MEMCACHED_SOME_ERRORS, "Programmer error, MEMCACHED_SOME_ERRORS was about to be set on a org::libmemcached::Instance");
- if (memcached_fatal(rc) == false)
+ if (memcached_fatal(rc) == false and rc != MEMCACHED_CLIENT_ERROR)
{
return rc;
}
memcached_string_t error_host= { hostname_port_message, size_t(size) };
- assert(self.root);
+ assert_msg(self.root, "Programmer error, root was not set on instance");
if (self.root == NULL)
{
return rc;
_set(self, (*self.root));
assert(self.root->error_messages);
assert(self.error_messages);
+ assert(self.error_messages->rc == self.root->error_messages->rc);
return rc;
}
_set(*self.root, &error_host, rc, at, local_errno);
_set(self, (*self.root));
+#if 0
+ if (self.root->error_messages->rc != self.error_messages->rc)
+ {
+ fprintf(stderr, "%s:%d %s != %s\n", __FILE__, __LINE__,
+ memcached_strerror(NULL, self.root->error_messages->rc),
+ memcached_strerror(NULL, self.error_messages->rc));
+ }
+#endif
+
return rc;
}
and buffer[6] == '_'
and buffer[7] == 'E' and buffer[8] == 'R' and buffer[9] == 'R' and buffer[10] == 'O' and buffer[11] == 'R')
{
- return MEMCACHED_CLIENT_ERROR;
+ // Move past the basic error message and whitespace
+ char *startptr= buffer + memcached_literal_param_size("CLIENT_ERROR");
+ if (startptr[0] == ' ')
+ {
+ startptr++;
+ }
+
+ char *endptr= startptr;
+ while (*endptr != '\r' && *endptr != '\n') endptr++;
+
+ return memcached_set_error(*instance, MEMCACHED_CLIENT_ERROR, MEMCACHED_AT, startptr, size_t(endptr - startptr));
}
}
break;
{"lp:1009493", true, (test_callback_fn*)regression_1009493_TEST },
{"lp:1021819", true, (test_callback_fn*)regression_1021819_TEST },
{"lp:1048945", true, (test_callback_fn*)regression_1048945_TEST },
+ {"lp:1067242", true, (test_callback_fn*)regression_1067242_TEST },
{0, false, (test_callback_fn*)0}
};
return TEST_SUCCESS;
}
+test_return_t regression_1067242_TEST(memcached_st *memc)
+{
+ test_compare(MEMCACHED_SUCCESS, memcached_set(memc,
+ test_literal_param(__func__),
+ test_literal_param("-2"),
+ 0, 0));
+
+ memcached_return_t rc;
+ char* value;
+ test_true((value= memcached_get(memc, test_literal_param(__func__), NULL, NULL, &rc)));
+ test_compare(MEMCACHED_SUCCESS, rc);
+ free(value);
+
+ for (size_t x= 0; x < 10; x++)
+ {
+ uint64_t new_number;
+ test_compare(MEMCACHED_CLIENT_ERROR,
+ memcached_increment(memc,
+ test_literal_param(__func__), 1, &new_number));
+ test_compare(MEMCACHED_CLIENT_ERROR, memcached_last_error(memc));
+ test_true((value= memcached_get(memc, test_literal_param(__func__), NULL, NULL, &rc)));
+ test_compare(MEMCACHED_SUCCESS, rc);
+ free(value);
+ }
+
+ return TEST_SUCCESS;
+}
+
/*
Set the value, then quit to make sure it is flushed.
Come back in and test that add fails.
test_return_t regression_994772_TEST(memcached_st*);
test_return_t regression_1009493_TEST(memcached_st*);
test_return_t regression_1048945_TEST(memcached_st*);
+test_return_t regression_1067242_TEST(memcached_st*);