Fossil SCM
Ensure that the synclog table exists before trying to query it.
Commit
42a23ae71f3923db839c0cd12d25cb1b6439fe5cc139c8a87d7b64453ef8ebfb
Parent
40170e6164a2b7e…
1 file changed
+7
-2
+7
-2
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -1747,11 +1747,14 @@ | ||
| 1747 | 1747 | /* pragma req-synclog ?CLIENT-URL? |
| 1748 | 1748 | ** |
| 1749 | 1749 | ** Request synclog data. If the CLIENT-URL argument is provided, |
| 1750 | 1750 | ** it will be the canonical URL for the client. |
| 1751 | 1751 | */ |
| 1752 | - if( blob_eq(&xfer.aToken[1], "req-synclog") && g.perm.RdSLog ){ | |
| 1752 | + if( blob_eq(&xfer.aToken[1], "req-synclog") | |
| 1753 | + && g.perm.RdSLog | |
| 1754 | + && db_table_exists("repository","synclog") | |
| 1755 | + ){ | |
| 1753 | 1756 | Stmt qSynclog; |
| 1754 | 1757 | if( xfer.nToken>=2 ){ |
| 1755 | 1758 | zClientUrl = blob_str(&xfer.aToken[2]); |
| 1756 | 1759 | if( zClientUrl!=0 |
| 1757 | 1760 | && sqlite3_strlike("http%//localhost%", zClientUrl, 0)==0 |
| @@ -2221,11 +2224,13 @@ | ||
| 2221 | 2224 | } |
| 2222 | 2225 | if( zSelfUrl==0 ){ |
| 2223 | 2226 | blob_appendf(&send,"pragma req-synclog\n"); |
| 2224 | 2227 | }else{ |
| 2225 | 2228 | blob_appendf(&send,"pragma req-synclog %s\n", zSelfUrl); |
| 2226 | - if( syncFlags & SYNC_PUSH_SYNCLOG ){ | |
| 2229 | + if( (syncFlags & SYNC_PUSH_SYNCLOG)!=0 | |
| 2230 | + && db_table_exists("repository","synclog") | |
| 2231 | + ){ | |
| 2227 | 2232 | Stmt qSynclog; |
| 2228 | 2233 | db_prepare(&qSynclog, |
| 2229 | 2234 | "SELECT sfrom, sto, unixepoch(stime), stype FROM synclog" |
| 2230 | 2235 | " WHERE sfrom!=%Q AND sto!=%Q", |
| 2231 | 2236 | g.url.canonical, g.url.canonical |
| 2232 | 2237 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1747,11 +1747,14 @@ | |
| 1747 | /* pragma req-synclog ?CLIENT-URL? |
| 1748 | ** |
| 1749 | ** Request synclog data. If the CLIENT-URL argument is provided, |
| 1750 | ** it will be the canonical URL for the client. |
| 1751 | */ |
| 1752 | if( blob_eq(&xfer.aToken[1], "req-synclog") && g.perm.RdSLog ){ |
| 1753 | Stmt qSynclog; |
| 1754 | if( xfer.nToken>=2 ){ |
| 1755 | zClientUrl = blob_str(&xfer.aToken[2]); |
| 1756 | if( zClientUrl!=0 |
| 1757 | && sqlite3_strlike("http%//localhost%", zClientUrl, 0)==0 |
| @@ -2221,11 +2224,13 @@ | |
| 2221 | } |
| 2222 | if( zSelfUrl==0 ){ |
| 2223 | blob_appendf(&send,"pragma req-synclog\n"); |
| 2224 | }else{ |
| 2225 | blob_appendf(&send,"pragma req-synclog %s\n", zSelfUrl); |
| 2226 | if( syncFlags & SYNC_PUSH_SYNCLOG ){ |
| 2227 | Stmt qSynclog; |
| 2228 | db_prepare(&qSynclog, |
| 2229 | "SELECT sfrom, sto, unixepoch(stime), stype FROM synclog" |
| 2230 | " WHERE sfrom!=%Q AND sto!=%Q", |
| 2231 | g.url.canonical, g.url.canonical |
| 2232 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1747,11 +1747,14 @@ | |
| 1747 | /* pragma req-synclog ?CLIENT-URL? |
| 1748 | ** |
| 1749 | ** Request synclog data. If the CLIENT-URL argument is provided, |
| 1750 | ** it will be the canonical URL for the client. |
| 1751 | */ |
| 1752 | if( blob_eq(&xfer.aToken[1], "req-synclog") |
| 1753 | && g.perm.RdSLog |
| 1754 | && db_table_exists("repository","synclog") |
| 1755 | ){ |
| 1756 | Stmt qSynclog; |
| 1757 | if( xfer.nToken>=2 ){ |
| 1758 | zClientUrl = blob_str(&xfer.aToken[2]); |
| 1759 | if( zClientUrl!=0 |
| 1760 | && sqlite3_strlike("http%//localhost%", zClientUrl, 0)==0 |
| @@ -2221,11 +2224,13 @@ | |
| 2224 | } |
| 2225 | if( zSelfUrl==0 ){ |
| 2226 | blob_appendf(&send,"pragma req-synclog\n"); |
| 2227 | }else{ |
| 2228 | blob_appendf(&send,"pragma req-synclog %s\n", zSelfUrl); |
| 2229 | if( (syncFlags & SYNC_PUSH_SYNCLOG)!=0 |
| 2230 | && db_table_exists("repository","synclog") |
| 2231 | ){ |
| 2232 | Stmt qSynclog; |
| 2233 | db_prepare(&qSynclog, |
| 2234 | "SELECT sfrom, sto, unixepoch(stime), stype FROM synclog" |
| 2235 | " WHERE sfrom!=%Q AND sto!=%Q", |
| 2236 | g.url.canonical, g.url.canonical |
| 2237 |