Skip to content

Fix bug in Decimal scale#14603

Merged
abyss7 merged 2 commits intoClickHouse:masterfrom
4ertus2:decimal
Sep 9, 2020
Merged

Fix bug in Decimal scale#14603
abyss7 merged 2 commits intoClickHouse:masterfrom
4ertus2:decimal

Conversation

@4ertus2
Copy link
Copy Markdown
Contributor

@4ertus2 4ertus2 commented Sep 8, 2020

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

Changelog category (leave one):

  • Bug Fix

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix wrong Decimal multiplication result caused wrong decimal scale of result column.

@robot-clickhouse robot-clickhouse added the pr-bugfix Pull request with bugfix, not backported by default label Sep 8, 2020
{
UInt32 scale = (tx.getScale() > ty.getScale() ? tx.getScale() : ty.getScale());
if (is_multiply)
scale = tx.getScale() * ty.getScale();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The error's here

@abyss7 abyss7 self-assigned this Sep 9, 2020
@abyss7
Copy link
Copy Markdown
Contributor

abyss7 commented Sep 9, 2020

Integration test error comes from the master branch.

@abyss7 abyss7 merged commit 48f29ae into ClickHouse:master Sep 9, 2020
4ertus2 pushed a commit that referenced this pull request Sep 9, 2020
4ertus2 pushed a commit that referenced this pull request Sep 9, 2020
4ertus2 pushed a commit that referenced this pull request Sep 9, 2020
4ertus2 added a commit that referenced this pull request Sep 9, 2020
4ertus2 added a commit that referenced this pull request Sep 9, 2020
4ertus2 added a commit that referenced this pull request Sep 9, 2020
alexey-milovidov added a commit that referenced this pull request Sep 10, 2020
Backport #14603 to 20.7: Fix bug in Decimal scale
alexey-milovidov added a commit that referenced this pull request Sep 10, 2020
Backport #14603 to 20.8: Fix bug in Decimal scale
alexey-milovidov added a commit that referenced this pull request Sep 10, 2020
Backport #14603 to 20.6: Fix bug in Decimal scale
alexey-milovidov added a commit that referenced this pull request Sep 10, 2020
Backport #14603 to 20.9: Fix bug in Decimal scale
4ertus2 added a commit that referenced this pull request Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-docs-needed pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants