* Fixes NHibernate overflow exception when saving some objects (under at least PostgreSQL 8.3) * Thanks Tommil!GenericGridServerConcept
parent
fbeedc3272
commit
631e10f269
|
@ -1,7 +1,7 @@
|
||||||
create table InventoryFolders (
|
create table InventoryFolders (
|
||||||
ID NVARCHAR(255) not null,
|
ID NVARCHAR(255) not null,
|
||||||
Type SMALLINT null,
|
Type SMALLINT null,
|
||||||
Version SMALLINT null,
|
Version INT null,
|
||||||
ParentID NVARCHAR(255) null,
|
ParentID NVARCHAR(255) null,
|
||||||
Owner NVARCHAR(255) null,
|
Owner NVARCHAR(255) null,
|
||||||
Name NVARCHAR(64) null,
|
Name NVARCHAR(64) null,
|
||||||
|
|
|
@ -49,8 +49,8 @@ create table Prims (
|
||||||
ScaleY REAL null,
|
ScaleY REAL null,
|
||||||
ScaleZ REAL null,
|
ScaleZ REAL null,
|
||||||
PCode TINYINT null,
|
PCode TINYINT null,
|
||||||
PathBegin SMALLINT null,
|
PathBegin INT null,
|
||||||
PathEnd SMALLINT null,
|
PathEnd INT null,
|
||||||
PathScaleX TINYINT null,
|
PathScaleX TINYINT null,
|
||||||
PathScaleY TINYINT null,
|
PathScaleY TINYINT null,
|
||||||
PathShearX TINYINT null,
|
PathShearX TINYINT null,
|
||||||
|
@ -62,10 +62,10 @@ create table Prims (
|
||||||
PathTaperX TINYINT null,
|
PathTaperX TINYINT null,
|
||||||
PathTaperY TINYINT null,
|
PathTaperY TINYINT null,
|
||||||
PathTwist TINYINT null,
|
PathTwist TINYINT null,
|
||||||
ProfileBegin SMALLINT null,
|
ProfileBegin INT null,
|
||||||
ProfileEnd SMALLINT null,
|
ProfileEnd INT null,
|
||||||
ProfileCurve TINYINT null,
|
ProfileCurve TINYINT null,
|
||||||
ProfileHollow SMALLINT null,
|
ProfileHollow INT null,
|
||||||
Texture VARBINARY(8000) null,
|
Texture VARBINARY(8000) null,
|
||||||
ExtraParams VARBINARY(8000) null,
|
ExtraParams VARBINARY(8000) null,
|
||||||
State TINYINT null,
|
State TINYINT null,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
CREATE TABLE Assets (
|
CREATE TABLE Assets (
|
||||||
ID VARCHAR(36) NOT NULL,
|
ID VARCHAR(36) NOT NULL,
|
||||||
Type TINYINT DEFAULT NULL,
|
Type SMALLINT DEFAULT NULL,
|
||||||
Name VARCHAR(64) DEFAULT NULL,
|
Name VARCHAR(64) DEFAULT NULL,
|
||||||
Description VARCHAR(64) DEFAULT NULL,
|
Description VARCHAR(64) DEFAULT NULL,
|
||||||
Local BIT DEFAULT NULL,
|
Local BIT DEFAULT NULL,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
CREATE TABLE InventoryFolders (
|
CREATE TABLE InventoryFolders (
|
||||||
ID VARCHAR(36) NOT NULL,
|
ID VARCHAR(36) NOT NULL,
|
||||||
Type SMALLINT DEFAULT NULL,
|
Type SMALLINT DEFAULT NULL,
|
||||||
Version SMALLINT DEFAULT NULL,
|
Version INT DEFAULT NULL,
|
||||||
ParentID VARCHAR(36) DEFAULT NULL,
|
ParentID VARCHAR(36) DEFAULT NULL,
|
||||||
Owner VARCHAR(36) DEFAULT NULL,
|
Owner VARCHAR(36) DEFAULT NULL,
|
||||||
Name VARCHAR(64) DEFAULT NULL,
|
Name VARCHAR(64) DEFAULT NULL,
|
||||||
|
@ -13,8 +13,8 @@ CREATE INDEX InventoryFoldersParentIdIndex ON InventoryFolders (ParentID);
|
||||||
|
|
||||||
CREATE TABLE InventoryItems (
|
CREATE TABLE InventoryItems (
|
||||||
ID VARCHAR(36) NOT NULL,
|
ID VARCHAR(36) NOT NULL,
|
||||||
InvType SMALLINT DEFAULT NULL,
|
InvType INT DEFAULT NULL,
|
||||||
AssetType SMALLINT DEFAULT NULL,
|
AssetType INT DEFAULT NULL,
|
||||||
AssetID VARCHAR(36) DEFAULT NULL,
|
AssetID VARCHAR(36) DEFAULT NULL,
|
||||||
Folder VARCHAR(36) DEFAULT NULL,
|
Folder VARCHAR(36) DEFAULT NULL,
|
||||||
Owner VARCHAR(36) DEFAULT NULL,
|
Owner VARCHAR(36) DEFAULT NULL,
|
||||||
|
|
|
@ -71,7 +71,6 @@ CREATE TABLE Prims (
|
||||||
PathTaperX INT DEFAULT NULL,
|
PathTaperX INT DEFAULT NULL,
|
||||||
PathTaperY INT DEFAULT NULL,
|
PathTaperY INT DEFAULT NULL,
|
||||||
PathTwist INT DEFAULT NULL,
|
PathTwist INT DEFAULT NULL,
|
||||||
PathTwistBegin INT DEFAULT NULL,
|
|
||||||
ProfileBegin INT DEFAULT NULL,
|
ProfileBegin INT DEFAULT NULL,
|
||||||
ProfileEnd INT DEFAULT NULL,
|
ProfileEnd INT DEFAULT NULL,
|
||||||
ProfileCurve INT DEFAULT NULL,
|
ProfileCurve INT DEFAULT NULL,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
CREATE TABLE InventoryFolders (
|
CREATE TABLE InventoryFolders (
|
||||||
ID VARCHAR(36) NOT NULL,
|
ID VARCHAR(36) NOT NULL,
|
||||||
Type SMALLINT DEFAULT NULL,
|
Type SMALLINT DEFAULT NULL,
|
||||||
Version SMALLINT DEFAULT NULL,
|
Version INT DEFAULT NULL,
|
||||||
ParentID VARCHAR(36) DEFAULT NULL,
|
ParentID VARCHAR(36) DEFAULT NULL,
|
||||||
Owner VARCHAR(36) DEFAULT NULL,
|
Owner VARCHAR(36) DEFAULT NULL,
|
||||||
Name VARCHAR(64) DEFAULT NULL,
|
Name VARCHAR(64) DEFAULT NULL,
|
||||||
|
@ -13,8 +13,8 @@ CREATE INDEX InventoryFoldersParentIdIndex ON InventoryFolders (ParentID);
|
||||||
|
|
||||||
CREATE TABLE InventoryItems (
|
CREATE TABLE InventoryItems (
|
||||||
ID VARCHAR(36) NOT NULL,
|
ID VARCHAR(36) NOT NULL,
|
||||||
InvType SMALLINT DEFAULT NULL,
|
InvType INT DEFAULT NULL,
|
||||||
AssetType SMALLINT DEFAULT NULL,
|
AssetType INT DEFAULT NULL,
|
||||||
AssetID VARCHAR(36) DEFAULT NULL,
|
AssetID VARCHAR(36) DEFAULT NULL,
|
||||||
Folder VARCHAR(36) DEFAULT NULL,
|
Folder VARCHAR(36) DEFAULT NULL,
|
||||||
Owner VARCHAR(36) DEFAULT NULL,
|
Owner VARCHAR(36) DEFAULT NULL,
|
||||||
|
|
|
@ -58,8 +58,8 @@ CREATE TABLE Prims (
|
||||||
ScaleY DOUBLE PRECISION DEFAULT NULL,
|
ScaleY DOUBLE PRECISION DEFAULT NULL,
|
||||||
ScaleZ DOUBLE PRECISION DEFAULT NULL,
|
ScaleZ DOUBLE PRECISION DEFAULT NULL,
|
||||||
PCode INT DEFAULT NULL,
|
PCode INT DEFAULT NULL,
|
||||||
PathBegin SMALLINT DEFAULT NULL,
|
PathBegin INT DEFAULT NULL,
|
||||||
PathEnd SMALLINT DEFAULT NULL,
|
PathEnd INT DEFAULT NULL,
|
||||||
PathScaleX INT DEFAULT NULL,
|
PathScaleX INT DEFAULT NULL,
|
||||||
PathScaleY INT DEFAULT NULL,
|
PathScaleY INT DEFAULT NULL,
|
||||||
PathShearX INT DEFAULT NULL,
|
PathShearX INT DEFAULT NULL,
|
||||||
|
@ -71,11 +71,10 @@ CREATE TABLE Prims (
|
||||||
PathTaperX SMALLINT DEFAULT NULL,
|
PathTaperX SMALLINT DEFAULT NULL,
|
||||||
PathTaperY SMALLINT DEFAULT NULL,
|
PathTaperY SMALLINT DEFAULT NULL,
|
||||||
PathTwist SMALLINT DEFAULT NULL,
|
PathTwist SMALLINT DEFAULT NULL,
|
||||||
PathTwistBegin INT DEFAULT NULL,
|
ProfileBegin INT DEFAULT NULL,
|
||||||
ProfileBegin SMALLINT DEFAULT NULL,
|
ProfileEnd INT DEFAULT NULL,
|
||||||
ProfileEnd SMALLINT DEFAULT NULL,
|
|
||||||
ProfileCurve INT DEFAULT NULL,
|
ProfileCurve INT DEFAULT NULL,
|
||||||
ProfileHollow SMALLINT DEFAULT NULL,
|
ProfileHollow INT DEFAULT NULL,
|
||||||
State INT DEFAULT NULL,
|
State INT DEFAULT NULL,
|
||||||
Texture BYTEA,
|
Texture BYTEA,
|
||||||
ExtraParams BYTEA,
|
ExtraParams BYTEA,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
CREATE TABLE Assets (
|
CREATE TABLE Assets (
|
||||||
ID VARCHAR(36) NOT NULL,
|
ID VARCHAR(36) NOT NULL,
|
||||||
Type TINYINT DEFAULT NULL,
|
Type SMALLINT DEFAULT NULL,
|
||||||
Name VARCHAR(64) DEFAULT NULL,
|
Name VARCHAR(64) DEFAULT NULL,
|
||||||
Description VARCHAR(64) DEFAULT NULL,
|
Description VARCHAR(64) DEFAULT NULL,
|
||||||
Local BIT DEFAULT NULL,
|
Local BIT DEFAULT NULL,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
CREATE TABLE InventoryFolders (
|
CREATE TABLE InventoryFolders (
|
||||||
ID VARCHAR(36) NOT NULL,
|
ID VARCHAR(36) NOT NULL,
|
||||||
Type SMALLINT DEFAULT NULL,
|
Type SMALLINT DEFAULT NULL,
|
||||||
Version SMALLINT DEFAULT NULL,
|
Version INT DEFAULT NULL,
|
||||||
ParentID VARCHAR(36) DEFAULT NULL,
|
ParentID VARCHAR(36) DEFAULT NULL,
|
||||||
Owner VARCHAR(36) DEFAULT NULL,
|
Owner VARCHAR(36) DEFAULT NULL,
|
||||||
Name VARCHAR(64) DEFAULT NULL,
|
Name VARCHAR(64) DEFAULT NULL,
|
||||||
|
@ -13,8 +13,8 @@ CREATE INDEX InventoryFoldersParentIdIndex ON InventoryFolders (ParentID);
|
||||||
|
|
||||||
CREATE TABLE InventoryItems (
|
CREATE TABLE InventoryItems (
|
||||||
ID VARCHAR(36) NOT NULL,
|
ID VARCHAR(36) NOT NULL,
|
||||||
InvType SMALLINT DEFAULT NULL,
|
InvType INT DEFAULT NULL,
|
||||||
AssetType SMALLINT DEFAULT NULL,
|
AssetType INT DEFAULT NULL,
|
||||||
AssetID VARCHAR(36) DEFAULT NULL,
|
AssetID VARCHAR(36) DEFAULT NULL,
|
||||||
Folder VARCHAR(36) DEFAULT NULL,
|
Folder VARCHAR(36) DEFAULT NULL,
|
||||||
Owner VARCHAR(36) DEFAULT NULL,
|
Owner VARCHAR(36) DEFAULT NULL,
|
||||||
|
|
|
@ -71,7 +71,6 @@ CREATE TABLE Prims (
|
||||||
PathTaperX INT DEFAULT NULL,
|
PathTaperX INT DEFAULT NULL,
|
||||||
PathTaperY INT DEFAULT NULL,
|
PathTaperY INT DEFAULT NULL,
|
||||||
PathTwist INT DEFAULT NULL,
|
PathTwist INT DEFAULT NULL,
|
||||||
PathTwistBegin INT DEFAULT NULL,
|
|
||||||
ProfileBegin INT DEFAULT NULL,
|
ProfileBegin INT DEFAULT NULL,
|
||||||
ProfileEnd INT DEFAULT NULL,
|
ProfileEnd INT DEFAULT NULL,
|
||||||
ProfileCurve INT DEFAULT NULL,
|
ProfileCurve INT DEFAULT NULL,
|
||||||
|
|
|
@ -73,7 +73,7 @@ namespace OpenSim.Data.NHibernate
|
||||||
int ord = rs.GetOrdinal(names[0]);
|
int ord = rs.GetOrdinal(names[0]);
|
||||||
if (!rs.IsDBNull(ord))
|
if (!rs.IsDBNull(ord))
|
||||||
{
|
{
|
||||||
uint1 = (UInt16)rs.GetInt16(ord);
|
uint1 = (UInt16)rs.GetInt32(ord);
|
||||||
}
|
}
|
||||||
|
|
||||||
return uint1;
|
return uint1;
|
||||||
|
@ -82,7 +82,7 @@ namespace OpenSim.Data.NHibernate
|
||||||
public void NullSafeSet(IDbCommand cmd, object obj, int index)
|
public void NullSafeSet(IDbCommand cmd, object obj, int index)
|
||||||
{
|
{
|
||||||
UInt16 uint1 = (UInt16)obj;
|
UInt16 uint1 = (UInt16)obj;
|
||||||
((IDataParameter)cmd.Parameters[index]).Value = Convert.ToInt16(uint1);
|
((IDataParameter)cmd.Parameters[index]).Value = Convert.ToInt32(uint1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public object Replace(object original, object target, object owner)
|
public object Replace(object original, object target, object owner)
|
||||||
|
@ -97,7 +97,7 @@ namespace OpenSim.Data.NHibernate
|
||||||
|
|
||||||
public SqlType[] SqlTypes
|
public SqlType[] SqlTypes
|
||||||
{
|
{
|
||||||
get { return new SqlType [] { NHibernateUtil.Int16.SqlType }; }
|
get { return new SqlType [] { NHibernateUtil.Int32.SqlType }; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,6 +243,11 @@ namespace OpenSim.Data.Tests
|
||||||
byte clickaction = (byte) random.Next(127);
|
byte clickaction = (byte) random.Next(127);
|
||||||
PrimitiveBaseShape pbshap = new PrimitiveBaseShape();
|
PrimitiveBaseShape pbshap = new PrimitiveBaseShape();
|
||||||
pbshap = PrimitiveBaseShape.Default;
|
pbshap = PrimitiveBaseShape.Default;
|
||||||
|
pbshap.PathBegin = ushort.MaxValue;
|
||||||
|
pbshap.PathEnd = ushort.MaxValue;
|
||||||
|
pbshap.ProfileBegin = ushort.MaxValue;
|
||||||
|
pbshap.ProfileEnd = ushort.MaxValue;
|
||||||
|
pbshap.ProfileHollow = ushort.MaxValue;
|
||||||
Vector3 scale = new Vector3(random.Next(),random.Next(),random.Next());
|
Vector3 scale = new Vector3(random.Next(),random.Next(),random.Next());
|
||||||
byte updatef = (byte) random.Next(127);
|
byte updatef = (byte) random.Next(127);
|
||||||
|
|
||||||
|
@ -366,7 +371,14 @@ namespace OpenSim.Data.Tests
|
||||||
//Assert.That(linknum,Is.EqualTo(p.LinkNum));
|
//Assert.That(linknum,Is.EqualTo(p.LinkNum));
|
||||||
Assert.That(clickaction,Is.EqualTo(p.ClickAction));
|
Assert.That(clickaction,Is.EqualTo(p.ClickAction));
|
||||||
Assert.That(scale,Is.EqualTo(p.Scale));
|
Assert.That(scale,Is.EqualTo(p.Scale));
|
||||||
|
|
||||||
//Assert.That(updatef,Is.EqualTo(p.UpdateFlag));
|
//Assert.That(updatef,Is.EqualTo(p.UpdateFlag));
|
||||||
|
|
||||||
|
Assert.That(pbshap.PathBegin, Is.EqualTo(p.Shape.PathBegin));
|
||||||
|
Assert.That(pbshap.PathEnd, Is.EqualTo(p.Shape.PathEnd));
|
||||||
|
Assert.That(pbshap.ProfileBegin, Is.EqualTo(p.Shape.ProfileBegin));
|
||||||
|
Assert.That(pbshap.ProfileEnd, Is.EqualTo(p.Shape.ProfileEnd));
|
||||||
|
Assert.That(pbshap.ProfileHollow, Is.EqualTo(p.Shape.ProfileHollow));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|
Loading…
Reference in New Issue