From ec0dc208dd87f08170041222464f6aa6c7cab0bb Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 9 Aug 2007 20:07:58 +0000 Subject: [PATCH] build update clauses correctly --- .../OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs index cd72f58094..c2ef9a5b06 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs @@ -184,9 +184,14 @@ namespace OpenSim.DataStore.MonoSqliteStorage private SqliteCommand createUpdateCommand(string table, string pk, Dictionary defs) { string sql = "update " + table + " set "; + string subsql = ""; foreach (string key in defs.Keys) { - sql += key + "= :" + key + ", "; + if (subsql.Length > 0) { // + subsql += ", "; + } + subsql += key + "= :" + key; } + sql += subsql; sql += " where " + pk; SqliteCommand cmd = new SqliteCommand(sql);