-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Case-insensitive tag names with SQLite provider #14012
Conversation
Hi there @lewishazell, thank you for this contribution! 👍 While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
Use LIKE instead of = to ignore collation rules.
Thanks @lewishazell for the fix, I'll have to try this out 😉 |
Hi @lewishazell , I have tested your update and it works all fine 👍 CHeers and thanks again for the fix! |
Great, thanks @mikecp! Glad to help! 😄 |
Cherry picked for 10.6 in bb7752c |
* Ensure case insensitivity in tag name queries. Use LIKE instead of = to ignore collation rules. * Add integration test for creating tag relations with mixed casing. (cherry picked from commit 37d737f)
This reverts commit bb7752c.
Hey @lewishazell, unfortunately, I've had to revert this pull request since it does not work on SQL Server (thankfully, you had added tests (Big H5YR), we'd love another PR however which also works with SQL Server 😄 |
@nikolajlauridsen Bummer! I was sure I tested on SQL Server. Maybe I set it up incorrectly. I'll see what I can do :) |
Yeah always a bummer to have something reverted, and sorry that I don't have any more info as to why right now 😅 I just saw that the tests failed while building the RC that's gonna be released today, so didn't have much time 😄 But I see why it wasn't caught earlier, it's because PRs only run the integration tests against SQLite, and not SQL Server, so they didn't run until I was making the release. When testing locally however you can actually make the tests use LocalDB, if you go into the |
@nikolajlauridsen Sorry for my tardiness on this, been busy! Thanks for the LocalDB tip 😄 I've stepped through this and it seems the issue actually lies with the behaviour of SQLite combined with the assertion in the test being faulty. If tags are cAsE iNsEnSiTiVe, we should expect I think case insensitive comparison for tag names on line 145 of TagRepository.cs would fix this. I'm also leaning more towards using Then the integration test should ensure:
I take it this will be a new PR? |
This reverts commit bb7752c.
Prerequisites
If there's an existing issue for this PR then this fixes #13981
Description
I've fixed the case-sensitivity issues with tags in SQLite by using LIKE instead of = when querying and joining tags.
This could be fixed through collations but would require either database-specific SQL or database-specific schema changes. I liked this way because it works everywhere and doesn't need large changes in the database setup.
To test:
I have also added an integration test, though this only tests the in-memory SQLite database.