Skip to content

Like function gives incorrect results when pattern has regex meta chars #552

Description

@psvri

The like function dosent escape regex meta characters properly. This causes the like function to give incorrect result when compared to sqlite3 as shown below.

Master limbo branch output

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

SQLite3 output

❯ python -m sqlite3    
sqlite3 shell, running on SQLite version 3.45.3
Connected to a transient in-memory database

Each command will be run using execute() on the cursor.
Type ".help" for more information; type ".quit" or CTRL-Z to quit.
sqlite> select like('\%A', '\A');
(1,)
sqlite> select like('A$%', 'A$');
(1,)
sqlite> select like('%a.a', 'aaaa');
(0,)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions