diff options
author | Justin Clarke Casey | 2009-02-19 18:31:45 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-02-19 18:31:45 +0000 |
commit | 631e10f269210cc352acc453fe04f56343c73360 (patch) | |
tree | aa38818eb01549179f0f90322b8cd5c0a249c5d1 | |
parent | * It think it actually works now. Only that AssetService weirdness left to fix. (diff) | |
download | opensim-SC_OLD-631e10f269210cc352acc453fe04f56343c73360.zip opensim-SC_OLD-631e10f269210cc352acc453fe04f56343c73360.tar.gz opensim-SC_OLD-631e10f269210cc352acc453fe04f56343c73360.tar.bz2 opensim-SC_OLD-631e10f269210cc352acc453fe04f56343c73360.tar.xz |
* Apply http://opensimulator.org/mantis/view.php?id=3151
* Fixes NHibernate overflow exception when saving some objects (under at least PostgreSQL 8.3)
* Thanks Tommil!
Diffstat (limited to '')
12 files changed, 37 insertions, 28 deletions
diff --git a/OpenSim/Data/NHibernate/Resources/MsSql2005Dialect/001_InventoryStore.sql b/OpenSim/Data/NHibernate/Resources/MsSql2005Dialect/001_InventoryStore.sql index 37ba733..82936c4 100644 --- a/OpenSim/Data/NHibernate/Resources/MsSql2005Dialect/001_InventoryStore.sql +++ b/OpenSim/Data/NHibernate/Resources/MsSql2005Dialect/001_InventoryStore.sql | |||
@@ -1,7 +1,7 @@ | |||
1 | create table InventoryFolders ( | 1 | create table InventoryFolders ( |
2 | ID NVARCHAR(255) not null, | 2 | ID NVARCHAR(255) not null, |
3 | Type SMALLINT null, | 3 | Type SMALLINT null, |
4 | Version SMALLINT null, | 4 | Version INT null, |
5 | ParentID NVARCHAR(255) null, | 5 | ParentID NVARCHAR(255) null, |
6 | Owner NVARCHAR(255) null, | 6 | Owner NVARCHAR(255) null, |
7 | Name NVARCHAR(64) null, | 7 | Name NVARCHAR(64) null, |
diff --git a/OpenSim/Data/NHibernate/Resources/MsSql2005Dialect/001_RegionStore.sql b/OpenSim/Data/NHibernate/Resources/MsSql2005Dialect/001_RegionStore.sql index 56ad905..f388f1a 100644 --- a/OpenSim/Data/NHibernate/Resources/MsSql2005Dialect/001_RegionStore.sql +++ b/OpenSim/Data/NHibernate/Resources/MsSql2005Dialect/001_RegionStore.sql | |||
@@ -49,8 +49,8 @@ create table Prims ( | |||
49 | ScaleY REAL null, | 49 | ScaleY REAL null, |
50 | ScaleZ REAL null, | 50 | ScaleZ REAL null, |
51 | PCode TINYINT null, | 51 | PCode TINYINT null, |
52 | PathBegin SMALLINT null, | 52 | PathBegin INT null, |
53 | PathEnd SMALLINT null, | 53 | PathEnd INT null, |
54 | PathScaleX TINYINT null, | 54 | PathScaleX TINYINT null, |
55 | PathScaleY TINYINT null, | 55 | PathScaleY TINYINT null, |
56 | PathShearX TINYINT null, | 56 | PathShearX TINYINT null, |
@@ -62,10 +62,10 @@ create table Prims ( | |||
62 | PathTaperX TINYINT null, | 62 | PathTaperX TINYINT null, |
63 | PathTaperY TINYINT null, | 63 | PathTaperY TINYINT null, |
64 | PathTwist TINYINT null, | 64 | PathTwist TINYINT null, |
65 | ProfileBegin SMALLINT null, | 65 | ProfileBegin INT null, |
66 | ProfileEnd SMALLINT null, | 66 | ProfileEnd INT null, |
67 | ProfileCurve TINYINT null, | 67 | ProfileCurve TINYINT null, |
68 | ProfileHollow SMALLINT null, | 68 | ProfileHollow INT null, |
69 | Texture VARBINARY(8000) null, | 69 | Texture VARBINARY(8000) null, |
70 | ExtraParams VARBINARY(8000) null, | 70 | ExtraParams VARBINARY(8000) null, |
71 | State TINYINT null, | 71 | State TINYINT null, |
diff --git a/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_AssetStore.sql b/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_AssetStore.sql index 9573781..cd0958d 100644 --- a/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_AssetStore.sql +++ b/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_AssetStore.sql | |||
@@ -1,6 +1,6 @@ | |||
1 | CREATE TABLE Assets ( | 1 | CREATE TABLE Assets ( |
2 | ID VARCHAR(36) NOT NULL, | 2 | ID VARCHAR(36) NOT NULL, |
3 | Type TINYINT DEFAULT NULL, | 3 | Type SMALLINT DEFAULT NULL, |
4 | Name VARCHAR(64) DEFAULT NULL, | 4 | Name VARCHAR(64) DEFAULT NULL, |
5 | Description VARCHAR(64) DEFAULT NULL, | 5 | Description VARCHAR(64) DEFAULT NULL, |
6 | Local BIT DEFAULT NULL, | 6 | Local BIT DEFAULT NULL, |
diff --git a/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_InventoryStore.sql b/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_InventoryStore.sql index 13d8cf6..93d282b 100644 --- a/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_InventoryStore.sql +++ b/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_InventoryStore.sql | |||
@@ -1,7 +1,7 @@ | |||
1 | CREATE TABLE InventoryFolders ( | 1 | CREATE TABLE InventoryFolders ( |
2 | ID VARCHAR(36) NOT NULL, | 2 | ID VARCHAR(36) NOT NULL, |
3 | Type SMALLINT DEFAULT NULL, | 3 | Type SMALLINT DEFAULT NULL, |
4 | Version SMALLINT DEFAULT NULL, | 4 | Version INT DEFAULT NULL, |
5 | ParentID VARCHAR(36) DEFAULT NULL, | 5 | ParentID VARCHAR(36) DEFAULT NULL, |
6 | Owner VARCHAR(36) DEFAULT NULL, | 6 | Owner VARCHAR(36) DEFAULT NULL, |
7 | Name VARCHAR(64) DEFAULT NULL, | 7 | Name VARCHAR(64) DEFAULT NULL, |
@@ -13,8 +13,8 @@ CREATE INDEX InventoryFoldersParentIdIndex ON InventoryFolders (ParentID); | |||
13 | 13 | ||
14 | CREATE TABLE InventoryItems ( | 14 | CREATE TABLE InventoryItems ( |
15 | ID VARCHAR(36) NOT NULL, | 15 | ID VARCHAR(36) NOT NULL, |
16 | InvType SMALLINT DEFAULT NULL, | 16 | InvType INT DEFAULT NULL, |
17 | AssetType SMALLINT DEFAULT NULL, | 17 | AssetType INT DEFAULT NULL, |
18 | AssetID VARCHAR(36) DEFAULT NULL, | 18 | AssetID VARCHAR(36) DEFAULT NULL, |
19 | Folder VARCHAR(36) DEFAULT NULL, | 19 | Folder VARCHAR(36) DEFAULT NULL, |
20 | Owner VARCHAR(36) DEFAULT NULL, | 20 | Owner VARCHAR(36) DEFAULT NULL, |
diff --git a/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_RegionStore.sql b/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_RegionStore.sql index e44f012..74f67f2 100644 --- a/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_RegionStore.sql +++ b/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_RegionStore.sql | |||
@@ -71,7 +71,6 @@ CREATE TABLE Prims ( | |||
71 | PathTaperX INT DEFAULT NULL, | 71 | PathTaperX INT DEFAULT NULL, |
72 | PathTaperY INT DEFAULT NULL, | 72 | PathTaperY INT DEFAULT NULL, |
73 | PathTwist INT DEFAULT NULL, | 73 | PathTwist INT DEFAULT NULL, |
74 | PathTwistBegin INT DEFAULT NULL, | ||
75 | ProfileBegin INT DEFAULT NULL, | 74 | ProfileBegin INT DEFAULT NULL, |
76 | ProfileEnd INT DEFAULT NULL, | 75 | ProfileEnd INT DEFAULT NULL, |
77 | ProfileCurve INT DEFAULT NULL, | 76 | ProfileCurve INT DEFAULT NULL, |
diff --git a/OpenSim/Data/NHibernate/Resources/PostgreSQLDialect/001_InventoryStore.sql b/OpenSim/Data/NHibernate/Resources/PostgreSQLDialect/001_InventoryStore.sql index 9d0f711..42af659 100644 --- a/OpenSim/Data/NHibernate/Resources/PostgreSQLDialect/001_InventoryStore.sql +++ b/OpenSim/Data/NHibernate/Resources/PostgreSQLDialect/001_InventoryStore.sql | |||
@@ -1,7 +1,7 @@ | |||
1 | CREATE TABLE InventoryFolders ( | 1 | CREATE TABLE InventoryFolders ( |
2 | ID VARCHAR(36) NOT NULL, | 2 | ID VARCHAR(36) NOT NULL, |
3 | Type SMALLINT DEFAULT NULL, | 3 | Type SMALLINT DEFAULT NULL, |
4 | Version SMALLINT DEFAULT NULL, | 4 | Version INT DEFAULT NULL, |
5 | ParentID VARCHAR(36) DEFAULT NULL, | 5 | ParentID VARCHAR(36) DEFAULT NULL, |
6 | Owner VARCHAR(36) DEFAULT NULL, | 6 | Owner VARCHAR(36) DEFAULT NULL, |
7 | Name VARCHAR(64) DEFAULT NULL, | 7 | Name VARCHAR(64) DEFAULT NULL, |
@@ -13,8 +13,8 @@ CREATE INDEX InventoryFoldersParentIdIndex ON InventoryFolders (ParentID); | |||
13 | 13 | ||
14 | CREATE TABLE InventoryItems ( | 14 | CREATE TABLE InventoryItems ( |
15 | ID VARCHAR(36) NOT NULL, | 15 | ID VARCHAR(36) NOT NULL, |
16 | InvType SMALLINT DEFAULT NULL, | 16 | InvType INT DEFAULT NULL, |
17 | AssetType SMALLINT DEFAULT NULL, | 17 | AssetType INT DEFAULT NULL, |
18 | AssetID VARCHAR(36) DEFAULT NULL, | 18 | AssetID VARCHAR(36) DEFAULT NULL, |
19 | Folder VARCHAR(36) DEFAULT NULL, | 19 | Folder VARCHAR(36) DEFAULT NULL, |
20 | Owner VARCHAR(36) DEFAULT NULL, | 20 | Owner VARCHAR(36) DEFAULT NULL, |
diff --git a/OpenSim/Data/NHibernate/Resources/PostgreSQLDialect/001_RegionStore.sql b/OpenSim/Data/NHibernate/Resources/PostgreSQLDialect/001_RegionStore.sql index ff227c1..25c3945 100644 --- a/OpenSim/Data/NHibernate/Resources/PostgreSQLDialect/001_RegionStore.sql +++ b/OpenSim/Data/NHibernate/Resources/PostgreSQLDialect/001_RegionStore.sql | |||
@@ -58,8 +58,8 @@ CREATE TABLE Prims ( | |||
58 | ScaleY DOUBLE PRECISION DEFAULT NULL, | 58 | ScaleY DOUBLE PRECISION DEFAULT NULL, |
59 | ScaleZ DOUBLE PRECISION DEFAULT NULL, | 59 | ScaleZ DOUBLE PRECISION DEFAULT NULL, |
60 | PCode INT DEFAULT NULL, | 60 | PCode INT DEFAULT NULL, |
61 | PathBegin SMALLINT DEFAULT NULL, | 61 | PathBegin INT DEFAULT NULL, |
62 | PathEnd SMALLINT DEFAULT NULL, | 62 | PathEnd INT DEFAULT NULL, |
63 | PathScaleX INT DEFAULT NULL, | 63 | PathScaleX INT DEFAULT NULL, |
64 | PathScaleY INT DEFAULT NULL, | 64 | PathScaleY INT DEFAULT NULL, |
65 | PathShearX INT DEFAULT NULL, | 65 | PathShearX INT DEFAULT NULL, |
@@ -71,11 +71,10 @@ CREATE TABLE Prims ( | |||
71 | PathTaperX SMALLINT DEFAULT NULL, | 71 | PathTaperX SMALLINT DEFAULT NULL, |
72 | PathTaperY SMALLINT DEFAULT NULL, | 72 | PathTaperY SMALLINT DEFAULT NULL, |
73 | PathTwist SMALLINT DEFAULT NULL, | 73 | PathTwist SMALLINT DEFAULT NULL, |
74 | PathTwistBegin INT DEFAULT NULL, | 74 | ProfileBegin INT DEFAULT NULL, |
75 | ProfileBegin SMALLINT DEFAULT NULL, | 75 | ProfileEnd INT DEFAULT NULL, |
76 | ProfileEnd SMALLINT DEFAULT NULL, | ||
77 | ProfileCurve INT DEFAULT NULL, | 76 | ProfileCurve INT DEFAULT NULL, |
78 | ProfileHollow SMALLINT DEFAULT NULL, | 77 | ProfileHollow INT DEFAULT NULL, |
79 | State INT DEFAULT NULL, | 78 | State INT DEFAULT NULL, |
80 | Texture BYTEA, | 79 | Texture BYTEA, |
81 | ExtraParams BYTEA, | 80 | ExtraParams BYTEA, |
diff --git a/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_AssetStore.sql b/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_AssetStore.sql index 15e10b3..aedf764 100644 --- a/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_AssetStore.sql +++ b/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_AssetStore.sql | |||
@@ -1,6 +1,6 @@ | |||
1 | CREATE TABLE Assets ( | 1 | CREATE TABLE Assets ( |
2 | ID VARCHAR(36) NOT NULL, | 2 | ID VARCHAR(36) NOT NULL, |
3 | Type TINYINT DEFAULT NULL, | 3 | Type SMALLINT DEFAULT NULL, |
4 | Name VARCHAR(64) DEFAULT NULL, | 4 | Name VARCHAR(64) DEFAULT NULL, |
5 | Description VARCHAR(64) DEFAULT NULL, | 5 | Description VARCHAR(64) DEFAULT NULL, |
6 | Local BIT DEFAULT NULL, | 6 | Local BIT DEFAULT NULL, |
diff --git a/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_InventoryStore.sql b/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_InventoryStore.sql index 5f4dcaa..38978ee 100644 --- a/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_InventoryStore.sql +++ b/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_InventoryStore.sql | |||
@@ -1,7 +1,7 @@ | |||
1 | CREATE TABLE InventoryFolders ( | 1 | CREATE TABLE InventoryFolders ( |
2 | ID VARCHAR(36) NOT NULL, | 2 | ID VARCHAR(36) NOT NULL, |
3 | Type SMALLINT DEFAULT NULL, | 3 | Type SMALLINT DEFAULT NULL, |
4 | Version SMALLINT DEFAULT NULL, | 4 | Version INT DEFAULT NULL, |
5 | ParentID VARCHAR(36) DEFAULT NULL, | 5 | ParentID VARCHAR(36) DEFAULT NULL, |
6 | Owner VARCHAR(36) DEFAULT NULL, | 6 | Owner VARCHAR(36) DEFAULT NULL, |
7 | Name VARCHAR(64) DEFAULT NULL, | 7 | Name VARCHAR(64) DEFAULT NULL, |
@@ -13,8 +13,8 @@ CREATE INDEX InventoryFoldersParentIdIndex ON InventoryFolders (ParentID); | |||
13 | 13 | ||
14 | CREATE TABLE InventoryItems ( | 14 | CREATE TABLE InventoryItems ( |
15 | ID VARCHAR(36) NOT NULL, | 15 | ID VARCHAR(36) NOT NULL, |
16 | InvType SMALLINT DEFAULT NULL, | 16 | InvType INT DEFAULT NULL, |
17 | AssetType SMALLINT DEFAULT NULL, | 17 | AssetType INT DEFAULT NULL, |
18 | AssetID VARCHAR(36) DEFAULT NULL, | 18 | AssetID VARCHAR(36) DEFAULT NULL, |
19 | Folder VARCHAR(36) DEFAULT NULL, | 19 | Folder VARCHAR(36) DEFAULT NULL, |
20 | Owner VARCHAR(36) DEFAULT NULL, | 20 | Owner VARCHAR(36) DEFAULT NULL, |
diff --git a/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_RegionStore.sql b/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_RegionStore.sql index 7b591be..1cf5e15 100644 --- a/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_RegionStore.sql +++ b/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_RegionStore.sql | |||
@@ -71,7 +71,6 @@ CREATE TABLE Prims ( | |||
71 | PathTaperX INT DEFAULT NULL, | 71 | PathTaperX INT DEFAULT NULL, |
72 | PathTaperY INT DEFAULT NULL, | 72 | PathTaperY INT DEFAULT NULL, |
73 | PathTwist INT DEFAULT NULL, | 73 | PathTwist INT DEFAULT NULL, |
74 | PathTwistBegin INT DEFAULT NULL, | ||
75 | ProfileBegin INT DEFAULT NULL, | 74 | ProfileBegin INT DEFAULT NULL, |
76 | ProfileEnd INT DEFAULT NULL, | 75 | ProfileEnd INT DEFAULT NULL, |
77 | ProfileCurve INT DEFAULT NULL, | 76 | ProfileCurve INT DEFAULT NULL, |
diff --git a/OpenSim/Data/NHibernate/UInt16Type.cs b/OpenSim/Data/NHibernate/UInt16Type.cs index 907e832..05b9ce6 100644 --- a/OpenSim/Data/NHibernate/UInt16Type.cs +++ b/OpenSim/Data/NHibernate/UInt16Type.cs | |||
@@ -73,7 +73,7 @@ namespace OpenSim.Data.NHibernate | |||
73 | int ord = rs.GetOrdinal(names[0]); | 73 | int ord = rs.GetOrdinal(names[0]); |
74 | if (!rs.IsDBNull(ord)) | 74 | if (!rs.IsDBNull(ord)) |
75 | { | 75 | { |
76 | uint1 = (UInt16)rs.GetInt16(ord); | 76 | uint1 = (UInt16)rs.GetInt32(ord); |
77 | } | 77 | } |
78 | 78 | ||
79 | return uint1; | 79 | return uint1; |
@@ -82,7 +82,7 @@ namespace OpenSim.Data.NHibernate | |||
82 | public void NullSafeSet(IDbCommand cmd, object obj, int index) | 82 | public void NullSafeSet(IDbCommand cmd, object obj, int index) |
83 | { | 83 | { |
84 | UInt16 uint1 = (UInt16)obj; | 84 | UInt16 uint1 = (UInt16)obj; |
85 | ((IDataParameter)cmd.Parameters[index]).Value = Convert.ToInt16(uint1); | 85 | ((IDataParameter)cmd.Parameters[index]).Value = Convert.ToInt32(uint1); |
86 | } | 86 | } |
87 | 87 | ||
88 | public object Replace(object original, object target, object owner) | 88 | public object Replace(object original, object target, object owner) |
@@ -97,7 +97,7 @@ namespace OpenSim.Data.NHibernate | |||
97 | 97 | ||
98 | public SqlType[] SqlTypes | 98 | public SqlType[] SqlTypes |
99 | { | 99 | { |
100 | get { return new SqlType [] { NHibernateUtil.Int16.SqlType }; } | 100 | get { return new SqlType [] { NHibernateUtil.Int32.SqlType }; } |
101 | } | 101 | } |
102 | } | 102 | } |
103 | } | 103 | } |
diff --git a/OpenSim/Data/Tests/BasicRegionTest.cs b/OpenSim/Data/Tests/BasicRegionTest.cs index 8e58443..89cfd7f 100644 --- a/OpenSim/Data/Tests/BasicRegionTest.cs +++ b/OpenSim/Data/Tests/BasicRegionTest.cs | |||
@@ -243,6 +243,11 @@ namespace OpenSim.Data.Tests | |||
243 | byte clickaction = (byte) random.Next(127); | 243 | byte clickaction = (byte) random.Next(127); |
244 | PrimitiveBaseShape pbshap = new PrimitiveBaseShape(); | 244 | PrimitiveBaseShape pbshap = new PrimitiveBaseShape(); |
245 | pbshap = PrimitiveBaseShape.Default; | 245 | pbshap = PrimitiveBaseShape.Default; |
246 | pbshap.PathBegin = ushort.MaxValue; | ||
247 | pbshap.PathEnd = ushort.MaxValue; | ||
248 | pbshap.ProfileBegin = ushort.MaxValue; | ||
249 | pbshap.ProfileEnd = ushort.MaxValue; | ||
250 | pbshap.ProfileHollow = ushort.MaxValue; | ||
246 | Vector3 scale = new Vector3(random.Next(),random.Next(),random.Next()); | 251 | Vector3 scale = new Vector3(random.Next(),random.Next(),random.Next()); |
247 | byte updatef = (byte) random.Next(127); | 252 | byte updatef = (byte) random.Next(127); |
248 | 253 | ||
@@ -366,7 +371,14 @@ namespace OpenSim.Data.Tests | |||
366 | //Assert.That(linknum,Is.EqualTo(p.LinkNum)); | 371 | //Assert.That(linknum,Is.EqualTo(p.LinkNum)); |
367 | Assert.That(clickaction,Is.EqualTo(p.ClickAction)); | 372 | Assert.That(clickaction,Is.EqualTo(p.ClickAction)); |
368 | Assert.That(scale,Is.EqualTo(p.Scale)); | 373 | Assert.That(scale,Is.EqualTo(p.Scale)); |
374 | |||
369 | //Assert.That(updatef,Is.EqualTo(p.UpdateFlag)); | 375 | //Assert.That(updatef,Is.EqualTo(p.UpdateFlag)); |
376 | |||
377 | Assert.That(pbshap.PathBegin, Is.EqualTo(p.Shape.PathBegin)); | ||
378 | Assert.That(pbshap.PathEnd, Is.EqualTo(p.Shape.PathEnd)); | ||
379 | Assert.That(pbshap.ProfileBegin, Is.EqualTo(p.Shape.ProfileBegin)); | ||
380 | Assert.That(pbshap.ProfileEnd, Is.EqualTo(p.Shape.ProfileEnd)); | ||
381 | Assert.That(pbshap.ProfileHollow, Is.EqualTo(p.Shape.ProfileHollow)); | ||
370 | } | 382 | } |
371 | 383 | ||
372 | [Test] | 384 | [Test] |