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

tablecodec: fix the issue that decoding an index value might panic (#53034) #53173

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #53034

What problem does this PR solve?

Issue Number: close #47115

Problem Summary: decoding an index value with large padding size might panic, because the padding size is:

  • encoded via: types.NewUintDatum(paddingSize) => encodeUint
  • decoded via decodeRestoredValuesV5 => rd.DecodeToBytesNoHandle => rd.encodeOldDatum(IntFlag) => codec.EncodeVarint(buf, decodeInt(raw)) because the field type is not marked as unsigned in buildRestoredColumn.

What changed and how does it work?

Set unsigned flag to the field type correctly.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

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

Please refer to Release Notes Language Style Guide to write a quality release note.

None

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot ti-chi-bot added ok-to-test release-note-none size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-6.5 labels May 10, 2024
@ti-chi-bot ti-chi-bot bot added do-not-merge/cherry-pick-not-approved size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 10, 2024
@ti-chi-bot ti-chi-bot added the cherry-pick-approved Cherry pick PR approved by release team. label May 10, 2024
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed do-not-merge/cherry-pick-not-approved size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 10, 2024
Signed-off-by: zyguan <zhongyangguan@gmail.com>
@zyguan zyguan force-pushed the cherry-pick-53034-to-release-6.5 branch from ac660cc to ae074a0 Compare May 10, 2024 10:09
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 10, 2024
Copy link

codecov bot commented May 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (release-6.5@389b0c1). Click here to learn what that means.

Additional details and impacted files
@@               Coverage Diff                @@
##             release-6.5     #53173   +/-   ##
================================================
  Coverage               ?   73.6505%           
================================================
  Files                  ?       1096           
  Lines                  ?     351598           
  Branches               ?          0           
================================================
  Hits                   ?     258954           
  Misses                 ?      76014           
  Partials               ?      16630           

@ti-chi-bot ti-chi-bot bot added the lgtm label May 13, 2024
Copy link

ti-chi-bot bot commented May 13, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: crazycs520, ekexium

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

The pull request process is described here

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

Copy link

ti-chi-bot bot commented May 13, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-05-11 04:23:49.158809202 +0000 UTC m=+1281582.915944823: ☑️ agreed by crazycs520.
  • 2024-05-13 01:59:13.853997032 +0000 UTC m=+1445707.611132607: ☑️ agreed by ekexium.

@ti-chi-bot ti-chi-bot bot merged commit 335e834 into pingcap:release-6.5 May 13, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved cherry-pick-approved Cherry pick PR approved by release team. lgtm ok-to-test release-note-none size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-6.5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants