incubator-seata icon indicating copy to clipboard operation
incubator-seata copied to clipboard

bugfix: fix index type misjudgment in Dm/KingbaseTableMetaCache

Open lokidundun opened this issue 2 weeks ago • 1 comments

Ⅰ. Describe what this PR did

Fixes the incorrect index type judgment in DmTableMetaCache and KingbaseTableMetaCache, which caused the "Before image size is not equaled to after image size" bug when using DM/Kingbase databases with Seata

Fixes the processPrimaries logic: Collect the full list of primary key columns (preserving the column order) via the standard COLUMN_NAME (from DatabaseMetaData.getPrimaryKeys()). Only mark an index as IndexType.PRIMARY if its column list (both order and content) exactly matches the primary key columns.

Ⅱ. Does this pull request fix one issue?

fixes #6960

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

lokidundun avatar Dec 10 '25 06:12 lokidundun

Codecov Report

:x: Patch coverage is 90.00000% with 2 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 70.98%. Comparing base (1b2a486) to head (48c9dcd).

Files with missing lines Patch % Lines
.../datasource/sql/struct/cache/DmTableMetaCache.java 90.00% 0 Missing and 1 partial :warning:
...ource/sql/struct/cache/KingbaseTableMetaCache.java 90.00% 0 Missing and 1 partial :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##                2.x    #7843      +/-   ##
============================================
+ Coverage     70.90%   70.98%   +0.07%     
- Complexity      992      994       +2     
============================================
  Files          1322     1322              
  Lines         50322    50330       +8     
  Branches       5946     5950       +4     
============================================
+ Hits          35683    35725      +42     
+ Misses        11693    11656      -37     
- Partials       2946     2949       +3     
Files with missing lines Coverage Δ
.../datasource/sql/struct/cache/DmTableMetaCache.java 89.79% <90.00%> (+6.81%) :arrow_up:
...ource/sql/struct/cache/KingbaseTableMetaCache.java 89.79% <90.00%> (-0.63%) :arrow_down:

... and 16 files with indirect coverage changes

Impacted file tree graph

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Dec 10 '25 07:12 codecov[bot]