Escape schema/tablenames in metadata.getTables() #2398
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Escape _'s and %s in schema/table names used in getTables() because so that searches for a table with an _ in them won't also match tables without them, since the jdbc method uses those in LIKE operations
Fixes #1604
Dev Handoff Notes (Internal Use)
Links
Testing
Dev Verification
Replicated issue by running changelog:
with defaultSchemaName=test_schema and then with defaultSchemaName="test-schema" on postgresql. After those two successful updates, any future runs against defaultSchemaName=test_schema failed. NOTE: the reproduction does depend a bit on how the database returns rows back internally. I initially tried
testrschema
as an alternative totest_schema
but it worked becausetest_schema
came back beforetestrschema
in the problem query.┆Issue is synchronized with this Jira Bug by Unito