bugfix: fix index type misjudgment in Dm/KingbaseTableMetaCache
- [x] I have read the CONTRIBUTING.md guidelines.
- [x] I have registered the PR changes.
Ⅰ. 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
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).
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: |
: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.