Skip to content
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

White space first of =* operator #242

Open
MrSEKIRO opened this issue Dec 30, 2024 · 5 comments
Open

White space first of =* operator #242

MrSEKIRO opened this issue Dec 30, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@MrSEKIRO
Copy link

Version

2.14.2

Details

Hi,
I am using GridifyAsync for finding the records which some field contains some string starting with whitespace, but it ignores the first white space of that string.
e.g. I want to look for " Something" on column error:
error Like =* Something

the sql would be like:

SELECT * 
FROM tbl_Log 
WHERE Error Like '% Something%'

but it search for all strings in error column which has "Something".

Steps to reproduce

  • Step 1
    make some table with string column
  • Step 2
    search using below expression:
    error Like =* Something
@MrSEKIRO MrSEKIRO added the bug Something isn't working label Dec 30, 2024
@alirezanet
Copy link
Owner

alirezanet commented Dec 30, 2024

Hi @MrSEKIRO,
Thank you for the feedback. this is a known issue, You can find a temporary workaround here (although not sure if it works for your case)
But I'll try to fix this issue in the next versions

@MrSEKIRO
Copy link
Author

MrSEKIRO commented Dec 30, 2024

For my case it just return the result if there is no spaces and trimming is not needed.

I should wait for next version.
Tnx @alirezanet

@alirezanet
Copy link
Owner

alirezanet commented Dec 30, 2024

I just tested the leading space behavior and noticed you can escape it if needed. so another workaround would be this:

Error =*\ Something

But I'm also considering adding a new configuration to disable the AutoTrim feature. what do you think?

@MrSEKIRO
Copy link
Author

That may work but in my case I am doing some translations to Gridify filters and it won't fit well.
How about using quotations for Contains filters like that?

@alirezanet
Copy link
Owner

That may work but in my case I am doing some translations to Gridify filters and it won't fit well. How about using quotations for Contains filters like that?

If you mean something like this Error=*' Something' it will cause another problem, what if you want to search for a string that contains ' instead of space ... so basically it doesn't change anything and probably makes it worse because we need two escapes instead of one in that case. Error=*\' Something\'

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