Skip to content

Fixes like function when pattern has regex meta chars#553

Merged
penberg merged 3 commits into
tursodatabase:mainfrom
psvri:fix_like
Dec 27, 2024
Merged

Fixes like function when pattern has regex meta chars#553
penberg merged 3 commits into
tursodatabase:mainfrom
psvri:fix_like

Conversation

@psvri

@psvri psvri commented Dec 26, 2024

Copy link
Copy Markdown
Contributor

Fixes #552

In our construct regex function, we were not escaping the required characters properly which was causing the failure.

Limbo output with this branch

limbo> select like('\%A', '\A');
1
limbo> select like('A$%', 'A$');
1
limbo> select like('%a.a', 'aaaa');
0

@penberg

penberg commented Dec 27, 2024

Copy link
Copy Markdown
Collaborator

Can you please add a test in testing/like.test for this?

@psvri

psvri commented Dec 27, 2024

Copy link
Copy Markdown
Contributor Author

Can you please add a test in testing/like.test for this?

Done

@penberg penberg changed the title Fixes like function giving incorrect results when pattern has regex meta chars Fixes like function when pattern has regex meta chars Dec 27, 2024
@penberg penberg closed this in 5b8f00c Dec 27, 2024
@penberg penberg merged commit 5b8f00c into tursodatabase:main Dec 27, 2024
@psvri psvri deleted the fix_like branch December 27, 2024 16:38
jussisaurio added a commit that referenced this pull request Dec 29, 2024
jussisaurio added a commit that referenced this pull request Dec 29, 2024
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.

Like function gives incorrect results when pattern has regex meta chars

2 participants