|
// 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:
_ in LIKE should be interpreted as . in regex. (Ref: SQL LIKE)
., ?, etc.. in LIKE should be treated as literal and should not have special meaning.
- LIKE query in MySQL can be case sensitive when run on a column that uses case insensitive collation(eg:
utf8_general_ci).