Browse code

lib/srdb1: update custom sql functions for uid tables

Daniel-Constantin Mierla authored on 23/01/2013 11:55:51
Showing 6 changed files
... ...
@@ -216,7 +216,7 @@ create function todomain (pdid varchar(64)) returns varchar(128)
216 216
 READS SQL DATA
217 217
 begin
218 218
     declare tdomain varchar(128) default NULL;
219
-	select domain into tdomain from domain where did=pdid and 
219
+	select domain into tdomain from uid_domain where did=pdid and 
220 220
         canonical(flags) limit 1;
221 221
 	return tdomain;
222 222
 end
... ...
@@ -238,7 +238,7 @@ create function todid (pdomain varchar(128)) returns varchar(64)
238 238
 READS SQL DATA
239 239
 begin
240 240
     declare tdid varchar(64) default NULL;
241
-    select did into tdid from domain where domain=pdomain and 
241
+    select did into tdid from uid_domain where domain=pdomain and 
242 242
         active(flags) limit 1;
243 243
 	return tdid;
244 244
 end
... ...
@@ -124,7 +124,7 @@ begin
124 124
         set tdid = todid(substr(puri FROM i + 1));
125 125
 	    set puri = left(puri, i - 1);
126 126
 	end if;
127
-	select uid into tuid from uri where scheme=tscheme and
127
+	select uid into tuid from uid_uri where scheme=tscheme and
128 128
         username=puri and did=tdid and active(flags);
129 129
 	return tuid;
130 130
 end
... ...
@@ -8,5 +8,3 @@ METADATA_LOGFLAGS
8 8
 0
9 9
 METADATA_DEFAULTS
10 10
 NIL|NIL|0|NIL|0
11
-uid_global_attrs|
12
-uid_global_attrs|1
... ...
@@ -114,6 +114,8 @@ uid_domain|
114 114
 uid_domain|2
115 115
 uid_domain_attrs|
116 116
 uid_domain_attrs|1
117
+uid_global_attrs|
118
+uid_global_attrs|1
117 119
 uid_uri|
118 120
 uid_uri|3
119 121
 uid_uri_attrs|
... ...
@@ -1,2 +1 @@
1 1
 id(int,auto) name(string) type(int) value(string,null) flags(int) 
2
-uid_global_attrs:1
... ...
@@ -52,6 +52,7 @@ uacreg:1
52 52
 uid_credentials:7
53 53
 uid_domain:2
54 54
 uid_domain_attrs:1
55
+uid_global_attrs:1
55 56
 uid_uri:3
56 57
 uid_uri_attrs:2
57 58
 uid_user_attrs:3