-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Escape identifiers in metadata SQL properly when used as string literal #2442
Conversation
I agree that it is a bug, but this very much looks like a BC break for me. If i remember correct i even wrote a few scripts many years ago where i hit this and worked around it by calling quote manually. If ive have done that possible others have as well. |
@kimhemsoe yeah but it is wrong to do a |
@deeky666 I don't think that there is a sensible way to test this. I'd still apply some minimal assertions around the identifiers inside the SQL though, as that would show BC breaks in the quoting immediately, even though the tests may seem fragile. |
@Ocramius done. |
@Ocramius thanks |
Closes #2436
@Ocramius I tried to write tests but neither of my approaches felt right. First I tried to
assertContains()
the resulting SQL but that is not applicable to all platforms and methods as the given identifiers to escape are not always used as string literals (heavily depends on the platform's SQL statement) or are not even used at all. Then I tried to write functional tests but that is problematic, too as I cannot test the$database
identifiers properly on all platforms because that involves creating a database (which is heavy and not supported on all platforms) with escape characters in the name.Any idea what test to write here or should we take it "as is"?