From 4bc4844646e3162ae3121619438732b48bbfe0ca Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Tue, 13 Nov 2007 15:50:56 +0000 Subject: working now. Needs cleanup, but I'll have to do that after the next meeting --- .../MonoSqliteDataStore.cs | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs index 4aff606..dcd6609 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs @@ -252,12 +252,13 @@ namespace OpenSim.DataStore.MonoSqlite lock (ds) { SqliteCommand cmd = new SqliteCommand("insert into terrain(RegionUUID, Revision, Heightfield)" + - "values(:RegionUUID, :Revision, :Heightfield)", conn); + " values(:RegionUUID, :Revision, :Heightfield)", conn); using(cmd) { - cmd.Parameters.Add(":RegionUUID", regionID); - cmd.Parameters.Add(":Revision", revision); - cmd.Parameters.Add(":Heightfield", serializeTerrain(ter)); + + cmd.Parameters.Add(new SqliteParameter(":RegionUUID", regionID.ToString())); + cmd.Parameters.Add(new SqliteParameter(":Revision", revision)); + cmd.Parameters.Add(new SqliteParameter(":Heightfield", serializeTerrain(ter))); cmd.ExecuteNonQuery(); } } @@ -269,10 +270,11 @@ namespace OpenSim.DataStore.MonoSqlite terret.Initialize(); SqliteCommand cmd = new SqliteCommand("select RegionUUID, Revision, Heightfield from terrain" + - "where RegionUUID=:RegionUUID order by Revision desc limit 1", conn); - cmd.Parameters.Add(":RegionUUID", regionID); + " where RegionUUID=:RegionUUID order by Revision desc limit 1", conn); + SqliteParameter param = new SqliteParameter(); + cmd.Parameters.Add(new SqliteParameter(":RegionUUID", regionID.ToString())); - using (SqliteDataReader row = cmd.ExecuteReader(CommandBehavior.SingleRow)) + using (SqliteDataReader row = cmd.ExecuteReader()) { int rev = 0; if (row.Read()) @@ -852,6 +854,13 @@ namespace OpenSim.DataStore.MonoSqlite param.SourceVersion = DataRowVersion.Current; return param; } + + private SqliteParameter createParamWithValue(string name, Type type, Object o) + { + SqliteParameter param = createSqliteParameter(name, type); + param.Value = o; + return param; + } private void setupPrimCommands(SqliteDataAdapter da, SqliteConnection conn) { -- cgit v1.1