[3.1.x] Query: Cosmos: Generate enum literal/parameter correctly #23448
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #20404
Description
When using enum value in a Cosmos query, the query throws rather than giving results back.
Customer Impact
Customers are unable to run queries which need to use enum values. There is no work-around.
How found
Reported my multiple customers on 3.1. We made a similar patch fix for relational providers, and based on feedback we are now bringing this for Cosmos as well.
Test coverage
Added test specifically for queries similar to customer queries. Also enabled existing tests which were using enums but were failing earlier.
Regression?
Not that we know of.
Risk
Low. We are backporting existing fix which went in 5.0 release and has no reported issues with it so far.