-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
是否存在空指针partition先访问后判断的问题? #1410
Comments
能否加微信助手 PikiwiDB ,然后加入 微信群交流下? |
可以改成 std::pair<std::shared_ptr,int> 存储下指针和id |
@fly1ngpengu1ns The bug really exists. Maybe you can submit a pr. Just record the table_name & partition_id in the log. |
Thanks for your support! I have submitted a PR: #1414 |
您好!我在阅读源码时发现,在https://github.com/OpenAtomFoundation/pika/blob/unstable/src/pika_server.cc#L988 中,存在着下面这样的代码:
这里partition是NULL的时候才会进988行的处理流程,但是这里用了partition->GetPartitionName(),使用到了空指针?
而查看partition的赋值语句
std::shared_ptr<Partition> partition = GetTablePartitionById(table_name, partition_id);
中调用的函数GetTablePartitionById:发现他确实是可以返回NULL的,上述访问空指针的流程确实存在,但是有点不知道怎么修改?能直接输出partition_id,而不是partition_name吗?
同样的问题还出现在了https://github.com/OpenAtomFoundation/pika/blob/unstable/src/pika_server.cc#L971 和
https://github.com/OpenAtomFoundation/pika/blob/unstable/src/pika_server.cc#L965 中
The text was updated successfully, but these errors were encountered: