Fossil SCM
Change the database fingerprint algorithm slightly so that it is not dependent on the details of floating-point computations, and thus gives the same answer on a native x64 processor as it does under valgrind. Also fix a bug in the RID change event computation so that it works even if files have been added.
Commit
265f8e2d8337f4c34e3dfc7645f2c81c65f0f3fb33f1d195fa09f387d4d20dfc
Parent
44900415b10f342…
2 files changed
+2
-2
+1
-1
M
src/db.c
+2
-2
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -3928,16 +3928,16 @@ | ||
| 3928 | 3928 | ** the remaining fields of the RCVFROM table entry. MD5 is used for this |
| 3929 | 3929 | ** because it is 4x faster than SHA3 and 5x faster than SHA1, and there |
| 3930 | 3930 | ** are no security concerns - this is just a checksum, not a security |
| 3931 | 3931 | ** token. |
| 3932 | 3932 | */ |
| 3933 | -char *db_fingerprint(int rcvid){ | |
| 3933 | +char *db_fingerprint(int rcvid){ | |
| 3934 | 3934 | char *z = 0; |
| 3935 | 3935 | Blob sql = BLOB_INITIALIZER; |
| 3936 | 3936 | Stmt q; |
| 3937 | 3937 | blob_append_sql(&sql, |
| 3938 | - "SELECT rcvid, quote(uid), quote(mtime), quote(nonce), quote(ipaddr)" | |
| 3938 | + "SELECT rcvid, quote(uid), datetime(mtime), quote(nonce), quote(ipaddr)" | |
| 3939 | 3939 | " FROM rcvfrom" |
| 3940 | 3940 | ); |
| 3941 | 3941 | if( rcvid<=0 ){ |
| 3942 | 3942 | blob_append_sql(&sql, " ORDER BY rcvid DESC LIMIT 1"); |
| 3943 | 3943 | }else{ |
| 3944 | 3944 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -3928,16 +3928,16 @@ | |
| 3928 | ** the remaining fields of the RCVFROM table entry. MD5 is used for this |
| 3929 | ** because it is 4x faster than SHA3 and 5x faster than SHA1, and there |
| 3930 | ** are no security concerns - this is just a checksum, not a security |
| 3931 | ** token. |
| 3932 | */ |
| 3933 | char *db_fingerprint(int rcvid){ |
| 3934 | char *z = 0; |
| 3935 | Blob sql = BLOB_INITIALIZER; |
| 3936 | Stmt q; |
| 3937 | blob_append_sql(&sql, |
| 3938 | "SELECT rcvid, quote(uid), quote(mtime), quote(nonce), quote(ipaddr)" |
| 3939 | " FROM rcvfrom" |
| 3940 | ); |
| 3941 | if( rcvid<=0 ){ |
| 3942 | blob_append_sql(&sql, " ORDER BY rcvid DESC LIMIT 1"); |
| 3943 | }else{ |
| 3944 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -3928,16 +3928,16 @@ | |
| 3928 | ** the remaining fields of the RCVFROM table entry. MD5 is used for this |
| 3929 | ** because it is 4x faster than SHA3 and 5x faster than SHA1, and there |
| 3930 | ** are no security concerns - this is just a checksum, not a security |
| 3931 | ** token. |
| 3932 | */ |
| 3933 | char *db_fingerprint(int rcvid){ |
| 3934 | char *z = 0; |
| 3935 | Blob sql = BLOB_INITIALIZER; |
| 3936 | Stmt q; |
| 3937 | blob_append_sql(&sql, |
| 3938 | "SELECT rcvid, quote(uid), datetime(mtime), quote(nonce), quote(ipaddr)" |
| 3939 | " FROM rcvfrom" |
| 3940 | ); |
| 3941 | if( rcvid<=0 ){ |
| 3942 | blob_append_sql(&sql, " ORDER BY rcvid DESC LIMIT 1"); |
| 3943 | }else{ |
| 3944 |
+1
-1
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -1059,11 +1059,11 @@ | ||
| 1059 | 1059 | " UNION SELECT mrid FROM vfile" |
| 1060 | 1060 | " UNION SELECT merge FROM vmerge" |
| 1061 | 1061 | " UNION SELECT %d" |
| 1062 | 1062 | ")" |
| 1063 | 1063 | "SELECT group_concat(x,' ') FROM allrid" |
| 1064 | - " WHERE x NOT IN (SELECT oldrid FROM idMap);", | |
| 1064 | + " WHERE x<>0 AND x NOT IN (SELECT oldrid FROM idMap);", | |
| 1065 | 1065 | oldVid |
| 1066 | 1066 | ); |
| 1067 | 1067 | if( zUnresolved[0] ){ |
| 1068 | 1068 | fossil_fatal("Unresolved RID values: %s\n", zUnresolved); |
| 1069 | 1069 | } |
| 1070 | 1070 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -1059,11 +1059,11 @@ | |
| 1059 | " UNION SELECT mrid FROM vfile" |
| 1060 | " UNION SELECT merge FROM vmerge" |
| 1061 | " UNION SELECT %d" |
| 1062 | ")" |
| 1063 | "SELECT group_concat(x,' ') FROM allrid" |
| 1064 | " WHERE x NOT IN (SELECT oldrid FROM idMap);", |
| 1065 | oldVid |
| 1066 | ); |
| 1067 | if( zUnresolved[0] ){ |
| 1068 | fossil_fatal("Unresolved RID values: %s\n", zUnresolved); |
| 1069 | } |
| 1070 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -1059,11 +1059,11 @@ | |
| 1059 | " UNION SELECT mrid FROM vfile" |
| 1060 | " UNION SELECT merge FROM vmerge" |
| 1061 | " UNION SELECT %d" |
| 1062 | ")" |
| 1063 | "SELECT group_concat(x,' ') FROM allrid" |
| 1064 | " WHERE x<>0 AND x NOT IN (SELECT oldrid FROM idMap);", |
| 1065 | oldVid |
| 1066 | ); |
| 1067 | if( zUnresolved[0] ){ |
| 1068 | fossil_fatal("Unresolved RID values: %s\n", zUnresolved); |
| 1069 | } |
| 1070 |