]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Improved error messages coming out of sqlite3-rsync.
authordrh <>
Sat, 14 Sep 2024 10:59:32 +0000 (10:59 +0000)
committerdrh <>
Sat, 14 Sep 2024 10:59:32 +0000 (10:59 +0000)
FossilOrigin-Name: 452fb6de3984c3cb10d30b51dcdb2574578ca128a0c519b2bd43df0bdd343083

manifest
manifest.uuid
tool/sqlite3-rsync.c

index 718c5d7e296f182d1f2ccdf803f5cb5e9d15eafb..a7fa243946c5a5fee377183d1eca2af280292fda 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Make\sthe\soutput\sfrom\ssqlite3-rsync\swith\sa\ssingle\s-v\soption\sthe\ssame\sas\sit\nis\swith\sregular\srsync.\s\sOnly\sshow\sthe\sSSH\scommand\swith\stwo\sor\smore\s-v\soptions,\nor\sif\sthere\sis\san\serror\sin\spopen2().
-D 2024-09-14T10:48:05.083
+C Improved\serror\smessages\scoming\sout\sof\ssqlite3-rsync.
+D 2024-09-14T10:59:32.119
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -2174,7 +2174,7 @@ F tool/speedtest8inst1.c 7ce07da76b5e745783e703a834417d725b7d45fd
 F tool/spellsift.tcl 52b4b04dc4333c7ab024f09d9d66ed6b6f7c6eb00b38497a09f338fa55d40618 x
 F tool/split-sqlite3c.tcl 5aa60643afca558bc732b1444ae81a522326f91e1dc5665b369c54f09e20de60
 F tool/sqldiff.c 847fc8fcfddf5ce4797b7394cad6372f2f5dc17d8186e2ef8fb44d50fae4f44a
-F tool/sqlite3-rsync.c bb2e19ff46b9679b2c605c474f16a237d81784a819ea6a9265c4d405f323c6e9
+F tool/sqlite3-rsync.c a92a4fa8752690546aada08fa04250c2c0c9a600156193a862ad27ebe4bbf34e
 F tool/sqlite3_analyzer.c.in 8da2b08f56eeac331a715036cf707cc20f879f231362be0c22efd682e2b89b4f
 F tool/sqltclsh.c.in 1bcc2e9da58fadf17b0bf6a50e68c1159e602ce057210b655d50bad5aaaef898
 F tool/sqltclsh.tcl 862f4cf1418df5e1315b5db3b5ebe88969e2a784525af5fbf9596592f14ed848
@@ -2213,8 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P dff76b7a3436031ea5a61b8a44ddfa1d40ea20c983f3d34a8501cd7074db68b8
-R 95aaf9a89250b8760572431cb6032176
+P 105ec44b470318fc9ff1773027c4064343f224068c9b6e71c5618f18f7dfcc3f
+R 11b249479d28ab8ab57cb1dd31e2a2f3
 U drh
-Z abc0757084d259b46638ccae491d778a
+Z 8a831d8281ba8f908e1ad29b156358da
 # Remove this line to create a well-formed Fossil manifest.
index ff3b2077601c6bfabad1b37319564566d3c60647..c542164d90e125b0e470d53e43242bdf07d05e49 100644 (file)
@@ -1 +1 @@
-105ec44b470318fc9ff1773027c4064343f224068c9b6e71c5618f18f7dfcc3f
+452fb6de3984c3cb10d30b51dcdb2574578ca128a0c519b2bd43df0bdd343083
index 9554b87c92424463867a397c1b4508031d763934..d3898b49a0669b7d7519479afc2602e45a04aaa6 100644 (file)
@@ -1184,8 +1184,8 @@ static void originSide(SQLiteRsync *p){
     /* Open the ORIGIN database. */
     rc = sqlite3_open_v2(p->zOrigin, &p->db, SQLITE_OPEN_READWRITE, 0);
     if( rc ){
-      reportError(p, "unable to open origin database file \"%s\": %s",
-                  sqlite3_errmsg(p->db));
+      reportError(p, "cannot open origin \"%s\": %s",
+                  p->zOrigin, sqlite3_errmsg(p->db));
       closeDb(p);
       return;
     }
@@ -1368,7 +1368,7 @@ static void replicaSide(SQLiteRsync *p){
         p->szPage = szOPage;
         rc = sqlite3_open(p->zReplica, &p->db);
         if( rc ){
-          reportError(p, "cannot open replica database \"%s\": %s",
+          reportError(p, "cannot open replica \"%s\": %s",
                       p->zReplica, sqlite3_errmsg(p->db));
           closeDb(p);
           break;
@@ -1430,6 +1430,7 @@ static void replicaSide(SQLiteRsync *p){
                    sqlite3_sql(pIns), sqlite3_errmsg(p->db));
           }
           sqlite3_reset(pIns);
+          p->nPage = nOPage;
           runSql(p, "COMMIT");
         }
         break;
@@ -1734,14 +1735,16 @@ int main(int argc, char const * const *argv){
     }else{
       printf("\n");
     }
-    if( nIO<=szTotal && nIO>0 ){
-      zMsg = sqlite3_mprintf("total size %,lld  speedup is %.2f",
-         szTotal, (double)szTotal/(double)nIO);
-    }else{
-      zMsg = sqlite3_mprintf("total size %,lld", szTotal);
+    if( ctx.nErr==0 ){
+      if( nIO<=szTotal && nIO>0 ){
+        zMsg = sqlite3_mprintf("total size %,lld  speedup is %.2f",
+           szTotal, (double)szTotal/(double)nIO);
+      }else{
+        zMsg = sqlite3_mprintf("total size %,lld", szTotal);
+      }
+      printf("%s\n", zMsg);
+      sqlite3_free(zMsg);
     }
-    printf("%s\n", zMsg);
-    sqlite3_free(zMsg);
   }
   sqlite3_free(zCmd);
   if( pIn!=0 && pOut!=0 ){