Fossil SCM
The name_to_rid() routine returns record-IDs even if they do not appear in the EVENT table.
Commit
a758144e26883464a7e0510c61fb25b965a01196
Parent
1ec715ae3493e09…
1 file changed
+9
-5
+9
-5
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -253,15 +253,19 @@ | ||
| 253 | 253 | if( rid>0 ) return rid; |
| 254 | 254 | |
| 255 | 255 | /* Undocumented: numeric tags get translated directly into the RID */ |
| 256 | 256 | for(i=0; fossil_isdigit(zTag[i]); i++){} |
| 257 | 257 | if( zTag[i]==0 ){ |
| 258 | - rid = db_int(0, | |
| 259 | - "SELECT event.objid" | |
| 260 | - " FROM event" | |
| 261 | - " WHERE event.objid=%s" | |
| 262 | - " AND event.type GLOB '%q'", zTag, zType); | |
| 258 | + if( strcmp(zType,"*")==0 ){ | |
| 259 | + rid = atoi(zTag); | |
| 260 | + }else{ | |
| 261 | + rid = db_int(0, | |
| 262 | + "SELECT event.objid" | |
| 263 | + " FROM event" | |
| 264 | + " WHERE event.objid=%s" | |
| 265 | + " AND event.type GLOB '%q'", zTag, zType); | |
| 266 | + } | |
| 263 | 267 | } |
| 264 | 268 | return rid; |
| 265 | 269 | } |
| 266 | 270 | |
| 267 | 271 | |
| 268 | 272 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -253,15 +253,19 @@ | |
| 253 | if( rid>0 ) return rid; |
| 254 | |
| 255 | /* Undocumented: numeric tags get translated directly into the RID */ |
| 256 | for(i=0; fossil_isdigit(zTag[i]); i++){} |
| 257 | if( zTag[i]==0 ){ |
| 258 | rid = db_int(0, |
| 259 | "SELECT event.objid" |
| 260 | " FROM event" |
| 261 | " WHERE event.objid=%s" |
| 262 | " AND event.type GLOB '%q'", zTag, zType); |
| 263 | } |
| 264 | return rid; |
| 265 | } |
| 266 | |
| 267 | |
| 268 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -253,15 +253,19 @@ | |
| 253 | if( rid>0 ) return rid; |
| 254 | |
| 255 | /* Undocumented: numeric tags get translated directly into the RID */ |
| 256 | for(i=0; fossil_isdigit(zTag[i]); i++){} |
| 257 | if( zTag[i]==0 ){ |
| 258 | if( strcmp(zType,"*")==0 ){ |
| 259 | rid = atoi(zTag); |
| 260 | }else{ |
| 261 | rid = db_int(0, |
| 262 | "SELECT event.objid" |
| 263 | " FROM event" |
| 264 | " WHERE event.objid=%s" |
| 265 | " AND event.type GLOB '%q'", zTag, zType); |
| 266 | } |
| 267 | } |
| 268 | return rid; |
| 269 | } |
| 270 | |
| 271 | |
| 272 |