Skip to content

Unmatched escape characters for LIKE should error #3216

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

Open
ScottDugas opened this issue Feb 28, 2025 · 0 comments
Open

Unmatched escape characters for LIKE should error #3216

ScottDugas opened this issue Feb 28, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@ScottDugas
Copy link
Collaborator

A query like:

select * from B WHERE B2 NOT LIKE '\'

should error with 22025 because the \ is not escaping anything.

Similarly, if an ESCAPE is specifically provided, it should fail:

select * from B WHERE B2 NOT LIKE 'Z' ESCAPE 'Z'

Right now we will treat it the same as:

select * from B WHERE B2 NOT LIKE 'Z'
ScottDugas added a commit to ScottDugas/fdb-record-layer that referenced this issue Feb 28, 2025
I figured out the proper behavior, and updated the comments when
pattern is just an escape character.
alecgrieser added a commit to alecgrieser/fdb-record-layer that referenced this issue Mar 4, 2025
commit c6b7cc0
Author: Scott Dugas <sdugas@apple.com>
Date:   Fri Feb 28 12:16:35 2025 -0500

    Another test and referencing issue FoundationDB#3216

    I figured out the proper behavior, and updated the comments when
    pattern is just an escape character.

commit 545ba60
Author: Scott Dugas <sdugas@apple.com>
Date:   Fri Feb 28 10:44:13 2025 -0500

    Set supported_version for like.yamsql

commit 63eb20f
Author: Scott Dugas <sdugas@apple.com>
Date:   Thu Feb 27 17:04:02 2025 -0500

    Add some LIKE tests with single letter patterns

    This adds some tests of LIKE queries that have single letter patterns
    that actually match things. This is an effort to see if there are
    other oddities in this area.

commit 582f498
Author: Scott Dugas <sdugas@apple.com>
Date:   Thu Feb 27 17:03:15 2025 -0500

    Improve error messages when failing to parse blocks

    I forgot to put my test_blocks in separate documents, and this
    helped me find my mistake.

commit 9f8acdf
Author: Scott Dugas <sdugas@apple.com>
Date:   Thu Feb 27 16:03:51 2025 -0500

    Fix continuation parsing for LIKE operators

    Previously, it would parse the query as the escape character, making
    continuations useless.
    i.e. `LIKE 'XYZ' ESCAPE 'XYZ'`, regardless of what the original
    query had for the escape character, if it had one.

    This Resolves: FoundationDB#3099
@alecgrieser alecgrieser added the bug Something isn't working label Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants