Skip to content
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 crash in median over Nullable(Decimal128) #6378

Merged
merged 4 commits into from Aug 8, 2019

Conversation

4ertus2
Copy link
Contributor

@4ertus2 4ertus2 commented Aug 7, 2019

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Category (leave one):

  • Bug Fix

Short description (up to few sentences):
Crash in median over Nullable(Decimal128)

@4ertus2 4ertus2 changed the title Test for #6371 [wip] Fix crash in median over Nullable(Decimal128) Aug 7, 2019
@4ertus2
Copy link
Contributor Author

4ertus2 commented Aug 7, 2019

There's no alignment in AllocatorWithStackMemory. It leads to crash in attepmt to push_back __int128 into PODArrayWithStackMemory

@alexey-milovidov
Copy link
Member

Also we can replace __int128 to more portable boost::cpp_int. It may lead to performance degradation, but most likely not.

@4ertus2 4ertus2 changed the title [wip] Fix crash in median over Nullable(Decimal128) Fix crash in median over Nullable(Decimal128) Aug 7, 2019
Copy link
Member

@alexey-milovidov alexey-milovidov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asked a question in Telegram chat.

@@ -636,6 +636,6 @@ using PaddedPODArray = PODArray<T, initial_bytes, TAllocator, 15, 16>;
template <typename T, size_t inline_bytes,
size_t rounded_bytes = integerRoundUp(inline_bytes, sizeof(T))>
using PODArrayWithStackMemory = PODArray<T, rounded_bytes,
AllocatorWithStackMemory<Allocator<false>, rounded_bytes>>;
AllocatorWithStackMemory<Allocator<false>, rounded_bytes, ((sizeof(T) < 16) ? sizeof(T) : 16)>>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also alignof keyword.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change.

@alexey-milovidov alexey-milovidov merged commit b579692 into ClickHouse:master Aug 8, 2019
@CurtizJ CurtizJ added the pr-bugfix Pull request with bugfix, not backported by default label Aug 9, 2019
CurtizJ pushed a commit that referenced this pull request Aug 9, 2019
Fix crash in median over Nullable(Decimal128)

(cherry picked from commit b579692)
CurtizJ pushed a commit that referenced this pull request Aug 9, 2019
Fix crash in median over Nullable(Decimal128)

(cherry picked from commit b579692)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix Pull request with bugfix, not backported by default
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants