Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

backslash in string incorrectly escaping closing quote #13

Open
aharpervc opened this issue May 4, 2015 · 10 comments
Open

backslash in string incorrectly escaping closing quote #13

aharpervc opened this issue May 4, 2015 · 10 comments
Labels

Comments

@aharpervc
Copy link

Example:
wrong

It should look like this (minus the space I added to hack the highlighting):
right

@winstliu winstliu added the bug label May 4, 2015
@aharpervc
Copy link
Author

@jlewis91 it's still happening in 0.17.0. It has not yet been fixed.

@Cxarli
Copy link
Contributor

Cxarli commented Oct 27, 2015

Should it? You escape the quote, so it's still a string, right?

@aharpervc
Copy link
Author

\ is not a string escape character in SQL

@jeremiahpslewis
Copy link
Contributor

Agree with @C-Bouthoorn. In Mysql it is. Looks like this is a parameter that can be set, but as a default, backslash can be used as an escape. See: https://dev.mysql.com/doc/refman/5.0/en/string-literals.html, look for NO_BACKSLASH_ESCAPES. Recommend leaving the behavior as it is and closing this.

@winstliu
Copy link
Contributor

Ok, since we're on this topic now: should language-sql support MySQL or just strictly SQL? There's another PR open right now (#16) that aims to remove MySQL comments.

@Cxarli
Copy link
Contributor

Cxarli commented Oct 27, 2015

@aharpervc I'm sorry, I was confused with MySQL

@50Wliu I think we should have a language-sql and language-mysql. MySQL has more differences from default SQL, of which this is one. See this page for differences. The struggle is how we're going to see when to use which one.

@jeremiahpslewis
Copy link
Contributor

Gotcha. Would it be possible to add a preferences toggle to select the sql flavor? It seems like it would be inefficient (also lousy from a user perspective) to fork out MySQL, given the large degree of shared components...

@winstliu
Copy link
Contributor

Would it be possible to add a preferences toggle to select the sql flavor?

I don't believe so, though it is possible to have multiple grammars in the same package (see language-c for a good example of this).

@gontadu
Copy link
Contributor

gontadu commented Jul 5, 2016

Are the various grammars then distinguished based on the file's extension?

@winstliu
Copy link
Contributor

winstliu commented Jul 15, 2016

@gontadu Correct. (Or, alternatively, a first-line match, though I don't think that's applicable to SQL)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants