Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/bin/memcapable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,14 @@ static enum test_return receive_error_response(void) {
return TEST_PASS;
}

static enum test_return receive_delete_with_extra_args_response(void) {
char buffer[80];
execute(receive_line(buffer, sizeof(buffer)));
verify(strncmp(buffer, "ERROR", 5) == 0 || strncmp(buffer, "CLIENT_ERROR", 12) == 0
|| strcmp(buffer, "NOT_FOUND\r\n") == 0);
return TEST_PASS;
}

static enum test_return test_ascii_quit(void) {
if (!v16x_or_greater) {
/* Verify that quit handles unknown options */
Expand Down Expand Up @@ -1451,9 +1459,13 @@ static enum test_return test_ascii_delete_impl(const char *key, bool noreply) {

execute(send_string("delete\r\n"));
execute(receive_error_response());
/* BUG: the server accepts delete a b */

/*
* Some servers reject extra delete arguments, while memcached 1.6 treats
* them as accepted option tokens and returns the result for key "a".
*/
execute(send_string("delete a b c d e\r\n"));
execute(receive_error_response());
execute(receive_delete_with_extra_args_response());

char buffer[1024];
snprintf(buffer, sizeof(buffer), "delete %s%s\r\n", key, noreply ? " noreply" : "");
Expand Down
Loading