Deleted Added
sdiff udiff text old ( 361456 ) new ( 362190 )
full compact
1/* DO NOT EDIT!
2** This file is automatically generated by the script in the canonical
3** SQLite source tree at tool/mkshellc.tcl. That script combines source
4** code from various constituent source files of SQLite into this single
5** "shell.c" file used to implement the SQLite command-line shell.
6**
7** Most of the code found below comes from the "src/shell.c.in" file in
8** the canonical SQLite source tree. That main file contains "INCLUDE"

--- 22 unchanged lines hidden (view full) ---

31** utility for accessing SQLite databases.
32*/
33#if (defined(_WIN32) || defined(WIN32)) && !defined(_CRT_SECURE_NO_WARNINGS)
34/* This needs to come before any includes for MSVC compiler */
35#define _CRT_SECURE_NO_WARNINGS
36#endif
37
38/*
39** Warning pragmas copied from msvc.h in the core.
40*/
41#if defined(_MSC_VER)
42#pragma warning(disable : 4054)
43#pragma warning(disable : 4055)
44#pragma warning(disable : 4100)
45#pragma warning(disable : 4127)
46#pragma warning(disable : 4130)

--- 95 unchanged lines hidden (view full) ---

142# define shell_write_history(X)
143# define shell_stifle_history(X)
144
145# define SHELL_USE_LOCAL_GETLINE 1
146#endif
147
148
149#if defined(_WIN32) || defined(WIN32)
150# include <io.h>
151# include <fcntl.h>
152# define isatty(h) _isatty(h)
153# ifndef access
154# define access(f,m) _access((f),(m))
155# endif
156# ifndef unlink
157# define unlink _unlink
158# endif
159# ifndef strdup
160# define strdup _strdup
161# endif
162# undef popen
163# define popen _popen
164# undef pclose
165# define pclose _pclose
166#else
167 /* Make sure isatty() has a prototype. */
168 extern int isatty(int);
169
170# if !defined(__RTP__) && !defined(_WRS_KERNEL)
171 /* popen and pclose are not C89 functions and so are
172 ** sometimes omitted from the <stdio.h> header */
173 extern FILE *popen(const char*,const char*);

--- 12 unchanged lines hidden (view full) ---

186#endif
187
188/* ctype macros that work with signed characters */
189#define IsSpace(X) isspace((unsigned char)X)
190#define IsDigit(X) isdigit((unsigned char)X)
191#define ToLower(X) (char)tolower((unsigned char)X)
192
193#if defined(_WIN32) || defined(WIN32)
194#include <windows.h>
195
196/* string conversion routines only needed on Win32 */
197extern char *sqlite3_win32_unicode_to_utf8(LPCWSTR);
198extern char *sqlite3_win32_mbcs_to_utf8_v2(const char *, int);
199extern char *sqlite3_win32_utf8_to_mbcs_v2(const char *, int);
200extern LPWSTR sqlite3_win32_utf8_to_unicode(const char *zText);
201#endif
202
203/* On Windows, we normally run with output mode of TEXT so that \n characters
204** are automatically translated into \r\n. However, this behavior needs
205** to be disabled in some cases (ex: when generating CSV output and when
206** rendering quoted strings that contain \n characters). The following
207** routines take care of that.
208*/
209#if defined(_WIN32) || defined(WIN32)
210static void setBinaryMode(FILE *file, int isOutput){
211 if( isOutput ) fflush(file);
212 _setmode(_fileno(file), _O_BINARY);
213}
214static void setTextMode(FILE *file, int isOutput){
215 if( isOutput ) fflush(file);
216 _setmode(_fileno(file), _O_TEXT);
217}

--- 87 unchanged lines hidden (view full) ---

