Skip to content

Commit

Permalink
0004957: allow upgrade/downgrade between CLOB and LONGVARCHAR defn
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Sep 23, 2021
1 parent 9f63f85 commit 1d517d2
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -116,7 +116,10 @@ protected void writeCastExpression(Column sourceColumn, Column targetColumn, Str
String sourceNativeType = getBareNativeType(sourceColumn);
String targetNativeType = getBareNativeType(targetColumn);

if (sourceNativeType.equals(targetNativeType)) {
if (sourceNativeType.equals(targetNativeType)
|| ((sourceNativeType.equalsIgnoreCase("CLOB") || sourceNativeType.equalsIgnoreCase("LONG VARCHAR"))
&& (targetNativeType.equalsIgnoreCase("CHAR") || targetNativeType.equalsIgnoreCase("VARCHAR")
|| targetNativeType.equalsIgnoreCase("LONG VARCHAR")))) {
printIdentifier(getColumnName(sourceColumn), ddl);
} else {
// Derby currently has the limitation that it cannot convert numeric
Expand Down

0 comments on commit 1d517d2

Please sign in to comment.