Skip to content

/*comments containing ? eat a substitution */ #790

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

Closed
jnvm opened this issue Apr 20, 2014 · 1 comment
Closed

/*comments containing ? eat a substitution */ #790

jnvm opened this issue Apr 20, 2014 · 1 comment
Labels
Milestone

Comments

@jnvm
Copy link

jnvm commented Apr 20, 2014

/A query with a comment containing a ? will have it replaced/ instead of the ? in the real query.

I suppose I could just put the comment in js instead of the query string, but it's pretty large and multi-line
using these
escapes
so I could area-select the query and test it straight in the mysql client, so the comment inline seems appropriate.

If not worth addressing, maybe just a "do not put ? in /query comments/ " in the documentation would clarify.

Otherwise, wonderfully useful driver!

@dougwilson
Copy link
Member

Thanks, this is definitely not something we are going to fix and is simply a limitation of the ?-replacement stuff. I'll add a note about this limitation to the documentation. For reference, we simply blindly swap instances of ? for the values, otherwise we would need a full SQL language parser, which just adds complexity and is slower.

@dougwilson dougwilson added this to the 2.2 milestone Apr 20, 2014
dougwilson added a commit that referenced this issue Apr 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants