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

Commit

Permalink
Fixes the regression in the db connect string prepending enhancement
Browse files Browse the repository at this point in the history
Fixes a problem introduced in
b4031c2
where the _rdbConnectionTemplateDebug was used instead of
_rdbConnectionTemplate, and with only a data source (no credentials), if
missing from the INI file (like on IW production machines).  Also
removes case-sensitivity on the "Data Source" existence check.
  • Loading branch information
Jim Tarber committed Aug 22, 2016
1 parent 3cc23d5 commit 4b5e961
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 4b5e961

Please sign in to comment.