-
Notifications
You must be signed in to change notification settings - Fork 69
Fix tag empty error and disorder timestamp. #489
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #489 +/- ##
===========================================
+ Coverage 65.70% 65.77% +0.06%
===========================================
Files 566 566
Lines 33360 33430 +70
Branches 4664 4688 +24
===========================================
+ Hits 21919 21987 +68
- Misses 10789 10790 +1
- Partials 652 653 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
for (int32_t pos : id_column_context.pos_in_result_) { | ||
common::String device_id( | ||
device_query_task_->get_device_id()->get_segments().at( | ||
id_column_context.pos_in_device_id_)); | ||
common::String device_id; | ||
if (device_query_task_->get_device_id()->segment_num() <= | ||
id_column_context.pos_in_device_id_) { | ||
device_id = common::String(""); | ||
} else { | ||
device_id = common::String( | ||
device_query_task_->get_device_id()->get_segments().at( | ||
id_column_context.pos_in_device_id_)); | ||
} | ||
if (RET_FAIL(col_appenders_[pos + 1]->fill( | ||
(char*)&device_id, sizeof(device_id), | ||
current_block_->get_row_count()))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should distinguish null from empty string.
("table1", null, "tag1") is different from ("table1", "", "tag1")
3b74e14
to
c40d043
Compare
write_var_int(storage::NO_STR_TO_READ, out); | ||
return ret; | ||
} | ||
size_t str_len = std::strlen(str); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not guaranteed that a tag will not contain '\0', so it is invalid to use std::strlen.
cpp/src/common/device_id.h
Outdated
virtual const std::vector<std::string>& get_segments() const { | ||
virtual const std::vector<char*>& get_segments() const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As stated, C-style strings may have a potential problem.
How about using std::string*?
char *tmp_buf = static_cast<char *>(malloc(len + 1)); | ||
tmp_buf[len] = '\0'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is adding '\0' still necessary?
In this pr:
Fixed the issue of out-of-order data writes.
Fixed the issue related to writing and reading with empty tags.
Added support for writing null tag values.