-
Notifications
You must be signed in to change notification settings - Fork 605
Added support for Mysql Backslash escapes #844
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
Conversation
Now that I think about it, I realize that serializing special types back into a string will not end well. |
As far as I can tell, in order to correctly convert characters back into escape characters, (for example - converting a null byte back to This presents a few problems:
I'd love to hear any thoughts about the correct way these things should work, and I'll be happy to implement them |
Another issue -
Both of them would be serialized to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me -- thank you @cobyge
Pull Request Test Coverage Report for Build 4632867435
💛 - Coveralls |
In general I would prefer we be usecase driven. The issues you highlight seem like issues, but I am not sure how important it is to ensure full round trip display compatibility at this time, especially when there are multiple potential ways to escape/encode a particular character. Perhaps you can write some tests cases that show the behavior (or lack thereof) that you are worried about and we can use those to drive the discussion of what the expected behavior is.
I am not sure it is critical to recover the original query byte for byte. Thing such as whitespace / newlines are not preserved either |
Hi,
This fixes issue #800
This adds proper support for MySQL backslash escaping (As described here)
Before now, the escaping support would only work for escaping single-quotes or backslashes. This adds full support for all Special Character Escape Sequences supported by MySQL at the current time (as defined in the table in the link above).
I also added some tests to make sure that the special characters are parsed as they should be.
Let me know if there is anything else I can do in order for this to get merged.