[CSHARP-4559] LINQ Provider V3 Has Different Behavior? Created: 05/Mar/23  Updated: 27/Oct/23  Resolved: 07/Apr/23

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 2.19.0
Fix Version/s: None

Type: Bug Priority: Unknown
Reporter: Cassio Mosqueira Assignee: Robert Stam
Resolution: Gone away Votes: 0
Labels: LINQ3
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Summary

Upgrading to LINQ provider 3 caused unexpected behavior in our application. Here's a query that returns results in v2, but returns nothing on v3: 

query.Where(x => 
    x.ClientName.ToLower().Contains(dto.Client) || 
    x.ClientEmail.ToLower().Contains(dto.Client) ||  
    x.AdditionalClients.Any(c => 
        c.ClientName.ToLower().Contains(dto.Client) || 
        c.ClientEmail.ToLower().Contains(dto.Client)));

Has the behavior of Contains changed intentionally?

Driver: 2.19

Server: Atlas 5.0.15



 Comments   
Comment by PM Bot [ 07/Apr/23 ]

There hasn't been any recent activity on this ticket, so we're resolving it. Thanks for reaching out! Please feel free to comment on this if you're able to provide more information.

Comment by PM Bot [ 24/Mar/23 ]

Hey cassio@intakeq.com, We need additional details to investigate the problem. If this is still an issue for you, please provide the requested information.

Comment by Robert Stam [ 16/Mar/23 ]

I was unable to reproduce this. You can see my attempt to reproduce this here:

https://github.com/rstam/mongo-csharp-driver/blob/csharp4559/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationTests/Jira/CSharp4559Tests.cs

I had to guess at the class declarations to get a full example that would compile and run.

I found that LINQ2 and LINQ3 produce the exact same MQL, so therefore they also return the same results.

Let me know if I have missed something.

Comment by Robert Stam [ 07/Mar/23 ]

Thanks for reporting this. I will investigate further before long.

Generated at Wed Feb 07 21:48:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.