Fix to solve mantis 717 problem. Makes sure the region DB schema is up to date and consistent
parent
c9eb051936
commit
b99455d23d
|
@ -97,11 +97,16 @@ namespace OpenSim.Framework.Data.MySQL
|
|||
database.ExecuteResourceSql("CreateRegionsTable.sql");
|
||||
return;
|
||||
}
|
||||
else if (oldVersion.Contains("Rev. 1"))
|
||||
if (oldVersion.Contains("Rev. 1"))
|
||||
{
|
||||
database.ExecuteResourceSql("UpgradeRegionsTableToVersion2.sql");
|
||||
return;
|
||||
}
|
||||
if (oldVersion.Contains("Rev. 2"))
|
||||
{
|
||||
database.ExecuteResourceSql("UpgradeRegionsTableToVersion3.sql");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -23,9 +23,10 @@ CREATE TABLE `regions` (
|
|||
`regionUserRecvKey` varchar(128) default NULL,
|
||||
`regionUserSendKey` varchar(128) default NULL, `regionMapTexture` varchar(36) default NULL,
|
||||
`serverHttpPort` int(10) default NULL, `serverRemotingPort` int(10) default NULL,
|
||||
`owner_uuid` varchar(36) default '00000000-0000-0000-0000-000000000000' not null,
|
||||
`originUUID` varchar(36),
|
||||
PRIMARY KEY (`uuid`),
|
||||
KEY `regionName` (`regionName`),
|
||||
KEY `regionHandle` (`regionHandle`),
|
||||
KEY `overrideHandles` (`eastOverrideHandle`,`westOverrideHandle`,`southOverrideHandle`,`northOverrideHandle`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Rev. 2';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Rev. 3';
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
DROP PROCEDURE IF EXISTS upgraderegions3;
|
||||
|
||||
create procedure upgraderegions3()
|
||||
BEGIN
|
||||
DECLARE db_name varchar(64);
|
||||
select database() into db_name;
|
||||
IF ((select count(*) from information_schema.columns where table_name='regions' and column_name='owner_uuid' and table_schema=db_name) > 0)
|
||||
THEN
|
||||
ALTER TABLE `regions`, COMMENT='Rev. 3';
|
||||
ELSE
|
||||
ALTER TABLE `regions`
|
||||
ADD COLUMN `owner_uuid` varchar(36) default '00000000-0000-0000-0000-000000000000' not null after serverRemotingPort, COMMENT='Rev. 3';
|
||||
END IF;
|
||||
END;
|
||||
|
||||
call upgraderegions3();
|
||||
|
||||
|
|
@ -470,20 +470,21 @@ namespace OpenSim
|
|||
public UDPServer CreateRegion(RegionInfo regionInfo, bool portadd_flag)
|
||||
{
|
||||
int port = regionInfo.InternalEndPoint.Port;
|
||||
if ((proxyOffset != 0) && (portadd_flag))
|
||||
|
||||
// set initial RegionID to originRegionID in RegionInfo. (it needs for loding prims)
|
||||
regionInfo.originRegionID = regionInfo.RegionID;
|
||||
|
||||
// set initial ServerURI
|
||||
regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName
|
||||
+ ":" + regionInfo.InternalEndPoint.Port.ToString();
|
||||
|
||||
if ((proxyUrl.Length > 0) && (portadd_flag))
|
||||
{
|
||||
// set proxy url to RegionInfo
|
||||
regionInfo.proxyUrl = proxyUrl;
|
||||
|
||||
// set initial RegionID to originRegionID in RegionInfo. (it needs for loding prims)
|
||||
regionInfo.originRegionID = regionInfo.RegionID;
|
||||
|
||||
// set initial ServerURI
|
||||
regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName
|
||||
+ ":" + regionInfo.InternalEndPoint.Port.ToString();
|
||||
|
||||
ProxyCommand(proxyUrl, "AddPort", port, port + proxyOffset, regionInfo.ExternalHostName);
|
||||
}
|
||||
|
||||
UDPServer udpServer;
|
||||
Scene scene = SetupScene(regionInfo, proxyOffset, out udpServer, m_permissions);
|
||||
|
||||
|
|
Loading…
Reference in New Issue