Skip to content

Commit

Permalink
0002316: On SQL Server a default value of '' is exported as ''''
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Jun 14, 2015
1 parent b5d676f commit bedb315
Showing 1 changed file with 7 additions and 8 deletions.
Expand Up @@ -1305,24 +1305,23 @@ public StringBuilder appendIdentifier(StringBuilder query, String identifier) {
* @return The resulting text
*/
protected String unescape(String text, String unescaped, String escaped) {
String result = text;

// we need special handling if the single quote is escaped via a double
// single quote
if (result != null) {
if (text != null && !"''".equals(text)) {
if (escaped.equals("''")) {
if ((result.length() > 2) && result.startsWith("'") && result.endsWith("'")) {
result = "'"
+ StringUtils.replace(result.substring(1, result.length() - 1),
if ((text.length() > 2) && text.startsWith("'") && text.endsWith("'")) {
text = "'"
+ StringUtils.replace(text.substring(1, text.length() - 1),
escaped, unescaped) + "'";
} else {
result = StringUtils.replace(result, escaped, unescaped);
text = StringUtils.replace(text, escaped, unescaped);
}
} else {
result = StringUtils.replace(result, escaped, unescaped);
text = StringUtils.replace(text, escaped, unescaped);
}
}
return result;
return text;
}

public List<String> getTableTypes() {
Expand Down

0 comments on commit bedb315

Please sign in to comment.