diff options
author | Melanie Thielker | 2008-07-19 21:01:10 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-07-19 21:01:10 +0000 |
commit | 212ab8c6d9de2e54fe83733f79d5f415bc104460 (patch) | |
tree | ebf51e403dd44363db315e7081a4490fd0aac0bf | |
parent | Mantis#1785. Thank you kindly, Junta_Kohime for a patch that" (diff) | |
download | opensim-SC-212ab8c6d9de2e54fe83733f79d5f415bc104460.zip opensim-SC-212ab8c6d9de2e54fe83733f79d5f415bc104460.tar.gz opensim-SC-212ab8c6d9de2e54fe83733f79d5f415bc104460.tar.bz2 opensim-SC-212ab8c6d9de2e54fe83733f79d5f415bc104460.tar.xz |
Change SQLite argument marker from the more standard '@' to the ':' supported
but earlier versions of the SQLite dll
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteEstateData.cs | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs index dd6145c..db85239 100644 --- a/OpenSim/Data/SQLite/SQLiteEstateData.cs +++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs | |||
@@ -88,12 +88,12 @@ namespace OpenSim.Data.SQLite | |||
88 | EstateSettings es = new EstateSettings(); | 88 | EstateSettings es = new EstateSettings(); |
89 | es.OnSave += StoreEstateSettings; | 89 | es.OnSave += StoreEstateSettings; |
90 | 90 | ||
91 | string sql = "select estate_settings."+String.Join(",estate_settings.", FieldList)+" from estate_map left join estate_settings on estate_map.EstateID = estate_settings.EstateID where estate_settings.EstateID is not null and RegionID = @RegionID"; | 91 | string sql = "select estate_settings."+String.Join(",estate_settings.", FieldList)+" from estate_map left join estate_settings on estate_map.EstateID = estate_settings.EstateID where estate_settings.EstateID is not null and RegionID = :RegionID"; |
92 | 92 | ||
93 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); | 93 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); |
94 | 94 | ||
95 | cmd.CommandText = sql; | 95 | cmd.CommandText = sql; |
96 | cmd.Parameters.Add("@RegionID", regionID.ToString()); | 96 | cmd.Parameters.Add(":RegionID", regionID.ToString()); |
97 | 97 | ||
98 | IDataReader r = cmd.ExecuteReader(); | 98 | IDataReader r = cmd.ExecuteReader(); |
99 | 99 | ||
@@ -126,7 +126,7 @@ namespace OpenSim.Data.SQLite | |||
126 | 126 | ||
127 | names.Remove("EstateID"); | 127 | names.Remove("EstateID"); |
128 | 128 | ||
129 | sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( @"+String.Join(", @", names.ToArray())+")"; | 129 | sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( :"+String.Join(", :", names.ToArray())+")"; |
130 | 130 | ||
131 | cmd.CommandText = sql; | 131 | cmd.CommandText = sql; |
132 | cmd.Parameters.Clear(); | 132 | cmd.Parameters.Clear(); |
@@ -136,13 +136,13 @@ namespace OpenSim.Data.SQLite | |||
136 | if(m_FieldMap[name].GetValue(es) is bool) | 136 | if(m_FieldMap[name].GetValue(es) is bool) |
137 | { | 137 | { |
138 | if((bool)m_FieldMap[name].GetValue(es)) | 138 | if((bool)m_FieldMap[name].GetValue(es)) |
139 | cmd.Parameters.Add("@"+name, "1"); | 139 | cmd.Parameters.Add(":"+name, "1"); |
140 | else | 140 | else |
141 | cmd.Parameters.Add("@"+name, "0"); | 141 | cmd.Parameters.Add(":"+name, "0"); |
142 | } | 142 | } |
143 | else | 143 | else |
144 | { | 144 | { |
145 | cmd.Parameters.Add("@"+name, m_FieldMap[name].GetValue(es).ToString()); | 145 | cmd.Parameters.Add(":"+name, m_FieldMap[name].GetValue(es).ToString()); |
146 | } | 146 | } |
147 | } | 147 | } |
148 | 148 | ||
@@ -159,9 +159,9 @@ namespace OpenSim.Data.SQLite | |||
159 | 159 | ||
160 | r.Close(); | 160 | r.Close(); |
161 | 161 | ||
162 | cmd.CommandText = "insert into estate_map values (@RegionID, @EstateID)"; | 162 | cmd.CommandText = "insert into estate_map values (:RegionID, :EstateID)"; |
163 | cmd.Parameters.Add("@RegionID", regionID.ToString()); | 163 | cmd.Parameters.Add(":RegionID", regionID.ToString()); |
164 | cmd.Parameters.Add("@EstateID", es.EstateID.ToString()); | 164 | cmd.Parameters.Add(":EstateID", es.EstateID.ToString()); |
165 | 165 | ||
166 | // This will throw on dupe key | 166 | // This will throw on dupe key |
167 | try | 167 | try |
@@ -175,8 +175,8 @@ namespace OpenSim.Data.SQLite | |||
175 | // Munge and transfer the ban list | 175 | // Munge and transfer the ban list |
176 | // | 176 | // |
177 | cmd.Parameters.Clear(); | 177 | cmd.Parameters.Clear(); |
178 | cmd.CommandText = "insert into estateban select "+es.EstateID.ToString()+", bannedUUID, bannedIp, bannedIpHostMask, '' from regionban where regionban.regionUUID = @UUID"; | 178 | cmd.CommandText = "insert into estateban select "+es.EstateID.ToString()+", bannedUUID, bannedIp, bannedIpHostMask, '' from regionban where regionban.regionUUID = :UUID"; |
179 | cmd.Parameters.Add("@UUID", regionID.ToString()); | 179 | cmd.Parameters.Add(":UUID", regionID.ToString()); |
180 | 180 | ||
181 | try | 181 | try |
182 | { | 182 | { |
@@ -205,9 +205,9 @@ namespace OpenSim.Data.SQLite | |||
205 | List<string> terms = new List<string>(); | 205 | List<string> terms = new List<string>(); |
206 | 206 | ||
207 | foreach (string f in fields) | 207 | foreach (string f in fields) |
208 | terms.Add(f+" = @"+f); | 208 | terms.Add(f+" = :"+f); |
209 | 209 | ||
210 | string sql = "update estate_settings set "+String.Join(", ", terms.ToArray())+" where EstateID = @EstateID"; | 210 | string sql = "update estate_settings set "+String.Join(", ", terms.ToArray())+" where EstateID = :EstateID"; |
211 | 211 | ||
212 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); | 212 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); |
213 | 213 | ||
@@ -218,13 +218,13 @@ namespace OpenSim.Data.SQLite | |||
218 | if(m_FieldMap[name].GetValue(es) is bool) | 218 | if(m_FieldMap[name].GetValue(es) is bool) |
219 | { | 219 | { |
220 | if((bool)m_FieldMap[name].GetValue(es)) | 220 | if((bool)m_FieldMap[name].GetValue(es)) |
221 | cmd.Parameters.Add("@"+name, "1"); | 221 | cmd.Parameters.Add(":"+name, "1"); |
222 | else | 222 | else |
223 | cmd.Parameters.Add("@"+name, "0"); | 223 | cmd.Parameters.Add(":"+name, "0"); |
224 | } | 224 | } |
225 | else | 225 | else |
226 | { | 226 | { |
227 | cmd.Parameters.Add("@"+name, m_FieldMap[name].GetValue(es).ToString()); | 227 | cmd.Parameters.Add(":"+name, m_FieldMap[name].GetValue(es).ToString()); |
228 | } | 228 | } |
229 | } | 229 | } |
230 | 230 | ||
@@ -242,8 +242,8 @@ namespace OpenSim.Data.SQLite | |||
242 | 242 | ||
243 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); | 243 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); |
244 | 244 | ||
245 | cmd.CommandText = "select bannedUUID from estateban where EstateID = @EstateID"; | 245 | cmd.CommandText = "select bannedUUID from estateban where EstateID = :EstateID"; |
246 | cmd.Parameters.Add("@EstateID", es.EstateID); | 246 | cmd.Parameters.Add(":EstateID", es.EstateID); |
247 | 247 | ||
248 | IDataReader r = cmd.ExecuteReader(); | 248 | IDataReader r = cmd.ExecuteReader(); |
249 | 249 | ||
@@ -266,19 +266,19 @@ namespace OpenSim.Data.SQLite | |||
266 | { | 266 | { |
267 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); | 267 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); |
268 | 268 | ||
269 | cmd.CommandText = "delete from estateban where EstateID = @EstateID"; | 269 | cmd.CommandText = "delete from estateban where EstateID = :EstateID"; |
270 | cmd.Parameters.Add("@EstateID", es.EstateID.ToString()); | 270 | cmd.Parameters.Add(":EstateID", es.EstateID.ToString()); |
271 | 271 | ||
272 | cmd.ExecuteNonQuery(); | 272 | cmd.ExecuteNonQuery(); |
273 | 273 | ||
274 | cmd.Parameters.Clear(); | 274 | cmd.Parameters.Clear(); |
275 | 275 | ||
276 | cmd.CommandText = "insert into estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask) values ( @EstateID, @bannedUUID, '', '', '' )"; | 276 | cmd.CommandText = "insert into estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask) values ( :EstateID, :bannedUUID, '', '', '' )"; |
277 | 277 | ||
278 | foreach(EstateBan b in es.EstateBans) | 278 | foreach(EstateBan b in es.EstateBans) |
279 | { | 279 | { |
280 | cmd.Parameters.Add("@EstateID", es.EstateID.ToString()); | 280 | cmd.Parameters.Add(":EstateID", es.EstateID.ToString()); |
281 | cmd.Parameters.Add("@bannedUUID", b.bannedUUID.ToString()); | 281 | cmd.Parameters.Add(":bannedUUID", b.bannedUUID.ToString()); |
282 | 282 | ||
283 | cmd.ExecuteNonQuery(); | 283 | cmd.ExecuteNonQuery(); |
284 | cmd.Parameters.Clear(); | 284 | cmd.Parameters.Clear(); |
@@ -289,19 +289,19 @@ namespace OpenSim.Data.SQLite | |||
289 | { | 289 | { |
290 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); | 290 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); |
291 | 291 | ||
292 | cmd.CommandText = "delete from "+table+" where EstateID = @EstateID"; | 292 | cmd.CommandText = "delete from "+table+" where EstateID = :EstateID"; |
293 | cmd.Parameters.Add("@EstateID", EstateID.ToString()); | 293 | cmd.Parameters.Add(":EstateID", EstateID.ToString()); |
294 | 294 | ||
295 | cmd.ExecuteNonQuery(); | 295 | cmd.ExecuteNonQuery(); |
296 | 296 | ||
297 | cmd.Parameters.Clear(); | 297 | cmd.Parameters.Clear(); |
298 | 298 | ||
299 | cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( @EstateID, @uuid )"; | 299 | cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( :EstateID, :uuid )"; |
300 | 300 | ||
301 | foreach(LLUUID uuid in data) | 301 | foreach(LLUUID uuid in data) |
302 | { | 302 | { |
303 | cmd.Parameters.Add("@EstateID", EstateID.ToString()); | 303 | cmd.Parameters.Add(":EstateID", EstateID.ToString()); |
304 | cmd.Parameters.Add("@uuid", uuid.ToString()); | 304 | cmd.Parameters.Add(":uuid", uuid.ToString()); |
305 | 305 | ||
306 | cmd.ExecuteNonQuery(); | 306 | cmd.ExecuteNonQuery(); |
307 | cmd.Parameters.Clear(); | 307 | cmd.Parameters.Clear(); |
@@ -314,8 +314,8 @@ namespace OpenSim.Data.SQLite | |||
314 | 314 | ||
315 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); | 315 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); |
316 | 316 | ||
317 | cmd.CommandText = "select uuid from "+table+" where EstateID = @EstateID"; | 317 | cmd.CommandText = "select uuid from "+table+" where EstateID = :EstateID"; |
318 | cmd.Parameters.Add("@EstateID", EstateID); | 318 | cmd.Parameters.Add(":EstateID", EstateID); |
319 | 319 | ||
320 | IDataReader r = cmd.ExecuteReader(); | 320 | IDataReader r = cmd.ExecuteReader(); |
321 | 321 | ||