mdayakar commented on code in PR #4476:
URL: https://github.com/apache/hive/pull/4476#discussion_r1265784618
##########
hplsql/src/main/java/org/apache/hive/hplsql/Utils.java:
##########
@@ -38,11 +38,11 @@ public static String unquoteString(String s) {
char ch = s.charAt(i);
char ch2 = (i < len - 1) ? s.charAt(i+1) : 0;
- if((i == 0 || i == len -1) && (ch == '\'' || ch == '"'))
+ if((i == 0 || i == len - 1) && (ch == '\'' || ch == '"'))
continue;
else
- // \' and '' escape sequences
- if((ch == '\\' && ch2 == '\'') || (ch == '\'' && ch2 == '\''))
+ // \' and '' escape sequences and include ' if last two characters
are ''
+ if((ch == '\\' && ch2 == '\'') || (ch == '\'' && ch2 == '\'' && i
!= len - 2))
Review Comment:
Added TestUtils unit test class.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]