305/*
306** Check to see if we have timer support. Return 1 if necessary
307** support found (or found previously).
308*/
309static int hasTimer(void){
310 if( getProcessTimesAddr ){
311 return 1;
312 } else {
313 /* GetProcessTimes() isn't supported in WIN95 and some other Windows
314 ** versions. See if the version we are running on has it, and if it
315 ** does, save off a pointer to it and the current process handle.
316 */
317 hProcess = GetCurrentProcess();
318 if( hProcess ){
319 HINSTANCE hinstLib = LoadLibrary(TEXT("Kernel32.dll"));
320 if( NULL != hinstLib ){
321 getProcessTimesAddr =
322 (GETPROCTIMES) GetProcAddress(hinstLib, "GetProcessTimes");
323 if( NULL != getProcessTimesAddr ){
324 return 1;
325 }
326 FreeLibrary(hinstLib);
327 }
328 }
329 }
330 return 0;
331}
332
333/*
334** Begin timing an operation
335*/
336static void beginTimer(void){

--- 73 unchanged lines hidden (view full) ---

410*/
411static sqlite3 *globalDb = 0;
412
413/*
414** True if an interrupt (Control-C) has been received.
415*/
416static volatile int seenInterrupt = 0;
417
418/*
419** This is the name of our program. It is set in main(), used
420** in a number of other places, mostly for error messages.
421*/
422static char *Argv0;
423
424/*
425** Prompt strings. Initialized in main. Settable with
426** .prompt main continue

--- 34 unchanged lines hidden (view full) ---

461#endif
462
463/* Indicate out-of-memory and exit. */
464static void shell_out_of_memory(void){
465 raw_printf(stderr,"Error: out of memory\n");
466 exit(1);
467}
468
469/*
470** Write I/O traces to the following stream.
471*/
472#ifdef SQLITE_ENABLE_IOTRACE
473static FILE *iotrace = 0;
474#endif
475
476/*

--- 1944 unchanged lines hidden (view full) ---

2421 }
2422 if( rc ) return 2;
2423 sqlite3_result_int64(pCtx, nWrite);
2424 }
2425 }
2426
2427 if( mtime>=0 ){
2428#if defined(_WIN32)
2429 /* Windows */
2430 FILETIME lastAccess;
2431 FILETIME lastWrite;
2432 SYSTEMTIME currentTime;
2433 LONGLONG intervals;
2434 HANDLE hFile;
2435 LPWSTR zUnicodeName;
2436 extern LPWSTR sqlite3_win32_utf8_to_unicode(const char*);

--- 14 unchanged lines hidden (view full) ---

2451 sqlite3_free(zUnicodeName);
2452 if( hFile!=INVALID_HANDLE_VALUE ){
2453 BOOL bResult = SetFileTime(hFile, NULL, &lastAccess, &lastWrite);
2454 CloseHandle(hFile);
2455 return !bResult;
2456 }else{
2457 return 1;
2458 }
2459#elif defined(AT_FDCWD) && 0 /* utimensat() is not universally available */
2460 /* Recent unix */
2461 struct timespec times[2];
2462 times[0].tv_nsec = times[1].tv_nsec = 0;
2463 times[0].tv_sec = time(0);
2464 times[1].tv_sec = mtime;
2465 if( utimensat(AT_FDCWD, zFile, times, AT_SYMLINK_NOFOLLOW) ){
2466 return 1;

--- 1741 unchanged lines hidden (view full) ---

4208 memset(&memtraceBase, 0, sizeof(memtraceBase));
4209 }
4210 }
4211 memtraceOut = 0;
4212 return rc;
4213}
4214
4215/************************* End ../ext/misc/memtrace.c ********************/
4216#ifdef SQLITE_HAVE_ZLIB
4217/************************* Begin ../ext/misc/zipfile.c ******************/
4218/*
4219** 2017-12-26
4220**
4221** The author disclaims copyright to this source code. In place of
4222** a legal notice, here is a blessing:
4223**

--- 2196 unchanged lines hidden (view full) ---

6420**
6421** Utility functions sqlar_compress() and sqlar_uncompress(). Useful
6422** for working with sqlar archives and used by the shell tool's built-in
6423** sqlar support.
6424*/
6425/* #include "sqlite3ext.h" */
6426SQLITE_EXTENSION_INIT1
6427#include <zlib.h>
6428
6429/*
6430** Implementation of the "sqlar_compress(X)" SQL function.
6431**
6432** If the type of X is SQLITE_BLOB, and compressing that blob using
6433** zlib utility function compress() yields a smaller blob, return the
6434** compressed blob. Otherwise, return a copy of X.
6435**

--- 1393 unchanged lines hidden (view full) ---

7829 rc = idxPrintfPrepareStmt(dbm, &pExplain, pzErr,
7830 "EXPLAIN QUERY PLAN %s", pStmt->zSql
7831 );
7832 while( rc==SQLITE_OK && sqlite3_step(pExplain)==SQLITE_ROW ){
7833 /* int iId = sqlite3_column_int(pExplain, 0); */
7834 /* int iParent = sqlite3_column_int(pExplain, 1); */
7835 /* int iNotUsed = sqlite3_column_int(pExplain, 2); */
7836 const char *zDetail = (const char*)sqlite3_column_text(pExplain, 3);
7837 int nDetail = STRLEN(zDetail);
7838 int i;
7839
7840 for(i=0; i<nDetail; i++){
7841 const char *zIdx = 0;
7842 if( memcmp(&zDetail[i], " USING INDEX ", 13)==0 ){
7843 zIdx = &zDetail[i+13];
7844 }else if( memcmp(&zDetail[i], " USING COVERING INDEX ", 22)==0 ){
7845 zIdx = &zDetail[i+22];
7846 }
7847 if( zIdx ){
7848 const char *zSql;
7849 int nIdx = 0;
7850 while( zIdx[nIdx]!='\0' && (zIdx[nIdx]!=' ' || zIdx[nIdx+1]!='(') ){
7851 nIdx++;
7852 }

--- 798 unchanged lines hidden (view full) ---

8651 idxTableFree(p->pTable);
8652 idxWriteFree(p->pWrite);
8653 idxHashClear(&p->hIdx);
8654 sqlite3_free(p->zCandidates);
8655 sqlite3_free(p);
8656 }
8657}
8658
8659#endif /* ifndef SQLITE_OMIT_VIRTUAL_TABLE */
8660
8661/************************* End ../ext/expert/sqlite3expert.c ********************/
8662
8663#if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB)
8664/************************* Begin ../ext/misc/dbdata.c ******************/
8665/*
8666** 2019-04-17
8667**

--- 929 unchanged lines hidden (view full) ---

9597 int normalMode; /* Output mode before ".explain on" */
9598 int writableSchema; /* True if PRAGMA writable_schema=ON */
9599 int showHeader; /* True to show column names in List or Column mode */
9600 int nCheck; /* Number of ".check" commands run */
9601 unsigned nProgress; /* Number of progress callbacks encountered */
9602 unsigned mxProgress; /* Maximum progress callbacks before failing */
9603 unsigned flgProgress; /* Flags for the progress callback */
9604 unsigned shellFlgs; /* Various flags */
9605 sqlite3_int64 szMax; /* --maxsize argument to .open */
9606 char *zDestTable; /* Name of destination table when MODE_Insert */
9607 char *zTempFile; /* Temporary file that might need deleting */
9608 char zTestcase[30]; /* Name of current test case */
9609 char colSeparator[20]; /* Column separator character for several modes */
9610 char rowSeparator[20]; /* Row separator character for MODE_Ascii */
9611 char colSepPrior[20]; /* Saved column separator */
9612 char rowSepPrior[20]; /* Saved row separator */

--- 284 unchanged lines hidden (view full) ---

