Fossil SCM

The name_to_rid() routine returns record-IDs even if they do not appear in the EVENT table.

drh 2012-10-15 14:41 trunk
Commit a758144e26883464a7e0510c61fb25b965a01196
1 file changed +9 -5
+9 -5
--- src/name.c
+++ src/name.c
@@ -253,15 +253,19 @@
253253
if( rid>0 ) return rid;
254254
255255
/* Undocumented: numeric tags get translated directly into the RID */
256256
for(i=0; fossil_isdigit(zTag[i]); i++){}
257257
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
+ }
263267
}
264268
return rid;
265269
}
266270
267271
268272
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button