Fossil

Check-in [4ce3a2bf]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:On the /hash-collisions page show the true first instance of each collision, not the second.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:4ce3a2bfacbf3fed12f4ba5dcaf739564de01074
User & Date: drh 2015-02-11 12:03:24
Context
2015-02-11
12:36
On the /hash-collisions page, list the longer collisions with links to /whatid. check-in: 3234cf1e user: drh tags: trunk
12:03
On the /hash-collisions page show the true first instance of each collision, not the second. check-in: 4ce3a2bf user: drh tags: trunk
11:51
Add the /hash-collisions webpage. check-in: 43e2aff5 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/name.c.

1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100

1101
1102
1103
1104
1105
1106
1107
  );
  while( db_step(&q)==SQLITE_ROW ){
    const char *zUuid = db_column_text(&q,0);
    int n = db_column_bytes(&q,0);
    int i;
    nHash++;
    for(i=0; zPrev[i] && zPrev[i]==zUuid[i]; i++){}
    memcpy(zPrev, zUuid, n+1);
    if( i>0 && i<=UUID_SIZE ){
      aCollide[i].cnt++;
      if( aCollide[i].z[0]==0 ) memcpy(aCollide[i].z, zPrev, n+1);
    }

  }
  db_finalize(&q);
  style_header("Hash Prefix Collisions");
  @ <table border=1><thead>
  @ <tr><th>Length<th>Instances<th>First Instance</tr>
  @ </thead><tbody>
  for(i=1; i<UUID_SIZE; i++){







<




>







1089
1090
1091
1092
1093
1094
1095

1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
  );
  while( db_step(&q)==SQLITE_ROW ){
    const char *zUuid = db_column_text(&q,0);
    int n = db_column_bytes(&q,0);
    int i;
    nHash++;
    for(i=0; zPrev[i] && zPrev[i]==zUuid[i]; i++){}

    if( i>0 && i<=UUID_SIZE ){
      aCollide[i].cnt++;
      if( aCollide[i].z[0]==0 ) memcpy(aCollide[i].z, zPrev, n+1);
    }
    memcpy(zPrev, zUuid, n+1);
  }
  db_finalize(&q);
  style_header("Hash Prefix Collisions");
  @ <table border=1><thead>
  @ <tr><th>Length<th>Instances<th>First Instance</tr>
  @ </thead><tbody>
  for(i=1; i<UUID_SIZE; i++){