Skip to content

Fix MySQL tag filters#68

Merged
mattn merged 1 commit into
fiatjaf:masterfrom
mattn:bugfix/mysql-tag-filters
Jul 3, 2026
Merged

Fix MySQL tag filters#68
mattn merged 1 commit into
fiatjaf:masterfrom
mattn:bugfix/mysql-tag-filters

Conversation

@mattn

@mattn mattn commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

The MySQL backend built a single LIKE pattern that concatenated all values of a tag filter into one ordered string, so an event only matched when it happened to contain every requested value in that exact order. This made multi-value tag filters effectively unsatisfiable and mismatched the semantics of the other backends.

Each tag value now produces its own tags LIKE ? clause joined with OR, so a tag key matches when the event carries any of the requested values, while distinct tag keys remain ANDed together as independent conditions. A regression test covering single- and multi-value tag queries is included.

This mirrors the equivalent MongoDB tag-filter fix.

@mattn mattn merged commit de322c9 into fiatjaf:master Jul 3, 2026
1 check passed
@mattn mattn deleted the bugfix/mysql-tag-filters branch July 3, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant