diff options
-rw-r--r-- | sonar-db/src/main/java/org/sonar/db/version/CreateTableBuilder.java | 17 | ||||
-rw-r--r-- | sonar-db/src/test/java/org/sonar/db/version/CreateTableBuilderTest.java | 54 |
2 files changed, 0 insertions, 71 deletions
diff --git a/sonar-db/src/main/java/org/sonar/db/version/CreateTableBuilder.java b/sonar-db/src/main/java/org/sonar/db/version/CreateTableBuilder.java index f5087f3764e..955106533af 100644 --- a/sonar-db/src/main/java/org/sonar/db/version/CreateTableBuilder.java +++ b/sonar-db/src/main/java/org/sonar/db/version/CreateTableBuilder.java @@ -114,7 +114,6 @@ public class CreateTableBuilder { appendColumns(res, dialect, columnDefs); appendPkConstraint(res); res.append(')'); - appendLOBStorageClause(res, dialect, columnDefs); appendCollationClause(res, dialect); return res.toString(); } @@ -227,22 +226,6 @@ public class CreateTableBuilder { } } - private static void appendLOBStorageClause(StringBuilder res, Dialect dialect, List<ColumnDef> columnDefs) { - if (!Oracle.ID.equals(dialect.getId())) { - return; - } - - List<ColumnDef> clobColumnDefs = columnDefs.stream() - .filter(columnDef -> columnDef instanceof ClobColumnDef || columnDef instanceof BlobColumnDef) - .collect(Collectors.toList()); - if (!clobColumnDefs.isEmpty()) { - res.append(" LOB ("); - appendColumnNames(res, clobColumnDefs); - res.append(')'); - res.append(" STORE AS SECUREFILE (RETENTION NONE NOCACHE NOLOGGING)"); - } - } - private static void appendCollationClause(StringBuilder res, Dialect dialect) { if (MySql.ID.equals(dialect.getId())) { res.append(" ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin"); diff --git a/sonar-db/src/test/java/org/sonar/db/version/CreateTableBuilderTest.java b/sonar-db/src/test/java/org/sonar/db/version/CreateTableBuilderTest.java index 710c9823bcf..2b11ff4eb89 100644 --- a/sonar-db/src/test/java/org/sonar/db/version/CreateTableBuilderTest.java +++ b/sonar-db/src/test/java/org/sonar/db/version/CreateTableBuilderTest.java @@ -509,60 +509,6 @@ public class CreateTableBuilderTest { }); } - @Test - public void builds_adds_LOB_storage_clause_on_Oracle_for_CLOB_column() { - List<String> stmts = new CreateTableBuilder(ORACLE, TABLE_NAME) - .addColumn(newClobColumnDefBuilder().setColumnName("clob_1").setIsNullable(false).build()) - .build(); - assertThat(stmts).hasSize(1); - - assertThat(stmts.iterator().next()).isEqualTo( - "CREATE TABLE " + TABLE_NAME + " (" + - "clob_1 CLOB NOT NULL)" + - " LOB (clob_1) STORE AS SECUREFILE (RETENTION NONE NOCACHE NOLOGGING)"); - } - - @Test - public void builds_adds_LOB_storage_clause_on_Oracle_for_BLOB_column() { - List<String> stmts = new CreateTableBuilder(ORACLE, TABLE_NAME) - .addColumn(newBlobColumnDefBuilder().setColumnName("blob_1").setIsNullable(false).build()) - .build(); - assertThat(stmts).hasSize(1); - - assertThat(stmts.iterator().next()).isEqualTo( - "CREATE TABLE " + TABLE_NAME + " (" + - "blob_1 BLOB NOT NULL)" + - " LOB (blob_1) STORE AS SECUREFILE (RETENTION NONE NOCACHE NOLOGGING)"); - } - - @Test - public void build_does_not_add_LOB_storage_clause_for_CLOB_column_for_other_than_Oracle() { - Arrays.stream(ALL_DIALECTS) - .filter(dialect -> dialect != ORACLE) - .forEach(dialect -> { - List<String> stmts = new CreateTableBuilder(dialect, TABLE_NAME) - .addColumn(newClobColumnDefBuilder().setColumnName("clob_1").setIsNullable(false).build()) - .build(); - assertThat(stmts).hasSize(1); - - assertThat(stmts.iterator().next()).doesNotContain("STORE AS SECUREFILE"); - }); - } - - @Test - public void build_does_not_add_LOB_storage_clause_for_BLOB_column_for_other_than_Oracle() { - Arrays.stream(ALL_DIALECTS) - .filter(dialect -> dialect != ORACLE) - .forEach(dialect -> { - List<String> stmts = new CreateTableBuilder(dialect, TABLE_NAME) - .addColumn(newBlobColumnDefBuilder().setColumnName("blob_1").setIsNullable(false).build()) - .build(); - assertThat(stmts).hasSize(1); - - assertThat(stmts.iterator().next()).doesNotContain("STORE AS SECUREFILE"); - }); - } - private static String bigIntSqlType(Dialect dialect) { return Oracle.ID.equals(dialect.getId()) ? "NUMBER (38)" : "BIGINT"; } |