Skip to content

Commit

Permalink
0001207: DB2 text column default value metadata values are quoted. Ne…
Browse files Browse the repository at this point in the history
…ed to remove quotes when reading table metadata from database.
  • Loading branch information
chenson42 committed May 10, 2013
1 parent b071895 commit 74b3d36
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -165,7 +165,12 @@ protected Column readColumn(DatabaseMetaDataWrapper metaData, Map<String, Object
column.setDefaultValue(newDefault.toString());
}
} else if (TypeMap.isTextType(column.getMappedTypeCode())) {
column.setDefaultValue(unescape(column.getDefaultValue(), "'", "''"));
String defaultValue = column.getDefaultValue();
// DB2 stores default text values quoted
if ((defaultValue.length() >= 2) && defaultValue.startsWith("'") && defaultValue.endsWith("'")) {
defaultValue = defaultValue.substring(1, defaultValue.length()-1);
}
column.setDefaultValue(unescape(defaultValue, "'", "''"));
}
}
return column;
Expand Down

0 comments on commit 74b3d36

Please sign in to comment.