diff --git a/src/Umbraco.Core/DatabaseContext.cs b/src/Umbraco.Core/DatabaseContext.cs index 54d97ba534..780e799095 100644 --- a/src/Umbraco.Core/DatabaseContext.cs +++ b/src/Umbraco.Core/DatabaseContext.cs @@ -385,10 +385,11 @@ namespace Umbraco.Core { LogHelper.Info("Database configuration status: Started"); - string message; + var message = string.Empty; var database = new UmbracoDatabase(_connectionString, ProviderName); - if (SyntaxConfig.SqlSyntaxProvider.SupportsCaseInsensitiveQueries(database) == false) + var supportsCaseInsensitiveQueries = SyntaxConfig.SqlSyntaxProvider.SupportsCaseInsensitiveQueries(database); + if (supportsCaseInsensitiveQueries == false) { message = "

 

The database you're trying to use does not support case insensitive queries.
We currently do not support these types of databases.

" + "

You can fix this by changing the following two settings in your my.ini file in your MySQL installation directory:

" + @@ -399,6 +400,29 @@ namespace Umbraco.Core return new Result { Message = message, Success = false, Percentage = "15" }; } + else if (supportsCaseInsensitiveQueries == null) + { + message = "

 

Warning! Could not check if your database type supports case insensitive queries.
We currently do not support these databases that do not support case insensitive queries.

" + + "

You can check this by looking for the following two settings in your my.ini file in your MySQL installation directory:

" + + "
lower_case_table_names=1\nlower_case_file_system=1

" + + "

Note: Make sure to check with your hosting provider if they support case insensitive queries as well.

" + + "

For more technical information on case sensitivity in MySQL, have a look at " + + "the documentation on the subject

"; + } + else + { + if (SyntaxConfig.SqlSyntaxProvider == MySqlSyntaxProvider.Instance) + { + message = "

 

Congratulations, the database step ran successfully!

" + + "

Note: You're using MySQL and the database instance you're connecting to seems to support case insensitive queries.

" + + "

However, your hosting provider may not support this option. Umbraco does not currently support MySQL installs that do not support case insensitive queries

" + + "

Make sure to check with your hosting provider if they support case insensitive queries as well.

" + + "

They can check this by looking for the following two settings in the my.ini file in their MySQL installation directory:

" + + "
lower_case_table_names=1\nlower_case_file_system=1

" + + "

For more technical information on case sensitivity in MySQL, have a look at " + + "the documentation on the subject

"; + } + } var schemaResult = ValidateDatabaseSchema(); var installedVersion = schemaResult.DetermineInstalledVersion(); @@ -408,7 +432,7 @@ namespace Umbraco.Core if (string.IsNullOrEmpty(GlobalSettings.ConfigurationStatus) && installedVersion.Equals(new Version(0, 0, 0))) { database.CreateDatabaseSchema(); - message = "Installation completed!"; + message = message + "

Installation completed!

"; } else { @@ -418,7 +442,7 @@ namespace Umbraco.Core var targetVersion = UmbracoVersion.Current; var runner = new MigrationRunner(configuredVersion, targetVersion, GlobalSettings.UmbracoMigrationName); var upgraded = runner.Execute(database, true); - message = "Upgrade completed!"; + message = message + "

Upgrade completed!

"; } LogHelper.Info("Database configuration status: " + message); diff --git a/src/Umbraco.Core/Persistence/SqlSyntax/MySqlSyntaxProvider.cs b/src/Umbraco.Core/Persistence/SqlSyntax/MySqlSyntaxProvider.cs index b2eb7f34bb..ef825ca4cc 100644 --- a/src/Umbraco.Core/Persistence/SqlSyntax/MySqlSyntaxProvider.cs +++ b/src/Umbraco.Core/Persistence/SqlSyntax/MySqlSyntaxProvider.cs @@ -312,15 +312,21 @@ namespace Umbraco.Core.Persistence.SqlSyntax public override bool? SupportsCaseInsensitiveQueries(Database db) { - bool? supportsCaseInsensitiveQueries; + bool? supportsCaseInsensitiveQueries = null; try { db.OpenSharedConnection(); - var lowerCaseFileSystem = db.Fetch("SELECT @@Global.lower_case_file_system"); - var lowerCaseTableNames = db.Fetch("SELECT @@Global.lower_case_table_names"); - - supportsCaseInsensitiveQueries = lowerCaseFileSystem.First() == 1 && lowerCaseTableNames.First() == 0; + // Need 4 @ signs as it is regarded as a parameter, @@ escapes it once, @@@@ escapes it twice + var lowerCaseFileSystem = db.Fetch("SELECT @@@@Global.lower_case_file_system"); + var lowerCaseTableNames = db.Fetch("SELECT @@@@Global.lower_case_table_names"); + + if(lowerCaseFileSystem.Any() && lowerCaseTableNames.Any()) + supportsCaseInsensitiveQueries = lowerCaseFileSystem.First() == 1 && lowerCaseTableNames.First() == 1; + } + catch(Exception ex) + { + Logging.LogHelper.Error("Error querying for lower_case support", ex); } finally {