Skip to content

Commit

Permalink
SAK-31695 - BasicLTI tables are created with inapproriate column types (
Browse files Browse the repository at this point in the history
  • Loading branch information
csev authored Jul 31, 2017
1 parent 76dc211 commit 6200a97
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1789,8 +1789,11 @@ public String formSql(String fieldinfo, String vendor) {
}
} else if ("url".equals(type) || "text".equals(type) || "textarea".equals(type)) {
if ("oracle".equals(vendor)) {
if (maxlength < 4000) {
schema = "VARCHAR2(" + maxlength + ")";
// SAK-31695
// Since we need UTF-8, we need to be conservative 4000/4 -> 1025
// Also we need to force "CHAR" to handle UTF-8 columns lengths
if (maxlength < 1025) {
schema = "VARCHAR2(" + maxlength + " CHAR)";
} else {
schema = "CLOB";
}
Expand Down Expand Up @@ -1904,6 +1907,9 @@ public String[] formAdjustTable(String table, String[] formDefinition, String ve
}
if ( sqlLength < maxlength ) shouldAlter = true;
if ( ! isNullable ) shouldAlter = true; // BLTI-220, BLTI-238

// shouldAlter = true; // Temporary SAK-31695 to force ALTER statements to be emitted

} else if ("radio".equals(type) || "checkbox".equals(type) || "integer".equals(type) ) {
if ( NUMBER_TYPE.equals(sqlType)) continue;
logger.severe(field+" must be Integer field");
Expand Down

0 comments on commit 6200a97

Please sign in to comment.