Fossil SCM
Correct SQL syntax error on "fossil changes -merge" which is not supposed to display any files yet still tries to run the file query even though it says only "ORDER BY pathname" with no SELECT
Commit
61da77525f0a1e3cc2e99d0eb0730b414cad3cca
Parent
74a5873cca56f61…
1 file changed
+6
+6
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -119,10 +119,15 @@ | ||
| 119 | 119 | int nErr = 0; |
| 120 | 120 | Blob rewrittenPathname; |
| 121 | 121 | Blob sql = BLOB_INITIALIZER, where = BLOB_INITIALIZER; |
| 122 | 122 | const char *zName; |
| 123 | 123 | int i; |
| 124 | + | |
| 125 | + /* Skip the file report if no files are requested at all. */ | |
| 126 | + if( !(flags & (C_ALL | C_EXTRA)) ){ | |
| 127 | + goto skipFiles; | |
| 128 | + } | |
| 124 | 129 | |
| 125 | 130 | /* Assemble the path-limiting WHERE clause, if any. */ |
| 126 | 131 | blob_zero(&where); |
| 127 | 132 | for(i=2; i<g.argc; i++){ |
| 128 | 133 | Blob fname; |
| @@ -293,10 +298,11 @@ | ||
| 293 | 298 | } |
| 294 | 299 | blob_reset(&rewrittenPathname); |
| 295 | 300 | db_finalize(&q); |
| 296 | 301 | |
| 297 | 302 | /* If C_MERGE, put merge contributors at the end of the report. */ |
| 303 | +skipFiles: | |
| 298 | 304 | if( flags & C_MERGE ){ |
| 299 | 305 | db_prepare(&q, "SELECT uuid, id FROM vmerge JOIN blob ON merge=rid" |
| 300 | 306 | " WHERE id<=0"); |
| 301 | 307 | while( db_step(&q)==SQLITE_ROW ){ |
| 302 | 308 | if( flags & C_COMMENT ){ |
| 303 | 309 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -119,10 +119,15 @@ | |
| 119 | int nErr = 0; |
| 120 | Blob rewrittenPathname; |
| 121 | Blob sql = BLOB_INITIALIZER, where = BLOB_INITIALIZER; |
| 122 | const char *zName; |
| 123 | int i; |
| 124 | |
| 125 | /* Assemble the path-limiting WHERE clause, if any. */ |
| 126 | blob_zero(&where); |
| 127 | for(i=2; i<g.argc; i++){ |
| 128 | Blob fname; |
| @@ -293,10 +298,11 @@ | |
| 293 | } |
| 294 | blob_reset(&rewrittenPathname); |
| 295 | db_finalize(&q); |
| 296 | |
| 297 | /* If C_MERGE, put merge contributors at the end of the report. */ |
| 298 | if( flags & C_MERGE ){ |
| 299 | db_prepare(&q, "SELECT uuid, id FROM vmerge JOIN blob ON merge=rid" |
| 300 | " WHERE id<=0"); |
| 301 | while( db_step(&q)==SQLITE_ROW ){ |
| 302 | if( flags & C_COMMENT ){ |
| 303 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -119,10 +119,15 @@ | |
| 119 | int nErr = 0; |
| 120 | Blob rewrittenPathname; |
| 121 | Blob sql = BLOB_INITIALIZER, where = BLOB_INITIALIZER; |
| 122 | const char *zName; |
| 123 | int i; |
| 124 | |
| 125 | /* Skip the file report if no files are requested at all. */ |
| 126 | if( !(flags & (C_ALL | C_EXTRA)) ){ |
| 127 | goto skipFiles; |
| 128 | } |
| 129 | |
| 130 | /* Assemble the path-limiting WHERE clause, if any. */ |
| 131 | blob_zero(&where); |
| 132 | for(i=2; i<g.argc; i++){ |
| 133 | Blob fname; |
| @@ -293,10 +298,11 @@ | |
| 298 | } |
| 299 | blob_reset(&rewrittenPathname); |
| 300 | db_finalize(&q); |
| 301 | |
| 302 | /* If C_MERGE, put merge contributors at the end of the report. */ |
| 303 | skipFiles: |
| 304 | if( flags & C_MERGE ){ |
| 305 | db_prepare(&q, "SELECT uuid, id FROM vmerge JOIN blob ON merge=rid" |
| 306 | " WHERE id<=0"); |
| 307 | while( db_step(&q)==SQLITE_ROW ){ |
| 308 | if( flags & C_COMMENT ){ |
| 309 |