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

BulkUpdate is case insensitive #641

Closed
yanzubenyan opened this issue Oct 8, 2021 · 7 comments
Closed

BulkUpdate is case insensitive #641

yanzubenyan opened this issue Oct 8, 2021 · 7 comments
Labels

Comments

@yanzubenyan
Copy link

In batch update, the original value of the field is D18, L=1600. In this case, changing L to l will not update

@borisdj
Copy link
Owner

borisdj commented Oct 8, 2021

What Db are you using, I've tested it with both SqlServer and works fine.
Generated Sql:

UPDATE i SET [Description] = N'D18, l=1600'
FROM [Item] AS [i]
WHERE [i].[ItemId] <= 500

Maybe you Db is case insensitive or something.
Anyway if you can write a test where it would be reproducible.

@yanzubenyan
Copy link
Author

image
image

@yanzubenyan
Copy link
Author

Just like in the picture, my l update to the sqlserver database is still L

@borisdj
Copy link
Owner

borisdj commented Oct 8, 2021

I see the issue is actually BulkUpdate and not BatchUpdate, but still I'm not able to reproduce it.

@yanzubenyan
Copy link
Author

text.zip

1633685589(1)

@borisdj
Copy link
Owner

borisdj commented Oct 8, 2021

Quite peculiar issue.
BulkUpdate uses MERGE that has EXISTS to skip updating same rows, but in this case seems that sql comparison L to l is same, probably because of collation: 'Chinese_PRC_CI_AS'.
With BulkConfig OmitClauseExistsExcept it can be turned of, just call it like this:
await _baseBomDetailRep.Context.BulkUpdateAsync(bulckall, new BulkConfig { OmitClauseExistsExcept = true });

@yanzubenyan
Copy link
Author

thank you for your answer

@borisdj borisdj changed the title Batch update is case insensitive BulkUpdate is case insensitive Oct 8, 2021
@borisdj borisdj closed this as completed Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants