MySQL: Check for case-sensitivity
This commit is contained in:
@@ -309,5 +309,27 @@ namespace Umbraco.Core.Persistence.SqlSyntax
|
||||
public override string DropIndex { get { return "DROP INDEX {0} ON {1}"; } }
|
||||
|
||||
public override string RenameColumn { get { return "ALTER TABLE {0} CHANGE {1} {2}"; } }
|
||||
|
||||
public override bool? SupportsCaseInsensitiveQueries(Database db)
|
||||
{
|
||||
bool? supportsCaseInsensitiveQueries;
|
||||
|
||||
try
|
||||
{
|
||||
db.OpenSharedConnection();
|
||||
var lowerCaseFileSystem = db.Fetch<int>("SELECT @@Global.lower_case_file_system");
|
||||
var lowerCaseTableNames = db.Fetch<int>("SELECT @@Global.lower_case_table_names");
|
||||
|
||||
supportsCaseInsensitiveQueries = lowerCaseFileSystem.First() == 1 && lowerCaseTableNames.First() == 0;
|
||||
}
|
||||
finally
|
||||
{
|
||||
db.CloseSharedConnection();
|
||||
}
|
||||
|
||||
// Could return null, which means testing failed,
|
||||
// add message to check with their hosting provider
|
||||
return supportsCaseInsensitiveQueries;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user