-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
bugfix: postgresql schema lowerCase #2479
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2479 +/- ##
=============================================
- Coverage 51.45% 51.44% -0.01%
- Complexity 2662 2664 +2
=============================================
Files 529 529
Lines 16952 16956 +4
Branches 2049 2051 +2
=============================================
+ Hits 8722 8723 +1
- Misses 7405 7408 +3
Partials 825 825
|
@@ -102,7 +102,7 @@ private TableMeta resultSetMetaToSchema(DatabaseMetaData dbmd, String tableName) | |||
* select * from "Sel'ect" | |||
*/ | |||
if (null != schemaName) { | |||
schemaName = schemaName.replaceAll("(^\")|(\"$)", ""); | |||
schemaName = schemaName.replaceAll("(^\")|(\"$)", "").toLowerCase(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why if schema name not null, lower case the schema name?
How about the situation like below?
CREATE DATABASE "SeAtA"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix:
select * from TEST.test
select * from test.TEST
select * from "Test".test
select * from "Test"."Select"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
*/ | ||
if (null != schemaName) { | ||
schemaName = schemaName.replaceAll("(^\")|(\"$)", ""); | ||
if (schemaName.startsWith("\"") && schemaName.endsWith("\"")) { | ||
schemaName = schemaName.replaceAll("(^\")|(\"$)", ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can quotes exist between characters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has been confirmed that it may contain special characters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
support select * from "Te"'st"."Select"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?
#2435
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews