aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-04-09 19:01:52 +0000
committerJustin Clarke Casey2009-04-09 19:01:52 +0000
commit67333d48fc0b9e70804b7ceef80494484b2a247c (patch)
treed9d191522f0ba65a02d6bf4480cbe606b6e37f02 /OpenSim/Data/SQLite
parent* Improve inventory uuid conversions to make sure that we aren't converting a... (diff)
downloadopensim-SC_OLD-67333d48fc0b9e70804b7ceef80494484b2a247c.zip
opensim-SC_OLD-67333d48fc0b9e70804b7ceef80494484b2a247c.tar.gz
opensim-SC_OLD-67333d48fc0b9e70804b7ceef80494484b2a247c.tar.bz2
opensim-SC_OLD-67333d48fc0b9e70804b7ceef80494484b2a247c.tar.xz
* Change UUIDs in SQLite user db to dashed format to match representations elsewhere
Diffstat (limited to 'OpenSim/Data/SQLite')
-rw-r--r--OpenSim/Data/SQLite/Resources/009_UserStore.sql11
-rw-r--r--OpenSim/Data/SQLite/SQLiteInventoryStore.cs2
-rw-r--r--OpenSim/Data/SQLite/SQLiteUserData.cs20
3 files changed, 22 insertions, 11 deletions
diff --git a/OpenSim/Data/SQLite/Resources/009_UserStore.sql b/OpenSim/Data/SQLite/Resources/009_UserStore.sql
new file mode 100644
index 0000000..b4cc00c
--- /dev/null
+++ b/OpenSim/Data/SQLite/Resources/009_UserStore.sql
@@ -0,0 +1,11 @@
1BEGIN;
2
3update users
4 set UUID = substr(UUID, 1, 8) || "-" || substr(UUID, 9, 4) || "-" || substr(UUID, 13, 4) || "-" || substr(UUID, 17, 4) || "-" || substr(UUID, 21)
5 where UUID not like '%-%';
6
7update useragents
8 set UUID = substr(UUID, 1, 8) || "-" || substr(UUID, 9, 4) || "-" || substr(UUID, 13, 4) || "-" || substr(UUID, 17, 4) || "-" || substr(UUID, 21)
9 where UUID not like '%-%';
10
11COMMIT;
diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
index e84eed5..d6f41fd 100644
--- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
+++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
@@ -877,7 +877,7 @@ namespace OpenSim.Data.SQLite
877 DataTable inventoryItemTable = ds.Tables["inventoryitems"]; 877 DataTable inventoryItemTable = ds.Tables["inventoryitems"];
878 string selectExp 878 string selectExp
879 = "avatarID = '" + avatarID + "' AND assetType = " + (int)AssetType.Gesture + " AND flags = 1"; 879 = "avatarID = '" + avatarID + "' AND assetType = " + (int)AssetType.Gesture + " AND flags = 1";
880 m_log.DebugFormat("[SQL]: sql = " + selectExp); 880 //m_log.DebugFormat("[SQL]: sql = " + selectExp);
881 DataRow[] rows = inventoryItemTable.Select(selectExp); 881 DataRow[] rows = inventoryItemTable.Select(selectExp);
882 foreach (DataRow row in rows) 882 foreach (DataRow row in rows)
883 { 883 {
diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs
index 788a9ea..5f9f979 100644
--- a/OpenSim/Data/SQLite/SQLiteUserData.cs
+++ b/OpenSim/Data/SQLite/SQLiteUserData.cs
@@ -162,7 +162,7 @@ namespace OpenSim.Data.SQLite
162 { 162 {
163 lock (ds) 163 lock (ds)
164 { 164 {
165 DataRow row = ds.Tables["users"].Rows.Find(Util.ToRawUuidString(uuid)); 165 DataRow row = ds.Tables["users"].Rows.Find(uuid.ToString());
166 if (row != null) 166 if (row != null)
167 { 167 {
168 UserProfileData user = buildUserProfile(row); 168 UserProfileData user = buildUserProfile(row);
@@ -341,7 +341,7 @@ namespace OpenSim.Data.SQLite
341 { 341 {
342 lock (ds) 342 lock (ds)
343 { 343 {
344 DataRow row = agents.Rows.Find(Util.ToRawUuidString(uuid)); 344 DataRow row = agents.Rows.Find(uuid.ToString());
345 if (row == null) infos[uuid] = null; 345 if (row == null) infos[uuid] = null;
346 else 346 else
347 { 347 {
@@ -422,7 +422,7 @@ namespace OpenSim.Data.SQLite
422 { 422 {
423 lock (ds) 423 lock (ds)
424 { 424 {
425 DataRow row = ds.Tables["useragents"].Rows.Find(Util.ToRawUuidString(uuid)); 425 DataRow row = ds.Tables["useragents"].Rows.Find(uuid.ToString());
426 if (row != null) 426 if (row != null)
427 { 427 {
428 return buildUserAgent(row); 428 return buildUserAgent(row);
@@ -472,7 +472,7 @@ namespace OpenSim.Data.SQLite
472 DataTable users = ds.Tables["users"]; 472 DataTable users = ds.Tables["users"];
473 lock (ds) 473 lock (ds)
474 { 474 {
475 DataRow row = users.Rows.Find(Util.ToRawUuidString(AgentID)); 475 DataRow row = users.Rows.Find(AgentID.ToString());
476 if (row == null) 476 if (row == null)
477 { 477 {
478 m_log.Warn("[USER DB]: Unable to store new web login key for non-existant user"); 478 m_log.Warn("[USER DB]: Unable to store new web login key for non-existant user");
@@ -531,7 +531,7 @@ namespace OpenSim.Data.SQLite
531 531
532 lock (ds) 532 lock (ds)
533 { 533 {
534 DataRow row = users.Rows.Find(Util.ToRawUuidString(user.ID)); 534 DataRow row = users.Rows.Find(user.ID.ToString());
535 if (row == null) 535 if (row == null)
536 { 536 {
537 row = users.NewRow(); 537 row = users.NewRow();
@@ -560,7 +560,7 @@ namespace OpenSim.Data.SQLite
560 DataTable users = ds.Tables["users"]; 560 DataTable users = ds.Tables["users"];
561 lock (ds) 561 lock (ds)
562 { 562 {
563 DataRow row = users.Rows.Find(Util.ToRawUuidString(user.ID)); 563 DataRow row = users.Rows.Find(user.ID.ToString());
564 if (row == null) 564 if (row == null)
565 { 565 {
566 return false; 566 return false;
@@ -589,7 +589,7 @@ namespace OpenSim.Data.SQLite
589 DataTable agents = ds.Tables["useragents"]; 589 DataTable agents = ds.Tables["useragents"];
590 lock (ds) 590 lock (ds)
591 { 591 {
592 DataRow row = agents.Rows.Find(Util.ToRawUuidString(agent.ProfileID)); 592 DataRow row = agents.Rows.Find(agent.ProfileID.ToString());
593 if (row == null) 593 if (row == null)
594 { 594 {
595 row = agents.NewRow(); 595 row = agents.NewRow();
@@ -852,13 +852,13 @@ namespace OpenSim.Data.SQLite
852 } 852 }
853 853
854 /// <summary> 854 /// <summary>
855 /// 855 /// Persist user profile data
856 /// </summary> 856 /// </summary>
857 /// <param name="row"></param> 857 /// <param name="row"></param>
858 /// <param name="user"></param> 858 /// <param name="user"></param>
859 private void fillUserRow(DataRow row, UserProfileData user) 859 private void fillUserRow(DataRow row, UserProfileData user)
860 { 860 {
861 row["UUID"] = Util.ToRawUuidString(user.ID); 861 row["UUID"] = user.ID.ToString();
862 row["username"] = user.FirstName; 862 row["username"] = user.FirstName;
863 row["surname"] = user.SurName; 863 row["surname"] = user.SurName;
864 row["email"] = user.Email; 864 row["email"] = user.Email;
@@ -944,7 +944,7 @@ namespace OpenSim.Data.SQLite
944 /// <param name="ua"></param> 944 /// <param name="ua"></param>
945 private static void fillUserAgentRow(DataRow row, UserAgentData ua) 945 private static void fillUserAgentRow(DataRow row, UserAgentData ua)
946 { 946 {
947 row["UUID"] = Util.ToRawUuidString(ua.ProfileID); 947 row["UUID"] = ua.ProfileID.ToString();
948 row["agentIP"] = ua.AgentIP; 948 row["agentIP"] = ua.AgentIP;
949 row["agentPort"] = ua.AgentPort; 949 row["agentPort"] = ua.AgentPort;
950 row["agentOnline"] = ua.AgentOnline; 950 row["agentOnline"] = ua.AgentOnline;