Align empty sub query and empty append handling across stores - #920
Merged
Merged
Conversation
The dbal store skipped empty sub queries, while the in memory store and SubQuery::match() treat them as "match all". A query like `new Query(new SubQuery(), new SubQuery(['a']))` returned only the events tagged `a` on the database and every event in memory. The dbal store now returns all events in that case and resolves an empty only-last-event sub query to the last event of the store, the same as the in memory store. Appending no messages produced invalid sql on the dbal store. Both stores now treat it as a no-op, like StoreEventAppender already does.
|
Hello 👋 here is the most recent benchmark result:
This comment gets update everytime a new commit comes in! |
DanielBadura
approved these changes
Oct 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
TaggableDoctrineDbalStoresilently skipped empty sub queries, while theInMemoryStoreandSubQuery::match()treat them as "match all". Sonew Query(new SubQuery(), new SubQuery(['a']))returned only theaevents on the database but every event in memory, even though the docs say both stores behave the same. The dbal store now returns all events in that case, and an emptyonlyLastEventsub query resolves to the last event of the store. This also applies to append conditions, which go through the same query building.append([])on the dbal store produced invalid sql (FROM () AS data). Both stores now treat an empty append as a no-op, likeStoreEventAppenderalready does. Note that this also skips the append condition check in theInMemoryStore, which previously could throwAppendConditionNotMetfor an empty batch.