9897}
9898#endif /* SQLITE_NOHAVE_SYSTEM */
9899
9900/*
9901** Save or restore the current output mode
9902*/
9903static void outputModePush(ShellState *p){
9904 p->modePrior = p->mode;
9905 memcpy(p->colSepPrior, p->colSeparator, sizeof(p->colSeparator));
9906 memcpy(p->rowSepPrior, p->rowSeparator, sizeof(p->rowSeparator));
9907}
9908static void outputModePop(ShellState *p){
9909 p->mode = p->modePrior;
9910 memcpy(p->colSeparator, p->colSepPrior, sizeof(p->colSeparator));
9911 memcpy(p->rowSeparator, p->rowSepPrior, sizeof(p->rowSeparator));
9912}
9913
9914/*
9915** Output the given string as a hex-encoded blob (eg. X'1234' )
9916*/
9917static void output_hex_blob(FILE *out, const void *pBlob, int nBlob){

--- 948 unchanged lines hidden (view full) ---

10866**
10867** If the number of columns is 1 and that column contains text "--"
10868** then write the semicolon on a separate line. That way, if a
10869** "--" comment occurs at the end of the statement, the comment
10870** won't consume the semicolon terminator.
10871*/
10872static int run_table_dump_query(
10873 ShellState *p, /* Query context */
10874 const char *zSelect, /* SELECT statement to extract content */
10875 const char *zFirstRow /* Print before first row, if not NULL */
10876){
10877 sqlite3_stmt *pSelect;
10878 int rc;
10879 int nResult;
10880 int i;
10881 const char *z;
10882 rc = sqlite3_prepare_v2(p->db, zSelect, -1, &pSelect, 0);
10883 if( rc!=SQLITE_OK || !pSelect ){
10884 utf8_printf(p->out, "/**** ERROR: (%d) %s *****/\n", rc,
10885 sqlite3_errmsg(p->db));
10886 if( (rc&0xff)!=SQLITE_CORRUPT ) p->nErr++;
10887 return rc;
10888 }
10889 rc = sqlite3_step(pSelect);
10890 nResult = sqlite3_column_count(pSelect);
10891 while( rc==SQLITE_ROW ){
10892 if( zFirstRow ){
10893 utf8_printf(p->out, "%s", zFirstRow);
10894 zFirstRow = 0;
10895 }
10896 z = (const char*)sqlite3_column_text(pSelect, 0);
10897 utf8_printf(p->out, "%s", z);
10898 for(i=1; i<nResult; i++){
10899 utf8_printf(p->out, ",%s", sqlite3_column_text(pSelect, i));
10900 }
10901 if( z==0 ) z = "";
10902 while( z[0] && (z[0]!='-' || z[1]!='-') ) z++;
10903 if( z[0] ){

--- 440 unchanged lines hidden (view full) ---

11344/*
11345** Bind parameters on a prepared statement.
11346**
11347** Parameter bindings are taken from a TEMP table of the form:
11348**
11349** CREATE TEMP TABLE sqlite_parameters(key TEXT PRIMARY KEY, value)
11350** WITHOUT ROWID;
11351**
11352** No bindings occur if this table does not exist. The special character '$'
11353** is included in the table name to help prevent collisions with actual tables.
11354** The table must be in the TEMP schema.
11355*/
11356static void bind_prepared_stmt(ShellState *pArg, sqlite3_stmt *pStmt){
11357 int nVar;
11358 int i;
11359 int rc;
11360 sqlite3_stmt *pQ = 0;
11361
11362 nVar = sqlite3_bind_parameter_count(pStmt);

--- 287 unchanged lines hidden (view full) ---

11650 }
11651 zEQP = sqlite3_mprintf("EXPLAIN QUERY PLAN %s", zStmtSql);
11652 rc = sqlite3_prepare_v2(db, zEQP, -1, &pExplain, 0);
11653 if( rc==SQLITE_OK ){
11654 while( sqlite3_step(pExplain)==SQLITE_ROW ){
11655 const char *zEQPLine = (const char*)sqlite3_column_text(pExplain,3);
11656 int iEqpId = sqlite3_column_int(pExplain, 0);
11657 int iParentId = sqlite3_column_int(pExplain, 1);
11658 if( zEQPLine[0]=='-' ) eqp_render(pArg);
11659 eqp_append(pArg, iEqpId, iParentId, zEQPLine);
11660 }
11661 eqp_render(pArg);
11662 }
11663 sqlite3_finalize(pExplain);
11664 sqlite3_free(zEQP);
11665 if( pArg->autoEQP>=AUTOEQP_full ){

--- 394 unchanged lines hidden (view full) ---

12060 ".binary on|off Turn binary output on or off. Default OFF",
12061 ".cd DIRECTORY Change the working directory to DIRECTORY",
12062 ".changes on|off Show number of rows changed by SQL",
12063 ".check GLOB Fail if output since .testcase does not match",
12064 ".clone NEWDB Clone data into NEWDB from the existing database",
12065 ".databases List names and files of attached databases",
12066 ".dbconfig ?op? ?val? List or change sqlite3_db_config() options",
12067 ".dbinfo ?DB? Show status information about the database",
12068 ".dump ?TABLE? ... Render all database content as SQL",
12069 " Options:",
12070 " --preserve-rowids Include ROWID values in the output",
12071 " --newlines Allow unescaped newline characters in output",
12072 " TABLE is a LIKE pattern for the tables to dump",
12073 ".echo on|off Turn command echo on or off",
12074 ".eqp on|off|full|... Enable or disable automatic EXPLAIN QUERY PLAN",
12075 " Other Modes:",
12076#ifdef SQLITE_DEBUG
12077 " test Show raw EXPLAIN QUERY PLAN output",
12078 " trace Like \"full\" but enable \"PRAGMA vdbe_trace\"",
12079#endif
12080 " trigger Like \"full\" but also show trigger bytecode",
12081 ".excel Display the output of next command in spreadsheet",
12082 ".exit ?CODE? Exit this program with return-code CODE",
12083 ".expert EXPERIMENTAL. Suggest indexes for queries",
12084 ".explain ?on|off|auto? Change the EXPLAIN formatting mode. Default: auto",
12085 ".filectrl CMD ... Run various sqlite3_file_control() operations",
12086 " Run \".filectrl\" with no arguments for details",
12087 ".fullschema ?--indent? Show schema and the content of sqlite_stat tables",
12088 ".headers on|off Turn display of headers on or off",
12089 ".help ?-all? ?PATTERN? Show help text for PATTERN",
12090 ".import FILE TABLE Import data from FILE into TABLE",
12091#ifndef SQLITE_OMIT_TEST_CONTROL
12092 ".imposter INDEX TABLE Create imposter table TABLE on index INDEX",
12093#endif
12094 ".indexes ?TABLE? Show names of indexes",
12095 " If TABLE is specified, only show indexes for",
12096 " tables matching TABLE using the LIKE operator.",
12097#ifdef SQLITE_ENABLE_IOTRACE
12098 ".iotrace FILE Enable I/O diagnostic logging to FILE",

--- 14 unchanged lines hidden (view full) ---

12113 " html HTML <table> code",
12114 " insert SQL insert statements for TABLE",
12115 " line One value per line",
12116 " list Values delimited by \"|\"",
12117 " quote Escape answers as for SQL",
12118 " tabs Tab-separated values",
12119 " tcl TCL list elements",
12120 ".nullvalue STRING Use STRING in place of NULL values",
12121 ".once (-e|-x|FILE) Output for the next SQL command only to FILE",
12122 " If FILE begins with '|' then open as a pipe",
12123 " Other options:",
12124 " -e Invoke system text editor",
12125 " -x Open in a spreadsheet",
12126 ".open ?OPTIONS? ?FILE? Close existing database and reopen FILE",
12127 " Options:",
12128 " --append Use appendvfs to append database to the end of FILE",
12129#ifdef SQLITE_ENABLE_DESERIALIZE
12130 " --deserialize Load into memory useing sqlite3_deserialize()",
12131 " --hexdb Load the output of \"dbtotxt\" as an in-memory db",
12132 " --maxsize N Maximum size for --hexdb or --deserialized database",
12133#endif
12134 " --new Initialize FILE to an empty database",
12135 " --nofollow Do not follow symbolic links",
12136 " --readonly Open FILE readonly",
12137 " --zip FILE is a ZIP archive",
12138 ".output ?FILE? Send output to FILE or stdout if FILE is omitted",
12139 " If FILE begins with '|' then open it as a pipe.",
12140 ".parameter CMD ... Manage SQL parameter bindings",
12141 " clear Erase all bindings",
12142 " init Initialize the TEMP table that holds bindings",
12143 " list List the current parameter bindings",
12144 " set PARAMETER VALUE Given SQL parameter PARAMETER a value of VALUE",
12145 " PARAMETER should start with one of: $ : @ ?",
12146 " unset PARAMETER Remove PARAMETER from the binding table",
12147 ".print STRING... Print literal STRING",

--- 103 unchanged lines hidden (view full) ---

12251 int i = 0;
12252 int j = 0;
12253 int n = 0;
12254 char *zPat;
12255 if( zPattern==0
12256 || zPattern[0]=='0'
12257 || strcmp(zPattern,"-a")==0
12258 || strcmp(zPattern,"-all")==0
12259 ){
12260 /* Show all commands, but only one line per command */
12261 if( zPattern==0 ) zPattern = "";
12262 for(i=0; i<ArraySize(azHelp); i++){
12263 if( azHelp[i][0]=='.' || zPattern[0] ){
12264 utf8_printf(out, "%s\n", azHelp[i]);
12265 n++;
12266 }

--- 465 unchanged lines hidden (view full) ---

12732 exit(1);
12733 }
12734#ifndef SQLITE_OMIT_LOAD_EXTENSION
12735 sqlite3_enable_load_extension(p->db, 1);
12736#endif
12737 sqlite3_fileio_init(p->db, 0, 0);
12738 sqlite3_shathree_init(p->db, 0, 0);
12739 sqlite3_completion_init(p->db, 0, 0);
12740#if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB)
12741 sqlite3_dbdata_init(p->db, 0, 0);
12742#endif
12743#ifdef SQLITE_HAVE_ZLIB
12744 sqlite3_zipfile_init(p->db, 0, 0);
12745 sqlite3_sqlar_init(p->db, 0, 0);
12746#endif
12747 sqlite3_create_function(p->db, "shell_add_schema", 3, SQLITE_UTF8, 0,

--- 320 unchanged lines hidden (view full) ---

13068typedef struct ImportCtx ImportCtx;
13069struct ImportCtx {
13070 const char *zFile; /* Name of the input file */
13071 FILE *in; /* Read the CSV text from this input stream */
13072 char *z; /* Accumulated text for a field */
13073 int n; /* Number of bytes in z */
13074 int nAlloc; /* Space allocated for z[] */
13075 int nLine; /* Current line number */
13076 int bNotFirst; /* True if one or more bytes already read */
13077 int cTerm; /* Character that terminated the most recent field */
13078 int cColSep; /* The column separator character. (Usually ",") */
13079 int cRowSep; /* The row separator character. (Usually "\n") */
13080};
13081
13082/* Append a single byte to z[] */
13083static void import_append_char(ImportCtx *p, int c){

--- 365 unchanged lines hidden (view full) ---

13449 "open";
13450#else
13451 "xdg-open";
13452#endif
13453 char *zCmd;
13454 zCmd = sqlite3_mprintf("%s %s", zXdgOpenCmd, p->zTempFile);
13455 if( system(zCmd) ){
13456 utf8_printf(stderr, "Failed: [%s]\n", zCmd);
13457 }
13458 sqlite3_free(zCmd);
13459 outputModePop(p);
13460 p->doXdgOpen = 0;
13461 sqlite3_sleep(100);
13462 }
13463#endif /* !defined(SQLITE_NOHAVE_SYSTEM) */
13464 }
13465 p->outfile[0] = 0;
13466 p->out = stdout;
13467}
13468
13469/*

--- 59 unchanged lines hidden (view full) ---

13529 sqlite3_stmt *pStmt = 0;
13530 unsigned char aHdr[100];
13531 open_db(p, 0);
13532 if( p->db==0 ) return 1;
13533 rc = sqlite3_prepare_v2(p->db,
13534 "SELECT data FROM sqlite_dbpage(?1) WHERE pgno=1",
13535 -1, &pStmt, 0);
13536 if( rc ){
13537 if( !sqlite3_compileoption_used("ENABLE_DBPAGE_VTAB") ){
13538 utf8_printf(stderr, "the \".dbinfo\" command requires the "
13539 "-DSQLITE_ENABLE_DBPAGE_VTAB compile-time options\n");
13540 }else{
13541 utf8_printf(stderr, "error: %s\n", sqlite3_errmsg(p->db));
13542 }
13543 sqlite3_finalize(pStmt);
13544 return 1;
13545 }
13546 sqlite3_bind_text(pStmt, 1, zDb, -1, SQLITE_STATIC);
13547 if( sqlite3_step(pStmt)==SQLITE_ROW
13548 && sqlite3_column_bytes(pStmt,0)>100
13549 ){
13550 memcpy(aHdr, sqlite3_column_blob(pStmt,0), 100);

--- 192 unchanged lines hidden (view full) ---

13743static void newTempFile(ShellState *p, const char *zSuffix){
13744 clearTempFile(p);
13745 sqlite3_free(p->zTempFile);
13746 p->zTempFile = 0;
13747 if( p->db ){
13748 sqlite3_file_control(p->db, 0, SQLITE_FCNTL_TEMPFILENAME, &p->zTempFile);
13749 }
13750 if( p->zTempFile==0 ){
13751 sqlite3_uint64 r;
13752 sqlite3_randomness(sizeof(r), &r);
13753 p->zTempFile = sqlite3_mprintf("temp%llx.%s", r, zSuffix);
13754 }else{
13755 p->zTempFile = sqlite3_mprintf("%z.%s", p->zTempFile, zSuffix);
13756 }
13757 if( p->zTempFile==0 ){
13758 raw_printf(stderr, "out of memory\n");
13759 exit(1);
13760 }
13761}

--- 2007 unchanged lines hidden (view full) ---

15769#if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB)
15770 if( c=='r' && strncmp(azArg[0], "recover", n)==0 ){
15771 open_db(p, 0);
15772 rc = recoverDatabaseCmd(p, nArg, azArg);
15773 }else
15774#endif /* !(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB) */
15775
15776 if( c=='d' && strncmp(azArg[0], "dump", n)==0 ){
15777 const char *zLike = 0;
15778 int i;
15779 int savedShowHeader = p->showHeader;
15780 int savedShellFlags = p->shellFlgs;
15781 ShellClearFlag(p, SHFLG_PreserveRowid|SHFLG_Newlines|SHFLG_Echo);
15782 for(i=1; i<nArg; i++){
15783 if( azArg[i][0]=='-' ){
15784 const char *z = azArg[i]+1;
15785 if( z[0]=='-' ) z++;

--- 11 unchanged lines hidden (view full) ---

15797 ShellSetFlag(p, SHFLG_Newlines);
15798 }else
15799 {
15800 raw_printf(stderr, "Unknown option \"%s\" on \".dump\"\n", azArg[i]);
15801 rc = 1;
15802 goto meta_command_exit;
15803 }
15804 }else if( zLike ){
15805 raw_printf(stderr, "Usage: .dump ?--preserve-rowids? "
15806 "?--newlines? ?LIKE-PATTERN?\n");
15807 rc = 1;
15808 goto meta_command_exit;
15809 }else{
15810 zLike = azArg[i];
15811 }
15812 }
15813
15814 open_db(p, 0);
15815
15816 /* When playing back a "dump", the content might appear in an order
15817 ** which causes immediate foreign key constraints to be violated.
15818 ** So disable foreign-key constraint enforcement to prevent problems. */
15819 raw_printf(p->out, "PRAGMA foreign_keys=OFF;\n");
15820 raw_printf(p->out, "BEGIN TRANSACTION;\n");
15821 p->writableSchema = 0;
15822 p->showHeader = 0;
15823 /* Set writable_schema=ON since doing so forces SQLite to initialize
15824 ** as much of the schema as it can even if the sqlite_master table is
15825 ** corrupt. */
15826 sqlite3_exec(p->db, "SAVEPOINT dump; PRAGMA writable_schema=ON", 0, 0, 0);
15827 p->nErr = 0;
15828 if( zLike==0 ){
15829 run_schema_dump_query(p,
15830 "SELECT name, type, sql FROM sqlite_master "
15831 "WHERE sql NOT NULL AND type=='table' AND name!='sqlite_sequence'"
15832 );
15833 run_schema_dump_query(p,
15834 "SELECT name, type, sql FROM sqlite_master "
15835 "WHERE name=='sqlite_sequence'"
15836 );
15837 run_table_dump_query(p,
15838 "SELECT sql FROM sqlite_master "
15839 "WHERE sql NOT NULL AND type IN ('index','trigger','view')", 0
15840 );
15841 }else{
15842 char *zSql;
15843 zSql = sqlite3_mprintf(
15844 "SELECT name, type, sql FROM sqlite_master "
15845 "WHERE tbl_name LIKE %Q AND type=='table'"
15846 " AND sql NOT NULL", zLike);
15847 run_schema_dump_query(p,zSql);
15848 sqlite3_free(zSql);
15849 zSql = sqlite3_mprintf(
15850 "SELECT sql FROM sqlite_master "
15851 "WHERE sql NOT NULL"
15852 " AND type IN ('index','trigger','view')"
15853 " AND tbl_name LIKE %Q", zLike);
15854 run_table_dump_query(p, zSql, 0);
15855 sqlite3_free(zSql);
15856 }
15857 if( p->writableSchema ){
15858 raw_printf(p->out, "PRAGMA writable_schema=OFF;\n");
15859 p->writableSchema = 0;
15860 }
15861 sqlite3_exec(p->db, "PRAGMA writable_schema=OFF;", 0, 0, 0);
15862 sqlite3_exec(p->db, "RELEASE dump;", 0, 0, 0);
15863 raw_printf(p->out, p->nErr?"ROLLBACK; -- due to errors\n":"COMMIT;\n");
15864 p->showHeader = savedShowHeader;

--- 86 unchanged lines hidden (view full) ---

15951 { "chunk_size", SQLITE_FCNTL_CHUNK_SIZE, "SIZE" },
15952 /* { "win32_av_retry", SQLITE_FCNTL_WIN32_AV_RETRY, "COUNT DELAY" },*/
15953 { "persist_wal", SQLITE_FCNTL_PERSIST_WAL, "[BOOLEAN]" },
15954 { "psow", SQLITE_FCNTL_POWERSAFE_OVERWRITE, "[BOOLEAN]" },
15955 /* { "pragma", SQLITE_FCNTL_PRAGMA, "NAME ARG" },*/
15956 { "tempfilename", SQLITE_FCNTL_TEMPFILENAME, "" },
15957 { "has_moved", SQLITE_FCNTL_HAS_MOVED, "" },
15958 { "lock_timeout", SQLITE_FCNTL_LOCK_TIMEOUT, "MILLISEC" },
15959 };
15960 int filectrl = -1;
15961 int iCtrl = -1;
15962 sqlite3_int64 iRes = 0; /* Integer result to display if rc2==1 */
15963 int isOk = 0; /* 0: usage 1: %lld 2: no-result */
15964 int n2, i;
15965 const char *zCmd = 0;
15966
15967 open_db(p, 0);
15968 zCmd = nArg>=2 ? azArg[1] : "help";
15969
15970 /* The argument can optionally begin with "-" or "--" */
15971 if( zCmd[0]=='-' && zCmd[1] ){
15972 zCmd++;
15973 if( zCmd[0]=='-' && zCmd[1] ) zCmd++;
15974 }
15975
15976 /* --help lists all file-controls */
15977 if( strcmp(zCmd,"help")==0 ){

--- 25 unchanged lines hidden (view full) ---

16003 if( filectrl<0 ){
16004 utf8_printf(stderr,"Error: unknown file-control: %s\n"
16005 "Use \".filectrl --help\" for help\n", zCmd);
16006 }else{
16007 switch(filectrl){
16008 case SQLITE_FCNTL_SIZE_LIMIT: {
16009 if( nArg!=2 && nArg!=3 ) break;
16010 iRes = nArg==3 ? integerValue(azArg[2]) : -1;
16011 sqlite3_file_control(p->db, 0, SQLITE_FCNTL_SIZE_LIMIT, &iRes);
16012 isOk = 1;
16013 break;
16014 }
16015 case SQLITE_FCNTL_LOCK_TIMEOUT:
16016 case SQLITE_FCNTL_CHUNK_SIZE: {
16017 int x;
16018 if( nArg!=3 ) break;
16019 x = (int)integerValue(azArg[2]);
16020 sqlite3_file_control(p->db, 0, filectrl, &x);
16021 isOk = 2;
16022 break;
16023 }
16024 case SQLITE_FCNTL_PERSIST_WAL:
16025 case SQLITE_FCNTL_POWERSAFE_OVERWRITE: {
16026 int x;
16027 if( nArg!=2 && nArg!=3 ) break;
16028 x = nArg==3 ? booleanValue(azArg[2]) : -1;
16029 sqlite3_file_control(p->db, 0, filectrl, &x);
16030 iRes = x;
16031 isOk = 1;
16032 break;
16033 }
16034 case SQLITE_FCNTL_HAS_MOVED: {
16035 int x;
16036 if( nArg!=2 ) break;
16037 sqlite3_file_control(p->db, 0, filectrl, &x);
16038 iRes = x;
16039 isOk = 1;
16040 break;
16041 }
16042 case SQLITE_FCNTL_TEMPFILENAME: {
16043 char *z = 0;
16044 if( nArg!=2 ) break;
16045 sqlite3_file_control(p->db, 0, filectrl, &z);
16046 if( z ){
16047 utf8_printf(p->out, "%s\n", z);
16048 sqlite3_free(z);
16049 }
16050 isOk = 2;
16051 break;
16052 }
16053 }
16054 }
16055 if( isOk==0 && iCtrl>=0 ){
16056 utf8_printf(p->out, "Usage: .filectrl %s %s\n", zCmd,aCtrl[iCtrl].zUsage);
16057 rc = 1;
16058 }else if( isOk==1 ){
16059 char zBuf[100];
16060 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", iRes);

--- 67 unchanged lines hidden (view full) ---

16128 utf8_printf(p->out, "Nothing matches '%s'\n", azArg[1]);
16129 }
16130 }else{
16131 showHelp(p->out, 0);
16132 }
16133 }else
16134
16135 if( c=='i' && strncmp(azArg[0], "import", n)==0 ){
16136 char *zTable; /* Insert data into this table */
16137 char *zFile; /* Name of file to extra content from */
16138 sqlite3_stmt *pStmt = NULL; /* A statement */
16139 int nCol; /* Number of columns in the table */
16140 int nByte; /* Number of bytes in an SQL string */
16141 int i, j; /* Loop counters */
16142 int needCommit; /* True to COMMIT or ROLLBACK at end */
16143 int nSep; /* Number of bytes in p->colSeparator[] */
16144 char *zSql; /* An SQL statement */
16145 ImportCtx sCtx; /* Reader context */
16146 char *(SQLITE_CDECL *xRead)(ImportCtx*); /* Func to read one value */
16147 int (SQLITE_CDECL *xCloser)(FILE*); /* Func to close file */
16148
16149 if( nArg!=3 ){
16150 raw_printf(stderr, "Usage: .import FILE TABLE\n");
16151 goto meta_command_exit;
16152 }
16153 zFile = azArg[1];
16154 zTable = azArg[2];
16155 seenInterrupt = 0;
16156 memset(&sCtx, 0, sizeof(sCtx));
16157 open_db(p, 0);
16158 nSep = strlen30(p->colSeparator);
16159 if( nSep==0 ){
16160 raw_printf(stderr,
16161 "Error: non-null column separator required for import\n");
16162 return 1;
16163 }
16164 if( nSep>1 ){
16165 raw_printf(stderr, "Error: multi-character column separators not allowed"
16166 " for import\n");
16167 return 1;
16168 }
16169 nSep = strlen30(p->rowSeparator);
16170 if( nSep==0 ){
16171 raw_printf(stderr, "Error: non-null row separator required for import\n");
16172 return 1;
16173 }
16174 if( nSep==2 && p->mode==MODE_Csv && strcmp(p->rowSeparator, SEP_CrLf)==0 ){
16175 /* When importing CSV (only), if the row separator is set to the
16176 ** default output row separator, change it to the default input
16177 ** row separator. This avoids having to maintain different input
16178 ** and output row separators. */
16179 sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row);
16180 nSep = strlen30(p->rowSeparator);
16181 }
16182 if( nSep>1 ){
16183 raw_printf(stderr, "Error: multi-character row separators not allowed"
16184 " for import\n");
16185 return 1;
16186 }
16187 sCtx.zFile = zFile;
16188 sCtx.nLine = 1;
16189 if( sCtx.zFile[0]=='|' ){
16190#ifdef SQLITE_OMIT_POPEN
16191 raw_printf(stderr, "Error: pipes are not supported in this OS\n");
16192 return 1;
16193#else
16194 sCtx.in = popen(sCtx.zFile+1, "r");
16195 sCtx.zFile = "<pipe>";
16196 xCloser = pclose;
16197#endif
16198 }else{
16199 sCtx.in = fopen(sCtx.zFile, "rb");
16200 xCloser = fclose;
16201 }
16202 if( p->mode==MODE_Ascii ){
16203 xRead = ascii_read_one_field;
16204 }else{
16205 xRead = csv_read_one_field;
16206 }
16207 if( sCtx.in==0 ){
16208 utf8_printf(stderr, "Error: cannot open \"%s\"\n", zFile);
16209 return 1;
16210 }
16211 sCtx.cColSep = p->colSeparator[0];
16212 sCtx.cRowSep = p->rowSeparator[0];
16213 zSql = sqlite3_mprintf("SELECT * FROM %s", zTable);
16214 if( zSql==0 ){
16215 xCloser(sCtx.in);
16216 shell_out_of_memory();
16217 }
16218 nByte = strlen30(zSql);
16219 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
16220 import_append_char(&sCtx, 0); /* To ensure sCtx.z is allocated */

--- 5 unchanged lines hidden (view full) ---

16226 cSep = ',';
16227 if( sCtx.cTerm!=sCtx.cColSep ) break;
16228 }
16229 if( cSep=='(' ){
16230 sqlite3_free(zCreate);
16231 sqlite3_free(sCtx.z);
16232 xCloser(sCtx.in);
16233 utf8_printf(stderr,"%s: empty file\n", sCtx.zFile);
16234 return 1;
16235 }
16236 zCreate = sqlite3_mprintf("%z\n)", zCreate);
16237 rc = sqlite3_exec(p->db, zCreate, 0, 0, 0);
16238 sqlite3_free(zCreate);
16239 if( rc ){
16240 utf8_printf(stderr, "CREATE TABLE %s(...) failed: %s\n", zTable,
16241 sqlite3_errmsg(p->db));
16242 sqlite3_free(sCtx.z);
16243 xCloser(sCtx.in);
16244 return 1;
16245 }
16246 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
16247 }
16248 sqlite3_free(zSql);
16249 if( rc ){
16250 if (pStmt) sqlite3_finalize(pStmt);
16251 utf8_printf(stderr,"Error: %s\n", sqlite3_errmsg(p->db));
16252 xCloser(sCtx.in);
16253 return 1;
16254 }
16255 nCol = sqlite3_column_count(pStmt);
16256 sqlite3_finalize(pStmt);
16257 pStmt = 0;
16258 if( nCol==0 ) return 0; /* no columns, no error */
16259 zSql = sqlite3_malloc64( nByte*2 + 20 + nCol*2 );
16260 if( zSql==0 ){
16261 xCloser(sCtx.in);
16262 shell_out_of_memory();
16263 }
16264 sqlite3_snprintf(nByte+20, zSql, "INSERT INTO \"%w\" VALUES(?", zTable);
16265 j = strlen30(zSql);
16266 for(i=1; i<nCol; i++){
16267 zSql[j++] = ',';
16268 zSql[j++] = '?';
16269 }
16270 zSql[j++] = ')';
16271 zSql[j] = 0;
16272 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
16273 sqlite3_free(zSql);
16274 if( rc ){
16275 utf8_printf(stderr, "Error: %s\n", sqlite3_errmsg(p->db));
16276 if (pStmt) sqlite3_finalize(pStmt);
16277 xCloser(sCtx.in);
16278 return 1;
16279 }
16280 needCommit = sqlite3_get_autocommit(p->db);
16281 if( needCommit ) sqlite3_exec(p->db, "BEGIN", 0, 0, 0);
16282 do{
16283 int startLine = sCtx.nLine;
16284 for(i=0; i<nCol; i++){
16285 char *z = xRead(&sCtx);
16286 /*

--- 26 unchanged lines hidden (view full) ---

16313 sCtx.zFile, startLine, nCol, i);
16314 }
16315 if( i>=nCol ){
16316 sqlite3_step(pStmt);
16317 rc = sqlite3_reset(pStmt);
16318 if( rc!=SQLITE_OK ){
16319 utf8_printf(stderr, "%s:%d: INSERT failed: %s\n", sCtx.zFile,
16320 startLine, sqlite3_errmsg(p->db));
16321 }
16322 }
16323 }while( sCtx.cTerm!=EOF );
16324
16325 xCloser(sCtx.in);
16326 sqlite3_free(sCtx.z);
16327 sqlite3_finalize(pStmt);
16328 if( needCommit ) sqlite3_exec(p->db, "COMMIT", 0, 0, 0);
16329 }else
16330
16331#ifndef SQLITE_UNTESTABLE
16332 if( c=='i' && strncmp(azArg[0], "imposter", n)==0 ){
16333 char *zSql;
16334 char *zCollist = 0;
16335 sqlite3_stmt *pStmt;
16336 int tnum = 0;

--- 262 unchanged lines hidden (view full) ---

16599 sqlite3_snprintf(sizeof(p->nullValue), p->nullValue,
16600 "%.*s", (int)ArraySize(p->nullValue)-1, azArg[1]);
16601 }else{
16602 raw_printf(stderr, "Usage: .nullvalue STRING\n");
16603 rc = 1;
16604 }
16605 }else
16606
16607 if( c=='o' && strncmp(azArg[0], "open", n)==0 && n>=2 ){
16608 char *zNewFilename; /* Name of the database file to open */
16609 int iName = 1; /* Index in azArg[] of the filename */
16610 int newFlag = 0; /* True to delete file before opening */
16611 /* Close the existing database */
16612 session_close_all(p);
16613 close_db(p->db);
16614 p->db = 0;

--- 51 unchanged lines hidden (view full) ---

16666 open_db(p, 0);
16667 }
16668 }else
16669
16670 if( (c=='o'
16671 && (strncmp(azArg[0], "output", n)==0||strncmp(azArg[0], "once", n)==0))
16672 || (c=='e' && n==5 && strcmp(azArg[0],"excel")==0)
16673 ){
16674 const char *zFile = nArg>=2 ? azArg[1] : "stdout";
16675 int bTxtMode = 0;
16676 if( azArg[0][0]=='e' ){
16677 /* Transform the ".excel" command into ".once -x" */
16678 nArg = 2;
16679 azArg[0] = "once";
16680 zFile = azArg[1] = "-x";
16681 n = 4;
16682 }
16683 if( nArg>2 ){
16684 utf8_printf(stderr, "Usage: .%s [-e|-x|FILE]\n", azArg[0]);
16685 rc = 1;
16686 goto meta_command_exit;
16687 }
16688 if( n>1 && strncmp(azArg[0], "once", n)==0 ){
16689 if( nArg<2 ){
16690 raw_printf(stderr, "Usage: .once (-e|-x|FILE)\n");
16691 rc = 1;
16692 goto meta_command_exit;
16693 }
16694 p->outCount = 2;
16695 }else{
16696 p->outCount = 0;
16697 }
16698 output_reset(p);
16699 if( zFile[0]=='-' && zFile[1]=='-' ) zFile++;
16700#ifndef SQLITE_NOHAVE_SYSTEM
16701 if( strcmp(zFile, "-e")==0 || strcmp(zFile, "-x")==0 ){
16702 p->doXdgOpen = 1;
16703 outputModePush(p);
16704 if( zFile[1]=='x' ){
16705 newTempFile(p, "csv");
16706 p->mode = MODE_Csv;
16707 sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Comma);
16708 sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_CrLf);
16709 }else{
16710 newTempFile(p, "txt");
16711 bTxtMode = 1;
16712 }
16713 zFile = p->zTempFile;
16714 }
16715#endif /* SQLITE_NOHAVE_SYSTEM */
16716 if( zFile[0]=='|' ){
16717#ifdef SQLITE_OMIT_POPEN
16718 raw_printf(stderr, "Error: pipes are not supported in this OS\n");
16719 rc = 1;
16720 p->out = stdout;
16721#else
16722 p->out = popen(zFile + 1, "w");
16723 if( p->out==0 ){
16724 utf8_printf(stderr,"Error: cannot open pipe \"%s\"\n", zFile + 1);
16725 p->out = stdout;
16726 rc = 1;
16727 }else{
16728 sqlite3_snprintf(sizeof(p->outfile), p->outfile, "%s", zFile);
16729 }
16730#endif
16731 }else{
16732 p->out = output_file_open(zFile, bTxtMode);
16733 if( p->out==0 ){
16734 if( strcmp(zFile,"off")!=0 ){
16735 utf8_printf(stderr,"Error: cannot write to \"%s\"\n", zFile);
16736 }
16737 p->out = stdout;
16738 rc = 1;
16739 } else {
16740 sqlite3_snprintf(sizeof(p->outfile), p->outfile, "%s", zFile);
16741 }
16742 }
16743 }else
16744
16745 if( c=='p' && n>=3 && strncmp(azArg[0], "parameter", n)==0 ){
16746 open_db(p,0);
16747 if( nArg<=1 ) goto parameter_syntax_error;

--- 1047 unchanged lines hidden (view full) ---

17795 { "optimizations", SQLITE_TESTCTRL_OPTIMIZATIONS, "DISABLE-MASK" },
17796#ifdef YYCOVERAGE
17797 { "parser_coverage", SQLITE_TESTCTRL_PARSER_COVERAGE, "" },
17798#endif
17799 { "pending_byte", SQLITE_TESTCTRL_PENDING_BYTE, "OFFSET " },
17800 { "prng_restore", SQLITE_TESTCTRL_PRNG_RESTORE, "" },
17801 { "prng_save", SQLITE_TESTCTRL_PRNG_SAVE, "" },
17802 { "prng_seed", SQLITE_TESTCTRL_PRNG_SEED, "SEED ?db?" },
17803 { "reserve", SQLITE_TESTCTRL_RESERVE, "BYTES-OF-RESERVE"},
17804 };
17805 int testctrl = -1;
17806 int iCtrl = -1;
17807 int rc2 = 0; /* 0: usage. 1: %d 2: %x 3: no-output */
17808 int isOk = 0;
17809 int i, n2;
17810 const char *zCmd = 0;
17811

--- 36 unchanged lines hidden (view full) ---

17848 if( testctrl<0 ){
17849 utf8_printf(stderr,"Error: unknown test-control: %s\n"
17850 "Use \".testctrl --help\" for help\n", zCmd);
17851 }else{
17852 switch(testctrl){
17853
17854 /* sqlite3_test_control(int, db, int) */
17855 case SQLITE_TESTCTRL_OPTIMIZATIONS:
17856 case SQLITE_TESTCTRL_RESERVE:
17857 if( nArg==3 ){
17858 int opt = (int)strtol(azArg[2], 0, 0);
17859 rc2 = sqlite3_test_control(testctrl, p->db, opt);
17860 isOk = 3;
17861 }
17862 break;
17863
17864 /* sqlite3_test_control(int) */

--- 755 unchanged lines hidden (view full) ---

18620 sqlite3_snprintf(sizeof(continuePrompt), continuePrompt," ...> ");
18621}
18622
18623/*
18624** Output text to the console in a font that attracts extra attention.
18625*/
18626#ifdef _WIN32
18627static void printBold(const char *zText){
18628 HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE);
18629 CONSOLE_SCREEN_BUFFER_INFO defaultScreenInfo;
18630 GetConsoleScreenBufferInfo(out, &defaultScreenInfo);
18631 SetConsoleTextAttribute(out,
18632 FOREGROUND_RED|FOREGROUND_INTENSITY
18633 );
18634 printf("%s", zText);
18635 SetConsoleTextAttribute(out, defaultScreenInfo.wAttributes);
18636}
18637#else
18638static void printBold(const char *zText){
18639 printf("\033[1m%s\033[0m", zText);
18640}
18641#endif
18642
18643/*

--- 38 unchanged lines hidden (view full) ---

18682 int argcToFree = 0;
18683#endif
18684
18685 setBinaryMode(stdin, 0);
18686 setvbuf(stderr, 0, _IONBF, 0); /* Make sure stderr is unbuffered */
18687 stdin_is_interactive = isatty(0);
18688 stdout_is_console = isatty(1);
18689
18690#if !defined(_WIN32_WCE)
18691 if( getenv("SQLITE_DEBUG_BREAK") ){
18692 if( isatty(0) && isatty(2) ){
18693 fprintf(stderr,
18694 "attach debugger to process %d and press any key to continue.\n",
18695 GETPID());
18696 fgetc(stdin);
18697 }else{
18698#if defined(_WIN32) || defined(WIN32)
18699 DebugBreak();
18700#elif defined(SIGTRAP)
18701 raise(SIGTRAP);
18702#endif
18703 }
18704 }
18705#endif
18706
18707#if USE_SYSTEM_SQLITE+0!=1

--- 474 unchanged lines hidden ---