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

Possible regression in .QueryAllRawEvents with .In operator #3103

Closed
AlexSikilinda opened this issue Apr 1, 2024 · 1 comment
Closed

Possible regression in .QueryAllRawEvents with .In operator #3103

AlexSikilinda opened this issue Apr 1, 2024 · 1 comment

Comments

@AlexSikilinda
Copy link

Hi, I've tried to upgrade from v6.4 to v7.5 and encountered what I think is a regression.

We have the following query:

session.Events.QueryAllRawEvents()
    .Where(e => e.Id.In(eventsIds))
    .Where(e => e.AnyTenant());

In v6.4 it produces the following SQL (which works fine):

select data, type, mt_dotnet_type, seq_id, id, stream_id, version, timestamp, tenant_id, is_archived from public.mt_events as d where ((d.id = ANY(:p0) and  1=1) and  d.is_archived = FALSE)

but in the latest v7.5 it produces SQL checking d.data ->> id, which I believe is incorrect since it should check the ID column instead of going to data:

select data, type, mt_dotnet_type, seq_id, id, stream_id, version, timestamp, tenant_id, is_archived from public.mt_events as d where (1=1 and CAST(d.data ->> 'Id' as uuid) = ANY(:p0) and d.is_archived = FALSE);

As I understand, .QueryAllRawEvents should query IEvent properties (ID column in this case), not the data itself.

Thanks!

@jeremydmiller
Copy link
Member

Bug. Not a use case where we have a test at all apparently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants