aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL
diff options
context:
space:
mode:
authorMelanie2009-12-26 00:21:03 +0000
committerMelanie2009-12-26 00:21:03 +0000
commite51be5f4a79e7de7981cd3b36b6c3378acefb2bb (patch)
treeff58bd45136d1b632feb757a43b0c2cf1f5db85b /OpenSim/Data/MySQL
parentSet version back to core version (base) and suffix CM. Please DO NOT CHANGE THIS (diff)
parentAdd a generic REPLACE INTO handler for put into the generic table handler (diff)
downloadopensim-SC_OLD-e51be5f4a79e7de7981cd3b36b6c3378acefb2bb.zip
opensim-SC_OLD-e51be5f4a79e7de7981cd3b36b6c3378acefb2bb.tar.gz
opensim-SC_OLD-e51be5f4a79e7de7981cd3b36b6c3378acefb2bb.tar.bz2
opensim-SC_OLD-e51be5f4a79e7de7981cd3b36b6c3378acefb2bb.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r--OpenSim/Data/MySQL/MySQLGenericTableHandler.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
index 2f5937d..9b8a001 100644
--- a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
+++ b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
@@ -195,6 +195,31 @@ namespace OpenSim.Data.MySQL
195 MySqlCommand cmd = new MySqlCommand(); 195 MySqlCommand cmd = new MySqlCommand();
196 196
197 string query = ""; 197 string query = "";
198 List<String> names = new List<String>();
199 List<String> values = new List<String>();
200
201 foreach (FieldInfo fi in m_Fields.Values)
202 {
203 names.Add(fi.Name);
204 values.Add(fi.GetValue(row).ToString());
205 }
206
207 if (m_DataField != null)
208 {
209 Dictionary<string, string> data =
210 (Dictionary<string, string>)m_DataField.GetValue(row);
211
212 foreach (KeyValuePair<string, string> kvp in data)
213 {
214 names.Add(kvp.Key);
215 values.Add(kvp.Value);
216 }
217 }
218
219 query = String.Format("replace into {0} (`", m_Realm) + String.Join("`,`", names.ToArray()) + "`) values ('" + String.Join("','", values.ToArray()) + "')";
220
221 if (ExecuteNonQuery(cmd) > 0)
222 return true;
198 223
199 return false; 224 return false;
200 } 225 }