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.

drh 2019-09-23 18:25 trunk
Commit 265f8e2d8337f4c34e3dfc7645f2c81c65f0f3fb33f1d195fa09f387d4d20dfc
2 files changed +2 -2 +1 -1
+2 -2
--- src/db.c
+++ src/db.c
@@ -3928,16 +3928,16 @@
39283928
** the remaining fields of the RCVFROM table entry. MD5 is used for this
39293929
** because it is 4x faster than SHA3 and 5x faster than SHA1, and there
39303930
** are no security concerns - this is just a checksum, not a security
39313931
** token.
39323932
*/
3933
-char *db_fingerprint(int rcvid){
3933
+char *db_fingerprint(int rcvid){
39343934
char *z = 0;
39353935
Blob sql = BLOB_INITIALIZER;
39363936
Stmt q;
39373937
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)"
39393939
" FROM rcvfrom"
39403940
);
39413941
if( rcvid<=0 ){
39423942
blob_append_sql(&sql, " ORDER BY rcvid DESC LIMIT 1");
39433943
}else{
39443944
--- 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 @@
10591059
" UNION SELECT mrid FROM vfile"
10601060
" UNION SELECT merge FROM vmerge"
10611061
" UNION SELECT %d"
10621062
")"
10631063
"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);",
10651065
oldVid
10661066
);
10671067
if( zUnresolved[0] ){
10681068
fossil_fatal("Unresolved RID values: %s\n", zUnresolved);
10691069
}
10701070
--- 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

Keyboard Shortcuts

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