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

Support escape character in string #260

Closed
StpMax opened this issue Apr 11, 2023 · 6 comments · Fixed by #339
Closed

Support escape character in string #260

StpMax opened this issue Apr 11, 2023 · 6 comments · Fixed by #339
Assignees
Labels
bug Something isn't working

Comments

@StpMax
Copy link
Contributor

StpMax commented Apr 11, 2023

select 'a\ b'

String in this query at the moment parsed as is: 'a\ b'
But should be 'a b'

@StpMax StpMax added the bug Something isn't working label Apr 11, 2023
@StpMax
Copy link
Contributor Author

StpMax commented Jul 21, 2023

remind :)

@akshithagunupati
Copy link

Hi @StpMax can I work on this?

@ea-rus
Copy link
Contributor

ea-rus commented Nov 27, 2023

@akshithagunupati, yes, you can try to work on it

@akshithagunupati
Copy link

@ea-rus Thank you. But is it possible for you to elaborate on the issue please?

@StpMax
Copy link
Contributor Author

StpMax commented Dec 4, 2023

@akshithagunupati the issue is that mindsdb_sql does not support any escape sequence or escape character. Check examples at the end of this doc page. If run in mysql SELECT 'disappearing\ backslash'; you will get disappearing backslash. But if do the same using mindsdb_sql:

from mindsdb_sql import parse_sql
q = """
SELECT 'disappearing\ backslash';
"""
ast = parse_sql(q, dialect='mysql')
print(ast.targets[0].value)

result will be disappearing\ backslash, which is not correct

ea-rus added a commit that referenced this issue Jan 12, 2024
@ea-rus
Copy link
Contributor

ea-rus commented Jan 12, 2024

Added support escaping for quotes in #339

 select 'a \' b'
 select "a \" b"

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

Successfully merging a pull request may close this issue.

3 participants