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

fixed for #3234 and add the encrypted test case for more than four cipher coloumns #3295

Closed
wants to merge 2 commits into from
Closed

Conversation

xiyelife
Copy link
Contributor

Fixes #ISSUSE_ID.

Changes proposed in this pull request:

@coveralls
Copy link

Pull Request Test Coverage Report for Build 668

  • 27 of 28 (96.43%) changed or added relevant lines in 5 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.004%) to 67.488%

Changes Missing Coverage Covered Lines Changed/Added Lines %
sharding-core/sharding-core-rewrite/src/main/java/org/apache/shardingsphere/core/rewrite/feature/encrypt/parameter/impl/EncryptInsertValueParameterRewriter.java 8 9 88.89%
Files with Coverage Reduction New Missed Lines %
sharding-core/sharding-core-rewrite/src/main/java/org/apache/shardingsphere/core/rewrite/parameter/builder/impl/StandardParameterBuilder.java 1 94.12%
Totals Coverage Status
Change from base Build 479: 0.004%
Covered Lines: 11236
Relevant Lines: 16649

💛 - Coveralls

if (!insertColumnsSegment.isPresent()) {
return;
}
for (ColumnSegment each : insertColumnsSegment.get().getColumns()) {
Copy link
Member

Choose a reason for hiding this comment

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

How to deal insert SQL without columns, such as: INSERT INTO tbl VALUES(?, ?, ?)

If no columns, the insertColumnsSegment.get().getColumns() will return a empty list, and may cause failure.

I forget add the test cases for insert without columns, I will add it soon in other pull request.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I also forget add the test cases for insert without columns。
my purpose is:
in order to use the original order in SQL to rerwite cipher SQL, rather than using the column order in the configured encryption rules, otherwise it will also cause the parameters to be disordered.

@terrymanu
Copy link
Member

I have add test cases of insert without columns in #3299, please run your pr again to verify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When insert by mybatis, the parameters were still found to be out of ordered.
3 participants