Skip to content

fix: Use selective updates for scale rules(#6709) - #6974

Open
juicewcode wants to merge 1 commit into
apache:masterfrom
juicewcode:fix/6709-scale-rule-partial-update
Open

fix: Use selective updates for scale rules(#6709)#6974
juicewcode wants to merge 1 commit into
apache:masterfrom
juicewcode:fix/6709-scale-rule-partial-update

Conversation

@juicewcode

Copy link
Copy Markdown
Contributor

Fixes #6709
ScaleRuleServiceImpl#update previously called updateByPrimaryKey, which performs a full-column update.
When a partial update request omits optional fields such as minimum, maximum, sort, or status, those fields may
be written as NULL, unintentionally removing existing scale rule configuration.

Changes

Replace:
scaleRuleMapper.updateByPrimaryKey(after);
with:
scaleRuleMapper.updateByPrimaryKeySelective(after);

Make sure that:

  • You have read the contribution guidelines.
  • You submit test cases (unit or integration tests) that back your changes.
  • Your local test passed ./mvnw clean install -Dmaven.javadoc.skip=true.

  - Replace updateByPrimaryKey with updateByPrimaryKeySelective.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] ScaleRuleServiceImpl.update uses full updateByPrimaryKey, nulling omitted fields

1 participant