aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL
diff options
context:
space:
mode:
authorSean Dague2009-06-29 15:05:12 +0000
committerSean Dague2009-06-29 15:05:12 +0000
commit3dc2010da6412941bfbcdb29007b12a8f37b7bef (patch)
treef9fa0ad53b712d91d8fcc21aa6513c8a94dd4bf4 /OpenSim/Data/MSSQL
parentThank you kindly, Godfrey, for a patch that: (diff)
downloadopensim-SC_OLD-3dc2010da6412941bfbcdb29007b12a8f37b7bef.zip
opensim-SC_OLD-3dc2010da6412941bfbcdb29007b12a8f37b7bef.tar.gz
opensim-SC_OLD-3dc2010da6412941bfbcdb29007b12a8f37b7bef.tar.bz2
opensim-SC_OLD-3dc2010da6412941bfbcdb29007b12a8f37b7bef.tar.xz
From: Chris Yeoh <yeohc@au1.ibm.com>
Attached is a patch that changes the oar file saving of creation date/time to an integer instead of a string. I did this after justincc emailed me saying there is a problem with internationalisation doing it the old way and I said I'd fix it. Its been tested with MySQL and I've made the changes for MSSQL but that hasn't been well tested.
Diffstat (limited to 'OpenSim/Data/MSSQL')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLRegionData.cs19
-rw-r--r--OpenSim/Data/MSSQL/Resources/023_RegionStore.sql7
2 files changed, 12 insertions, 14 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs
index 293282e..1aaf2a5 100644
--- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs
@@ -723,7 +723,7 @@ VALUES
723,[elevation_1_ne] = @elevation_1_ne ,[elevation_2_ne] = @elevation_2_ne ,[elevation_1_se] = @elevation_1_se ,[elevation_2_se] = @elevation_2_se 723,[elevation_1_ne] = @elevation_1_ne ,[elevation_2_ne] = @elevation_2_ne ,[elevation_1_se] = @elevation_1_se ,[elevation_2_se] = @elevation_2_se
724,[elevation_1_sw] = @elevation_1_sw ,[elevation_2_sw] = @elevation_2_sw ,[water_height] = @water_height ,[terrain_raise_limit] = @terrain_raise_limit 724,[elevation_1_sw] = @elevation_1_sw ,[elevation_2_sw] = @elevation_2_sw ,[water_height] = @water_height ,[terrain_raise_limit] = @terrain_raise_limit
725,[terrain_lower_limit] = @terrain_lower_limit ,[use_estate_sun] = @use_estate_sun ,[fixed_sun] = @fixed_sun ,[sun_position] = @sun_position 725,[terrain_lower_limit] = @terrain_lower_limit ,[use_estate_sun] = @use_estate_sun ,[fixed_sun] = @fixed_sun ,[sun_position] = @sun_position
726,[covenant] = @covenant , [sunvectorx] = @sunvectorx, [sunvectory] = @sunvectory, [sunvectorz] = @sunvectorz, [Sandbox] = @Sandbox, [loaded_creation_date] = @loaded_creation_date, [loaded_creation_time] = @loaded_creation_time, [loaded_creation_id] = @loaded_creation_id 726,[covenant] = @covenant , [sunvectorx] = @sunvectorx, [sunvectory] = @sunvectory, [sunvectorz] = @sunvectorz, [Sandbox] = @Sandbox, [loaded_creation_datetime] = @loaded_creation_datetime, [loaded_creation_id] = @loaded_creation_id
727 WHERE [regionUUID] = @regionUUID"; 727 WHERE [regionUUID] = @regionUUID";
728 728
729 using (AutoClosingSqlCommand cmd = _Database.Query(sql)) 729 using (AutoClosingSqlCommand cmd = _Database.Query(sql))
@@ -777,14 +777,14 @@ VALUES
777 [block_show_in_search],[agent_limit],[object_bonus],[maturity],[disable_scripts],[disable_collisions],[disable_physics], 777 [block_show_in_search],[agent_limit],[object_bonus],[maturity],[disable_scripts],[disable_collisions],[disable_physics],
778 [terrain_texture_1],[terrain_texture_2],[terrain_texture_3],[terrain_texture_4],[elevation_1_nw],[elevation_2_nw],[elevation_1_ne], 778 [terrain_texture_1],[terrain_texture_2],[terrain_texture_3],[terrain_texture_4],[elevation_1_nw],[elevation_2_nw],[elevation_1_ne],
779 [elevation_2_ne],[elevation_1_se],[elevation_2_se],[elevation_1_sw],[elevation_2_sw],[water_height],[terrain_raise_limit], 779 [elevation_2_ne],[elevation_1_se],[elevation_2_se],[elevation_1_sw],[elevation_2_sw],[water_height],[terrain_raise_limit],
780 [terrain_lower_limit],[use_estate_sun],[fixed_sun],[sun_position],[covenant],[sunvectorx], [sunvectory], [sunvectorz],[Sandbox], [loaded_creation_date], [loaded_creation_time], [loaded_creation_id] 780 [terrain_lower_limit],[use_estate_sun],[fixed_sun],[sun_position],[covenant],[sunvectorx], [sunvectory], [sunvectorz],[Sandbox], [loaded_creation_datetime], [loaded_creation_id]
781 ) 781 )
782 VALUES 782 VALUES
783 (@regionUUID,@block_terraform,@block_fly,@allow_damage,@restrict_pushing,@allow_land_resell,@allow_land_join_divide, 783 (@regionUUID,@block_terraform,@block_fly,@allow_damage,@restrict_pushing,@allow_land_resell,@allow_land_join_divide,
784 @block_show_in_search,@agent_limit,@object_bonus,@maturity,@disable_scripts,@disable_collisions,@disable_physics, 784 @block_show_in_search,@agent_limit,@object_bonus,@maturity,@disable_scripts,@disable_collisions,@disable_physics,
785 @terrain_texture_1,@terrain_texture_2,@terrain_texture_3,@terrain_texture_4,@elevation_1_nw,@elevation_2_nw,@elevation_1_ne, 785 @terrain_texture_1,@terrain_texture_2,@terrain_texture_3,@terrain_texture_4,@elevation_1_nw,@elevation_2_nw,@elevation_1_ne,
786 @elevation_2_ne,@elevation_1_se,@elevation_2_se,@elevation_1_sw,@elevation_2_sw,@water_height,@terrain_raise_limit, 786 @elevation_2_ne,@elevation_1_se,@elevation_2_se,@elevation_1_sw,@elevation_2_sw,@water_height,@terrain_raise_limit,
787 @terrain_lower_limit,@use_estate_sun,@fixed_sun,@sun_position,@covenant,@sunvectorx,@sunvectory, @sunvectorz, @Sandbox, @loaded_creation_date, @loaded_creation_time, @loaded_creation_id)"; 787 @terrain_lower_limit,@use_estate_sun,@fixed_sun,@sun_position,@covenant,@sunvectorx,@sunvectory, @sunvectorz, @Sandbox, @loaded_creation_datetime, @loaded_creation_id)";
788 788
789 using (AutoClosingSqlCommand cmd = _Database.Query(sql)) 789 using (AutoClosingSqlCommand cmd = _Database.Query(sql))
790 { 790 {
@@ -845,15 +845,7 @@ VALUES
845 ); 845 );
846 newSettings.Covenant = new UUID((Guid)row["covenant"]); 846 newSettings.Covenant = new UUID((Guid)row["covenant"]);
847 847
848 if (row["loaded_creation_date"] is DBNull) 848 newSettings.LoadedCreationDateTime = Convert.ToInt32(row["loaded_creation_datetime"]);
849 newSettings.LoadedCreationDate = "";
850 else
851 newSettings.LoadedCreationDate = (String)row["loaded_creation_date"];
852
853 if (row["loaded_creation_time"] is DBNull)
854 newSettings.LoadedCreationTime = "";
855 else
856 newSettings.LoadedCreationTime = (String)row["loaded_creation_time"];
857 849
858 if (row["loaded_creation_id"] is DBNull) 850 if (row["loaded_creation_id"] is DBNull)
859 newSettings.LoadedCreationID = ""; 851 newSettings.LoadedCreationID = "";
@@ -1257,8 +1249,7 @@ VALUES
1257 parameters.Add(_Database.CreateParameter("sunvectory", settings.SunVector.Y)); 1249 parameters.Add(_Database.CreateParameter("sunvectory", settings.SunVector.Y));
1258 parameters.Add(_Database.CreateParameter("sunvectorz", settings.SunVector.Z)); 1250 parameters.Add(_Database.CreateParameter("sunvectorz", settings.SunVector.Z));
1259 parameters.Add(_Database.CreateParameter("covenant", settings.Covenant)); 1251 parameters.Add(_Database.CreateParameter("covenant", settings.Covenant));
1260 parameters.Add(_Database.CreateParameter("LoadedCreationDate", settings.LoadedCreationDate)); 1252 parameters.Add(_Database.CreateParameter("LoadedCreationDateTime", settings.LoadedCreationDateTime));
1261 parameters.Add(_Database.CreateParameter("LoadedCreationTime", settings.LoadedCreationTime));
1262 parameters.Add(_Database.CreateParameter("LoadedCreationID", settings.LoadedCreationID)); 1253 parameters.Add(_Database.CreateParameter("LoadedCreationID", settings.LoadedCreationID));
1263 1254
1264 return parameters.ToArray(); 1255 return parameters.ToArray();
diff --git a/OpenSim/Data/MSSQL/Resources/023_RegionStore.sql b/OpenSim/Data/MSSQL/Resources/023_RegionStore.sql
new file mode 100644
index 0000000..61b08f1
--- /dev/null
+++ b/OpenSim/Data/MSSQL/Resources/023_RegionStore.sql
@@ -0,0 +1,7 @@
1BEGIN TRANSACTION
2
3ALTER TABLE regionsettings DROP COLUMN loaded_creation_date;
4ALTER TABLE regionsettings DROP COLUMN loaded_creation_time;
5ALTER TABLE regionsettings ADD COLUMN loaded_creation_datetime int unsigned NOT NULL default 0;
6
7COMMIT