-
Notifications
You must be signed in to change notification settings - Fork 171
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
SNOW-1619625: Insufficient character unescaping #1868
Comments
also, THERE SHOULD BE A TEST CASE FOR |
Hi @sfc-gh-snow-drivers-warsaw-dl Hi, can you please give an estimate on when this can be fixed? |
hi - the team is looking into this issue, which seems to be more complex than it might seem at the first glance. We would like to also take a holistic approach to the issue and rework today's (little bit inconsistent) behaviour . The full rewrite can be only expected in the next major version of the JDBC driver. In the meantime, we're looking into making a workaround available which could be even implemented before the next major release. Please stay tuned and thank you for bearing with us - i'll keep this thread posted. |
Hi @bauer-at-work |
Hi @sfc-gh-dprzybysz, When do you think the correct approach can be implemented? |
With the fix in PR the schema should be without any escaping applied when passed as connection parameter. When schema is There are some flags and workarounds in fetching metadata functions - there are some plans to simplify the configuration and functions but probably it will result in behaviour changes so it won't become a default behaviour for current 3.x line |
What version of JDBC driver are you using?
latest from git
What operating system and processor architecture are you using?
Fedora 40, amd64
What version of Java are you using?
OpenJDK 64-Bit Server VM (Red_Hat-21.0.4.0.7-2) (build 21.0.4+7, mixed mode, sharing)
What did you do?
Snowflake Query Monitor reveals the following queries being executed:
What did you expect to see?
The first SQL statement is expected and correct. Two backslashes are required for the sequence to be interpreted as an escaping of the underscore character.
The second SQL statement is unexpected. Now that that metadata call results not in a
LIKE
operation but in a statement expecting a valid schema name, both backslash characters should have been 'unescaped'.The problem can be traced back to
SnowflakeDatabaseMetaData::unescapeChars(...)
.The function is only removing one of the two backslahes.
Fix
I had success with switching the order of statements as follows:
However, I might be missing other edge cases now.
The text was updated successfully, but these errors were encountered: