apache / apache/brpc

brpc redis客户端不支持空字符串

Open
#2,275 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
17.6k
Forks
4.1k
Avg merge
2d 12h
Merged PRs (30d)
69

Description

**Describe the bug (描述bug)**
brpc::RedisRequest request;
std::string value("");
request.AddCommand("set key %b", value.data(), value.size());

**To Reproduce (复现方法)**
以上

**Expected behavior (期望行为)**
设置key的值为空字符串成功, 因为redis本身支持空字符串

**Versions (各种版本)**
OS:
Compiler:
brpc:
protobuf:

**Additional context/screenshots (更多上下文/截图)**
报错为, 参数个数不对, 应该是拼接命令字符串的时候有问题

Contributor guide

Open the contributing guide

Research direction

Start with the RedisRequest::AddCommand call shown in the reproduction and trace how its arguments are assembled into a Redis command. Done means setting a key with an empty string succeeds without an argument-count error; add a regression test if the relevant test location can be found.

Written by the indexing model from the issue text.

Assessment

Tech stack
redis
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.