From 452bbe079e08aa81588f35523cea0cc89640faa3 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Thu, 22 Jun 2023 10:53:52 +0200 Subject: [PATCH] Use lowercase sa for SQL Server username Otherwise the selected collation might cause issues. --- .../mssql/deployment/MSSQLDevServicesProcessor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/extensions/devservices/mssql/src/main/java/io/quarkus/devservices/mssql/deployment/MSSQLDevServicesProcessor.java b/extensions/devservices/mssql/src/main/java/io/quarkus/devservices/mssql/deployment/MSSQLDevServicesProcessor.java index 7f32c0dd79b8d5..9cc82062f702bd 100644 --- a/extensions/devservices/mssql/src/main/java/io/quarkus/devservices/mssql/deployment/MSSQLDevServicesProcessor.java +++ b/extensions/devservices/mssql/src/main/java/io/quarkus/devservices/mssql/deployment/MSSQLDevServicesProcessor.java @@ -27,6 +27,11 @@ public class MSSQLDevServicesProcessor { private static final Logger LOG = Logger.getLogger(MSSQLDevServicesProcessor.class); + /** + * Using SA doesn't work with all collations so let's use the lowercase version instead. + */ + private static final String DEFAULT_USERNAME = "sa"; + @BuildStep DevServicesDatasourceProviderBuildItem setupMSSQL( List devServicesSharedNetworkBuildItem) { @@ -63,7 +68,7 @@ public RunningDevServicesDatasource startDatabase(Optional username, Opt return new RunningDevServicesDatasource(container.getContainerId(), container.getEffectiveJdbcUrl(), container.getReactiveUrl(), - container.getUsername(), + DEFAULT_USERNAME, container.getPassword(), new ContainerShutdownCloseable(container, "Microsoft SQL Server")); }