aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Storage
diff options
context:
space:
mode:
authorTeravus Ovares2007-12-27 18:49:16 +0000
committerTeravus Ovares2007-12-27 18:49:16 +0000
commitd82ed9a8c5aff8c95ce1c9aa092d68a4f649fa07 (patch)
tree3f9893938093c9c45ed8929890e42fb9f2cb3e35 /OpenSim/Region/Storage
parentMove hardcoded texture library inventory items out into OpenSimLibrary/xml. ... (diff)
downloadopensim-SC-d82ed9a8c5aff8c95ce1c9aa092d68a4f649fa07.zip
opensim-SC-d82ed9a8c5aff8c95ce1c9aa092d68a4f649fa07.tar.gz
opensim-SC-d82ed9a8c5aff8c95ce1c9aa092d68a4f649fa07.tar.bz2
opensim-SC-d82ed9a8c5aff8c95ce1c9aa092d68a4f649fa07.tar.xz
* Fixed MonoSQLite Update Table routine
* Charles, this will fix the red issue. * Same situation, the first run updates the tables (and gives you a ton of red errors), the second run and everything works as expected.
Diffstat (limited to 'OpenSim/Region/Storage')
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs6
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs28
2 files changed, 24 insertions, 10 deletions
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs
index 0a48126..60aeb83 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs
@@ -522,12 +522,12 @@ namespace OpenSim.DataStore.MSSQL
522 { 522 {
523 prim.SetSitTargetLL(new LLVector3( 523 prim.SetSitTargetLL(new LLVector3(
524 Convert.ToSingle(row["SitTargetOffsetX"]), 524 Convert.ToSingle(row["SitTargetOffsetX"]),
525 Convert.ToSingle(row["SitTargetOffsetX"]), 525 Convert.ToSingle(row["SitTargetOffsetY"]),
526 Convert.ToSingle(row["SitTargetOffsetZ"])), new LLQuaternion( 526 Convert.ToSingle(row["SitTargetOffsetZ"])), new LLQuaternion(
527 Convert.ToSingle(row["SitTargetOrientW"]),
528 Convert.ToSingle(row["SitTargetOrientX"]), 527 Convert.ToSingle(row["SitTargetOrientX"]),
529 Convert.ToSingle(row["SitTargetOrientY"]), 528 Convert.ToSingle(row["SitTargetOrientY"]),
530 Convert.ToSingle(row["SitTargetOrientX"]))); 529 Convert.ToSingle(row["SitTargetOrientZ"]),
530 Convert.ToSingle(row["SitTargetOrientW"])));
531 } 531 }
532 catch (System.InvalidCastException) 532 catch (System.InvalidCastException)
533 { 533 {
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
index 9118082..c885310 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
@@ -783,20 +783,34 @@ namespace OpenSim.DataStore.MonoSqlite
783 { 783 {
784 prim.SetSitTargetLL(new LLVector3( 784 prim.SetSitTargetLL(new LLVector3(
785 Convert.ToSingle(row["SitTargetOffsetX"]), 785 Convert.ToSingle(row["SitTargetOffsetX"]),
786 Convert.ToSingle(row["SitTargetOffsetX"]), 786 Convert.ToSingle(row["SitTargetOffsetY"]),
787 Convert.ToSingle(row["SitTargetOffsetZ"])), new LLQuaternion( 787 Convert.ToSingle(row["SitTargetOffsetZ"])), new LLQuaternion(
788 Convert.ToSingle(row["SitTargetOrientW"]),
789 Convert.ToSingle(row["SitTargetOrientX"]), 788 Convert.ToSingle(row["SitTargetOrientX"]),
790 Convert.ToSingle(row["SitTargetOrientY"]), 789 Convert.ToSingle(row["SitTargetOrientY"]),
791 Convert.ToSingle(row["SitTargetOrientX"]))); 790 Convert.ToSingle(row["SitTargetOrientZ"]),
791 Convert.ToSingle(row["SitTargetOrientW"])));
792 } 792 }
793 catch (System.InvalidCastException) 793 catch (System.InvalidCastException)
794 { 794 {
795 // Database table was created before we got here and now has null values :P 795 // Database table was created before we got here and now has null values :P
796 using (SqliteCommand cmd = new SqliteCommand("ALTER TABLE `prims` ADD COLUMN `SitTargetOffsetX` float NOT NULL default 0, ADD COLUMN `SitTargetOffsetY` float NOT NULL default 0, ADD COLUMN `SitTargetOffsetZ` float NOT NULL default 0, ADD COLUMN `SitTargetOrientW` float NOT NULL default 0, ADD COLUMN `SitTargetOrientX` float NOT NULL default 0, ADD COLUMN `SitTargetOrientY` float NOT NULL default 0, ADD COLUMN `SitTargetOrientZ` float NOT NULL default 0;", m_conn)) 796 m_conn.Open();
797 { 797 SqliteCommand cmd = new SqliteCommand("ALTER TABLE prims ADD COLUMN SitTargetOffsetX float NOT NULL default 0;", m_conn);
798 cmd.ExecuteNonQuery(); 798 cmd.ExecuteNonQuery();
799 } 799 cmd = new SqliteCommand("ALTER TABLE prims ADD COLUMN SitTargetOffsetY float NOT NULL default 0;", m_conn);
800 cmd.ExecuteNonQuery();
801 cmd = new SqliteCommand("ALTER TABLE prims ADD COLUMN SitTargetOffsetZ float NOT NULL default 0;", m_conn);
802 cmd.ExecuteNonQuery();
803 cmd = new SqliteCommand("ALTER TABLE prims ADD COLUMN SitTargetOrientW float NOT NULL default 0;", m_conn);
804 cmd.ExecuteNonQuery();
805 cmd = new SqliteCommand("ALTER TABLE prims ADD COLUMN SitTargetOrientX float NOT NULL default 0;", m_conn);
806 cmd.ExecuteNonQuery();
807 cmd = new SqliteCommand("ALTER TABLE prims ADD COLUMN SitTargetOrientY float NOT NULL default 0;", m_conn);
808 cmd.ExecuteNonQuery();
809 cmd = new SqliteCommand("ALTER TABLE prims ADD COLUMN SitTargetOrientZ float NOT NULL default 0;", m_conn);
810 cmd.ExecuteNonQuery();
811
812
813
800 } 814 }
801 815
802 return prim; 816 return prim;