Fossil SCM

Fix to the /hash-collisions page: Only consider the SHA1 hashes in the BLOB table, not the random hexadecimal identifiers assigned to tickets and tech-notes. The latter two live in a different namespace.

drh 2015-02-11 13:18 trunk
Commit 327eee14525ff1c98f4f36e73c8ed24ded7fc55c
1 file changed +6 -8
+6 -8
--- src/name.c
+++ src/name.c
@@ -104,10 +104,15 @@
104104
** If zType is NULL or "" or "*" then any type of artifact will serve.
105105
** If zType is "br" then find the first check-in of the named branch
106106
** rather than the last.
107107
** zType is "ci" in most use cases since we are usually searching for
108108
** a check-in.
109
+**
110
+** Note that the input zTag for types "t" and "e" is the SHA1 hash of
111
+** the ticket-change or event-change artifact, not the randomly generated
112
+** hexadecimal identifier assigned to tickets and events. Those identifiers
113
+** live in a separate namespace.
109114
*/
110115
int symbolic_name_to_rid(const char *zTag, const char *zType){
111116
int vid;
112117
int rid = 0;
113118
int nTag;
@@ -1079,18 +1084,11 @@
10791084
login_check_credentials();
10801085
if( !g.perm.Read ){ login_needed(); return; }
10811086
memset(aCollide, 0, sizeof(aCollide));
10821087
for(i=0; i<ArraySize(aCollide); i++) blob_init(&aCollide[i].ex,0,0);
10831088
memset(zPrev, 0, sizeof(zPrev));
1084
- db_prepare(&q,
1085
- "SELECT tkt_uuid FROM ticket\n"
1086
- "UNION ALL\n"
1087
- "SELECT substr(tagname,7) FROM tag WHERE tagname GLOB 'event-*'\n"
1088
- "UNION ALL\n"
1089
- "SELECT uuid FROM blob\n"
1090
- "ORDER BY 1"
1091
- );
1089
+ db_prepare(&q,"SELECT uuid FROM blob ORDER BY 1");
10921090
while( db_step(&q)==SQLITE_ROW ){
10931091
const char *zUuid = db_column_text(&q,0);
10941092
int n = db_column_bytes(&q,0);
10951093
int i;
10961094
nHash++;
10971095
--- src/name.c
+++ src/name.c
@@ -104,10 +104,15 @@
104 ** If zType is NULL or "" or "*" then any type of artifact will serve.
105 ** If zType is "br" then find the first check-in of the named branch
106 ** rather than the last.
107 ** zType is "ci" in most use cases since we are usually searching for
108 ** a check-in.
 
 
 
 
 
109 */
110 int symbolic_name_to_rid(const char *zTag, const char *zType){
111 int vid;
112 int rid = 0;
113 int nTag;
@@ -1079,18 +1084,11 @@
1079 login_check_credentials();
1080 if( !g.perm.Read ){ login_needed(); return; }
1081 memset(aCollide, 0, sizeof(aCollide));
1082 for(i=0; i<ArraySize(aCollide); i++) blob_init(&aCollide[i].ex,0,0);
1083 memset(zPrev, 0, sizeof(zPrev));
1084 db_prepare(&q,
1085 "SELECT tkt_uuid FROM ticket\n"
1086 "UNION ALL\n"
1087 "SELECT substr(tagname,7) FROM tag WHERE tagname GLOB 'event-*'\n"
1088 "UNION ALL\n"
1089 "SELECT uuid FROM blob\n"
1090 "ORDER BY 1"
1091 );
1092 while( db_step(&q)==SQLITE_ROW ){
1093 const char *zUuid = db_column_text(&q,0);
1094 int n = db_column_bytes(&q,0);
1095 int i;
1096 nHash++;
1097
--- src/name.c
+++ src/name.c
@@ -104,10 +104,15 @@
104 ** If zType is NULL or "" or "*" then any type of artifact will serve.
105 ** If zType is "br" then find the first check-in of the named branch
106 ** rather than the last.
107 ** zType is "ci" in most use cases since we are usually searching for
108 ** a check-in.
109 **
110 ** Note that the input zTag for types "t" and "e" is the SHA1 hash of
111 ** the ticket-change or event-change artifact, not the randomly generated
112 ** hexadecimal identifier assigned to tickets and events. Those identifiers
113 ** live in a separate namespace.
114 */
115 int symbolic_name_to_rid(const char *zTag, const char *zType){
116 int vid;
117 int rid = 0;
118 int nTag;
@@ -1079,18 +1084,11 @@
1084 login_check_credentials();
1085 if( !g.perm.Read ){ login_needed(); return; }
1086 memset(aCollide, 0, sizeof(aCollide));
1087 for(i=0; i<ArraySize(aCollide); i++) blob_init(&aCollide[i].ex,0,0);
1088 memset(zPrev, 0, sizeof(zPrev));
1089 db_prepare(&q,"SELECT uuid FROM blob ORDER BY 1");
 
 
 
 
 
 
 
1090 while( db_step(&q)==SQLITE_ROW ){
1091 const char *zUuid = db_column_text(&q,0);
1092 int n = db_column_bytes(&q,0);
1093 int i;
1094 nHash++;
1095

Keyboard Shortcuts

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