{"record":{"id":"396d38bc233aa5cc","repo":"SonarSource/sonarqube","slug":"unsupported-dialect-id-396d38","errorCode":null,"errorMessage":"Unsupported dialect id ","messagePattern":"Unsupported dialect id ","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/sql/RenameColumnsBuilder.java","lineNumber":80,"sourceCode":"        validateColumnName(r.getOldColumnName());\n        validateColumnName(r.getNewColumnName());\n        checkArgument(!r.getNewColumnName().equals(r.getOldColumnName()), \"Column names must be different\");\n      });\n    return createSqlStatement();\n  }\n\n  private List<String> createSqlStatement() {\n    return renamings.stream().map(\n      r -> {\n        switch (dialect.getId()) {\n          case H2.ID:\n            return \"ALTER TABLE \" + tableName + \" ALTER COLUMN \" + r.getOldColumnName() + \" RENAME TO \" + r.getNewColumnName();\n          case Oracle.ID, PostgreSql.ID:\n            return \"ALTER TABLE \" + tableName + \" RENAME COLUMN \" + r.getOldColumnName() + \" TO \" + r.getNewColumnName();\n          case MsSql.ID:\n            return \"EXEC sp_rename '\" + tableName + \".\" + r.getOldColumnName() + \"', '\" + r.getNewColumnName() + \"', 'COLUMN'\";\n          default:\n            throw new IllegalArgumentException(\"Unsupported dialect id \" + dialect.getId());\n        }\n      }).toList();\n  }\n\n  private static class Renaming implements ColumnDef {\n    private final ColumnDef columnDef;\n    private final String oldColumnName;\n\n    private Renaming(String oldColumnName, ColumnDef columnDef) {\n      this.columnDef = columnDef;\n      this.oldColumnName = oldColumnName;\n    }\n\n    public String getOldColumnName() {\n      return oldColumnName;\n    }\n\n    public String getNewColumnName() {","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/sql/RenameColumnsBuilder.java#L62-L98","documentation":"RenameColumnsBuilder.build() generates ALTER TABLE ... RENAME COLUMN statements per dialect (H2, Oracle/PostgreSQL, MsSql sp_rename). An unrecognized dialect id throws IllegalArgumentException \"Unsupported dialect id <id>\". Note this one throws IllegalArgumentException rather than IllegalStateException.","triggerScenarios":"Executing a column-rename migration step (RenameColumnsBuilder.build) against a Dialect whose id is not h2, oracle, postgresql, or mssql.","commonSituations":"Unsupported or experimental database backends; new dialect added to the platform but this builder not extended; misconfigured dialect id in sonar.properties.","solutions":["Confirm the deployment uses a supported database (H2 only for eval, PostgreSQL, Oracle, or MS SQL).","If a new dialect must be supported, add a case to RenameColumnsBuilder's switch with the proper RENAME syntax.","Search the codebase for other switch-on-dialect builders missed when the dialect was introduced."],"exampleFix":"// before\ndefault:\n  throw new IllegalArgumentException(\"Unsupported dialect id \" + dialect.getId());\n// after\ncase MySql.ID:\n  return \"RENAME TABLE \" + tableName + \" TO \" + tableName + \"_tmp\";\ndefault:\n  throw new IllegalArgumentException(\"Unsupported dialect id \" + dialect.getId());","handlingStrategy":"validation","validationCode":"if (!Set.of(H2.ID, Oracle.ID, PostgreSql.ID, MsSql.ID).contains(dialect.getId())) {\n  throw new IllegalArgumentException(\"Rename column unsupported for \" + dialect.getId());\n}","typeGuard":"boolean supportsRenameColumn(Dialect d) { return Set.of(H2.ID, Oracle.ID, PostgreSql.ID, MsSql.ID).contains(d.getId()); }","tryCatchPattern":"try {\n  sqls = new RenameColumnsBuilder(dialect).renameColumn(table, oldName, newName).build();\n} catch (IllegalArgumentException e) {\n  LOG.error(\"Column rename skipped: {}\", e.getMessage());\n}","preventionTips":["Confirm the target engine supports the rename syntax your migration emits.","Cover all dialect ids in RenameColumnsBuilder unit tests.","Run the migration dry-run/verification on a staging DB of the same engine type."],"tags":["database","migration","unsupported-dialect","column-rename"],"backgroundTag":"unsupported-enum-value","analyzedSha":"184c821202192afc1c599fc912d0889b69fffa53","analyzedAt":"2026-09-09T12:23:51.573Z","contentChangedAt":"2026-09-09T12:23:51.573Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}