You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Why make this change?
- Closes#2434
- when wildcard characters are used as literal character in search,
filter query fails to resolve correctly.
- we never use the wild characters of SQL for their intended use as wild
characters when queried from GraphQL. They are always used as literal
search characters.
## What is this change?
- we are adding `\` whenever a special character (wildcard) is used in
the filter query.
- while mysql,pgsql are able to understand and treat `\` as escape
charachters, for MsSQL, we have to use `ESCAPE` clause.
- The `ESCAPE` clause in a `LIKE` query specifies a character to treat
as an escape character. This is especially useful when your search
pattern contains special characters like %, _, or the actual escape
character, which otherwise have special meanings in LIKE patterns.
- I have updated the query builder for MsSql, which checks if it is a
`LIKE` query and only then it adds an `ESCAPE` clause.
There is a special case for mysql for wildcard (`\`), which needs to be
handled separately. I have created an issue to tackle it. #2499
## How was this tested?
- [X] Integration Tests
- [x] manual tests
## Sample Request(s)
![image](https://github.com/user-attachments/assets/9c283f6c-6443-4dee-bb45-d0d71b109420)
![image](https://github.com/user-attachments/assets/4a0f74df-8eaa-4ff9-b034-edf3ce058cda)
![image](https://github.com/user-attachments/assets/c7ae22a1-da7d-41bf-91ae-7190e5abcaf3)
---------
Co-authored-by: Aniruddh Munde <[email protected]>
What happened?
https://bugs.mysql.com/bug.php?id=10489
https://stackoverflow.com/questions/14926386/how-can-i-search-for-slash-in-mysql-and-why-is-escaping-not-required-fo
Version
main
What database are you using?
MySQL
What hosting model are you using?
Local (including CLI)
Which API approach are you accessing DAB through?
GraphQL, REST
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: