-
Notifications
You must be signed in to change notification settings - Fork 104
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
PostgreSQL sink creates table when entity id contains special characters #2220
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,9 +41,9 @@ public static String encodePostgreSQL(String in) { | |
char c = in.charAt(i); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where encodePostgreSQL() function is used? It seems this PR fixes it but it is not clear to me where it is used... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When "Enable ecoding=true", encodePostgreSQL() function is used while building schema name, db name and table name. |
||
int code = c; | ||
|
||
if (code >= 97 && code <= 119) { // a-w --> a-w | ||
if (code >= 97 && code <= 119 || code >= 65 && code <= 87) { // a-w--> a-w,A-W-->A-W | ||
out += c; | ||
} else if (c == 'x') { | ||
} else if (c == 'x'|| c == 'X') { | ||
String next4; | ||
|
||
if (i + 4 < in.length()) { | ||
|
@@ -57,7 +57,7 @@ public static String encodePostgreSQL(String in) { | |
} else { // x --> x | ||
out += c; | ||
} // if else | ||
} else if (code == 121 || code == 122) { // yz --> yz | ||
} else if (code == 121 || code == 122 || code ==89 || code == 90) { // yz --> yz,YZ-->YZ | ||
out += c; | ||
} else if (code >= 48 && code <= 57) { // 0-9 --> 0-9 | ||
out += c; | ||
|
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.
After the changes in this PR, is
encode()
still used in other parts of the code? Or it can be removed?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.
encode() is used in below part of the code:
When "enable encoding=false" that time encode() is used to build DBName and SchemaName in class NGSIPostgreSQLSink. Also it is used in other sink like NGSIPostgisSink, NGSIOracleSink,NGSIMysqlSink etc. So we can't remove it.
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.
Thanks for the clarification
NTC