-
Notifications
You must be signed in to change notification settings - Fork 78
Escaping date sometimes results in empty string #67
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
Comments
Hi @williamd5 sorry you are having this issue. I'm not sure off-hand, but I will try and comb through the code to see under what condition there can be an empty string returned for a |
I'm going to mark this as a bug for now, as it should work for |
Thank you for the information. I will try to debug as you said and see if I can find anything. |
In sqlstring lib I added debug to check
The recommended alternative in the SO answer seems to work. I will open a PR on sqlstring with a reference to this issue. |
Thank you! I am happy to make the fix, but if you want to do it and open a PR, please be sure to add a test case for this condition. |
If you could make the fix that would be great |
Any suggestion how to test cross-frame in the tests? I have started a branch on a fork cloudnode-pro/sqlstring@patch/67 |
Hi @williamd5 sorry I was away over the week; I just have a short amount of time today, so wanted to get this fixed for ya. I landed the change + test. |
This is a very weird issue that I was not able to fully debug to find the cause.
Part of my project's code looks like this:
When I run a query with {Date} objects, some of them resulted in a query like (demo)


Running
mysql.escape(new Date())
I get empty string.I installed mysql and sqlstring on a new plain project and could not reproduce this.
mysql.escape(...)
seems to work with any other type.Any ideas what could be the cause for this?
The text was updated successfully, but these errors were encountered: