Skip to content

fix deserialization bug because of uninitialized Decimal256#9967

Merged
ti-chi-bot[bot] merged 5 commits intopingcap:masterfrom
guo-shaoge:fix_column_decimal_deserialize
Mar 10, 2025
Merged

fix deserialization bug because of uninitialized Decimal256#9967
ti-chi-bot[bot] merged 5 commits intopingcap:masterfrom
guo-shaoge:fix_column_decimal_deserialize

Conversation

@guo-shaoge
Copy link
Contributor

@guo-shaoge guo-shaoge commented Mar 9, 2025

What problem does this PR solve?

Issue Number: close #9966

Problem Summary:

ColumnDecimal::deserializeAndInsertFromArena():

data.resize(data.size() + 1)
deserializeDecimal256Helper(data.back(), pos);

data is a PaddedPODArray, which means it will not call constructor when you resize new element.
So the argument passed into deserializeDecimal256Helper is not inited, but the current implementation of deserializeDecimal256Helper assume it's inited, which may cause the negate() function didn't work as expected.

What is changed and how it works?


Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

Signed-off-by: guo-shaoge <shaoge1994@163.com>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed do-not-merge/needs-triage-completed labels Mar 9, 2025
Signed-off-by: guo-shaoge <shaoge1994@163.com>
@ti-chi-bot ti-chi-bot bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 9, 2025
Signed-off-by: guo-shaoge <shaoge1994@163.com>
@guo-shaoge guo-shaoge force-pushed the fix_column_decimal_deserialize branch from 3b9c4da to 160da56 Compare March 9, 2025 10:50
@guo-shaoge guo-shaoge changed the title fix ColumnDecimal deseiralize fix Decimal256 deserialize Mar 9, 2025
Signed-off-by: guo-shaoge <shaoge1994@163.com>
@guo-shaoge guo-shaoge changed the title fix Decimal256 deserialize fix deserialization bug because of uninitialized Decimal256 Mar 10, 2025
Copy link
Contributor

@yibin87 yibin87 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Mar 10, 2025
Copy link
Contributor

@windtalker windtalker left a comment

Choose a reason for hiding this comment

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

lgtm

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Mar 10, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: windtalker, yibin87

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Mar 10, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Mar 10, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-03-10 02:04:00.959235134 +0000 UTC m=+148596.564764062: ☑️ agreed by yibin87.
  • 2025-03-10 04:46:35.539836347 +0000 UTC m=+158351.145365259: ☑️ agreed by windtalker.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Mar 10, 2025

@guo-shaoge: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

trigger some heavy tests which will not run always when PR updated.

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot bot merged commit e178ee3 into pingcap:master Mar 10, 2025
5 checks passed
@JaySon-Huang JaySon-Huang deleted the fix_column_decimal_deserialize branch March 10, 2025 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decimal256 didn't call constructor when deserialize from Arena

3 participants