Skip to content

Conditional_non_pii_keys behavior is not consistent with original LIKE behavior #230

@justjkk

Description

@justjkk

// replace sql patterns with regex patterns
// TODO: cover all cases :pray
pattern = strings.ReplaceAll(pattern, "%", ".*")
pattern = "^" + pattern + "$"
regex, ok := m.regexes[pattern]

The above logic is not consistent with the LIKE functionality since:

  1. _ in LIKE should be interpreted as . in regex. (Ref: SQL LIKE)
  2. ., ?, etc.. in LIKE should be treated as literal and should not have special meaning.
  3. LIKE query in MySQL can be case sensitive when run on a column that uses case insensitive collation(eg: utf8_general_ci).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions