From a1037ce43caa81a0cd4ac6a83908245bea5061ad Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Tue, 23 Jul 2013 15:38:26 +0200 Subject: [PATCH] Fixes U4-2187 - Enable support for MySQL on Linux --- src/Umbraco.Core/DatabaseContext.cs | 12 ++++++------ .../Persistence/SqlSyntax/MySqlSyntaxProvider.cs | 5 ++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Core/DatabaseContext.cs b/src/Umbraco.Core/DatabaseContext.cs index 214636153a..4f52f61683 100644 --- a/src/Umbraco.Core/DatabaseContext.cs +++ b/src/Umbraco.Core/DatabaseContext.cs @@ -407,8 +407,8 @@ namespace Umbraco.Core 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:

" + - "
lower_case_table_names=1\nlower_case_file_system=1

" + + "

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

" + + "
lower_case_table_names=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

"; @@ -418,8 +418,8 @@ namespace Umbraco.Core 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

" + + "

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

" + + "
lower_case_table_names=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

"; @@ -432,8 +432,8 @@ namespace Umbraco.Core "

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

" + + "

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

" + + "
lower_case_table_names=1

" + "

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

"; } diff --git a/src/Umbraco.Core/Persistence/SqlSyntax/MySqlSyntaxProvider.cs b/src/Umbraco.Core/Persistence/SqlSyntax/MySqlSyntaxProvider.cs index 389650d606..52ea11e572 100644 --- a/src/Umbraco.Core/Persistence/SqlSyntax/MySqlSyntaxProvider.cs +++ b/src/Umbraco.Core/Persistence/SqlSyntax/MySqlSyntaxProvider.cs @@ -317,11 +317,10 @@ namespace Umbraco.Core.Persistence.SqlSyntax { db.OpenSharedConnection(); // 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; + if(lowerCaseTableNames.Any()) + supportsCaseInsensitiveQueries = lowerCaseTableNames.First() == 1; } catch(Exception ex) {