We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When the input of ReadMany includes values with ', the query parsing fails with:
'
(Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: ; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: ; Reason: ({"errors":[{"severity":"Error","location":{"start":37,"end":41},"code":"SC1001","message":"Syntax error, incorrect syntax near 'user'."}]}););) ----> Microsoft.Azure.Cosmos.CosmosException : Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: ; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: ; Reason: ({"errors":[{"severity":"Error","location":{"start":37,"end":41},"code":"SC1001","message":"Syntax error, incorrect syntax near 'user'."}]});); ----> Microsoft.Azure.Cosmos.Query.Core.Exceptions.ExpectedQueryPartitionProviderException : {"errors":[{"severity":"Error","location":{"start":37,"end":41},"code":"SC1001","message":"Syntax error, incorrect syntax near 'user'."}]}
Create a container with /id as Partition Key Path. Then:
/id
CosmosClient client = new CosmosClient("<connection string>"); Container container = client.GetContainer("myDb", "container"); string id = "the'user@test.com"; IReadOnlyList<(string, Cosmos.PartitionKey)> partitionKeyValues = new List<(string, Cosmos.PartitionKey)>() { (id, new Cosmos.PartitionKey(id)) }; FeedResponse<dynamic> response = await container.ReadManyItemsAsync<dynamic>(partitionKeyValues);
The query that gets generated is:
{"query":"SELECT * FROM c WHERE c.id IN ( 'the'user@test.com' )"}
The problem is that for this case (/id being the Partition Key Definition), we use:
https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/Microsoft.Azure.Cosmos/src/ReadManyQueryHelper.cs#L252-L261
When the container does not have /id as the Partition Key Definition, then we use SqlParameter:
SqlParameter
https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/Microsoft.Azure.Cosmos/src/ReadManyQueryHelper.cs#L276-L278
The text was updated successfully, but these errors were encountered:
ealsur
Successfully merging a pull request may close this issue.
When the input of ReadMany includes values with
'
, the query parsing fails with:Repro
Create a container with
/id
as Partition Key Path. Then:The query that gets generated is:
The problem is that for this case (
/id
being the Partition Key Definition), we use:https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/Microsoft.Azure.Cosmos/src/ReadManyQueryHelper.cs#L252-L261
When the container does not have
/id
as the Partition Key Definition, then we useSqlParameter
:https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/Microsoft.Azure.Cosmos/src/ReadManyQueryHelper.cs#L276-L278
The text was updated successfully, but these errors were encountered: