-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[fix](split_by_string) Fix split by string core on column string #28030
Conversation
run buildall |
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.
clang-tidy made some suggestions
run buildall |
run buildall |
(From new machine)TeamCity pipeline, clickbench performance test result: |
TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
|
str_pos += delimiter_ref.size; | ||
const size_t new_size = old_size + split_part_size; | ||
column_string_chars.resize(new_size); | ||
if (split_part_size > 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.
what if str_ref.length>16
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.
I dont know. The snippet is copied from #18496
It seems that there is no guarantee for the memory alignment. I will figure it out.
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.
I think we are safe here, since ColumnString uses PaddedPODArray as its data type.
using PaddedPODArray = PODArray<T, initial_bytes, TAllocator, 15, 16>;
means it will always be safe to read/write 16 bytes after end of StrRef of a ColumnString.
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.
LGTM
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
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.
LGTM
…ysql result (apache#28069) BE will core dump if result block is invalid when we doing result serialization. An existing bug case is described in apache#28030, so we add check branch to avoid BE core dump due to out of range related problem.
…ysql result (apache#28069) BE will core dump if result block is invalid when we doing result serialization. An existing bug case is described in apache#28030, so we add check branch to avoid BE core dump due to out of range related problem.
wait for another PR to merge to 2.0 branch and then merge this PR.
Applying
split_by_string
on string column, such asselect split_by_string ("abc", string) from tbl
, will trigger LOG_FATAL on master and make branch-2.0 core dump on mysql result serde.Since we will have an invalid block like below: