]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add the --backslash option to the command-line shell for testing purposes.
authordrh <drh@noemail.net>
Thu, 16 Apr 2015 15:05:04 +0000 (15:05 +0000)
committerdrh <drh@noemail.net>
Thu, 16 Apr 2015 15:05:04 +0000 (15:05 +0000)
FossilOrigin-Name: dd96211e8022365637286b146120cc5db44a9923

manifest
manifest.uuid
src/shell.c

index 86969a411cf060f4f5097e574c5350bee7571703..93103be3ba3aaa85dfa8f3cc3cc3a178e0a88e8a 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sa\sfaulty\sassert()\sin\sthe\scompound\sselect\scode\sgenerator.
-D 2015-04-16T14:33:35.359
+C Add\sthe\s--backslash\soption\sto\sthe\scommand-line\sshell\sfor\stesting\spurposes.
+D 2015-04-16T15:05:04.946
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 5f78b1ab81b64e7c57a75d170832443e66c0880a
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -231,7 +231,7 @@ F src/random.c ba2679f80ec82c4190062d756f22d0c358180696
 F src/resolve.c 66cfe49a9c3b449ef13b89a8c47036a4ed167eab
 F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e
 F src/select.c b7b91db829464db6ebba4cd6a878a0ef688b847d
-F src/shell.c 72b61a9d41ba12b67ea06fe9267abcc012c6c5bb
+F src/shell.c 28b3e1174a7fc00155d7d00880a33589a88508c9
 F src/sqlite.h.in ca27603a36fcacdaac5a19d8ee35aaff8ce8516f
 F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
 F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d
@@ -1250,7 +1250,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P ec5a493ad27593ca78899b3001630c1898b940ff
-R 11ac4c431272562d678d3132e12f4ff6
+P 9d336be1b16aa9bd5c9e4132bb645874993c7d96
+R 5fbffaa37b14ccf06bc3b95dfad9c618
 U drh
-Z 9969aaea0bee219926e4d05bec4ccd67
+Z e400cf12f450b0a1df16da05ddca199b
index 523f920fa32a0a7efdcf47672b9f7d280827b3dc..57720c5916589055b680620aae2ea5af5e1be1d2 100644 (file)
@@ -1 +1 @@
-9d336be1b16aa9bd5c9e4132bb645874993c7d96
\ No newline at end of file
+dd96211e8022365637286b146120cc5db44a9923
\ No newline at end of file
index 0f7234c47f6aec4f24aacbe59e695b8464794c14..0d83084741c8ae76aff1ddb7848fd03ea0048189 100644 (file)
@@ -527,6 +527,7 @@ struct ShellState {
   int autoEQP;           /* Run EXPLAIN QUERY PLAN prior to seach SQL stmt */
   int statsOn;           /* True to display memory stats before each finalize */
   int scanstatsOn;       /* True to display scan stats before each finalize */
+  int backslashOn;       /* Resolve C-style \x escapes in SQL input text */
   int outCount;          /* Revert to stdout when reaching zero */
   int cnt;               /* Number of records displayed so far */
   FILE *out;             /* Write results here */
@@ -4111,6 +4112,7 @@ static int process_input(ShellState *p, FILE *in){
                 && sqlite3_complete(zSql) ){
       p->cnt = 0;
       open_db(p, 0);
+      if( p->backslashOn ) resolve_backslashes(zSql);
       BEGIN_TIMER;
       rc = shell_exec(p->db, zSql, shell_callback, p, &zErrMsg);
       END_TIMER;
@@ -4577,6 +4579,13 @@ int SQLITE_CDECL main(int argc, char **argv){
       data.statsOn = 1;
     }else if( strcmp(z,"-scanstats")==0 ){
       data.scanstatsOn = 1;
+    }else if( strcmp(z,"-backslash")==0 ){
+      /* Undocumented command-line option: -backslash
+      ** Causes C-style backslash escapes to be evaluated in SQL statements
+      ** prior to sending the SQL into SQLite.  Useful for injecting
+      ** crazy bytes in the middle of SQL statements for testing and debugging.
+      */
+      data.backslashOn = 1;
     }else if( strcmp(z,"-bail")==0 ){
       bail_on_error = 1;
     }else if( strcmp(z,"-version")==0 ){