Skip to content
Snippets Groups Projects
Commit dc26522a authored by Georgios Bitzes's avatar Georgios Bitzes
Browse files

Add support for 'DEBUG SEGFAULT'

parent 29db5269
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,7 @@ std::map<std::string,
struct cmdMapInit {
cmdMapInit() {
redis_cmd_map["ping"] = {RedisCommand::PING, CommandType::CONTROL};
redis_cmd_map["debug"] = {RedisCommand::DEBUG, CommandType::CONTROL};
redis_cmd_map["get"] = {RedisCommand::GET, CommandType::READ};
redis_cmd_map["exists"] = {RedisCommand::EXISTS, CommandType::READ};
......
......@@ -30,6 +30,8 @@ namespace quarkdb {
enum class RedisCommand {
PING,
DEBUG,
FLUSHALL,
GET,
......
......@@ -45,6 +45,14 @@ LinkStatus RedisDispatcher::dispatch(Connection *conn, RedisRequest &request, Re
return conn->string(request[1]);
}
case RedisCommand::DEBUG: {
if(request.size() != 2) return conn->errArgs(request[0]);
if(request[1] == "segfault" || request[1] == "SEGFAULT") {
*( (int*) nullptr) = 5; // bye bye
}
return conn->err(SSTR("unknown argument '" << request[1] << "'"));
}
case RedisCommand::FLUSHALL: {
if(request.size() != 1) return conn->errArgs(request[0]);
rocksdb::Status st = store.flushall();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment