Skip to content
This repository has been archived by the owner on Aug 19, 2018. It is now read-only.

Commit

Permalink
Merge pull request #266 from InWorldz/db-connect-prepend-fix
Browse files Browse the repository at this point in the history
Fixes the regression in the db connect string prepending enhancement
  • Loading branch information
Jim Tarber authored Aug 22, 2016
2 parents 3cc23d5 + 4b5e961 commit d85ac52
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
14 changes: 10 additions & 4 deletions OpenSim/Region/CoreModules/Avatar/Search/AvatarSearchModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,20 @@ public void Initialize(Scene scene, IConfigSource config)
IConfig myConfig = config.Configs["Startup"];
string connstr = myConfig.GetString("core_connection_string", String.Empty);
_rdbConnectionTemplate = myConfig.GetString("rdb_connection_template", String.Empty);
if (!_rdbConnectionTemplate.Contains("Data Source"))
if (!String.IsNullOrWhiteSpace(_rdbConnectionTemplate))
{
_rdbConnectionTemplate = "Data Source={0};" + _rdbConnectionTemplate;
if (!_rdbConnectionTemplate.ToLower().Contains("data source"))
{
_rdbConnectionTemplate = "Data Source={0};" + _rdbConnectionTemplate;
}
}
_rdbConnectionTemplateDebug = myConfig.GetString("rdb_connection_template_debug", String.Empty);
if (!_rdbConnectionTemplateDebug.Contains("Data Source"))
if (!String.IsNullOrWhiteSpace(_rdbConnectionTemplateDebug))
{
_rdbConnectionTemplateDebug = "Data Source={0};" + _rdbConnectionTemplateDebug;
if (!_rdbConnectionTemplateDebug.ToLower().Contains("data source"))
{
_rdbConnectionTemplateDebug = "Data Source={0};" + _rdbConnectionTemplateDebug;
}
}
_connFactory = new ConnectionFactory("MySQL", connstr);

Expand Down
14 changes: 10 additions & 4 deletions OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,20 @@ public void Initialize(Scene scene, IConfigSource config)
IConfig myConfig = config.Configs["Startup"];
string connstr = myConfig.GetString("core_connection_string", String.Empty);
_rdbConnectionTemplate = myConfig.GetString("rdb_connection_template", String.Empty);
if (!_rdbConnectionTemplate.Contains("Data Source"))
if (!String.IsNullOrWhiteSpace(_rdbConnectionTemplate))
{
_rdbConnectionTemplate = "Data Source={0};" + _rdbConnectionTemplate;
if (!_rdbConnectionTemplate.ToLower().Contains("data source"))
{
_rdbConnectionTemplate = "Data Source={0};" + _rdbConnectionTemplate;
}
}
_rdbConnectionTemplateDebug = myConfig.GetString("rdb_connection_template_debug", String.Empty);
if (!_rdbConnectionTemplateDebug.Contains("Data Source"))
if (!String.IsNullOrWhiteSpace(_rdbConnectionTemplateDebug))
{
_rdbConnectionTemplateDebug = "Data Source={0};" + _rdbConnectionTemplateDebug;
if (!_rdbConnectionTemplateDebug.ToLower().Contains("data source"))
{
_rdbConnectionTemplateDebug = "Data Source={0};" + _rdbConnectionTemplateDebug;
}
}
_connFactory = new ConnectionFactory("MySQL", connstr);

Expand Down

0 comments on commit d85ac52

Please sign in to comment.