Fossil SCM

Merge trunk. More to-the-point message in case of fork warnings after sync.

jan.nijtmans 2015-04-19 18:26 sync-forkwarn merge
Commit cf59ea316546280b90ca0deb3633bd4bfeb40825
3 files changed +10 -1 +2 -1 +2 -1
+10 -1
--- src/shell.c
+++ src/shell.c
@@ -525,10 +525,11 @@
525525
sqlite3 *db; /* The database */
526526
int echoOn; /* True to echo input commands */
527527
int autoEQP; /* Run EXPLAIN QUERY PLAN prior to seach SQL stmt */
528528
int statsOn; /* True to display memory stats before each finalize */
529529
int scanstatsOn; /* True to display scan stats before each finalize */
530
+ int backslashOn; /* Resolve C-style \x escapes in SQL input text */
530531
int outCount; /* Revert to stdout when reaching zero */
531532
int cnt; /* Number of records displayed so far */
532533
FILE *out; /* Write results here */
533534
FILE *traceOut; /* Output for sqlite3_trace() */
534535
int nErr; /* Number of errors seen */
@@ -1942,11 +1943,11 @@
19421943
static void resolve_backslashes(char *z){
19431944
int i, j;
19441945
char c;
19451946
while( *z && *z!='\\' ) z++;
19461947
for(i=j=0; (c = z[i])!=0; i++, j++){
1947
- if( c=='\\' ){
1948
+ if( c=='\\' && z[i+1]!=0 ){
19481949
c = z[++i];
19491950
if( c=='n' ){
19501951
c = '\n';
19511952
}else if( c=='t' ){
19521953
c = '\t';
@@ -4109,10 +4110,11 @@
41094110
}
41104111
if( nSql && line_contains_semicolon(&zSql[nSqlPrior], nSql-nSqlPrior)
41114112
&& sqlite3_complete(zSql) ){
41124113
p->cnt = 0;
41134114
open_db(p, 0);
4115
+ if( p->backslashOn ) resolve_backslashes(zSql);
41144116
BEGIN_TIMER;
41154117
rc = shell_exec(p->db, zSql, shell_callback, p, &zErrMsg);
41164118
END_TIMER;
41174119
if( rc || zErrMsg ){
41184120
char zPrefix[100];
@@ -4575,10 +4577,17 @@
45754577
data.autoEQP = 1;
45764578
}else if( strcmp(z,"-stats")==0 ){
45774579
data.statsOn = 1;
45784580
}else if( strcmp(z,"-scanstats")==0 ){
45794581
data.scanstatsOn = 1;
4582
+ }else if( strcmp(z,"-backslash")==0 ){
4583
+ /* Undocumented command-line option: -backslash
4584
+ ** Causes C-style backslash escapes to be evaluated in SQL statements
4585
+ ** prior to sending the SQL into SQLite. Useful for injecting
4586
+ ** crazy bytes in the middle of SQL statements for testing and debugging.
4587
+ */
4588
+ data.backslashOn = 1;
45804589
}else if( strcmp(z,"-bail")==0 ){
45814590
bail_on_error = 1;
45824591
}else if( strcmp(z,"-version")==0 ){
45834592
printf("%s %s\n", sqlite3_libversion(), sqlite3_sourceid());
45844593
return 0;
45854594
--- src/shell.c
+++ src/shell.c
@@ -525,10 +525,11 @@
525 sqlite3 *db; /* The database */
526 int echoOn; /* True to echo input commands */
527 int autoEQP; /* Run EXPLAIN QUERY PLAN prior to seach SQL stmt */
528 int statsOn; /* True to display memory stats before each finalize */
529 int scanstatsOn; /* True to display scan stats before each finalize */
 
530 int outCount; /* Revert to stdout when reaching zero */
531 int cnt; /* Number of records displayed so far */
532 FILE *out; /* Write results here */
533 FILE *traceOut; /* Output for sqlite3_trace() */
534 int nErr; /* Number of errors seen */
@@ -1942,11 +1943,11 @@
1942 static void resolve_backslashes(char *z){
1943 int i, j;
1944 char c;
1945 while( *z && *z!='\\' ) z++;
1946 for(i=j=0; (c = z[i])!=0; i++, j++){
1947 if( c=='\\' ){
1948 c = z[++i];
1949 if( c=='n' ){
1950 c = '\n';
1951 }else if( c=='t' ){
1952 c = '\t';
@@ -4109,10 +4110,11 @@
4109 }
4110 if( nSql && line_contains_semicolon(&zSql[nSqlPrior], nSql-nSqlPrior)
4111 && sqlite3_complete(zSql) ){
4112 p->cnt = 0;
4113 open_db(p, 0);
 
4114 BEGIN_TIMER;
4115 rc = shell_exec(p->db, zSql, shell_callback, p, &zErrMsg);
4116 END_TIMER;
4117 if( rc || zErrMsg ){
4118 char zPrefix[100];
@@ -4575,10 +4577,17 @@
4575 data.autoEQP = 1;
4576 }else if( strcmp(z,"-stats")==0 ){
4577 data.statsOn = 1;
4578 }else if( strcmp(z,"-scanstats")==0 ){
4579 data.scanstatsOn = 1;
 
 
 
 
 
 
 
4580 }else if( strcmp(z,"-bail")==0 ){
4581 bail_on_error = 1;
4582 }else if( strcmp(z,"-version")==0 ){
4583 printf("%s %s\n", sqlite3_libversion(), sqlite3_sourceid());
4584 return 0;
4585
--- src/shell.c
+++ src/shell.c
@@ -525,10 +525,11 @@
525 sqlite3 *db; /* The database */
526 int echoOn; /* True to echo input commands */
527 int autoEQP; /* Run EXPLAIN QUERY PLAN prior to seach SQL stmt */
528 int statsOn; /* True to display memory stats before each finalize */
529 int scanstatsOn; /* True to display scan stats before each finalize */
530 int backslashOn; /* Resolve C-style \x escapes in SQL input text */
531 int outCount; /* Revert to stdout when reaching zero */
532 int cnt; /* Number of records displayed so far */
533 FILE *out; /* Write results here */
534 FILE *traceOut; /* Output for sqlite3_trace() */
535 int nErr; /* Number of errors seen */
@@ -1942,11 +1943,11 @@
1943 static void resolve_backslashes(char *z){
1944 int i, j;
1945 char c;
1946 while( *z && *z!='\\' ) z++;
1947 for(i=j=0; (c = z[i])!=0; i++, j++){
1948 if( c=='\\' && z[i+1]!=0 ){
1949 c = z[++i];
1950 if( c=='n' ){
1951 c = '\n';
1952 }else if( c=='t' ){
1953 c = '\t';
@@ -4109,10 +4110,11 @@
4110 }
4111 if( nSql && line_contains_semicolon(&zSql[nSqlPrior], nSql-nSqlPrior)
4112 && sqlite3_complete(zSql) ){
4113 p->cnt = 0;
4114 open_db(p, 0);
4115 if( p->backslashOn ) resolve_backslashes(zSql);
4116 BEGIN_TIMER;
4117 rc = shell_exec(p->db, zSql, shell_callback, p, &zErrMsg);
4118 END_TIMER;
4119 if( rc || zErrMsg ){
4120 char zPrefix[100];
@@ -4575,10 +4577,17 @@
4577 data.autoEQP = 1;
4578 }else if( strcmp(z,"-stats")==0 ){
4579 data.statsOn = 1;
4580 }else if( strcmp(z,"-scanstats")==0 ){
4581 data.scanstatsOn = 1;
4582 }else if( strcmp(z,"-backslash")==0 ){
4583 /* Undocumented command-line option: -backslash
4584 ** Causes C-style backslash escapes to be evaluated in SQL statements
4585 ** prior to sending the SQL into SQLite. Useful for injecting
4586 ** crazy bytes in the middle of SQL statements for testing and debugging.
4587 */
4588 data.backslashOn = 1;
4589 }else if( strcmp(z,"-bail")==0 ){
4590 bail_on_error = 1;
4591 }else if( strcmp(z,"-version")==0 ){
4592 printf("%s %s\n", sqlite3_libversion(), sqlite3_sourceid());
4593 return 0;
4594
+2 -1
--- src/xfer.c
+++ src/xfer.c
@@ -1974,9 +1974,10 @@
19741974
manifest_crosslink_end(MC_PERMIT_HOOKS);
19751975
content_enable_dephantomize(1);
19761976
db_end_transaction(0);
19771977
}
19781978
if( (syncFlags & SYNC_CLONE)==0 && g.forkSeen ){
1979
- fossil_warning("***** WARNING: a fork has occurred *****");
1979
+ fossil_warning("***** WARNING: a fork has occurred ***** use "
1980
+ "\"fossil forks\" for more details.");
19801981
}
19811982
return nErr;
19821983
}
19831984
--- src/xfer.c
+++ src/xfer.c
@@ -1974,9 +1974,10 @@
1974 manifest_crosslink_end(MC_PERMIT_HOOKS);
1975 content_enable_dephantomize(1);
1976 db_end_transaction(0);
1977 }
1978 if( (syncFlags & SYNC_CLONE)==0 && g.forkSeen ){
1979 fossil_warning("***** WARNING: a fork has occurred *****");
 
1980 }
1981 return nErr;
1982 }
1983
--- src/xfer.c
+++ src/xfer.c
@@ -1974,9 +1974,10 @@
1974 manifest_crosslink_end(MC_PERMIT_HOOKS);
1975 content_enable_dephantomize(1);
1976 db_end_transaction(0);
1977 }
1978 if( (syncFlags & SYNC_CLONE)==0 && g.forkSeen ){
1979 fossil_warning("***** WARNING: a fork has occurred ***** use "
1980 "\"fossil forks\" for more details.");
1981 }
1982 return nErr;
1983 }
1984
+2 -1
--- src/xfer.c
+++ src/xfer.c
@@ -1974,9 +1974,10 @@
19741974
manifest_crosslink_end(MC_PERMIT_HOOKS);
19751975
content_enable_dephantomize(1);
19761976
db_end_transaction(0);
19771977
}
19781978
if( (syncFlags & SYNC_CLONE)==0 && g.forkSeen ){
1979
- fossil_warning("***** WARNING: a fork has occurred *****");
1979
+ fossil_warning("***** WARNING: a fork has occurred ***** use "
1980
+ "\"fossil forks\" for more details.");
19801981
}
19811982
return nErr;
19821983
}
19831984
--- src/xfer.c
+++ src/xfer.c
@@ -1974,9 +1974,10 @@
1974 manifest_crosslink_end(MC_PERMIT_HOOKS);
1975 content_enable_dephantomize(1);
1976 db_end_transaction(0);
1977 }
1978 if( (syncFlags & SYNC_CLONE)==0 && g.forkSeen ){
1979 fossil_warning("***** WARNING: a fork has occurred *****");
 
1980 }
1981 return nErr;
1982 }
1983
--- src/xfer.c
+++ src/xfer.c
@@ -1974,9 +1974,10 @@
1974 manifest_crosslink_end(MC_PERMIT_HOOKS);
1975 content_enable_dephantomize(1);
1976 db_end_transaction(0);
1977 }
1978 if( (syncFlags & SYNC_CLONE)==0 && g.forkSeen ){
1979 fossil_warning("***** WARNING: a fork has occurred ***** use "
1980 "\"fossil forks\" for more details.");
1981 }
1982 return nErr;
1983 }
1984

Keyboard Shortcuts

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