Skip to content

4.0: Fix data branch decimal results on 4.0-dev - #24895

Merged
mergify[bot] merged 7 commits into
matrixorigin:4.0-devfrom
gouhongshen:codex/fix-data-branch-decimal-4.0
Jun 15, 2026
Merged

mergify[bot] merged 7 commits into
matrixorigin:4.0-devfrom
gouhongshen:codex/fix-data-branch-decimal-4.0

Conversation

@gouhongshen

@gouhongshen gouhongshen commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #24847

What this PR does / why we need it:

Port the data branch decimal result conversion fix to 4.0-dev.

  • Preserve decimal precision/scale metadata from MySQL result columns and validate invalid/missing decimal metadata.
  • Materialize decimal64/decimal128/decimal256 row values as typed MatrixOne vectors when building data branch output batches.
  • Decode and compare decimal256 raw tuple values in data branch hashdiff/change replay paths.
  • Add focused unit tests and BVT coverage with diff_14.sql for decimal64/decimal128/decimal256 data branch diff.

Notes:

Checks:

  • make -C thirdparties
  • source $HOME/.zshrc && moenv && go test ./pkg/container/types ./pkg/frontend ./pkg/vm/engine/disttae/logtailreplay
  • git diff --check upstream/4.0-dev...HEAD

Draft until CI confirms this port on 4.0-dev.

@matrix-meow matrix-meow added the size/M Denotes a PR that changes [100,499] lines label Jun 9, 2026
@mergify
mergify Bot requested a review from XuPeng-SH June 9, 2026 07:24
@gouhongshen gouhongshen changed the title [codex] Fix data branch decimal results on 4.0-dev 4.0: Fix data branch decimal results on 4.0-dev Jun 9, 2026
@gouhongshen
gouhongshen force-pushed the codex/fix-data-branch-decimal-4.0 branch from 1baf6dd to 2d48dd5 Compare June 10, 2026 02:54
@mergify mergify Bot added kind/bug Something isn't working kind/test-ci labels Jun 10, 2026
@gouhongshen

Copy link
Copy Markdown
Contributor Author

Updated this PR to address the review coverage gaps.

Covered in this push:

  • Added focused appendFromEntry() coverage for decimal256, including null handling.
  • Expanded diff_14 to cover decimal UPDATE / INSERT / DELETE paths under save_query_result=on.
  • Added a product-level pick_12 conflict case using decimal(39,4) as a non-PK value, covering fail / skip / accept behavior. This also covers the decimal256 pick output path without mixing in the separately tracked decimal256 PK issue ([Bug]: data branch pick does not support decimal256 primary keys #24902).

Local validation on 4.0-dev:

  • source $HOME/.zshrc && moenv && go test ./pkg/frontend ./pkg/vm/engine/disttae/logtailreplay
  • BVT diff_14: 15/15 passed
  • BVT pick_12: 69/69 passed
  • git diff --check

Re-requesting review.

@gouhongshen

Copy link
Copy Markdown
Contributor Author

已把 3.0-dev 上处理 change request 的 decimal256 data branch pick 修复 port 到 4.0-dev。

本次更新 commit: cab3ab3fa9 fix: support decimal256 data branch pick keys

本地验证:

source $HOME/.zshrc && cd /Users/ghs-mo/MOWorkSpace/matrixone-2nd && moenv && cd /private/tmp/matrixone-port-decimal-4.0 && go test ./pkg/container/types ./pkg/container/vector ./pkg/frontend ./pkg/sql/colexec/lockop ./pkg/vm/engine/readutil ./pkg/objectio/mergeutil ./pkg/vm/engine/tae/mergesort -run 'TestSimpleTupleAllTypes|TestSingleTypeTuple|TestDecimal256OrderTuple|TestTupleSQLStrings|TestTupleSQLStringsWithEncodeDecode|TestDecodeTupleWithSchema|TestUnpackNthElement|TestType_DescString|TestFetchDecimal256Rows|TestFetchDecimal256RowsWithFilter|TestFetchDecimal256RowsWithFilterAll|TestNumericGap_AllTypes|TestIsNumericType|TestAppendNumericStringToVec_AllTypes|TestCoercePickKeyVectorToType_Decimal256ReformatsToTargetType|TestExtractPKValDecimal256|TestFormatPickKeyVectorValueAsString_AllSupportedKinds|TestLCAProbeJoinCastType|TestConstructBlockPKFilter|TestMergeBaseFilterInKind|TestMergeSortBatchesDecimal256|TestAObjMergeDecimal256' -count=1

结果:PASS。git diff --check 也已通过。

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed from multiple angles with extra unhappy-path focus.

I did not find a new blocking issue in this 4.0-dev backport. Decimal metadata preservation, decimal64/128/256 materialization, and decimal256 diff/replay handling all look consistent with the intended fix, and the added unit/BVT coverage hits the main regression surface.

I also checked the main unhappy-path concern around convertRowsIntoBatch early-return cleanup: that partial-batch cleanup pattern already exists in 4.0-dev (for example the pre-existing timestamp parse path), so this PR does not introduce a new cleanup regression there.

@matrix-meow matrix-meow removed the size/L Denotes a PR that changes [500,999] lines label Jun 15, 2026
@mergify

mergify Bot commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-06-15 15:32 UTC · Rule: release-4.0
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-06-15 17:36 UTC · at efc4df075f4c977474201c53a8819e8168cbef17 · squash

This pull request spent 2 hours 4 minutes 28 seconds in the queue, including 1 hour 3 minutes 36 seconds running CI.

Required conditions to merge
  • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-decision = APPROVED [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PESSIMISTIC)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PESSIMISTIC)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PESSIMISTIC)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
    • check-neutral = Matrixone Standlone CI / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
    • check-skipped = Matrixone Standlone CI / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-neutral = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / SCA Test on Ubuntu/x86
    • check-neutral = Matrixone CI / SCA Test on Ubuntu/x86
    • check-skipped = Matrixone CI / SCA Test on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(Optimistic/PUSH)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(Optimistic/PUSH)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(Optimistic/PUSH)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
    • check-neutral = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
    • check-skipped = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Upgrade CI / Compatibility Test With Target on Linux/x64(LAUNCH)
    • check-neutral = Matrixone Upgrade CI / Compatibility Test With Target on Linux/x64(LAUNCH)
    • check-skipped = Matrixone Upgrade CI / Compatibility Test With Target on Linux/x64(LAUNCH)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Utils CI / Coverage
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working kind/test-ci size/XL Denotes a PR that changes [1000, 1999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants