From 636bf9f768347efec1342d45244719981df03fcf Mon Sep 17 00:00:00 2001 From: mistachkin Date: Sat, 19 Jul 2014 20:15:16 +0000 Subject: [PATCH 01/34] Add new ASCII mode to the shell capable of importing and exporting using the official unit and record separators (i.e. 0x1F and 0x1E, respectively). FossilOrigin-Name: 7fe601ead0d0ae26cb09d0dbc7d6367785376567 --- manifest | 21 +-- manifest.uuid | 2 +- src/shell.c | 344 +++++++++++++++++++++++++++++++++-------------- test/shell1.test | 46 +++++-- test/shell5.test | 39 +++++- 5 files changed, 328 insertions(+), 124 deletions(-) diff --git a/manifest b/manifest index 9c16ebe0d5..2bcc380e41 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Update\sthe\ssqlite3_stmt_busy()\sfunction\sso\sthat\sit\scorrectly\sreturns\strue\sfor\s"ROLLBACK"\sstatements\sthat\shave\sbeen\sstepped\sbut\snot\syet\sreset. -D 2014-07-19T17:57:10.785 +C Add\snew\sASCII\smode\sto\sthe\sshell\scapable\sof\simporting\sand\sexporting\susing\sthe\sofficial\sunit\sand\srecord\sseparators\s(i.e.\s0x1F\sand\s0x1E,\srespectively). +D 2014-07-19T20:15:16.631 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5eb79e334a5de69c87740edd56af6527dd219308 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -223,7 +223,7 @@ F src/random.c d10c1f85b6709ca97278428fd5db5bbb9c74eece F src/resolve.c 5fc110baeacf120a73fe34e103f052632ff11a02 F src/rowset.c a9c9aae3234b44a6d7c6f5a3cadf90dce1e627be F src/select.c 6762c62e11b504aa014edceab8886495165e3a77 -F src/shell.c 566aee8213372a2e81ba0eb34e9759f7b2574009 +F src/shell.c f1524cdcf12af7eeff98c7846518ce5424d38d60 F src/sqlite.h.in fd8e3a36b0aded082dc93a4b89c1e85324b4cf75 F src/sqlite3.rc 11094cc6a157a028b301a9f06b3d03089ea37c3e F src/sqlite3ext.h 886f5a34de171002ad46fae8c36a7d8051c190fc @@ -818,11 +818,11 @@ F test/shared9.test 5f2a8f79b4d6c7d107a01ffa1ed05ae7e6333e21 F test/sharedA.test 0cdf1a76dfa00e6beee66af5b534b1e8df2720f5 F test/shared_err.test 0079c05c97d88cfa03989b7c20a8b266983087aa F test/sharedlock.test 5ede3c37439067c43b0198f580fd374ebf15d304 -F test/shell1.test fb080d67c81e8a80a79ea04b36f127209b5bd112 +F test/shell1.test 4e4f8e6be18384f0bde93acc01947d7217e81774 F test/shell2.test c57da3a381c099b02c813ba156298d5c2f5c93a3 F test/shell3.test 5e8545ec72c4413a0e8d4c6be56496e3c257ca29 F test/shell4.test 8a9c08976291e6c6c808b4d718f4a8b299f339f5 -F test/shell5.test ef0c52952a4a96dc1d9ec3b1fa81ec897ca48154 +F test/shell5.test 3c9264ddf171d778d7d93bda5eea0bafe8a65069 F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3 F test/show_speedtest1_rtree.tcl 32e6c5f073d7426148a6936a0408f4b5b169aba5 F test/shrink.test 8c70f62b6e8eb4d54533de6d65bd06b1b9a17868 @@ -1182,7 +1182,10 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 574cc8eb1448cff67390f2e16cc9b7c3ddd4658b -R 3e17c7c287ebc0f7c8d4dc519939fd8f -U dan -Z 2190a4b1d8dc0a3facc078eb683578eb +P 61cee3c0678f5abd9131a29ab946a5e71f55643e +R 2620c0e44150895c6e6dda7db94cda7b +T *branch * asciiMode +T *sym-asciiMode * +T -sym-trunk * +U mistachkin +Z 0122ab3028becc4213d4d02208439f07 diff --git a/manifest.uuid b/manifest.uuid index 5e45c34d1e..7ba436b017 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -61cee3c0678f5abd9131a29ab946a5e71f55643e \ No newline at end of file +7fe601ead0d0ae26cb09d0dbc7d6367785376567 \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index 97167dc877..bae22d56a6 100644 --- a/src/shell.c +++ b/src/shell.c @@ -457,7 +457,8 @@ struct callback_data { int writableSchema; /* True if PRAGMA writable_schema=ON */ int showHeader; /* True to show column names in List or Column mode */ char *zDestTable; /* Name of destination table when MODE_Insert */ - char separator[20]; /* Separator character for MODE_List */ + char colSeparator[20]; /* Column separator character for several modes */ + char rowSeparator[20]; /* Row separator character for MODE_Ascii */ int colWidth[100]; /* Requested width of each column when in column mode*/ int actualWidth[100]; /* Actual width of each column */ char nullvalue[20]; /* The text to print when a NULL comes back from @@ -488,6 +489,7 @@ struct callback_data { #define MODE_Tcl 6 /* Generate ANSI-C or TCL quoted elements */ #define MODE_Csv 7 /* Quote strings, numbers are plain */ #define MODE_Explain 8 /* Like MODE_Column, but do not truncate data */ +#define MODE_Ascii 9 /* Use ASCII unit and record separators (0x1F/0x1E) */ static const char *modeDescr[] = { "line", @@ -499,8 +501,16 @@ static const char *modeDescr[] = { "tcl", "csv", "explain", + "ascii", }; +/* +** These are the column/row separators used by the ASCII mode. +*/ +#define SEP_Line "\n" +#define SEP_Column "\x1F" +#define SEP_Row "\x1E" + /* ** Number of elements in an array */ @@ -667,11 +677,11 @@ static void output_csv(struct callback_data *p, const char *z, int bSep){ fprintf(out,"%s",p->nullvalue); }else{ int i; - int nSep = strlen30(p->separator); + int nSep = strlen30(p->colSeparator); for(i=0; z[i]; i++){ if( needCsvQuote[((unsigned char*)z)[i]] - || (z[i]==p->separator[0] && - (nSep==1 || memcmp(z, p->separator, nSep)==0)) ){ + || (z[i]==p->colSeparator[0] && + (nSep==1 || memcmp(z, p->colSeparator, nSep)==0)) ){ i = 0; break; } @@ -688,7 +698,7 @@ static void output_csv(struct callback_data *p, const char *z, int bSep){ } } if( bSep ){ - fprintf(p->out, "%s", p->separator); + fprintf(p->out, "%s", p->colSeparator); } } @@ -720,10 +730,10 @@ static int shell_callback(void *pArg, int nArg, char **azArg, char **azCol, int int len = strlen30(azCol[i] ? azCol[i] : ""); if( len>w ) w = len; } - if( p->cnt++>0 ) fprintf(p->out,"\n"); + if( p->cnt++>0 ) fprintf(p->out, "%s", p->rowSeparator); for(i=0; iout,"%*s = %s\n", w, azCol[i], - azArg[i] ? azArg[i] : p->nullvalue); + fprintf(p->out,"%*s = %s%s", w, azCol[i], + azArg[i] ? azArg[i] : p->nullvalue, p->rowSeparator); } break; } @@ -748,9 +758,11 @@ static int shell_callback(void *pArg, int nArg, char **azArg, char **azCol, int } if( p->showHeader ){ if( w<0 ){ - fprintf(p->out,"%*.*s%s",-w,-w,azCol[i], i==nArg-1 ? "\n": " "); + fprintf(p->out,"%*.*s%s",-w,-w,azCol[i], + i==nArg-1 ? p->rowSeparator : " "); }else{ - fprintf(p->out,"%-*.*s%s",w,w,azCol[i], i==nArg-1 ? "\n": " "); + fprintf(p->out,"%-*.*s%s",w,w,azCol[i], + i==nArg-1 ? p->rowSeparator : " "); } } } @@ -765,7 +777,7 @@ static int shell_callback(void *pArg, int nArg, char **azArg, char **azCol, int } fprintf(p->out,"%-*.*s%s",w,w,"-----------------------------------" "----------------------------------------------------------", - i==nArg-1 ? "\n": " "); + i==nArg-1 ? p->rowSeparator : " "); } } } @@ -788,10 +800,12 @@ static int shell_callback(void *pArg, int nArg, char **azArg, char **azCol, int } if( w<0 ){ fprintf(p->out,"%*.*s%s",-w,-w, - azArg[i] ? azArg[i] : p->nullvalue, i==nArg-1 ? "\n": " "); + azArg[i] ? azArg[i] : p->nullvalue, + i==nArg-1 ? p->rowSeparator : " "); }else{ fprintf(p->out,"%-*.*s%s",w,w, - azArg[i] ? azArg[i] : p->nullvalue, i==nArg-1 ? "\n": " "); + azArg[i] ? azArg[i] : p->nullvalue, + i==nArg-1 ? p->rowSeparator : " "); } } break; @@ -800,7 +814,8 @@ static int shell_callback(void *pArg, int nArg, char **azArg, char **azCol, int case MODE_List: { if( p->cnt++==0 && p->showHeader ){ for(i=0; iout,"%s%s",azCol[i], i==nArg-1 ? "\n" : p->separator); + fprintf(p->out,"%s%s",azCol[i], + i==nArg-1 ? p->rowSeparator : p->colSeparator); } } if( azArg==0 ) break; @@ -809,11 +824,11 @@ static int shell_callback(void *pArg, int nArg, char **azArg, char **azCol, int if( z==0 ) z = p->nullvalue; fprintf(p->out, "%s", z); if( iout, "%s", p->separator); + fprintf(p->out, "%s", p->colSeparator); }else if( p->mode==MODE_Semi ){ - fprintf(p->out, ";\n"); + fprintf(p->out, ";%s", p->rowSeparator); }else{ - fprintf(p->out, "\n"); + fprintf(p->out, "%s", p->rowSeparator); } } break; @@ -842,16 +857,16 @@ static int shell_callback(void *pArg, int nArg, char **azArg, char **azCol, int if( p->cnt++==0 && p->showHeader ){ for(i=0; iout,azCol[i] ? azCol[i] : ""); - if(iout, "%s", p->separator); + if(iout, "%s", p->colSeparator); } - fprintf(p->out,"\n"); + fprintf(p->out, "%s", p->rowSeparator); } if( azArg==0 ) break; for(i=0; iout, azArg[i] ? azArg[i] : p->nullvalue); - if(iout, "%s", p->separator); + if(iout, "%s", p->colSeparator); } - fprintf(p->out,"\n"); + fprintf(p->out, "%s", p->rowSeparator); break; } case MODE_Csv: { @@ -859,13 +874,13 @@ static int shell_callback(void *pArg, int nArg, char **azArg, char **azCol, int for(i=0; iout,"\n"); + fprintf(p->out, "%s", p->rowSeparator); } if( azArg==0 ) break; for(i=0; iout,"\n"); + fprintf(p->out, "%s", p->rowSeparator); break; } case MODE_Insert: { @@ -897,6 +912,22 @@ static int shell_callback(void *pArg, int nArg, char **azArg, char **azCol, int fprintf(p->out,");\n"); break; } + case MODE_Ascii: { + if( p->cnt++==0 && p->showHeader ){ + for(i=0; i0 ) fprintf(p->out, "%s", p->colSeparator); + fprintf(p->out,"%s",azCol[i] ? azCol[i] : ""); + } + fprintf(p->out, "%s", p->rowSeparator); + } + if( azArg==0 ) break; + for(i=0; i0 ) fprintf(p->out, "%s", p->colSeparator); + fprintf(p->out,"%s",azArg[i] ? azArg[i] : p->nullvalue); + } + fprintf(p->out, "%s", p->rowSeparator); + break; + } } return 0; } @@ -1574,6 +1605,7 @@ static char zHelp[] = ".backup ?DB? FILE Backup DB (default \"main\") to FILE\n" ".bail on|off Stop after hitting an error. Default OFF\n" ".clone NEWDB Clone data into NEWDB from the existing database\n" + ".colseparator STRING This is an alias for .separator\n" ".databases List names and files of attached databases\n" ".dump ?TABLE? ... Dump the database in an SQL text format\n" " If TABLE specified, only dump tables matching\n" @@ -1598,6 +1630,7 @@ static char zHelp[] = #endif ".log FILE|off Turn logging on or off. FILE can be stderr/stdout\n" ".mode MODE ?TABLE? Set output mode where MODE is one of:\n" + " ascii Columns/rows delimited with 0x1F and 0x1E\n" " csv Comma-separated values\n" " column Left-aligned columns. (See .width)\n" " html HTML code\n" @@ -1615,11 +1648,12 @@ static char zHelp[] = ".quit Exit this program\n" ".read FILENAME Execute SQL in FILENAME\n" ".restore ?DB? FILE Restore content of DB (default \"main\") from FILE\n" + ".rowseparator STRING Change row separator for output mode and .import\n" ".save FILE Write in-memory database into FILE\n" ".schema ?TABLE? Show the CREATE statements\n" " If TABLE specified, only show tables matching\n" " LIKE pattern TABLE.\n" - ".separator STRING Change separator used by output mode and .import\n" + ".separator STRING Change column separator for output mode and .import\n" ".shell CMD ARGS... Run CMD ARGS... in a system shell\n" ".show Show the current values for various settings\n" ".stats on|off Turn stats on or off\n" @@ -1832,10 +1866,10 @@ static void test_breakpoint(void){ } /* -** An object used to read a CSV file +** An object used to read a CSV and other files for import. */ -typedef struct CSVReader CSVReader; -struct CSVReader { +typedef struct ImportCtx ImportCtx; +struct ImportCtx { const char *zFile; /* Name of the input file */ FILE *in; /* Read the CSV text from this input stream */ char *z; /* Accumulated text for a field */ @@ -1843,11 +1877,12 @@ struct CSVReader { int nAlloc; /* Space allocated for z[] */ int nLine; /* Current line number */ int cTerm; /* Character that terminated the most recent field */ - int cSeparator; /* The separator character. (Usually ",") */ + int cColSep; /* The column separator character. (Usually ",") */ + int cRowSep; /* The row separator character. (Usually "\n") */ }; /* Append a single byte to z[] */ -static void csv_append_char(CSVReader *p, int c){ +static void import_append_char(ImportCtx *p, int c){ if( p->n+1>=p->nAlloc ){ p->nAlloc += p->nAlloc + 100; p->z = sqlite3_realloc(p->z, p->nAlloc); @@ -1865,15 +1900,17 @@ static void csv_append_char(CSVReader *p, int c){ ** + Input comes from p->in. ** + Store results in p->z of length p->n. Space to hold p->z comes ** from sqlite3_malloc(). -** + Use p->cSep as the separator. The default is ",". +** + Use p->cSep as the column separator. The default is ",". +** + Use p->rSep as the row separator. The default is "\n". ** + Keep track of the line number in p->nLine. ** + Store the character that terminates the field in p->cTerm. Store ** EOF on end-of-file. ** + Report syntax errors on stderr */ -static char *csv_read_one_field(CSVReader *p){ - int c, pc, ppc; - int cSep = p->cSeparator; +static char *csv_read_one_field(ImportCtx *p){ + int c; + int cSep = p->cColSep; + int rSep = p->cRowSep; p->n = 0; c = fgetc(p->in); if( c==EOF || seenInterrupt ){ @@ -1881,12 +1918,13 @@ static char *csv_read_one_field(CSVReader *p){ return 0; } if( c=='"' ){ + int pc, ppc; int startLine = p->nLine; int cQuote = c; pc = ppc = 0; while( 1 ){ c = fgetc(p->in); - if( c=='\n' ) p->nLine++; + if( c==rSep ) p->nLine++; if( c==cQuote ){ if( pc==cQuote ){ pc = 0; @@ -1894,8 +1932,8 @@ static char *csv_read_one_field(CSVReader *p){ } } if( (c==cSep && pc==cQuote) - || (c=='\n' && pc==cQuote) - || (c=='\n' && pc=='\r' && ppc==cQuote) + || (c==rSep && pc==cQuote) + || (c==rSep && pc=='\r' && ppc==cQuote) || (c==EOF && pc==cQuote) ){ do{ p->n--; }while( p->z[p->n]!=cQuote ); @@ -1909,19 +1947,19 @@ static char *csv_read_one_field(CSVReader *p){ if( c==EOF ){ fprintf(stderr, "%s:%d: unterminated %c-quoted field\n", p->zFile, startLine, cQuote); - p->cTerm = EOF; + p->cTerm = c; break; } - csv_append_char(p, c); + import_append_char(p, c); ppc = pc; pc = c; } }else{ - while( c!=EOF && c!=cSep && c!='\n' ){ - csv_append_char(p, c); + while( c!=EOF && c!=cSep && c!=rSep ){ + import_append_char(p, c); c = fgetc(p->in); } - if( c=='\n' ){ + if( c==rSep ){ p->nLine++; if( p->n>0 && p->z[p->n-1]=='\r' ) p->n--; } @@ -1931,6 +1969,40 @@ static char *csv_read_one_field(CSVReader *p){ return p->z; } +/* Read a single field of ASCII delimited text. +** +** + Input comes from p->in. +** + Store results in p->z of length p->n. Space to hold p->z comes +** from sqlite3_malloc(). +** + Use p->cSep as the column separator. The default is "\x1F". +** + Use p->rSep as the row separator. The default is "\x1E". +** + Keep track of the row number in p->nLine. +** + Store the character that terminates the field in p->cTerm. Store +** EOF on end-of-file. +** + Report syntax errors on stderr +*/ +static char *ascii_read_one_field(ImportCtx *p){ + int c; + int cSep = p->cColSep; + int rSep = p->cRowSep; + p->n = 0; + c = fgetc(p->in); + if( c==EOF || seenInterrupt ){ + p->cTerm = EOF; + return 0; + } + while( c!=EOF && c!=cSep && c!=rSep ){ + import_append_char(p, c); + c = fgetc(p->in); + } + if( c==rSep ){ + p->nLine++; + } + p->cTerm = c; + if( p->z ) p->z[p->n] = 0; + return p->z; +} + /* ** Try to transfer data for table zTable. If an error is seen while ** moving forward, try to go backwards. The backwards movement won't @@ -2485,9 +2557,10 @@ static int do_meta_command(char *zLine, struct callback_data *p){ int nByte; /* Number of bytes in an SQL string */ int i, j; /* Loop counters */ int needCommit; /* True to COMMIT or ROLLBACK at end */ - int nSep; /* Number of bytes in p->separator[] */ + int nSep; /* Number of bytes in p->colSeparator[] */ char *zSql; /* An SQL statement */ - CSVReader sCsv; /* Reader context */ + ImportCtx sCtx; /* Reader context */ + char *(*xRead)(ImportCtx*); /* Procecure to read one value */ int (*xCloser)(FILE*); /* Procedure to close th3 connection */ if( nArg!=3 ){ @@ -2497,55 +2570,71 @@ static int do_meta_command(char *zLine, struct callback_data *p){ zFile = azArg[1]; zTable = azArg[2]; seenInterrupt = 0; - memset(&sCsv, 0, sizeof(sCsv)); + memset(&sCtx, 0, sizeof(sCtx)); open_db(p, 0); - nSep = strlen30(p->separator); + nSep = strlen30(p->colSeparator); if( nSep==0 ){ - fprintf(stderr, "Error: non-null separator required for import\n"); + fprintf(stderr, "Error: non-null column separator required for import\n"); return 1; } if( nSep>1 ){ - fprintf(stderr, "Error: multi-character separators not allowed" + fprintf(stderr, "Error: multi-character column separators not allowed" " for import\n"); return 1; } - sCsv.zFile = zFile; - sCsv.nLine = 1; - if( sCsv.zFile[0]=='|' ){ - sCsv.in = popen(sCsv.zFile+1, "r"); - sCsv.zFile = ""; + nSep = strlen30(p->rowSeparator); + if( nSep==0 ){ + fprintf(stderr, "Error: non-null row separator required for import\n"); + return 1; + } + if( nSep>1 ){ + fprintf(stderr, "Error: multi-character row separators not allowed" + " for import\n"); + return 1; + } + sCtx.zFile = zFile; + sCtx.nLine = 1; + if( sCtx.zFile[0]=='|' ){ + sCtx.in = popen(sCtx.zFile+1, "r"); + sCtx.zFile = ""; xCloser = pclose; }else{ - sCsv.in = fopen(sCsv.zFile, "rb"); + sCtx.in = fopen(sCtx.zFile, "rb"); xCloser = fclose; } - if( sCsv.in==0 ){ + if( p->mode==MODE_Ascii ){ + xRead = ascii_read_one_field; + }else{ + xRead = csv_read_one_field; + } + if( sCtx.in==0 ){ fprintf(stderr, "Error: cannot open \"%s\"\n", zFile); return 1; } - sCsv.cSeparator = p->separator[0]; + sCtx.cColSep = p->colSeparator[0]; + sCtx.cRowSep = p->rowSeparator[0]; zSql = sqlite3_mprintf("SELECT * FROM %s", zTable); if( zSql==0 ){ fprintf(stderr, "Error: out of memory\n"); - xCloser(sCsv.in); + xCloser(sCtx.in); return 1; } nByte = strlen30(zSql); rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); - csv_append_char(&sCsv, 0); /* To ensure sCsv.z is allocated */ + import_append_char(&sCtx, 0); /* To ensure sCtx.z is allocated */ if( rc && sqlite3_strglob("no such table: *", sqlite3_errmsg(db))==0 ){ char *zCreate = sqlite3_mprintf("CREATE TABLE %s", zTable); char cSep = '('; - while( csv_read_one_field(&sCsv) ){ - zCreate = sqlite3_mprintf("%z%c\n \"%s\" TEXT", zCreate, cSep, sCsv.z); + while( xRead(&sCtx) ){ + zCreate = sqlite3_mprintf("%z%c\n \"%s\" TEXT", zCreate, cSep, sCtx.z); cSep = ','; - if( sCsv.cTerm!=sCsv.cSeparator ) break; + if( sCtx.cTerm!=sCtx.cColSep ) break; } if( cSep=='(' ){ sqlite3_free(zCreate); - sqlite3_free(sCsv.z); - xCloser(sCsv.in); - fprintf(stderr,"%s: empty file\n", sCsv.zFile); + sqlite3_free(sCtx.z); + xCloser(sCtx.in); + fprintf(stderr,"%s: empty file\n", sCtx.zFile); return 1; } zCreate = sqlite3_mprintf("%z\n)", zCreate); @@ -2554,8 +2643,8 @@ static int do_meta_command(char *zLine, struct callback_data *p){ if( rc ){ fprintf(stderr, "CREATE TABLE %s(...) failed: %s\n", zTable, sqlite3_errmsg(db)); - sqlite3_free(sCsv.z); - xCloser(sCsv.in); + sqlite3_free(sCtx.z); + xCloser(sCtx.in); return 1; } rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); @@ -2564,7 +2653,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){ if( rc ){ if (pStmt) sqlite3_finalize(pStmt); fprintf(stderr,"Error: %s\n", sqlite3_errmsg(db)); - xCloser(sCsv.in); + xCloser(sCtx.in); return 1; } nCol = sqlite3_column_count(pStmt); @@ -2574,7 +2663,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){ zSql = sqlite3_malloc( nByte*2 + 20 + nCol*2 ); if( zSql==0 ){ fprintf(stderr, "Error: out of memory\n"); - xCloser(sCsv.in); + xCloser(sCtx.in); return 1; } sqlite3_snprintf(nByte+20, zSql, "INSERT INTO \"%w\" VALUES(?", zTable); @@ -2590,46 +2679,56 @@ static int do_meta_command(char *zLine, struct callback_data *p){ if( rc ){ fprintf(stderr, "Error: %s\n", sqlite3_errmsg(db)); if (pStmt) sqlite3_finalize(pStmt); - xCloser(sCsv.in); + xCloser(sCtx.in); return 1; } needCommit = sqlite3_get_autocommit(db); if( needCommit ) sqlite3_exec(db, "BEGIN", 0, 0, 0); do{ - int startLine = sCsv.nLine; + int startLine = sCtx.nLine; for(i=0; imode==MODE_Ascii && (z==0 || z[0]==0) && i==0 ) break; sqlite3_bind_text(pStmt, i+1, z, -1, SQLITE_TRANSIENT); - if( i=nCol ){ sqlite3_step(pStmt); rc = sqlite3_reset(pStmt); if( rc!=SQLITE_OK ){ - fprintf(stderr, "%s:%d: INSERT failed: %s\n", sCsv.zFile, startLine, + fprintf(stderr, "%s:%d: INSERT failed: %s\n", sCtx.zFile, startLine, sqlite3_errmsg(db)); } } - }while( sCsv.cTerm!=EOF ); + }while( sCtx.cTerm!=EOF ); - xCloser(sCsv.in); - sqlite3_free(sCsv.z); + xCloser(sCtx.in); + sqlite3_free(sCtx.z); sqlite3_finalize(pStmt); if( needCommit ) sqlite3_exec(db, "COMMIT", 0, 0, 0); }else @@ -2747,19 +2846,26 @@ static int do_meta_command(char *zLine, struct callback_data *p){ p->mode = MODE_Html; }else if( c2=='t' && strncmp(azArg[1],"tcl",n2)==0 ){ p->mode = MODE_Tcl; - sqlite3_snprintf(sizeof(p->separator), p->separator, " "); + sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, " "); + sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Line); }else if( c2=='c' && strncmp(azArg[1],"csv",n2)==0 ){ p->mode = MODE_Csv; - sqlite3_snprintf(sizeof(p->separator), p->separator, ","); + sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, ","); + sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Line); }else if( c2=='t' && strncmp(azArg[1],"tabs",n2)==0 ){ p->mode = MODE_List; - sqlite3_snprintf(sizeof(p->separator), p->separator, "\t"); + sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, "\t"); + sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Line); }else if( c2=='i' && strncmp(azArg[1],"insert",n2)==0 ){ p->mode = MODE_Insert; set_table_name(p, nArg>=3 ? azArg[2] : "table"); + }else if( c2=='a' && strncmp(azArg[1],"ascii",n2)==0 ){ + p->mode = MODE_Ascii; + sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Column); + sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row); }else { fprintf(stderr,"Error: mode should be one of: " - "column csv html insert line list tabs tcl\n"); + "ascii column csv html insert line list tabs tcl\n"); rc = 1; } }else @@ -3028,10 +3134,30 @@ static int do_meta_command(char *zLine, struct callback_data *p){ }else #endif + if( c=='r' && strncmp(azArg[0], "rowseparator", n)==0 ){ + if( nArg==2 ){ + sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, + "%.*s", (int)sizeof(p->rowSeparator)-1, azArg[1]); + }else{ + fprintf(stderr, "Usage: .rowseparator STRING\n"); + rc = 1; + } + }else + + if( c=='c' && strncmp(azArg[0], "colseparator", n)==0 ){ + if( nArg==2 ){ + sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, + "%.*s", (int)sizeof(p->colSeparator)-1, azArg[1]); + }else{ + fprintf(stderr, "Usage: .colseparator STRING\n"); + rc = 1; + } + }else + if( c=='s' && strncmp(azArg[0], "separator", n)==0 ){ if( nArg==2 ){ - sqlite3_snprintf(sizeof(p->separator), p->separator, - "%.*s", (int)sizeof(p->separator)-1, azArg[1]); + sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, + "%.*s", (int)sizeof(p->colSeparator)-1, azArg[1]); }else{ fprintf(stderr, "Usage: .separator STRING\n"); rc = 1; @@ -3064,21 +3190,24 @@ static int do_meta_command(char *zLine, struct callback_data *p){ rc = 1; goto meta_command_exit; } - fprintf(p->out,"%9.9s: %s\n","echo", p->echoOn ? "on" : "off"); - fprintf(p->out,"%9.9s: %s\n","eqp", p->autoEQP ? "on" : "off"); - fprintf(p->out,"%9.9s: %s\n","explain", p->explainPrev.valid ? "on" :"off"); - fprintf(p->out,"%9.9s: %s\n","headers", p->showHeader ? "on" : "off"); - fprintf(p->out,"%9.9s: %s\n","mode", modeDescr[p->mode]); - fprintf(p->out,"%9.9s: ", "nullvalue"); + fprintf(p->out,"%12.12s: %s\n","echo", p->echoOn ? "on" : "off"); + fprintf(p->out,"%12.12s: %s\n","eqp", p->autoEQP ? "on" : "off"); + fprintf(p->out,"%12.12s: %s\n","explain", p->explainPrev.valid ? "on" :"off"); + fprintf(p->out,"%12.12s: %s\n","headers", p->showHeader ? "on" : "off"); + fprintf(p->out,"%12.12s: %s\n","mode", modeDescr[p->mode]); + fprintf(p->out,"%12.12s: ", "nullvalue"); output_c_string(p->out, p->nullvalue); fprintf(p->out, "\n"); - fprintf(p->out,"%9.9s: %s\n","output", + fprintf(p->out,"%12.12s: %s\n","output", strlen30(p->outfile) ? p->outfile : "stdout"); - fprintf(p->out,"%9.9s: ", "separator"); - output_c_string(p->out, p->separator); + fprintf(p->out,"%12.12s: ", "colseparator"); + output_c_string(p->out, p->colSeparator); fprintf(p->out, "\n"); - fprintf(p->out,"%9.9s: %s\n","stats", p->statsOn ? "on" : "off"); - fprintf(p->out,"%9.9s: ","width"); + fprintf(p->out,"%12.12s: ", "rowseparator"); + output_c_string(p->out, p->rowSeparator); + fprintf(p->out, "\n"); + fprintf(p->out,"%12.12s: %s\n","stats", p->statsOn ? "on" : "off"); + fprintf(p->out,"%12.12s: ","width"); for (i=0;i<(int)ArraySize(p->colWidth) && p->colWidth[i] != 0;i++) { fprintf(p->out,"%d ",p->colWidth[i]); } @@ -3672,8 +3801,10 @@ static int process_sqliterc( ** Show available command line options */ static const char zOptions[] = + " -ascii set output mode to 'ascii'\n" " -bail stop after hitting an error\n" " -batch force batch I/O\n" + " -colseparator SEP same as -separator\n" " -column set output mode to 'column'\n" " -cmd COMMAND run \"COMMAND\" before reading stdin\n" " -csv set output mode to 'csv'\n" @@ -3693,6 +3824,7 @@ static const char zOptions[] = " -multiplex enable the multiplexor VFS\n" #endif " -nullvalue TEXT set text string for NULL values. Default ''\n" + " -rowseparator SEP set output line separator. Default: '\\n'\n" " -separator SEP set output field separator. Default: '|'\n" " -stats print memory stats before each finalize\n" " -version show SQLite version\n" @@ -3720,7 +3852,8 @@ static void usage(int showDetail){ static void main_init(struct callback_data *data) { memset(data, 0, sizeof(*data)); data->mode = MODE_List; - memcpy(data->separator,"|", 2); + memcpy(data->colSeparator,"|", 2); + memcpy(data->rowSeparator,"\n", 2); data->showHeader = 0; sqlite3_config(SQLITE_CONFIG_URI, 1); sqlite3_config(SQLITE_CONFIG_LOG, shellLog, data); @@ -3918,9 +4051,18 @@ int main(int argc, char **argv){ data.mode = MODE_Column; }else if( strcmp(z,"-csv")==0 ){ data.mode = MODE_Csv; - memcpy(data.separator,",",2); - }else if( strcmp(z,"-separator")==0 ){ - sqlite3_snprintf(sizeof(data.separator), data.separator, + memcpy(data.colSeparator,",",2); + }else if( strcmp(z,"-ascii")==0 ){ + data.mode = MODE_Ascii; + sqlite3_snprintf(sizeof(data.colSeparator), data.colSeparator, + SEP_Column); + sqlite3_snprintf(sizeof(data.rowSeparator), data.rowSeparator, + SEP_Row); + }else if( strcmp(z,"-separator")==0 || strcmp(z,"-colseparator")==0 ){ + sqlite3_snprintf(sizeof(data.colSeparator), data.colSeparator, + "%s",cmdline_option_value(argc,argv,++i)); + }else if( strcmp(z,"-rowseparator")==0 ){ + sqlite3_snprintf(sizeof(data.rowSeparator), data.rowSeparator, "%s",cmdline_option_value(argc,argv,++i)); }else if( strcmp(z,"-nullvalue")==0 ){ sqlite3_snprintf(sizeof(data.nullvalue), data.nullvalue, diff --git a/test/shell1.test b/test/shell1.test index e6fb0c28d2..9c7190e007 100644 --- a/test/shell1.test +++ b/test/shell1.test @@ -206,10 +206,10 @@ do_test shell1-2.2.4 { } {0 {}} do_test shell1-2.2.5 { catchcmd "test.db" ".mode \"insert FOO" -} {1 {Error: mode should be one of: column csv html insert line list tabs tcl}} +} {1 {Error: mode should be one of: ascii column csv html insert line list tabs tcl}} do_test shell1-2.2.6 { catchcmd "test.db" ".mode \'insert FOO" -} {1 {Error: mode should be one of: column csv html insert line list tabs tcl}} +} {1 {Error: mode should be one of: ascii column csv html insert line list tabs tcl}} # check multiple tokens, and quoted tokens do_test shell1-2.3.1 { @@ -237,7 +237,7 @@ do_test shell1-2.3.7 { # check quoted args are unquoted do_test shell1-2.4.1 { catchcmd "test.db" ".mode FOO" -} {1 {Error: mode should be one of: column csv html insert line list tabs tcl}} +} {1 {Error: mode should be one of: ascii column csv html insert line list tabs tcl}} do_test shell1-2.4.2 { catchcmd "test.db" ".mode csv" } {0 {}} @@ -420,6 +420,7 @@ do_test shell1-3.12.3 { } {1 {Usage: .indices ?LIKE-PATTERN?}} # .mode MODE ?TABLE? Set output mode where MODE is one of: +# ascii Columns/rows delimited with 0x1F and 0x1E # csv Comma-separated values # column Left-aligned columns. (See .width) # html HTML
code @@ -430,10 +431,10 @@ do_test shell1-3.12.3 { # tcl TCL list elements do_test shell1-3.13.1 { catchcmd "test.db" ".mode" -} {1 {Error: mode should be one of: column csv html insert line list tabs tcl}} +} {1 {Error: mode should be one of: ascii column csv html insert line list tabs tcl}} do_test shell1-3.13.2 { catchcmd "test.db" ".mode FOO" -} {1 {Error: mode should be one of: column csv html insert line list tabs tcl}} +} {1 {Error: mode should be one of: ascii column csv html insert line list tabs tcl}} do_test shell1-3.13.3 { catchcmd "test.db" ".mode csv" } {0 {}} @@ -466,10 +467,10 @@ do_test shell1-3.13.11 { # don't allow partial mode type matches do_test shell1-3.13.12 { catchcmd "test.db" ".mode l" -} {1 {Error: mode should be one of: column csv html insert line list tabs tcl}} +} {1 {Error: mode should be one of: ascii column csv html insert line list tabs tcl}} do_test shell1-3.13.13 { catchcmd "test.db" ".mode li" -} {1 {Error: mode should be one of: column csv html insert line list tabs tcl}} +} {1 {Error: mode should be one of: ascii column csv html insert line list tabs tcl}} do_test shell1-3.13.14 { catchcmd "test.db" ".mode lin" } {0 {}} @@ -585,7 +586,7 @@ CREATE VIEW v2 AS SELECT x+1 AS y FROM t1; CREATE VIEW v1 AS SELECT y+1 FROM v2;}} db eval {DROP VIEW v1; DROP VIEW v2; DROP TABLE t1;} -# .separator STRING Change separator used by output mode and .import +# .separator STRING Change column separator used by output and .import do_test shell1-3.22.1 { catchcmd "test.db" ".separator" } {1 {Usage: .separator STRING}} @@ -606,10 +607,11 @@ do_test shell1-3.23.1 { [regexp {mode:} $res] \ [regexp {nullvalue:} $res] \ [regexp {output:} $res] \ - [regexp {separator:} $res] \ + [regexp {colseparator:} $res] \ + [regexp {rowseparator:} $res] \ [regexp {stats:} $res] \ [regexp {width:} $res] -} {1 1 1 1 1 1 1 1 1} +} {1 1 1 1 1 1 1 1 1 1} do_test shell1-3.23.2 { # too many arguments catchcmd "test.db" ".show BAD" @@ -809,4 +811,28 @@ do_test shell1-4.6 { ";" "$"} 7} +# .colseparator STRING Change column separator used by output and .import +do_test shell1-5.1.1 { + catchcmd "test.db" ".colseparator" +} {1 {Usage: .colseparator STRING}} +do_test shell1-5.1.2 { + catchcmd "test.db" ".colseparator FOO" +} {0 {}} +do_test shell1-5.1.3 { + # too many arguments + catchcmd "test.db" ".colseparator FOO BAD" +} {1 {Usage: .colseparator STRING}} + +# .rowseparator STRING Change row separator used by output and .import +do_test shell1-6.1.1 { + catchcmd "test.db" ".rowseparator" +} {1 {Usage: .rowseparator STRING}} +do_test shell1-6.1.2 { + catchcmd "test.db" ".rowseparator FOO" +} {0 {}} +do_test shell1-6.1.3 { + # too many arguments + catchcmd "test.db" ".rowseparator FOO BAD" +} {1 {Usage: .rowseparator STRING}} + finish_test diff --git a/test/shell5.test b/test/shell5.test index 6e9dd20639..4e11e8798b 100644 --- a/test/shell5.test +++ b/test/shell5.test @@ -64,10 +64,16 @@ do_test shell5-1.2.3 { catchcmd "test.db" ".separator FOO BAD" } {1 {Usage: .separator STRING}} -# separator should default to "|" -do_test shell5-1.3.1 { +# column separator should default to "|" +do_test shell5-1.3.1.1 { set res [catchcmd "test.db" ".show"] - list [regexp {separator: \"\|\"} $res] + list [regexp {colseparator: \"\|\"} $res] +} {1} + +# row separator should default to "\n" +do_test shell5-1.3.1.2 { + set res [catchcmd "test.db" ".show"] + list [regexp {rowseparator: \"\\n\"} $res] } {1} # set separator to different value. @@ -369,5 +375,32 @@ CREATE TABLE t4(a, b); db eval { SELECT * FROM t4 } } {xy\" hello one 2 {} {}} +#---------------------------------------------------------------------------- +# Tests for the shell "ascii" import/export mode. +# +do_test shell5-3.1 { + set fd [open shell5.csv w] + fconfigure $fd -encoding binary -translation binary + puts -nonewline $fd "\"test 1\"\x1F,test 2\r\n\x1E" + puts -nonewline $fd "test 3\x1Ftest 4\n" + close $fd + catchcmd test.db { +.mode ascii +CREATE TABLE t5(a, b); +.import shell5.csv t5 + } + db eval { SELECT * FROM t5 } +} "\{\"test 1\"} \{,test 2\r\n\} \{test 3\} \{test 4\n\}" + +# +# NOTE: This test ends up converting the "\r\n" to "\n\n" due +# to end-of-line translation on the "stdout" channel. +# +do_test shell5-3.2 { + catchcmd test.db { +.mode ascii +SELECT * FROM t5; + } +} "0 \{\"test 1\"\x1F,test 2\n\n\x1Etest 3\x1Ftest 4\n\x1E\}" finish_test From 486fd43fd848bb5003127bbdf51370dc6b9a5faf Mon Sep 17 00:00:00 2001 From: mistachkin Date: Thu, 24 Jul 2014 22:20:23 +0000 Subject: [PATCH 02/34] Fix typo in comment and update help text. FossilOrigin-Name: 289092bb64463efe78a5f01b06b24aa664a31feb --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/shell.c | 7 ++++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index 0a878d2dde..3db2a79fc6 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Merge\supdates\sfrom\strunk. -D 2014-07-24T22:13:12.489 +C Fix\stypo\sin\scomment\sand\supdate\shelp\stext. +D 2014-07-24T22:20:23.336 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5eb79e334a5de69c87740edd56af6527dd219308 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -223,7 +223,7 @@ F src/random.c d10c1f85b6709ca97278428fd5db5bbb9c74eece F src/resolve.c 5fc110baeacf120a73fe34e103f052632ff11a02 F src/rowset.c a9c9aae3234b44a6d7c6f5a3cadf90dce1e627be F src/select.c 6762c62e11b504aa014edceab8886495165e3a77 -F src/shell.c 3af679cad9c2e7caf7f8b997fb543afbc76d7c13 +F src/shell.c e1177e053e214be9c1549dac5bbcb2164b6114dd F src/sqlite.h.in ac4451c9da2771d2f4d702ef89722407242906d9 F src/sqlite3.rc 11094cc6a157a028b301a9f06b3d03089ea37c3e F src/sqlite3ext.h 886f5a34de171002ad46fae8c36a7d8051c190fc @@ -1184,7 +1184,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 7fe601ead0d0ae26cb09d0dbc7d6367785376567 fb1048cb2b613a0dbfe625a5df05e9dcd736a433 -R 551b1710cff332eae579e1d24ac340a5 +P 8dc0cdf652f099d464d3de416dffd83efb895009 +R df3c0e791329cbe951d92033daed226e U mistachkin -Z 5a827010d4d8351c000cbf9e79de9417 +Z b422ee17d0b3078b84860803513f7cb8 diff --git a/manifest.uuid b/manifest.uuid index 3cf998f636..27a93d5aad 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -8dc0cdf652f099d464d3de416dffd83efb895009 \ No newline at end of file +289092bb64463efe78a5f01b06b24aa664a31feb \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index 55b41662ea..78339db8b4 100644 --- a/src/shell.c +++ b/src/shell.c @@ -1623,7 +1623,8 @@ static char zHelp[] = ".backup ?DB? FILE Backup DB (default \"main\") to FILE\n" ".bail on|off Stop after hitting an error. Default OFF\n" ".clone NEWDB Clone data into NEWDB from the existing database\n" - ".colseparator STRING This is an alias for .separator\n" + ".colseparator STRING This is an alias for the one argument version of\n" + " .separator\n" ".databases List names and files of attached databases\n" ".dump ?TABLE? ... Dump the database in an SQL text format\n" " If TABLE specified, only dump tables matching\n" @@ -2646,7 +2647,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){ int nSep; /* Number of bytes in p->colSeparator[] */ char *zSql; /* An SQL statement */ ImportCtx sCtx; /* Reader context */ - char *(*xRead)(ImportCtx*); /* Procecure to read one value */ + char *(*xRead)(ImportCtx*); /* Procedure to read one value */ int (*xCloser)(FILE*); /* Procedure to close th3 connection */ if( nArg!=3 ){ @@ -3899,7 +3900,7 @@ static const char zOptions[] = " -ascii set output mode to 'ascii'\n" " -bail stop after hitting an error\n" " -batch force batch I/O\n" - " -colseparator SEP same as -separator\n" + " -colseparator SEP same as -separator with one argument\n" " -column set output mode to 'column'\n" " -cmd COMMAND run \"COMMAND\" before reading stdin\n" " -csv set output mode to 'csv'\n" From 815ab5ac49d9d7c7510f54db5a58ae57e6da215e Mon Sep 17 00:00:00 2001 From: mistachkin Date: Thu, 24 Jul 2014 22:33:47 +0000 Subject: [PATCH 03/34] Update a shell test case. FossilOrigin-Name: b84008cb964f234b6a6b441f738e344158c4c92a --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/shell1.test | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 3db2a79fc6..9cce47d31d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\stypo\sin\scomment\sand\supdate\shelp\stext. -D 2014-07-24T22:20:23.336 +C Update\sa\sshell\stest\scase. +D 2014-07-24T22:33:47.040 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5eb79e334a5de69c87740edd56af6527dd219308 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -820,7 +820,7 @@ F test/shared9.test 5f2a8f79b4d6c7d107a01ffa1ed05ae7e6333e21 F test/sharedA.test 0cdf1a76dfa00e6beee66af5b534b1e8df2720f5 F test/shared_err.test 0079c05c97d88cfa03989b7c20a8b266983087aa F test/sharedlock.test 5ede3c37439067c43b0198f580fd374ebf15d304 -F test/shell1.test d13ff516e3fcd4061bd072f56fd1551f2bf7fe52 +F test/shell1.test 1c0b7a79b1b91a56253ee0c4fbb309d39d16641e F test/shell2.test c57da3a381c099b02c813ba156298d5c2f5c93a3 F test/shell3.test 5e8545ec72c4413a0e8d4c6be56496e3c257ca29 F test/shell4.test 8a9c08976291e6c6c808b4d718f4a8b299f339f5 @@ -1184,7 +1184,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 8dc0cdf652f099d464d3de416dffd83efb895009 -R df3c0e791329cbe951d92033daed226e +P 289092bb64463efe78a5f01b06b24aa664a31feb +R 2dda198fecf0d2cc936f765b01233dec U mistachkin -Z b422ee17d0b3078b84860803513f7cb8 +Z 05cc0be56c34ce76332247b4a337d27f diff --git a/manifest.uuid b/manifest.uuid index 27a93d5aad..eb0aaa3df5 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -289092bb64463efe78a5f01b06b24aa664a31feb \ No newline at end of file +b84008cb964f234b6a6b441f738e344158c4c92a \ No newline at end of file diff --git a/test/shell1.test b/test/shell1.test index 0a0d0e3a16..efb45cdd95 100644 --- a/test/shell1.test +++ b/test/shell1.test @@ -612,9 +612,10 @@ do_test shell1-3.23.1 { [regexp {output:} $res] \ [regexp {colseparator:} $res] \ [regexp {rowseparator:} $res] \ + [regexp {newline:} $res] \ [regexp {stats:} $res] \ [regexp {width:} $res] -} {1 1 1 1 1 1 1 1 1 1} +} {1 1 1 1 1 1 1 1 1 1 1} do_test shell1-3.23.2 { # too many arguments catchcmd "test.db" ".show BAD" From 22c9638efdfd962bfe9e27909c1bcc08e034f5b8 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Thu, 24 Jul 2014 22:51:18 +0000 Subject: [PATCH 04/34] Correct help text and make consistent use of snprintf. FossilOrigin-Name: 9c424a5c50e4a2ed36556e99fba0e7072a2d3468 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/shell.c | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/manifest b/manifest index 9cce47d31d..3c60bf2ba4 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Update\sa\sshell\stest\scase. -D 2014-07-24T22:33:47.040 +C Correct\shelp\stext\sand\smake\sconsistent\suse\sof\ssnprintf. +D 2014-07-24T22:51:18.860 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5eb79e334a5de69c87740edd56af6527dd219308 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -223,7 +223,7 @@ F src/random.c d10c1f85b6709ca97278428fd5db5bbb9c74eece F src/resolve.c 5fc110baeacf120a73fe34e103f052632ff11a02 F src/rowset.c a9c9aae3234b44a6d7c6f5a3cadf90dce1e627be F src/select.c 6762c62e11b504aa014edceab8886495165e3a77 -F src/shell.c e1177e053e214be9c1549dac5bbcb2164b6114dd +F src/shell.c 5129214fbe720ce24802e750b1ac0a49f04034cd F src/sqlite.h.in ac4451c9da2771d2f4d702ef89722407242906d9 F src/sqlite3.rc 11094cc6a157a028b301a9f06b3d03089ea37c3e F src/sqlite3ext.h 886f5a34de171002ad46fae8c36a7d8051c190fc @@ -1184,7 +1184,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 289092bb64463efe78a5f01b06b24aa664a31feb -R 2dda198fecf0d2cc936f765b01233dec +P b84008cb964f234b6a6b441f738e344158c4c92a +R 0b04208537b14ee3bcc223e1a9755bab U mistachkin -Z 05cc0be56c34ce76332247b4a337d27f +Z 0945ca559f52609ad97025a5011e881c diff --git a/manifest.uuid b/manifest.uuid index eb0aaa3df5..6c6478f98e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b84008cb964f234b6a6b441f738e344158c4c92a \ No newline at end of file +9c424a5c50e4a2ed36556e99fba0e7072a2d3468 \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index 78339db8b4..3f67986967 100644 --- a/src/shell.c +++ b/src/shell.c @@ -3225,7 +3225,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){ if( c=='r' && strncmp(azArg[0], "rowseparator", n)==0 ){ if( nArg==2 ){ sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, - "%.*s", (int)sizeof(p->rowSeparator)-1, azArg[1]); + "%.*s", (int)ArraySize(p->rowSeparator)-1, azArg[1]); }else{ fprintf(stderr, "Usage: .rowseparator STRING\n"); rc = 1; @@ -3235,7 +3235,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){ if( c=='c' && strncmp(azArg[0], "colseparator", n)==0 ){ if( nArg==2 ){ sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, - "%.*s", (int)sizeof(p->colSeparator)-1, azArg[1]); + "%.*s", (int)ArraySize(p->colSeparator)-1, azArg[1]); }else{ fprintf(stderr, "Usage: .colseparator STRING\n"); rc = 1; @@ -3249,11 +3249,11 @@ static int do_meta_command(char *zLine, struct callback_data *p){ } if( nArg>=2 ){ sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, - "%.*s", (int)sizeof(p->colSeparator)-1, azArg[1]); + "%.*s", (int)ArraySize(p->colSeparator)-1, azArg[1]); } if( nArg>=3 ){ sqlite3_snprintf(sizeof(p->newline), p->newline, - "%.*s", (int)sizeof(p->newline)-1, azArg[2]); + "%.*s", (int)ArraySize(p->newline)-1, azArg[2]); } }else @@ -3900,7 +3900,7 @@ static const char zOptions[] = " -ascii set output mode to 'ascii'\n" " -bail stop after hitting an error\n" " -batch force batch I/O\n" - " -colseparator SEP same as -separator with one argument\n" + " -colseparator SEP same as -separator\n" " -column set output mode to 'column'\n" " -cmd COMMAND run \"COMMAND\" before reading stdin\n" " -csv set output mode to 'csv'\n" From e0d6885f1760c50515876456a8fbb6fbfbb278fd Mon Sep 17 00:00:00 2001 From: mistachkin Date: Thu, 11 Dec 2014 03:12:33 +0000 Subject: [PATCH 05/34] Simplify and cleanup the implementation of the new ASCII mode for the shell. FossilOrigin-Name: 66a28f7abaeaf1ebe6e43d856af88ac64b1ff230 --- manifest | 16 +++++------ manifest.uuid | 2 +- src/shell.c | 69 +++++++++++++++--------------------------------- test/shell1.test | 35 ++++-------------------- test/shell5.test | 4 +-- 5 files changed, 38 insertions(+), 88 deletions(-) diff --git a/manifest b/manifest index 82f498501b..2a02591071 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Merge\supdates\sfrom\strunk. -D 2014-12-11T02:28:42.201 +C Simplify\sand\scleanup\sthe\simplementation\sof\sthe\snew\sASCII\smode\sfor\sthe\sshell. +D 2014-12-11T03:12:33.799 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -229,7 +229,7 @@ F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/select.c f377fb8a5c73c10678ea74f3400f7913943e3d75 -F src/shell.c 1c7787d1066d1a858b8a4812663fde0e4a85b755 +F src/shell.c 84359f80c432f8b34f0af4fdee8055c9fc2639a2 F src/sqlite.h.in 2e699aabd1df6042aff4265cd93bdc8812629f11 F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d @@ -851,11 +851,11 @@ F test/sharedA.test 0cdf1a76dfa00e6beee66af5b534b1e8df2720f5 F test/sharedB.test 16cc7178e20965d75278f410943109b77b2e645e F test/shared_err.test 2f2aee20db294b9924e81f6ccbe60f19e21e8506 F test/sharedlock.test 5ede3c37439067c43b0198f580fd374ebf15d304 -F test/shell1.test 0d2cece602988da3fa066c00adf19cda0b1306ad +F test/shell1.test cdeb849acc2c37aada70d084564b0cc0a2c7df08 F test/shell2.test 12b8bf901b0e3a8ac58cf5c0c63a0a388d4d1862 F test/shell3.test 5e8545ec72c4413a0e8d4c6be56496e3c257ca29 F test/shell4.test 8a9c08976291e6c6c808b4d718f4a8b299f339f5 -F test/shell5.test 7dbc03751ceda1e5ce75553dff735a7ef0dea15c +F test/shell5.test d17a02d2327aadc6c062d5ba16b737d32601b11b F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3 F test/show_speedtest1_rtree.tcl 32e6c5f073d7426148a6936a0408f4b5b169aba5 F test/shrink.test 8c70f62b6e8eb4d54533de6d65bd06b1b9a17868 @@ -1227,7 +1227,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 51f33cf1290cf767c1c6ba0228f4f30e4059c994 d9f916ba09f1a61684b4d59548ab6cf71cdb6a37 -R 15ef4ed782851554150951631e8659fc +P 5b5d3e4d0d158594c0db05ddbf4d926b65825042 +R 7df644943b04f66f737e7f900957f44a U mistachkin -Z e24780e51cf083f098b96480beceaf1e +Z bc502efd9af4cfe5719e73721b9180f9 diff --git a/manifest.uuid b/manifest.uuid index 3eb6df633f..7be32cae90 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -5b5d3e4d0d158594c0db05ddbf4d926b65825042 \ No newline at end of file +66a28f7abaeaf1ebe6e43d856af88ac64b1ff230 \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index 22e691a8cb..c1d8f18333 100644 --- a/src/shell.c +++ b/src/shell.c @@ -911,13 +911,13 @@ static int shell_callback( for(i=0; iout, "%s", p->newline); + fprintf(p->out, "%s", p->rowSeparator); } if( nArg>0 ){ for(i=0; iout, "%s", p->newline); + fprintf(p->out, "%s", p->rowSeparator); } #if defined(WIN32) || defined(_WIN32) fflush(p->out); @@ -1711,8 +1711,6 @@ static char zHelp[] = ".backup ?DB? FILE Backup DB (default \"main\") to FILE\n" ".bail on|off Stop after hitting an error. Default OFF\n" ".clone NEWDB Clone data into NEWDB from the existing database\n" - ".colseparator STRING This is an alias for the one argument version of\n" - " .separator\n" ".databases List names and files of attached databases\n" ".dump ?TABLE? ... Dump the database in an SQL text format\n" " If TABLE specified, only dump tables matching\n" @@ -1737,13 +1735,13 @@ static char zHelp[] = #endif ".log FILE|off Turn logging on or off. FILE can be stderr/stdout\n" ".mode MODE ?TABLE? Set output mode where MODE is one of:\n" - " ascii Columns/rows delimited with 0x1F and 0x1E\n" + " ascii Columns/rows delimited by 0x1F and 0x1E\n" " csv Comma-separated values\n" " column Left-aligned columns. (See .width)\n" " html HTML
code\n" " insert SQL insert statements for TABLE\n" " line One value per line\n" - " list Values delimited by .separator string\n" + " list Values delimited by .separator strings\n" " tabs Tab-separated values\n" " tcl TCL list elements\n" ".nullvalue STRING Use STRING in place of NULL values\n" @@ -1755,14 +1753,13 @@ static char zHelp[] = ".quit Exit this program\n" ".read FILENAME Execute SQL in FILENAME\n" ".restore ?DB? FILE Restore content of DB (default \"main\") from FILE\n" - ".rowseparator STRING Change row separator for output mode and .import\n" ".save FILE Write in-memory database into FILE\n" ".scanstats on|off Turn sqlite3_stmt_scanstatus() metrics on or off\n" ".schema ?TABLE? Show the CREATE statements\n" " If TABLE specified, only show tables matching\n" " LIKE pattern TABLE.\n" - ".separator STRING ?NL? Change column separator for output mode and .import\n" - " NL is the end-of-line mark for CSV\n" + ".separator COL ?ROW? Change the column separator and optionally the row\n" + " separator for both the output mode and .import\n" ".shell CMD ARGS... Run CMD ARGS... in a system shell\n" ".show Show the current values for various settings\n" ".stats on|off Turn stats on or off\n" @@ -2764,6 +2761,14 @@ static int do_meta_command(char *zLine, ShellState *p){ fprintf(stderr, "Error: non-null row separator required for import\n"); return 1; } + if( nSep==2 && p->mode==MODE_Csv && strcmp(p->rowSeparator, SEP_CrLf)==0 ){ + /* When importing CSV (only), if the row separator is set to the + ** default output row separator, change it to the default input + ** row separator. This avoids having to maintain different input + ** and output row separators. */ + sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row); + nSep = strlen30(p->rowSeparator); + } if( nSep>1 ){ fprintf(stderr, "Error: multi-character row separators not allowed" " for import\n"); @@ -3027,9 +3032,8 @@ static int do_meta_command(char *zLine, ShellState *p){ sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row); }else if( c2=='c' && strncmp(azArg[1],"csv",n2)==0 ){ p->mode = MODE_Csv; - sqlite3_snprintf(sizeof(p->newline), p->newline, SEP_CrLf); sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Comma); - sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row); + sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_CrLf); }else if( c2=='t' && strncmp(azArg[1],"tabs",n2)==0 ){ p->mode = MODE_List; sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Tab); @@ -3334,29 +3338,9 @@ static int do_meta_command(char *zLine, ShellState *p){ }else #endif - if( c=='r' && strncmp(azArg[0], "rowseparator", n)==0 ){ - if( nArg==2 ){ - sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, - "%.*s", (int)ArraySize(p->rowSeparator)-1, azArg[1]); - }else{ - fprintf(stderr, "Usage: .rowseparator STRING\n"); - rc = 1; - } - }else - - if( c=='c' && strncmp(azArg[0], "colseparator", n)==0 ){ - if( nArg==2 ){ - sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, - "%.*s", (int)ArraySize(p->colSeparator)-1, azArg[1]); - }else{ - fprintf(stderr, "Usage: .colseparator STRING\n"); - rc = 1; - } - }else - if( c=='s' && strncmp(azArg[0], "separator", n)==0 ){ if( nArg<2 || nArg>3 ){ - fprintf(stderr, "Usage: .separator SEPARATOR ?NEWLINE?\n"); + fprintf(stderr, "Usage: .separator COL ?ROW?\n"); rc = 1; } if( nArg>=2 ){ @@ -3364,8 +3348,8 @@ static int do_meta_command(char *zLine, ShellState *p){ "%.*s", (int)ArraySize(p->colSeparator)-1, azArg[1]); } if( nArg>=3 ){ - sqlite3_snprintf(sizeof(p->newline), p->newline, - "%.*s", (int)ArraySize(p->newline)-1, azArg[2]); + sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, + "%.*s", (int)ArraySize(p->rowSeparator)-1, azArg[2]); } }else @@ -3412,9 +3396,6 @@ static int do_meta_command(char *zLine, ShellState *p){ fprintf(p->out,"%12.12s: ", "rowseparator"); output_c_string(p->out, p->rowSeparator); fprintf(p->out, "\n"); - fprintf(p->out,"%12.12s: ", "newline"); - output_c_string(p->out, p->newline); - fprintf(p->out, "\n"); fprintf(p->out,"%12.12s: %s\n","stats", p->statsOn ? "on" : "off"); fprintf(p->out,"%12.12s: ","width"); for (i=0;i<(int)ArraySize(p->colWidth) && p->colWidth[i] != 0;i++) { @@ -4080,7 +4061,6 @@ static const char zOptions[] = " -ascii set output mode to 'ascii'\n" " -bail stop after hitting an error\n" " -batch force batch I/O\n" - " -colseparator SEP same as -separator\n" " -column set output mode to 'column'\n" " -cmd COMMAND run \"COMMAND\" before reading stdin\n" " -csv set output mode to 'csv'\n" @@ -4100,12 +4080,11 @@ static const char zOptions[] = #ifdef SQLITE_ENABLE_MULTIPLEX " -multiplex enable the multiplexor VFS\n" #endif - " -newline SEP set newline character(s) for CSV\n" + " -newline SEP set output row separator. Default: '\\n'\n" " -nullvalue TEXT set text string for NULL values. Default ''\n" " -pagecache SIZE N use N slots of SZ bytes each for page cache memory\n" - " -rowseparator SEP set output line separator. Default: '\\n'\n" " -scratch SIZE N use N slots of SZ bytes each for scratch memory\n" - " -separator SEP set output field separator. Default: '|'\n" + " -separator SEP set output column separator. Default: '|'\n" " -stats print memory stats before each finalize\n" " -version show SQLite version\n" " -vfs NAME use NAME as the default VFS\n" @@ -4134,7 +4113,6 @@ static void main_init(ShellState *data) { data->mode = MODE_List; memcpy(data->colSeparator,SEP_Column, 2); memcpy(data->rowSeparator,SEP_Row, 2); - memcpy(data->newline,SEP_CrLf, 3); data->showHeader = 0; data->shellFlgs = SHFLG_Lookaside; sqlite3_config(SQLITE_CONFIG_URI, 1); @@ -4380,14 +4358,11 @@ int main(int argc, char **argv){ SEP_Unit); sqlite3_snprintf(sizeof(data.rowSeparator), data.rowSeparator, SEP_Record); - }else if( strcmp(z,"-separator")==0 || strcmp(z,"-colseparator")==0 ){ + }else if( strcmp(z,"-separator")==0 ){ sqlite3_snprintf(sizeof(data.colSeparator), data.colSeparator, "%s",cmdline_option_value(argc,argv,++i)); - }else if( strcmp(z,"-rowseparator")==0 ){ - sqlite3_snprintf(sizeof(data.rowSeparator), data.rowSeparator, - "%s",cmdline_option_value(argc,argv,++i)); }else if( strcmp(z,"-newline")==0 ){ - sqlite3_snprintf(sizeof(data.newline), data.newline, + sqlite3_snprintf(sizeof(data.rowSeparator), data.rowSeparator, "%s",cmdline_option_value(argc,argv,++i)); }else if( strcmp(z,"-nullvalue")==0 ){ sqlite3_snprintf(sizeof(data.nullvalue), data.nullvalue, diff --git a/test/shell1.test b/test/shell1.test index c315d85c46..f24b00d494 100644 --- a/test/shell1.test +++ b/test/shell1.test @@ -421,13 +421,13 @@ do_test shell1-3.12.3 { } {1 {Usage: .indices ?LIKE-PATTERN?}} # .mode MODE ?TABLE? Set output mode where MODE is one of: -# ascii Columns/rows delimited with 0x1F and 0x1E +# ascii Columns/rows delimited by 0x1F and 0x1E # csv Comma-separated values # column Left-aligned columns. (See .width) # html HTML
code # insert SQL insert statements for TABLE # line One value per line -# list Values delimited by .separator string +# list Values delimited by .separator strings # tabs Tab-separated values # tcl TCL list elements do_test shell1-3.13.1 { @@ -590,7 +590,7 @@ db eval {DROP VIEW v1; DROP VIEW v2; DROP TABLE t1;} # .separator STRING Change column separator used by output and .import do_test shell1-3.22.1 { catchcmd "test.db" ".separator" -} {1 {Usage: .separator SEPARATOR ?NEWLINE?}} +} {1 {Usage: .separator COL ?ROW?}} do_test shell1-3.22.2 { catchcmd "test.db" ".separator FOO" } {0 {}} @@ -600,7 +600,7 @@ do_test shell1-3.22.3 { do_test shell1-3.22.4 { # too many arguments catchcmd "test.db" ".separator FOO BAD BAD2" -} {1 {Usage: .separator SEPARATOR ?NEWLINE?}} +} {1 {Usage: .separator COL ?ROW?}} # .show Show the current values for various settings do_test shell1-3.23.1 { @@ -613,10 +613,9 @@ do_test shell1-3.23.1 { [regexp {output:} $res] \ [regexp {colseparator:} $res] \ [regexp {rowseparator:} $res] \ - [regexp {newline:} $res] \ [regexp {stats:} $res] \ [regexp {width:} $res] -} {1 1 1 1 1 1 1 1 1 1 1} +} {1 1 1 1 1 1 1 1 1 1} do_test shell1-3.23.2 { # too many arguments catchcmd "test.db" ".show BAD" @@ -816,28 +815,4 @@ do_test shell1-4.6 { ";" "$"} 7} -# .colseparator STRING Change column separator used by output and .import -do_test shell1-5.1.1 { - catchcmd "test.db" ".colseparator" -} {1 {Usage: .colseparator STRING}} -do_test shell1-5.1.2 { - catchcmd "test.db" ".colseparator FOO" -} {0 {}} -do_test shell1-5.1.3 { - # too many arguments - catchcmd "test.db" ".colseparator FOO BAD" -} {1 {Usage: .colseparator STRING}} - -# .rowseparator STRING Change row separator used by output and .import -do_test shell1-6.1.1 { - catchcmd "test.db" ".rowseparator" -} {1 {Usage: .rowseparator STRING}} -do_test shell1-6.1.2 { - catchcmd "test.db" ".rowseparator FOO" -} {0 {}} -do_test shell1-6.1.3 { - # too many arguments - catchcmd "test.db" ".rowseparator FOO BAD" -} {1 {Usage: .rowseparator STRING}} - finish_test diff --git a/test/shell5.test b/test/shell5.test index 7c28d0bcd8..e384e375fb 100644 --- a/test/shell5.test +++ b/test/shell5.test @@ -55,7 +55,7 @@ do_test shell5-1.1.3 { # .separator STRING Change separator used by output mode and .import do_test shell5-1.2.1 { catchcmd "test.db" ".separator" -} {1 {Usage: .separator SEPARATOR ?NEWLINE?}} +} {1 {Usage: .separator COL ?ROW?}} do_test shell5-1.2.2 { catchcmd "test.db" ".separator ONE" } {0 {}} @@ -65,7 +65,7 @@ do_test shell5-1.2.3 { do_test shell5-1.2.4 { # too many arguments catchcmd "test.db" ".separator ONE TWO THREE" -} {1 {Usage: .separator SEPARATOR ?NEWLINE?}} +} {1 {Usage: .separator COL ?ROW?}} # column separator should default to "|" do_test shell5-1.3.1.1 { From f1f84a6ec1cffaaf7a78608deca8607b6dc942d6 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Thu, 11 Dec 2014 03:20:58 +0000 Subject: [PATCH 06/34] Further simplify shell mode changes. FossilOrigin-Name: cf9c6e7eea4cab073e608e6fefdd24be87a8abeb --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/shell.c | 2 -- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 2a02591071..498be7827e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Simplify\sand\scleanup\sthe\simplementation\sof\sthe\snew\sASCII\smode\sfor\sthe\sshell. -D 2014-12-11T03:12:33.799 +C Further\ssimplify\sshell\smode\schanges. +D 2014-12-11T03:20:58.752 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -229,7 +229,7 @@ F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/select.c f377fb8a5c73c10678ea74f3400f7913943e3d75 -F src/shell.c 84359f80c432f8b34f0af4fdee8055c9fc2639a2 +F src/shell.c 4649c6bdfcc72cebffa770f9a47d37b8a9120215 F src/sqlite.h.in 2e699aabd1df6042aff4265cd93bdc8812629f11 F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d @@ -1227,7 +1227,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 5b5d3e4d0d158594c0db05ddbf4d926b65825042 -R 7df644943b04f66f737e7f900957f44a +P 66a28f7abaeaf1ebe6e43d856af88ac64b1ff230 +R 96c15ebe6218f037cbb3aa3c87063a4c U mistachkin -Z bc502efd9af4cfe5719e73721b9180f9 +Z 166f8db90bdd2987f2d3879c9c0b3446 diff --git a/manifest.uuid b/manifest.uuid index 7be32cae90..edf02da4cf 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -66a28f7abaeaf1ebe6e43d856af88ac64b1ff230 \ No newline at end of file +cf9c6e7eea4cab073e608e6fefdd24be87a8abeb \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index c1d8f18333..a363d79bfa 100644 --- a/src/shell.c +++ b/src/shell.c @@ -3029,7 +3029,6 @@ static int do_meta_command(char *zLine, ShellState *p){ }else if( c2=='t' && strncmp(azArg[1],"tcl",n2)==0 ){ p->mode = MODE_Tcl; sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Space); - sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row); }else if( c2=='c' && strncmp(azArg[1],"csv",n2)==0 ){ p->mode = MODE_Csv; sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Comma); @@ -3037,7 +3036,6 @@ static int do_meta_command(char *zLine, ShellState *p){ }else if( c2=='t' && strncmp(azArg[1],"tabs",n2)==0 ){ p->mode = MODE_List; sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Tab); - sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row); }else if( c2=='i' && strncmp(azArg[1],"insert",n2)==0 ){ p->mode = MODE_Insert; set_table_name(p, nArg>=3 ? azArg[2] : "table"); From 44ca92062543cdd7918f0ddfd7c5566cc656cf03 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Thu, 11 Dec 2014 03:25:05 +0000 Subject: [PATCH 07/34] Remove an unused structure member. FossilOrigin-Name: d8404340cb01af440feebd19d291eb7198cfa576 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/shell.c | 1 - 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 498be7827e..c6c2741cf4 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Further\ssimplify\sshell\smode\schanges. -D 2014-12-11T03:20:58.752 +C Remove\san\sunused\sstructure\smember. +D 2014-12-11T03:25:05.862 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -229,7 +229,7 @@ F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/select.c f377fb8a5c73c10678ea74f3400f7913943e3d75 -F src/shell.c 4649c6bdfcc72cebffa770f9a47d37b8a9120215 +F src/shell.c d2c9565c39b74fbbafc5e298f46a5dce2712633a F src/sqlite.h.in 2e699aabd1df6042aff4265cd93bdc8812629f11 F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d @@ -1227,7 +1227,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 66a28f7abaeaf1ebe6e43d856af88ac64b1ff230 -R 96c15ebe6218f037cbb3aa3c87063a4c +P cf9c6e7eea4cab073e608e6fefdd24be87a8abeb +R ddc1d3f4245eaeea9a8356078a1ff2c8 U mistachkin -Z 166f8db90bdd2987f2d3879c9c0b3446 +Z 68f03e9f12ac1359ea66745b2be1a192 diff --git a/manifest.uuid b/manifest.uuid index edf02da4cf..92c9024aaa 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -cf9c6e7eea4cab073e608e6fefdd24be87a8abeb \ No newline at end of file +d8404340cb01af440feebd19d291eb7198cfa576 \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index a363d79bfa..21073c90f3 100644 --- a/src/shell.c +++ b/src/shell.c @@ -473,7 +473,6 @@ struct ShellState { char *zDestTable; /* Name of destination table when MODE_Insert */ char colSeparator[20]; /* Column separator character for several modes */ char rowSeparator[20]; /* Row separator character for MODE_Ascii */ - char newline[20]; /* Record separator in MODE_Csv */ int colWidth[100]; /* Requested width of each column when in column mode*/ int actualWidth[100]; /* Actual width of each column */ char nullvalue[20]; /* The text to print when a NULL comes back from From 44b99f7e2ef1fa751ad556e4ed3b4c99ade98dfe Mon Sep 17 00:00:00 2001 From: mistachkin Date: Thu, 11 Dec 2014 03:29:14 +0000 Subject: [PATCH 08/34] Rename a structure member to improve code clarity. FossilOrigin-Name: d48eda16ef8a84a93de9c6f38f794aceb4a6ba0d --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/shell.c | 30 +++++++++++++++--------------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/manifest b/manifest index c6c2741cf4..8e4591a12c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\san\sunused\sstructure\smember. -D 2014-12-11T03:25:05.862 +C Rename\sa\sstructure\smember\sto\simprove\scode\sclarity. +D 2014-12-11T03:29:14.206 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -229,7 +229,7 @@ F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/select.c f377fb8a5c73c10678ea74f3400f7913943e3d75 -F src/shell.c d2c9565c39b74fbbafc5e298f46a5dce2712633a +F src/shell.c 3628fab3fba6490bebba7fa63989c5c410eba0a5 F src/sqlite.h.in 2e699aabd1df6042aff4265cd93bdc8812629f11 F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d @@ -1227,7 +1227,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 cf9c6e7eea4cab073e608e6fefdd24be87a8abeb -R ddc1d3f4245eaeea9a8356078a1ff2c8 +P d8404340cb01af440feebd19d291eb7198cfa576 +R 46f56278d908459d592a073dfada5d9c U mistachkin -Z 68f03e9f12ac1359ea66745b2be1a192 +Z d954c642e1623a1d799298570f596d90 diff --git a/manifest.uuid b/manifest.uuid index 92c9024aaa..28bc895227 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d8404340cb01af440feebd19d291eb7198cfa576 \ No newline at end of file +d48eda16ef8a84a93de9c6f38f794aceb4a6ba0d \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index 21073c90f3..d102d4c047 100644 --- a/src/shell.c +++ b/src/shell.c @@ -475,7 +475,7 @@ struct ShellState { char rowSeparator[20]; /* Row separator character for MODE_Ascii */ int colWidth[100]; /* Requested width of each column when in column mode*/ int actualWidth[100]; /* Actual width of each column */ - char nullvalue[20]; /* The text to print when a NULL comes back from + char nullValue[20]; /* The text to print when a NULL comes back from ** the database */ SavedModeInfo normalMode;/* Holds the mode just before .explain ON */ char outfile[FILENAME_MAX]; /* Filename for *out */ @@ -693,14 +693,14 @@ static const char needCsvQuote[] = { /* ** Output a single term of CSV. Actually, p->separator is used for -** the separator, which may or may not be a comma. p->nullvalue is +** the separator, which may or may not be a comma. p->nullValue is ** the null value. Strings are quoted if necessary. The separator ** is only issued if bSep is true. */ static void output_csv(ShellState *p, const char *z, int bSep){ FILE *out = p->out; if( z==0 ){ - fprintf(out,"%s",p->nullvalue); + fprintf(out,"%s",p->nullValue); }else{ int i; int nSep = strlen30(p->colSeparator); @@ -765,7 +765,7 @@ static int shell_callback( if( p->cnt++>0 ) fprintf(p->out, "%s", p->rowSeparator); for(i=0; iout,"%*s = %s%s", w, azCol[i], - azArg[i] ? azArg[i] : p->nullvalue, p->rowSeparator); + azArg[i] ? azArg[i] : p->nullValue, p->rowSeparator); } break; } @@ -782,7 +782,7 @@ static int shell_callback( if( w==0 ){ w = strlen30(azCol[i] ? azCol[i] : ""); if( w<10 ) w = 10; - n = strlen30(azArg && azArg[i] ? azArg[i] : p->nullvalue); + n = strlen30(azArg && azArg[i] ? azArg[i] : p->nullValue); if( wactualWidth) ){ @@ -832,11 +832,11 @@ static int shell_callback( } if( w<0 ){ fprintf(p->out,"%*.*s%s",-w,-w, - azArg[i] ? azArg[i] : p->nullvalue, + azArg[i] ? azArg[i] : p->nullValue, i==nArg-1 ? p->rowSeparator : " "); }else{ fprintf(p->out,"%-*.*s%s",w,w, - azArg[i] ? azArg[i] : p->nullvalue, + azArg[i] ? azArg[i] : p->nullValue, i==nArg-1 ? p->rowSeparator : " "); } } @@ -853,7 +853,7 @@ static int shell_callback( if( azArg==0 ) break; for(i=0; inullvalue; + if( z==0 ) z = p->nullValue; fprintf(p->out, "%s", z); if( iout, "%s", p->colSeparator); @@ -879,7 +879,7 @@ static int shell_callback( fprintf(p->out,""); for(i=0; iout,"\n"); } fprintf(p->out,"\n"); @@ -895,7 +895,7 @@ static int shell_callback( } if( azArg==0 ) break; for(i=0; iout, azArg[i] ? azArg[i] : p->nullvalue); + output_c_string(p->out, azArg[i] ? azArg[i] : p->nullValue); if(iout, "%s", p->colSeparator); } fprintf(p->out, "%s", p->rowSeparator); @@ -964,7 +964,7 @@ static int shell_callback( if( azArg==0 ) break; for(i=0; i0 ) fprintf(p->out, "%s", p->colSeparator); - fprintf(p->out,"%s",azArg[i] ? azArg[i] : p->nullvalue); + fprintf(p->out,"%s",azArg[i] ? azArg[i] : p->nullValue); } fprintf(p->out, "%s", p->rowSeparator); break; @@ -3051,8 +3051,8 @@ static int do_meta_command(char *zLine, ShellState *p){ if( c=='n' && strncmp(azArg[0], "nullvalue", n)==0 ){ if( nArg==2 ){ - sqlite3_snprintf(sizeof(p->nullvalue), p->nullvalue, - "%.*s", (int)ArraySize(p->nullvalue)-1, azArg[1]); + sqlite3_snprintf(sizeof(p->nullValue), p->nullValue, + "%.*s", (int)ArraySize(p->nullValue)-1, azArg[1]); }else{ fprintf(stderr, "Usage: .nullvalue STRING\n"); rc = 1; @@ -3383,7 +3383,7 @@ static int do_meta_command(char *zLine, ShellState *p){ fprintf(p->out,"%12.12s: %s\n","headers", p->showHeader ? "on" : "off"); fprintf(p->out,"%12.12s: %s\n","mode", modeDescr[p->mode]); fprintf(p->out,"%12.12s: ", "nullvalue"); - output_c_string(p->out, p->nullvalue); + output_c_string(p->out, p->nullValue); fprintf(p->out, "\n"); fprintf(p->out,"%12.12s: %s\n","output", strlen30(p->outfile) ? p->outfile : "stdout"); @@ -4362,7 +4362,7 @@ int main(int argc, char **argv){ sqlite3_snprintf(sizeof(data.rowSeparator), data.rowSeparator, "%s",cmdline_option_value(argc,argv,++i)); }else if( strcmp(z,"-nullvalue")==0 ){ - sqlite3_snprintf(sizeof(data.nullvalue), data.nullvalue, + sqlite3_snprintf(sizeof(data.nullValue), data.nullValue, "%s",cmdline_option_value(argc,argv,++i)); }else if( strcmp(z,"-header")==0 ){ data.showHeader = 1; From dd11f2d9309b5e3687c82cd505ae686d27cea311 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Thu, 11 Dec 2014 04:49:46 +0000 Subject: [PATCH 09/34] Update a comment. FossilOrigin-Name: e0e102a0bd9d07bccdb1feb95767cb81fb57c29f --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/shell.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 8e4591a12c..e8f180d89f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Rename\sa\sstructure\smember\sto\simprove\scode\sclarity. -D 2014-12-11T03:29:14.206 +C Update\sa\scomment. +D 2014-12-11T04:49:46.125 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -229,7 +229,7 @@ F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/select.c f377fb8a5c73c10678ea74f3400f7913943e3d75 -F src/shell.c 3628fab3fba6490bebba7fa63989c5c410eba0a5 +F src/shell.c 1b7cb3efc5ae6fe82e36407508c4a6b00d8edde1 F src/sqlite.h.in 2e699aabd1df6042aff4265cd93bdc8812629f11 F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d @@ -1227,7 +1227,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 d8404340cb01af440feebd19d291eb7198cfa576 -R 46f56278d908459d592a073dfada5d9c +P d48eda16ef8a84a93de9c6f38f794aceb4a6ba0d +R 1034d99337e2b1563f22219c78cd5011 U mistachkin -Z d954c642e1623a1d799298570f596d90 +Z 59252e2fe2e00ed3f4f3196b070ae546 diff --git a/manifest.uuid b/manifest.uuid index 28bc895227..45d7bc2004 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d48eda16ef8a84a93de9c6f38f794aceb4a6ba0d \ No newline at end of file +e0e102a0bd9d07bccdb1feb95767cb81fb57c29f \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index d102d4c047..7f8a9ef3a6 100644 --- a/src/shell.c +++ b/src/shell.c @@ -692,7 +692,7 @@ static const char needCsvQuote[] = { }; /* -** Output a single term of CSV. Actually, p->separator is used for +** Output a single term of CSV. Actually, p->colSeparator is used for ** the separator, which may or may not be a comma. p->nullValue is ** the null value. Strings are quoted if necessary. The separator ** is only issued if bSep is true. From 64134662c03b2053813d0d40a0f17cc37bd8a9f2 Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 8 Jan 2015 22:08:57 +0000 Subject: [PATCH 10/34] Omit modules from the "valgrind" permutation that fork off separate processes. Also omit selectG.test because it is timing sensitive and valgrind is too slow to get the right answer. FossilOrigin-Name: 662932a69a0f69b7227cc05b75a9f1637a3862f4 --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/permutations.test | 4 +++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 86064253cb..2425b043bb 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Try\sto\sfix\sup\sthe\s"valgrindtest"\starget\sin\sMakefile.in\sso\sthat\sit\savoids\nmisuse\stesting\sthat\scan\strigger\sfalse\serrors. -D 2015-01-08T16:47:51.547 +C Omit\smodules\sfrom\sthe\s"valgrind"\spermutation\sthat\sfork\soff\sseparate\sprocesses.\nAlso\somit\sselectG.test\sbecause\sit\sis\stiming\ssensitive\sand\svalgrind\sis\stoo\sslow\nto\sget\sthe\sright\sanswer. +D 2015-01-08T22:08:57.396 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in b40b4c2a3a187c41ee657d3f0e0e0dfe8fd860b5 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -782,7 +782,7 @@ F test/pagesize.test 1dd51367e752e742f58e861e65ed7390603827a0 F test/pcache.test b09104b03160aca0d968d99e8cd2c5b1921a993d F test/pcache2.test a83efe2dec0d392f814bfc998def1d1833942025 F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff -F test/permutations.test fa2b4e56d1427dd3763053d78ce2f132376bb695 +F test/permutations.test f9cc1dd987986c9d4949211c7a4ed55ec9aecba1 F test/pragma.test aa16dedfe01c02c8895169012f7dfde9c163f0d5 F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13 F test/pragma3.test 6f849ccffeee7e496d2f2b5e74152306c0b8757c @@ -1235,7 +1235,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 826fd311e7e2849aefbd81724dcb4a5644cfa126 -R 3faebdda7f25c90fe0938a6de3f393ba +P 50b5a8af843fff93452cd1c8f82152124a1d864a +R 7718b668b667d88e703b95fb67c34eb8 U drh -Z 770e2b1cc0fe0d2202d8e9974f70c6d8 +Z f40714ebbaab2e9d849176cec61c7af6 diff --git a/manifest.uuid b/manifest.uuid index 52c980db7c..cc01a8b4d4 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -50b5a8af843fff93452cd1c8f82152124a1d864a \ No newline at end of file +662932a69a0f69b7227cc05b75a9f1637a3862f4 \ No newline at end of file diff --git a/test/permutations.test b/test/permutations.test index 6c7b563041..44f62e8066 100644 --- a/test/permutations.test +++ b/test/permutations.test @@ -165,7 +165,9 @@ test_suite "valgrind" -prefix "" -description { Run the "veryquick" test suite with a couple of multi-process tests (that fail under valgrind) omitted. } -files [ - test_set $allquicktests -exclude *malloc* *ioerr* *fault* wal.test atof1.test + test_set $allquicktests -exclude *malloc* *ioerr* *fault* wal.test \ + shell*.test crash8.test atof1.test selectG.test \ + tkt-fc62af4523.test ] -initialize { set ::G(valgrind) 1 } -shutdown { From 655814d2bd1cfa85fca22057719afa587307e802 Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 9 Jan 2015 01:27:29 +0000 Subject: [PATCH 11/34] Fix three crash problems discovered by afl-fuzz. Ticket [a59ae93ee990a55]. FossilOrigin-Name: fe5788633131281a0f27c5b75993ce2ff958bfeb --- manifest | 17 ++++++++--------- manifest.uuid | 2 +- src/date.c | 4 +++- src/expr.c | 7 ++++--- test/fuzz2.test | 23 ++++++++++++++++++++++- 5 files changed, 38 insertions(+), 15 deletions(-) diff --git a/manifest b/manifest index 3fb84faf9c..31bf9fc126 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\s"ascii"\smode\sto\sthe\scommand-line\sshell. -D 2015-01-09T00:38:06.225 +C Fix\sthree\scrash\sproblems\sdiscovered\sby\safl-fuzz.\nTicket\s[a59ae93ee990a55]. +D 2015-01-09T01:27:29.636 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in b40b4c2a3a187c41ee657d3f0e0e0dfe8fd860b5 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -180,9 +180,9 @@ F src/build.c f5cfd7b32216f695b995bbc7c1a395f6d451d11f F src/callback.c 7b44ce59674338ad48b0e84e7b72f935ea4f68b0 F src/complete.c 198a0066ba60ab06fc00fba1998d870a4d575463 F src/ctime.c df19848891c8a553c80e6f5a035e768280952d1a -F src/date.c 93594514aae68de117ca4a2a0d6cc63eddf26744 +F src/date.c 53cedb541686b30eb5495753f0b622909a928780 F src/delete.c 0750b1eb4d96cd3fb2c798599a3a7c85e92f1417 -F src/expr.c 00da3072f362b06f39ce4052baa1d4ce2bb36d1c +F src/expr.c 7be80f7dc337329a24df45c2f3bdb2ea3b64c90e F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb F src/fkey.c e0444b61bed271a76840cbe6182df93a9baa3f12 F src/func.c 6d3c4ebd72aa7923ce9b110a7dc15f9b8c548430 @@ -619,7 +619,7 @@ F test/func4.test 6beacdfcb0e18c358e6c2dcacf1b65d1fa80955f F test/func5.test cdd224400bc3e48d891827cc913a57051a426fa4 F test/fuzz-oss1.test 4912e528ec9cf2f42134456933659d371c9e0d74 F test/fuzz.test 96083052bf5765e4518c1ba686ce2bab785670d1 -F test/fuzz2.test 207d0f9d06db3eaf47a6b7bfc835b8e2fc397167 +F test/fuzz2.test b34fe575aa10292135421ff4bf315de4cde7824a F test/fuzz3.test efd384b896c647b61a2c1848ba70d42aad60a7b3 F test/fuzz_common.tcl a87dfbb88c2a6b08a38e9a070dabd129e617b45b F test/fuzz_malloc.test 328f70aaca63adf29b4c6f06505ed0cf57ca7c26 @@ -1235,8 +1235,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 662932a69a0f69b7227cc05b75a9f1637a3862f4 ea99f4b29afb98dd474d96889c934763f5636891 -R 3f8d7ef6dd5f06bcfd99bf945267e110 -T +closed ea99f4b29afb98dd474d96889c934763f5636891 +P e1518a9478e1ce1ebd98894335e64c953064367f +R 0672c0c00968fffbda70996e37c442f8 U drh -Z 1642395151124fe3b880675afbc572b4 +Z 8756c3c12d1aed88e2c7a41409182fc3 diff --git a/manifest.uuid b/manifest.uuid index 1fa5f45fe0..833f237c5e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e1518a9478e1ce1ebd98894335e64c953064367f \ No newline at end of file +fe5788633131281a0f27c5b75993ce2ff958bfeb \ No newline at end of file diff --git a/src/date.c b/src/date.c index 10d9006263..d19b633608 100644 --- a/src/date.c +++ b/src/date.c @@ -895,8 +895,10 @@ static void strftimeFunc( size_t i,j; char *z; sqlite3 *db; - const char *zFmt = (const char*)sqlite3_value_text(argv[0]); + const char *zFmt; char zBuf[100]; + if( argc==0 ) return; + zFmt = (const char*)sqlite3_value_text(argv[0]); if( zFmt==0 || isDate(context, argc-1, argv+1, &x) ) return; db = sqlite3_context_db_handle(context); for(i=0, n=1; zFmt[i]; i++, n++){ diff --git a/src/expr.c b/src/expr.c index 817975ab3a..32adedf9bf 100644 --- a/src/expr.c +++ b/src/expr.c @@ -515,7 +515,7 @@ Expr *sqlite3PExpr( const Token *pToken /* Argument token */ ){ Expr *p; - if( op==TK_AND && pLeft && pRight ){ + if( op==TK_AND && pLeft && pRight && pParse->nErr==0 ){ /* Take advantage of short-circuit false optimization for AND */ p = sqlite3ExprAnd(pParse->db, pLeft, pRight); }else{ @@ -4069,10 +4069,11 @@ static int exprSrcCount(Walker *pWalker, Expr *pExpr){ int i; struct SrcCount *p = pWalker->u.pSrcCount; SrcList *pSrc = p->pSrc; - for(i=0; inSrc; i++){ + int nSrc = pSrc ? pSrc->nSrc : 0; + for(i=0; iiTable==pSrc->a[i].iCursor ) break; } - if( inSrc ){ + if( inThis++; }else{ p->nOther++; diff --git a/test/fuzz2.test b/test/fuzz2.test index 989b00f056..4b3fb72e2d 100644 --- a/test/fuzz2.test +++ b/test/fuzz2.test @@ -12,7 +12,6 @@ # # This file checks error recovery from malformed SQL strings. # -# $Id: fuzz2.test,v 1.3 2007/05/15 16:51:37 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -105,4 +104,26 @@ do_test fuzz2-5.5 { fuzzcatch {SELECT ALL * GROUP BY EXISTS ( SELECT "AAAAAA" . * , AAAAAA ( * ) AS AAAAAA FROM "AAAAAA" . "AAAAAA" AS "AAAAAA" USING ( AAAAAA , "AAAAAA" , "AAAAAA" ) WHERE AAAAAA ( DISTINCT ) - RAISE ( FAIL , "AAAAAA" ) HAVING "AAAAAA" . "AAAAAA" . AAAAAA ORDER BY #182 , #55 ) BETWEEN EXISTS ( SELECT ALL * FROM ( ( } } {1} +# Test cases discovered by Michal Zalewski on 2015-01-03 and reported on the +# sqlite-users mailing list. All of these cases cause segfaults in +# SQLite 3.8.7.4 and earlier. +# +do_test fuzz2-6.1 { + catchsql {SELECT n()AND+#0;} +} {1 {near "#0": syntax error}} +do_test fuzz2-6.2 { + catchsql {SELECT strftime()} +} {0 {{}}} +do_test fuzz2-6.3 { + catchsql {DETACH(SELECT group_concat(q));} +} {1 {no such column: q}} +do_test fuzz2-6.4a { + db eval {DROP TABLE IF EXISTS t0; CREATE TABLE t0(t);} + catchsql {INSERT INTO t0 SELECT strftime();} +} {0 {}} +do_test fuzz2-6.4b { + db eval {SELECT quote(t) FROM t0} +} {NULL} + + finish_test From 179c59792ea9f96f675f35bd769315b997433055 Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 9 Jan 2015 19:36:36 +0000 Subject: [PATCH 12/34] Improvements to the sqlite3_stmt_scanstatus() documentation. No changes to code. FossilOrigin-Name: 9309c9bc08c3cd5a96ada76544b11cae8e480c7a --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/sqlite.h.in | 16 ++++++++++++---- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index 31bf9fc126..a85b72ba84 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthree\scrash\sproblems\sdiscovered\sby\safl-fuzz.\nTicket\s[a59ae93ee990a55]. -D 2015-01-09T01:27:29.636 +C Improvements\sto\sthe\ssqlite3_stmt_scanstatus()\sdocumentation.\s\sNo\schanges\nto\scode. +D 2015-01-09T19:36:36.557 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in b40b4c2a3a187c41ee657d3f0e0e0dfe8fd860b5 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -230,7 +230,7 @@ F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/select.c e4c38c75e36f28aed80a69a725d888751bfd53df F src/shell.c 1b7cb3efc5ae6fe82e36407508c4a6b00d8edde1 -F src/sqlite.h.in ed799ff5c814227c7957eb4f4a217f67fdc0da48 +F src/sqlite.h.in 9dfc99d6533d36d6a549c4f3f01cacc8be956ada F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d F src/sqliteInt.h 5d5716d8b33a61606c6ee10112f4b6df56f42725 @@ -1235,7 +1235,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 e1518a9478e1ce1ebd98894335e64c953064367f -R 0672c0c00968fffbda70996e37c442f8 +P fe5788633131281a0f27c5b75993ce2ff958bfeb +R 968521e641f3d87d432aac13f78240cc U drh -Z 8756c3c12d1aed88e2c7a41409182fc3 +Z aa8a1778082346ce604633a8e2db1126 diff --git a/manifest.uuid b/manifest.uuid index 833f237c5e..16283ee9b1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -fe5788633131281a0f27c5b75993ce2ff958bfeb \ No newline at end of file +9309c9bc08c3cd5a96ada76544b11cae8e480c7a \ No newline at end of file diff --git a/src/sqlite.h.in b/src/sqlite.h.in index e13ee0acc9..f2e802eb00 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -7486,6 +7486,10 @@ int sqlite3_vtab_on_conflict(sqlite3 *); ** [sqlite3_stmt_scanstatus(S,X,T,V)] interface. Each constant designates a ** different metric for sqlite3_stmt_scanstatus() to return. ** +** When the value returned to V is a string, space to hold that string is +** managed by the prepared statement S and will be automatically freed when +** S is finalized. +** **
** [[SQLITE_SCANSTAT_NLOOP]]
SQLITE_SCANSTAT_NLOOP
**
^The [sqlite3_int64] variable pointed to by the T parameter will be @@ -7531,7 +7535,14 @@ int sqlite3_vtab_on_conflict(sqlite3 *); /* ** CAPI3REF: Prepared Statement Scan Status ** -** Return status data for a single loop within query pStmt. +** This interface returns information about the predicted and measured +** performance for pStmt. Advanced applications can use this +** interface to compare the predicted and the measured performance and +** issue warnings and/or rerun [ANALYZE] if discrepancies are found. +** +** Since this interface is expected to be rarely used, it is only +** available if SQLite is compiled using the [SQLITE_ENABLE_STMT_SCANSTATUS] +** compile-time option. ** ** The "iScanStatusOp" parameter determines which status information to return. ** The "iScanStatusOp" must be one of the [scanstatus options] or the behavior @@ -7549,9 +7560,6 @@ int sqlite3_vtab_on_conflict(sqlite3 *); ** as if the loop did not exist - it returns non-zero and leave the variable ** that pOut points to unchanged. ** -** This API is only available if the library is built with pre-processor -** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined. -** ** See also: [sqlite3_stmt_scanstatus_reset()] */ SQLITE_EXPERIMENTAL int sqlite3_stmt_scanstatus( From ea18142624eb55cdf68234133ae233511f5c49a0 Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 9 Jan 2015 19:45:28 +0000 Subject: [PATCH 13/34] Remove an unused preprocessor macro from pcache.c. FossilOrigin-Name: 88a7a967116a48aeb5fa7014613c0134b1b47bb3 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/pcache.c | 12 ------------ 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/manifest b/manifest index a85b72ba84..263ee479e3 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improvements\sto\sthe\ssqlite3_stmt_scanstatus()\sdocumentation.\s\sNo\schanges\nto\scode. -D 2015-01-09T19:36:36.557 +C Remove\san\sunused\spreprocessor\smacro\sfrom\spcache.c. +D 2015-01-09T19:45:28.380 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in b40b4c2a3a187c41ee657d3f0e0e0dfe8fd860b5 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -219,7 +219,7 @@ F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21 F src/pager.c 4120a49ecd37697e28f5ed807f470b9c0b88410c F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77 F src/parse.y c5d0d964f9ac023e8154cad512e54b0b6058e086 -F src/pcache.c b83d160ce81ca101f98f0d27498e6d6bd49f1599 +F src/pcache.c d210cf90d04365a74f85d21374dded65af67b0cb F src/pcache.h b44658c9c932d203510279439d891a2a83e12ba8 F src/pcache1.c 1e77432b40b7d3288327d9cdf399dcdfd2b6d3bf F src/pragma.c bd33aa24456f043bb6f6d32a918bbeed41d8c591 @@ -1235,7 +1235,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 fe5788633131281a0f27c5b75993ce2ff958bfeb -R 968521e641f3d87d432aac13f78240cc +P 9309c9bc08c3cd5a96ada76544b11cae8e480c7a +R f6f554b5a802a4e92e3eab21f211953f U drh -Z aa8a1778082346ce604633a8e2db1126 +Z 8f6247c72b9adb2b1ac832e2c95df43e diff --git a/manifest.uuid b/manifest.uuid index 16283ee9b1..cd33bea19a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9309c9bc08c3cd5a96ada76544b11cae8e480c7a \ No newline at end of file +88a7a967116a48aeb5fa7014613c0134b1b47bb3 \ No newline at end of file diff --git a/src/pcache.c b/src/pcache.c index 0194f63bb9..467e2b3dee 100644 --- a/src/pcache.c +++ b/src/pcache.c @@ -31,18 +31,6 @@ struct PCache { PgHdr *pPage1; /* Reference to page 1 */ }; -/* -** Some of the assert() macros in this code are too expensive to run -** even during normal debugging. Use them only rarely on long-running -** tests. Enable the expensive asserts using the -** -DSQLITE_ENABLE_EXPENSIVE_ASSERT=1 compile-time option. -*/ -#ifdef SQLITE_ENABLE_EXPENSIVE_ASSERT -# define expensive_assert(X) assert(X) -#else -# define expensive_assert(X) -#endif - /********************************** Linked List Management ********************/ /* Allowed values for second argument to pcacheManageDirtyList() */ From 1a803843ce553f912b6ed4d3e2422f75a045b525 Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 9 Jan 2015 20:00:21 +0000 Subject: [PATCH 14/34] Add SQLITE_ENABLE_STMT_SCANSTATUS to the Update-Delete-Limit configuration in the releasetest.tcl script. FossilOrigin-Name: c70d5edaf6327cb18df5285c3fc21b610f3d3294 --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/releasetest.tcl | 2 ++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/manifest b/manifest index 263ee479e3..863ceeeee8 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\san\sunused\spreprocessor\smacro\sfrom\spcache.c. -D 2015-01-09T19:45:28.380 +C Add\sSQLITE_ENABLE_STMT_SCANSTATUS\sto\sthe\sUpdate-Delete-Limit\sconfiguration\nin\sthe\sreleasetest.tcl\sscript. +D 2015-01-09T20:00:21.586 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in b40b4c2a3a187c41ee657d3f0e0e0dfe8fd860b5 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl 1e68ec50478dce13b374904668fb7e09409371fb +F test/releasetest.tcl 58ede36fff67c0799e44995f2b025f8854773c0a F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1235,7 +1235,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 9309c9bc08c3cd5a96ada76544b11cae8e480c7a -R f6f554b5a802a4e92e3eab21f211953f +P 88a7a967116a48aeb5fa7014613c0134b1b47bb3 +R 366d7baead37fb35af2c9724ea29fa87 U drh -Z 8f6247c72b9adb2b1ac832e2c95df43e +Z 19a0bf2d773a4306e8c2ab9a5efe117f diff --git a/manifest.uuid b/manifest.uuid index cd33bea19a..2626721cda 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -88a7a967116a48aeb5fa7014613c0134b1b47bb3 \ No newline at end of file +c70d5edaf6327cb18df5285c3fc21b610f3d3294 \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 3766dbd421..51bf29e31c 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -53,6 +53,7 @@ array set ::Configs { -O2 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1 + -DSQLITE_ENABLE_STMT_SCANSTATUS } "Check-Symbols" { -DSQLITE_MEMDEBUG=1 @@ -69,6 +70,7 @@ array set ::Configs { -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1 -DSQLITE_ENABLE_STAT4 + -DSQLITE_ENABLE_STMT_SCANSTATUS } "Debug-One" { --disable-shared From db6bafaeb8d693473eba49aafdd8927597d7b83e Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 9 Jan 2015 21:54:58 +0000 Subject: [PATCH 15/34] Change the testfixture binary so that it explicitly enabled core files on a crash (on unix). Add a test case to verify that this works. FossilOrigin-Name: 90f422ed81311d7ab2a90a381d36cba9c20227fc --- manifest | 16 ++++++++-------- manifest.uuid | 2 +- src/tclsqlite.c | 16 ++++++++++++++++ src/test1.c | 5 +++++ test/releasetest.tcl | 6 ++++++ 5 files changed, 36 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 863ceeeee8..07e62d4ef6 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sSQLITE_ENABLE_STMT_SCANSTATUS\sto\sthe\sUpdate-Delete-Limit\sconfiguration\nin\sthe\sreleasetest.tcl\sscript. -D 2015-01-09T20:00:21.586 +C Change\sthe\stestfixture\sbinary\sso\sthat\sit\sexplicitly\senabled\score\sfiles\s\non\sa\scrash\s(on\sunix).\s\sAdd\sa\stest\scase\sto\sverify\sthat\sthis\sworks. +D 2015-01-09T21:54:58.894 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in b40b4c2a3a187c41ee657d3f0e0e0dfe8fd860b5 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -237,8 +237,8 @@ F src/sqliteInt.h 5d5716d8b33a61606c6ee10112f4b6df56f42725 F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c 81712116e826b0089bb221b018929536b2b5406f F src/table.c e7a09215315a978057fb42c640f890160dbcc45e -F src/tclsqlite.c c6a21c64da1490e14d53cdc2062d1e2e57942622 -F src/test1.c 460d39e7abbcd0c61c9788c06e0d925f4d1e6a22 +F src/tclsqlite.c b1d0a181a9f8e8dae960370518a3450db93a6a8c +F src/test1.c 163cff8c4ebdda512e3b055716e3cc7f0e563a44 F src/test2.c 98049e51a17dc62606a99a9eb95ee477f9996712 F src/test3.c 1c0e5d6f080b8e33c1ce8b3078e7013fdbcd560c F src/test4.c 9b32d22f5f150abe23c1830e2057c4037c45b3df @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl 58ede36fff67c0799e44995f2b025f8854773c0a +F test/releasetest.tcl c7a6647a96745dff41c08a80064e16da48177c43 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1235,7 +1235,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 88a7a967116a48aeb5fa7014613c0134b1b47bb3 -R 366d7baead37fb35af2c9724ea29fa87 +P c70d5edaf6327cb18df5285c3fc21b610f3d3294 +R 521b82eb1167efbcde785d8c3ea7771d U drh -Z 19a0bf2d773a4306e8c2ab9a5efe117f +Z a63c757fcfd64e46bc375106b9e33672 diff --git a/manifest.uuid b/manifest.uuid index 2626721cda..b43c28f7e3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c70d5edaf6327cb18df5285c3fc21b610f3d3294 \ No newline at end of file +90f422ed81311d7ab2a90a381d36cba9c20227fc \ No newline at end of file diff --git a/src/tclsqlite.c b/src/tclsqlite.c index 32de527301..852f966a85 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -3813,6 +3813,11 @@ static void init_all(Tcl_Interp *interp){ #endif } +/* Needed for the setrlimit() system call on unix */ +#if defined(unix) +#include +#endif + #define TCLSH_MAIN main /* Needed to fake out mktclapp */ int TCLSH_MAIN(int argc, char **argv){ Tcl_Interp *interp; @@ -3826,6 +3831,17 @@ int TCLSH_MAIN(int argc, char **argv){ } #endif + /* Since the primary use case for this binary is testing of SQLite, + ** be sure to generate core files if we crash */ +#if defined(SQLITE_TEST) && defined(unix) + { struct rlimit x; + getrlimit(RLIMIT_CORE, &x); + x.rlim_cur = x.rlim_max; + setrlimit(RLIMIT_CORE, &x); + } +#endif /* SQLITE_TEST && unix */ + + /* Call sqlite3_shutdown() once before doing anything else. This is to ** test that sqlite3_shutdown() can be safely called by a process before ** sqlite3_initialize() is. */ diff --git a/src/test1.c b/src/test1.c index 8cbce70731..475473d77c 100644 --- a/src/test1.c +++ b/src/test1.c @@ -6618,6 +6618,7 @@ static int test_user_delete( ** 1 Overflow a signed integer ** 2 Jump based on an uninitialized variable ** 3 Read after free +** 4 Panic */ static int test_bad_behavior( ClientData clientData, /* Pointer to an integer containing zero */ @@ -6656,6 +6657,10 @@ static int test_bad_behavior( Tcl_SetObjResult(interp, Tcl_NewIntObj(a[i])); break; } + case 4: { + Tcl_Panic("Deliberate panic"); + break; + } } return TCL_OK; } diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 51bf29e31c..7d843bb324 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -169,6 +169,7 @@ array set ::Configs { Fail0 {-O0} Fail2 {-O0} Fail3 {-O0} + Fail4 {-O0} } array set ::Platforms { @@ -210,6 +211,7 @@ array set ::Platforms { Sanitize "TEST_FAILURE=1 test" Fail2 "TEST_FAILURE=2 valgrindtest" Fail3 "TEST_FAILURE=3 valgrindtest" + Fail4 "TEST_FAILURE=4 test" } } @@ -278,6 +280,9 @@ proc count_tests_and_errors {logfile rcVar errmsgVar} { if {!$seen} { set rc 1 set errmsg "Test did not complete" + if {[file readable core]} { + append errmsg " - core file exists" + } } } @@ -331,6 +336,7 @@ proc run_test_suite {name testtarget config} { trace_cmd file mkdir $dir trace_cmd cd $dir set errmsg {} + catch {file delete core} set rc [catch [configureCommand $configOpts]] if {!$rc} { set rc [catch [makeCommand $testtarget $cflags $opts]] From 05c7e0bdb6636e1d009f6313b776cd9e5a994ccf Mon Sep 17 00:00:00 2001 From: drh Date: Sat, 10 Jan 2015 14:27:17 +0000 Subject: [PATCH 16/34] Autoconf configure script updates: (1) remove the long-obsolete --enable-cross-thread-connections option. (2) remove the --with-hints= options. (3) Extension loading is enabled by default. (4) Check for strchrnull() (5) Update the --help text. FossilOrigin-Name: 5004063ce4c8816125372ecc5fd52140489306dd --- Makefile.in | 2 +- config.h.in | 3 ++ configure | 111 +++++++++----------------------------------------- configure.ac | 80 +++--------------------------------- manifest | 18 ++++---- manifest.uuid | 2 +- 6 files changed, 39 insertions(+), 177 deletions(-) diff --git a/Makefile.in b/Makefile.in index 42caa69835..01a7a570b8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -41,7 +41,7 @@ TCC += -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite # Omitting the define will cause extra debugging code to be inserted and # includes extra comments when "EXPLAIN stmt" is used. # -TCC += @TARGET_DEBUG@ @XTHREADCONNECT@ +TCC += @TARGET_DEBUG@ # Compiler options needed for programs that use the TCL library. # diff --git a/config.h.in b/config.h.in index efc1d47bc6..3d3c8c202a 100644 --- a/config.h.in +++ b/config.h.in @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H +/* Define to 1 if you have the strchrnul() function */ +#undef HAVE_STRCHRNUL + /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H diff --git a/configure b/configure index c0f751db62..25a7043b95 100755 --- a/configure +++ b/configure @@ -868,7 +868,6 @@ RELEASE VERSION_NUMBER BUILD_CC SQLITE_THREADSAFE -XTHREADCONNECT ALLOWRELEASE TEMP_STORE BUILD_EXEEXT @@ -906,9 +905,7 @@ enable_fast_install with_gnu_ld enable_libtool_lock enable_largefile -with_hints enable_threadsafe -enable_cross_thread_connections enable_releasemode enable_tempstore enable_tcl @@ -1562,9 +1559,7 @@ Optional Features: optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-largefile omit support for large files - --enable-threadsafe Support threadsafe operation - --enable-cross-thread-connections - Allow connection sharing across threads + --disable-threadsafe Disable mutexing --enable-releasemode Support libtool link to release mode --enable-tempstore Use an in-ram database for temporary tables (never,no,yes,always) @@ -1573,7 +1568,8 @@ Optional Features: --enable-debug enable debugging & verbose explain --disable-amalgamation Disable the amalgamation and instead build all files separately - --enable-load-extension Enable loading of external extensions + --disable-load-extension + Disable loading of external extensions --enable-gcov Enable coverage testing using gcov Optional Packages: @@ -1582,7 +1578,6 @@ Optional Packages: --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-hints=FILE Read configuration options from FILE --with-tcl=DIR directory containing tcl configuration (tclConfig.sh) --with-readline-lib specify readline library @@ -2058,9 +2053,6 @@ please regen with autoconf" >&2;} { (exit 1); exit 1; }; } fi -# The following RCS revision string applies to configure.in -# $Revision: 1.56 $ - ######### # Programs needed # @@ -3732,13 +3724,13 @@ if test "${lt_cv_nm_interface+set}" = set; then else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:3735: $ac_compile\"" >&5) + (eval echo "\"\$as_me:3727: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:3738: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:3730: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:3741: output\"" >&5) + (eval echo "\"\$as_me:3733: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -4960,7 +4952,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4963 "configure"' > conftest.$ac_ext + echo '#line 4955 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -6829,11 +6821,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6832: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6824: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6836: \$? = $ac_status" >&5 + echo "$as_me:6828: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7168,11 +7160,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7171: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7163: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7175: \$? = $ac_status" >&5 + echo "$as_me:7167: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7273,11 +7265,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7276: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7268: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7280: \$? = $ac_status" >&5 + echo "$as_me:7272: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -7328,11 +7320,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7331: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7323: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7335: \$? = $ac_status" >&5 + echo "$as_me:7327: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10141,7 +10133,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10144 "configure" +#line 10136 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10237,7 +10229,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10240 "configure" +#line 10232 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12146,7 +12138,8 @@ done -for ac_func in usleep fdatasync localtime_r gmtime_r localtime_s utime malloc_usable_size + +for ac_func in usleep fdatasync localtime_r gmtime_r localtime_s utime malloc_usable_size strchrnul do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -12342,45 +12335,6 @@ VERSION_NUMBER=`cat $srcdir/VERSION \ $as_echo "$as_me: Version number set to $VERSION_NUMBER" >&6;} -######### -# Check to see if the --with-hints=FILE option is used. If there is none, -# then check for a files named "$host.hints" and ../$hosts.hints where -# $host is the hostname of the build system. If still no hints are -# found, try looking in $system.hints and ../$system.hints where -# $system is the result of uname -s. -# - -# Check whether --with-hints was given. -if test "${with_hints+set}" = set; then - withval=$with_hints; hints=$withval -fi - -if test "$hints" = ""; then - host=`hostname | sed 's/\..*//'` - if test -r $host.hints; then - hints=$host.hints - else - if test -r ../$host.hints; then - hints=../$host.hints - fi - fi -fi -if test "$hints" = ""; then - sys=`uname -s` - if test -r $sys.hints; then - hints=$sys.hints - else - if test -r ../$sys.hints; then - hints=../$sys.hints - fi - fi -fi -if test "$hints" != ""; then - { $as_echo "$as_me:$LINENO: result: reading hints from $hints" >&5 -$as_echo "reading hints from $hints" >&6; } - . $hints -fi - ######### # Locate a compiler for the build machine. This compiler should # generate command-line programs that run on the build machine. @@ -12552,31 +12506,6 @@ fi fi -########## -# Do we want to allow a connection created in one thread to be used -# in another thread. This does not work on many Linux systems (ex: RedHat 9) -# due to bugs in the threading implementations. This is thus off by default. -# -# Check whether --enable-cross-thread-connections was given. -if test "${enable_cross_thread_connections+set}" = set; then - enableval=$enable_cross_thread_connections; -else - enable_xthreadconnect=no -fi - -{ $as_echo "$as_me:$LINENO: checking whether to allow connections to be shared across threads" >&5 -$as_echo_n "checking whether to allow connections to be shared across threads... " >&6; } -if test "$enable_xthreadconnect" = "no"; then - XTHREADCONNECT='' - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -else - XTHREADCONNECT='-DSQLITE_ALLOW_XTHREAD_CONNECT=1' - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } -fi - - ########## # Do we want to support release # @@ -13427,7 +13356,7 @@ fi if test "${enable_load_extension+set}" = set; then enableval=$enable_load_extension; use_loadextension=$enableval else - use_loadextension=no + use_loadextension=yes fi if test "${use_loadextension}" = "yes" ; then diff --git a/configure.ac b/configure.ac index 2e70f2c235..39c7a71a16 100644 --- a/configure.ac +++ b/configure.ac @@ -69,19 +69,6 @@ # The filename extension for executables on the # target platform. "" for Unix and ".exe" for windows. # -# The generated configure script will make an attempt to guess -# at all of the above parameters. You can override any of -# the guesses by setting the environment variable named -# "config_AAAA" where "AAAA" is the name of the parameter -# described above. (Exception: srcdir cannot be set this way.) -# If you have a file that sets one or more of these environment -# variables, you can invoke configure as follows: -# -# configure --with-hints=FILE -# -# where FILE is the name of the file that sets the environment -# variables. FILE should be an absolute pathname. -# # This configure.in file is easy to reuse on other projects. Just # change the argument to AC_INIT(). And disable any features that # you don't need (for example BLT) by erasing or commenting out @@ -98,11 +85,6 @@ AC_MSG_ERROR([configure script is out of date: please regen with autoconf]) fi -dnl Put the RCS revision string after AC_INIT so that it will also -dnl show in in configure. -# The following RCS revision string applies to configure.in -# $Revision: 1.56 $ - ######### # Programs needed # @@ -127,7 +109,7 @@ AC_CHECK_HEADERS([sys/types.h stdlib.h stdint.h inttypes.h malloc.h]) ######### # Figure out whether or not we have these functions # -AC_CHECK_FUNCS([usleep fdatasync localtime_r gmtime_r localtime_s utime malloc_usable_size]) +AC_CHECK_FUNCS([usleep fdatasync localtime_r gmtime_r localtime_s utime malloc_usable_size strchrnul]) ######### # By default, we use the amalgamation (this may be changed below...) @@ -180,41 +162,6 @@ VERSION_NUMBER=[`cat $srcdir/VERSION \ AC_MSG_NOTICE(Version number set to $VERSION_NUMBER) AC_SUBST(VERSION_NUMBER) -######### -# Check to see if the --with-hints=FILE option is used. If there is none, -# then check for a files named "$host.hints" and ../$hosts.hints where -# $host is the hostname of the build system. If still no hints are -# found, try looking in $system.hints and ../$system.hints where -# $system is the result of uname -s. -# -AC_ARG_WITH(hints, - AC_HELP_STRING([--with-hints=FILE],[Read configuration options from FILE]), - hints=$withval) -if test "$hints" = ""; then - host=`hostname | sed 's/\..*//'` - if test -r $host.hints; then - hints=$host.hints - else - if test -r ../$host.hints; then - hints=../$host.hints - fi - fi -fi -if test "$hints" = ""; then - sys=`uname -s` - if test -r $sys.hints; then - hints=$sys.hints - else - if test -r ../$sys.hints; then - hints=../$sys.hints - fi - fi -fi -if test "$hints" != ""; then - AC_MSG_RESULT(reading hints from $hints) - . $hints -fi - ######### # Locate a compiler for the build machine. This compiler should # generate command-line programs that run on the build machine. @@ -236,7 +183,7 @@ AC_SUBST(BUILD_CC) # Do we want to support multithreaded use of sqlite # AC_ARG_ENABLE(threadsafe, -AC_HELP_STRING([--enable-threadsafe],[Support threadsafe operation]),,enable_threadsafe=yes) +AC_HELP_STRING([--disable-threadsafe],[Disable mutexing]),,enable_threadsafe=yes) AC_MSG_CHECKING([whether to support threadsafe operation]) if test "$enable_threadsafe" = "no"; then SQLITE_THREADSAFE=0 @@ -251,23 +198,6 @@ if test "$SQLITE_THREADSAFE" = "1"; then AC_SEARCH_LIBS(pthread_create, pthread) fi -########## -# Do we want to allow a connection created in one thread to be used -# in another thread. This does not work on many Linux systems (ex: RedHat 9) -# due to bugs in the threading implementations. This is thus off by default. -# -AC_ARG_ENABLE(cross-thread-connections, -AC_HELP_STRING([--enable-cross-thread-connections],[Allow connection sharing across threads]),,enable_xthreadconnect=no) -AC_MSG_CHECKING([whether to allow connections to be shared across threads]) -if test "$enable_xthreadconnect" = "no"; then - XTHREADCONNECT='' - AC_MSG_RESULT([no]) -else - XTHREADCONNECT='-DSQLITE_ALLOW_XTHREAD_CONNECT=1' - AC_MSG_RESULT([yes]) -fi -AC_SUBST(XTHREADCONNECT) - ########## # Do we want to support release # @@ -605,9 +535,9 @@ AC_SUBST(USE_AMALGAMATION) ######### # See whether we should allow loadable extensions -AC_ARG_ENABLE(load-extension, AC_HELP_STRING([--enable-load-extension], - [Enable loading of external extensions]), - [use_loadextension=$enableval],[use_loadextension=no]) +AC_ARG_ENABLE(load-extension, AC_HELP_STRING([--disable-load-extension], + [Disable loading of external extensions]), + [use_loadextension=$enableval],[use_loadextension=yes]) if test "${use_loadextension}" = "yes" ; then OPT_FEATURE_FLAGS="" AC_SEARCH_LIBS(dlopen, dl) diff --git a/manifest b/manifest index 07e62d4ef6..a0918609eb 100644 --- a/manifest +++ b/manifest @@ -1,7 +1,7 @@ -C Change\sthe\stestfixture\sbinary\sso\sthat\sit\sexplicitly\senabled\score\sfiles\s\non\sa\scrash\s(on\sunix).\s\sAdd\sa\stest\scase\sto\sverify\sthat\sthis\sworks. -D 2015-01-09T21:54:58.894 +C Autoconf\sconfigure\sscript\supdates:\s\s(1)\sremove\sthe\slong-obsolete\n--enable-cross-thread-connections\soption.\s\s(2)\sremove\sthe\s--with-hints=\soptions.\n(3)\sExtension\sloading\sis\senabled\sby\sdefault.\s\s(4)\sCheck\sfor\sstrchrnull()\n(5)\sUpdate\sthe\s--help\stext. +D 2015-01-10T14:27:17.510 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in b40b4c2a3a187c41ee657d3f0e0e0dfe8fd860b5 +F Makefile.in 876093578650b28af50a20c819993ee779885adb F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 @@ -36,10 +36,10 @@ F autoconf/tea/win/makefile.vc f89d0184d0eee5f7e356ea407964dcd139939928 F autoconf/tea/win/nmakehlp.c 2070e086f39866b353a482d3a14dedaf26196506 F autoconf/tea/win/rules.vc c511f222b80064096b705dbeb97060ee1d6b6d63 F config.guess 226d9a188c6196f3033ffc651cbc9dcee1a42977 -F config.h.in 0921066a13130082764ab4ab6456f7b5bebe56de +F config.h.in 3e31d7366de5d76ecde79417c34fb469c8fd963d F config.sub 9ebe4c3b3dab6431ece34f16828b594fb420da55 -F configure 4343c810cc772571210af75d1a8f7c2eb711d75a x -F configure.ac 4cf9f60785143fa141b10962ccc885d973792e9a +F configure cc8ccb52cba371fef29990f1e33695c25fdcaf86 x +F configure.ac 1d3ece7d3830eb92aaa3933628d0515998d68aa5 F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad F doc/lemon.html 334dbf6621b8fb8790297ec1abf3cfa4621709d1 F doc/pager-invariants.txt 27fed9a70ddad2088750c4a2b493b63853da2710 @@ -1235,7 +1235,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 c70d5edaf6327cb18df5285c3fc21b610f3d3294 -R 521b82eb1167efbcde785d8c3ea7771d +P 90f422ed81311d7ab2a90a381d36cba9c20227fc +R c5a4ce14614667baa6ac385b32cb8bb4 U drh -Z a63c757fcfd64e46bc375106b9e33672 +Z 991825883a98cc750918a7830191009b diff --git a/manifest.uuid b/manifest.uuid index b43c28f7e3..24e0fa7fca 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -90f422ed81311d7ab2a90a381d36cba9c20227fc \ No newline at end of file +5004063ce4c8816125372ecc5fd52140489306dd \ No newline at end of file From 6aed1c4ff0785bcfc0cfa4a6d870df7f52c315b1 Mon Sep 17 00:00:00 2001 From: drh Date: Sat, 10 Jan 2015 15:21:26 +0000 Subject: [PATCH 17/34] Add the ability to put comments in the Config and Platform setup sections of the releasetest.tcl script. FossilOrigin-Name: d6f8c899d8f1bf66a2234e0eb91b259dd64eed31 --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/releasetest.tcl | 26 ++++++++++++++++++++++---- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index a0918609eb..08193af1d2 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Autoconf\sconfigure\sscript\supdates:\s\s(1)\sremove\sthe\slong-obsolete\n--enable-cross-thread-connections\soption.\s\s(2)\sremove\sthe\s--with-hints=\soptions.\n(3)\sExtension\sloading\sis\senabled\sby\sdefault.\s\s(4)\sCheck\sfor\sstrchrnull()\n(5)\sUpdate\sthe\s--help\stext. -D 2015-01-10T14:27:17.510 +C Add\sthe\sability\sto\sput\scomments\sin\sthe\sConfig\sand\sPlatform\ssetup\ssections\sof\nthe\sreleasetest.tcl\sscript. +D 2015-01-10T15:21:26.432 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 876093578650b28af50a20c819993ee779885adb F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl c7a6647a96745dff41c08a80064e16da48177c43 +F test/releasetest.tcl 70cf548d0d3dd57c6bd689ba4d68a75ac651ccde F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1235,7 +1235,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 90f422ed81311d7ab2a90a381d36cba9c20227fc -R c5a4ce14614667baa6ac385b32cb8bb4 +P 5004063ce4c8816125372ecc5fd52140489306dd +R 0032fe6b65d76fb914bf757ab4a44e02 U drh -Z 991825883a98cc750918a7830191009b +Z a5cee4a786b96df9f5af795aa5d3dc7a diff --git a/manifest.uuid b/manifest.uuid index 24e0fa7fca..6cb3dd802a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -5004063ce4c8816125372ecc5fd52140489306dd \ No newline at end of file +d6f8c899d8f1bf66a2234e0eb91b259dd64eed31 \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 7d843bb324..1d6ca184ad 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -29,7 +29,14 @@ Every test begins with a fresh run of the configure script at the top of the SQLite source tree. } -array set ::Configs { +# Omit comments (text between # and \n) in a long multi-line string. +# +proc strip_comments {in} { + regsub -all {#[^\n]*\n} $in {} out + return $out +} + +array set ::Configs [strip_comments { "Default" { -O2 --disable-amalgamation --disable-shared @@ -166,13 +173,19 @@ array set ::Configs { -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE } + + # The next group of configurations are used only by the + # Failure-Detection platform. They are all the same, but we need + # different names for them all so that they results appear in separate + # subdirectories. + # Fail0 {-O0} Fail2 {-O0} Fail3 {-O0} Fail4 {-O0} -} +}] -array set ::Platforms { +array set ::Platforms [strip_comments { Linux-x86_64 { "Check-Symbols" checksymbols "Debug-One" "mptest test" @@ -206,6 +219,11 @@ array set ::Platforms { "Windows NT-intel" { "Default" "mptest fulltestonly" } + + # The Failure-Detection platform runs various tests that deliberately + # fail. This is used as a test of this script to verify that this script + # correctly identifies failures. + # Failure-Detection { Fail0 "TEST_FAILURE=0 test" Sanitize "TEST_FAILURE=1 test" @@ -213,7 +231,7 @@ array set ::Platforms { Fail3 "TEST_FAILURE=3 valgrindtest" Fail4 "TEST_FAILURE=4 test" } -} +}] # End of configuration section. From 0ede9ebec71f6d7f7c1427d59c2c4705e7182251 Mon Sep 17 00:00:00 2001 From: drh Date: Sat, 10 Jan 2015 16:49:23 +0000 Subject: [PATCH 18/34] Improvements to compile-time-option hygiene. Use "#if OPTION" instead of "#ifdef OPTION" in cases where that makes sense, so that -DOPTION=0 will work. Add the "Have-Not" configuration in releasetest.tcl which disables all of the "HAVE_component" compile-time options. FossilOrigin-Name: 9e92a5ed5aaba20461ed4ce8359d6e34e7773d68 --- manifest | 30 +++--- manifest.uuid | 2 +- src/ctime.c | 218 +++++++++++++++++++++---------------------- src/date.c | 12 +-- src/main.c | 2 +- src/mem1.c | 6 +- src/printf.c | 11 --- src/shell.c | 13 ++- src/sqliteInt.h | 2 +- src/test_config.c | 2 +- src/util.c | 8 +- test/releasetest.tcl | 22 ++++- 12 files changed, 167 insertions(+), 161 deletions(-) diff --git a/manifest b/manifest index 08193af1d2..11f65e9adf 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\sability\sto\sput\scomments\sin\sthe\sConfig\sand\sPlatform\ssetup\ssections\sof\nthe\sreleasetest.tcl\sscript. -D 2015-01-10T15:21:26.432 +C Improvements\sto\scompile-time-option\shygiene.\s\sUse\s"#if\sOPTION"\sinstead\sof\n"#ifdef\sOPTION"\sin\scases\swhere\sthat\smakes\ssense,\sso\sthat\s-DOPTION=0\swill\swork.\nAdd\sthe\s"Have-Not"\sconfiguration\sin\sreleasetest.tcl\swhich\sdisables\sall\sof\nthe\s"HAVE_component"\scompile-time\soptions. +D 2015-01-10T16:49:23.031 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 876093578650b28af50a20c819993ee779885adb F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -179,8 +179,8 @@ F src/btreeInt.h a3d0ae1d511365e1a2b76ad10960dbe55c286f34 F src/build.c f5cfd7b32216f695b995bbc7c1a395f6d451d11f F src/callback.c 7b44ce59674338ad48b0e84e7b72f935ea4f68b0 F src/complete.c 198a0066ba60ab06fc00fba1998d870a4d575463 -F src/ctime.c df19848891c8a553c80e6f5a035e768280952d1a -F src/date.c 53cedb541686b30eb5495753f0b622909a928780 +F src/ctime.c 98f89724adc891a1a4c655bee04e33e716e05887 +F src/date.c e4d50b3283696836ec1036b695ead9a19e37a5ac F src/delete.c 0750b1eb4d96cd3fb2c798599a3a7c85e92f1417 F src/expr.c 7be80f7dc337329a24df45c2f3bdb2ea3b64c90e F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb @@ -195,10 +195,10 @@ F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e F src/lempar.c 7274c97d24bb46631e504332ccd3bd1b37841770 F src/loadext.c 86bd4e2fccd520b748cba52492ab60c4a770f660 -F src/main.c b0a7f3f9ff70106b7735f38c602d1b3ca56eb065 +F src/main.c 54c26e3f92153db87be276ca72605e7aa4c78029 F src/malloc.c 740db54387204c9a2eb67c6d98e68b08e9ef4eab F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 -F src/mem1.c faf615aafd8be74a71494dfa027c113ea5c6615f +F src/mem1.c abe6ee469b6c5a35c7f22bfeb9c9bac664a1c987 F src/mem2.c f1940d9e91948dd6a908fbb9ce3835c36b5d83c3 F src/mem3.c 61c9d47b792908c532ca3a62b999cf21795c6534 F src/mem5.c 61eeb90134f9a5be6c2e68d8daae7628b25953fb @@ -224,16 +224,16 @@ F src/pcache.h b44658c9c932d203510279439d891a2a83e12ba8 F src/pcache1.c 1e77432b40b7d3288327d9cdf399dcdfd2b6d3bf F src/pragma.c bd33aa24456f043bb6f6d32a918bbeed41d8c591 F src/prepare.c 173a5a499138451b2561614ecb87d78f9f4644b9 -F src/printf.c 9e75a6a0b55bf61cfff7d7e19d89834a1b938236 +F src/printf.c ea82bcb1b83273b4c67177c233c1f78c81fc42f9 F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/select.c e4c38c75e36f28aed80a69a725d888751bfd53df -F src/shell.c 1b7cb3efc5ae6fe82e36407508c4a6b00d8edde1 +F src/shell.c 96ba1f6300d36b8c8694ee9e27edf92590f384b4 F src/sqlite.h.in 9dfc99d6533d36d6a549c4f3f01cacc8be956ada F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d -F src/sqliteInt.h 5d5716d8b33a61606c6ee10112f4b6df56f42725 +F src/sqliteInt.h 8cdd843985cdc28bf5f291d89dc23a410a50f5ae F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c 81712116e826b0089bb221b018929536b2b5406f F src/table.c e7a09215315a978057fb42c640f890160dbcc45e @@ -252,7 +252,7 @@ F src/test_autoext.c dea8a01a7153b9adc97bd26161e4226329546e12 F src/test_backup.c 3875e899222b651e18b662f86e0e50daa946344e F src/test_blob.c 1f2e3e25255b731c4fcf15ee7990d06347cb6c09 F src/test_btree.c 2e9978eca99a9a4bfa8cae949efb00886860a64f -F src/test_config.c 035c17a173937d019b8dfc1d524f9d3fc8123504 +F src/test_config.c e7b2e1634324d746aa5e1c7e0929470e8be27953 F src/test_demovfs.c 69b2085076654ebc18014cbc6386f04409c959a9 F src/test_devsym.c e7498904e72ba7491d142d5c83b476c4e76993bc F src/test_fs.c ced436e3d4b8e4681328409b8081051ce614e28f @@ -289,7 +289,7 @@ F src/tokenize.c e00458c9938072b0ea711c850b8dcf4ddcb5fe18 F src/trigger.c 25571661fdeae8c7f975ff40ffec205520a3f92f F src/update.c 3c4ecc282accf12d39edb8d524cf089645e55a13 F src/utf.c fc6b889ba0779b7722634cdeaa25f1930d93820c -F src/util.c 3b627daa45c7308c1e36e3dbaa3f9ce7e5c7fa73 +F src/util.c 98a7627ca48ad3265b6940915a1d08355eb3fc7e F src/vacuum.c 9b30ec729337dd012ed88d4c292922c8ef9cf00c F src/vdbe.c 1a9e671c9cfc259e4d2affc71f7df4a4c00a842c F src/vdbe.h 6fc69d9c5e146302c56e163cb4b31d1ee64a18c3 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl 70cf548d0d3dd57c6bd689ba4d68a75ac651ccde +F test/releasetest.tcl b40c2e3eb7931b925e38d1d18a51fe4a55fc77c2 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1235,7 +1235,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 5004063ce4c8816125372ecc5fd52140489306dd -R 0032fe6b65d76fb914bf757ab4a44e02 +P d6f8c899d8f1bf66a2234e0eb91b259dd64eed31 +R b95d8ce08215c7ec2a42770b5c7b6593 U drh -Z a5cee4a786b96df9f5af795aa5d3dc7a +Z 921820c75b1deafea4774745e8ce3c77 diff --git a/manifest.uuid b/manifest.uuid index 6cb3dd802a..d798d891eb 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d6f8c899d8f1bf66a2234e0eb91b259dd64eed31 \ No newline at end of file +9e92a5ed5aaba20461ed4ce8359d6e34e7773d68 \ No newline at end of file diff --git a/src/ctime.c b/src/ctime.c index 59dc972d8d..4f98ffef61 100644 --- a/src/ctime.c +++ b/src/ctime.c @@ -33,91 +33,91 @@ static const char * const azCompileOpt[] = { #define CTIMEOPT_VAL_(opt) #opt #define CTIMEOPT_VAL(opt) CTIMEOPT_VAL_(opt) -#ifdef SQLITE_32BIT_ROWID +#if SQLITE_32BIT_ROWID "32BIT_ROWID", #endif -#ifdef SQLITE_4_BYTE_ALIGNED_MALLOC +#if SQLITE_4_BYTE_ALIGNED_MALLOC "4_BYTE_ALIGNED_MALLOC", #endif -#ifdef SQLITE_CASE_SENSITIVE_LIKE +#if SQLITE_CASE_SENSITIVE_LIKE "CASE_SENSITIVE_LIKE", #endif -#ifdef SQLITE_CHECK_PAGES +#if SQLITE_CHECK_PAGES "CHECK_PAGES", #endif -#ifdef SQLITE_COVERAGE_TEST +#if SQLITE_COVERAGE_TEST "COVERAGE_TEST", #endif -#ifdef SQLITE_DEBUG +#if SQLITE_DEBUG "DEBUG", #endif -#ifdef SQLITE_DEFAULT_LOCKING_MODE +#if SQLITE_DEFAULT_LOCKING_MODE "DEFAULT_LOCKING_MODE=" CTIMEOPT_VAL(SQLITE_DEFAULT_LOCKING_MODE), #endif #if defined(SQLITE_DEFAULT_MMAP_SIZE) && !defined(SQLITE_DEFAULT_MMAP_SIZE_xc) "DEFAULT_MMAP_SIZE=" CTIMEOPT_VAL(SQLITE_DEFAULT_MMAP_SIZE), #endif -#ifdef SQLITE_DISABLE_DIRSYNC +#if SQLITE_DISABLE_DIRSYNC "DISABLE_DIRSYNC", #endif -#ifdef SQLITE_DISABLE_LFS +#if SQLITE_DISABLE_LFS "DISABLE_LFS", #endif -#ifdef SQLITE_ENABLE_API_ARMOR +#if SQLITE_ENABLE_API_ARMOR "ENABLE_API_ARMOR", #endif -#ifdef SQLITE_ENABLE_ATOMIC_WRITE +#if SQLITE_ENABLE_ATOMIC_WRITE "ENABLE_ATOMIC_WRITE", #endif -#ifdef SQLITE_ENABLE_CEROD +#if SQLITE_ENABLE_CEROD "ENABLE_CEROD", #endif -#ifdef SQLITE_ENABLE_COLUMN_METADATA +#if SQLITE_ENABLE_COLUMN_METADATA "ENABLE_COLUMN_METADATA", #endif -#ifdef SQLITE_ENABLE_EXPENSIVE_ASSERT +#if SQLITE_ENABLE_EXPENSIVE_ASSERT "ENABLE_EXPENSIVE_ASSERT", #endif -#ifdef SQLITE_ENABLE_FTS1 +#if SQLITE_ENABLE_FTS1 "ENABLE_FTS1", #endif -#ifdef SQLITE_ENABLE_FTS2 +#if SQLITE_ENABLE_FTS2 "ENABLE_FTS2", #endif -#ifdef SQLITE_ENABLE_FTS3 +#if SQLITE_ENABLE_FTS3 "ENABLE_FTS3", #endif -#ifdef SQLITE_ENABLE_FTS3_PARENTHESIS +#if SQLITE_ENABLE_FTS3_PARENTHESIS "ENABLE_FTS3_PARENTHESIS", #endif -#ifdef SQLITE_ENABLE_FTS4 +#if SQLITE_ENABLE_FTS4 "ENABLE_FTS4", #endif -#ifdef SQLITE_ENABLE_ICU +#if SQLITE_ENABLE_ICU "ENABLE_ICU", #endif -#ifdef SQLITE_ENABLE_IOTRACE +#if SQLITE_ENABLE_IOTRACE "ENABLE_IOTRACE", #endif -#ifdef SQLITE_ENABLE_LOAD_EXTENSION +#if SQLITE_ENABLE_LOAD_EXTENSION "ENABLE_LOAD_EXTENSION", #endif -#ifdef SQLITE_ENABLE_LOCKING_STYLE +#if SQLITE_ENABLE_LOCKING_STYLE "ENABLE_LOCKING_STYLE=" CTIMEOPT_VAL(SQLITE_ENABLE_LOCKING_STYLE), #endif -#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT +#if SQLITE_ENABLE_MEMORY_MANAGEMENT "ENABLE_MEMORY_MANAGEMENT", #endif -#ifdef SQLITE_ENABLE_MEMSYS3 +#if SQLITE_ENABLE_MEMSYS3 "ENABLE_MEMSYS3", #endif -#ifdef SQLITE_ENABLE_MEMSYS5 +#if SQLITE_ENABLE_MEMSYS5 "ENABLE_MEMSYS5", #endif -#ifdef SQLITE_ENABLE_OVERSIZE_CELL_CHECK +#if SQLITE_ENABLE_OVERSIZE_CELL_CHECK "ENABLE_OVERSIZE_CELL_CHECK", #endif -#ifdef SQLITE_ENABLE_RTREE +#if SQLITE_ENABLE_RTREE "ENABLE_RTREE", #endif #if defined(SQLITE_ENABLE_STAT4) @@ -125,31 +125,31 @@ static const char * const azCompileOpt[] = { #elif defined(SQLITE_ENABLE_STAT3) "ENABLE_STAT3", #endif -#ifdef SQLITE_ENABLE_UNLOCK_NOTIFY +#if SQLITE_ENABLE_UNLOCK_NOTIFY "ENABLE_UNLOCK_NOTIFY", #endif -#ifdef SQLITE_ENABLE_UPDATE_DELETE_LIMIT +#if SQLITE_ENABLE_UPDATE_DELETE_LIMIT "ENABLE_UPDATE_DELETE_LIMIT", #endif -#ifdef SQLITE_HAS_CODEC +#if SQLITE_HAS_CODEC "HAS_CODEC", #endif -#ifdef SQLITE_HAVE_ISNAN +#if HAVE_ISNAN || SQLITE_HAVE_ISNAN "HAVE_ISNAN", #endif -#ifdef SQLITE_HOMEGROWN_RECURSIVE_MUTEX +#if SQLITE_HOMEGROWN_RECURSIVE_MUTEX "HOMEGROWN_RECURSIVE_MUTEX", #endif -#ifdef SQLITE_IGNORE_AFP_LOCK_ERRORS +#if SQLITE_IGNORE_AFP_LOCK_ERRORS "IGNORE_AFP_LOCK_ERRORS", #endif -#ifdef SQLITE_IGNORE_FLOCK_LOCK_ERRORS +#if SQLITE_IGNORE_FLOCK_LOCK_ERRORS "IGNORE_FLOCK_LOCK_ERRORS", #endif #ifdef SQLITE_INT64_TYPE "INT64_TYPE", #endif -#ifdef SQLITE_LOCK_TRACE +#if SQLITE_LOCK_TRACE "LOCK_TRACE", #endif #if defined(SQLITE_MAX_MMAP_SIZE) && !defined(SQLITE_MAX_MMAP_SIZE_xc) @@ -158,226 +158,226 @@ static const char * const azCompileOpt[] = { #ifdef SQLITE_MAX_SCHEMA_RETRY "MAX_SCHEMA_RETRY=" CTIMEOPT_VAL(SQLITE_MAX_SCHEMA_RETRY), #endif -#ifdef SQLITE_MEMDEBUG +#if SQLITE_MEMDEBUG "MEMDEBUG", #endif -#ifdef SQLITE_MIXED_ENDIAN_64BIT_FLOAT +#if SQLITE_MIXED_ENDIAN_64BIT_FLOAT "MIXED_ENDIAN_64BIT_FLOAT", #endif -#ifdef SQLITE_NO_SYNC +#if SQLITE_NO_SYNC "NO_SYNC", #endif -#ifdef SQLITE_OMIT_ALTERTABLE +#if SQLITE_OMIT_ALTERTABLE "OMIT_ALTERTABLE", #endif -#ifdef SQLITE_OMIT_ANALYZE +#if SQLITE_OMIT_ANALYZE "OMIT_ANALYZE", #endif -#ifdef SQLITE_OMIT_ATTACH +#if SQLITE_OMIT_ATTACH "OMIT_ATTACH", #endif -#ifdef SQLITE_OMIT_AUTHORIZATION +#if SQLITE_OMIT_AUTHORIZATION "OMIT_AUTHORIZATION", #endif -#ifdef SQLITE_OMIT_AUTOINCREMENT +#if SQLITE_OMIT_AUTOINCREMENT "OMIT_AUTOINCREMENT", #endif -#ifdef SQLITE_OMIT_AUTOINIT +#if SQLITE_OMIT_AUTOINIT "OMIT_AUTOINIT", #endif -#ifdef SQLITE_OMIT_AUTOMATIC_INDEX +#if SQLITE_OMIT_AUTOMATIC_INDEX "OMIT_AUTOMATIC_INDEX", #endif -#ifdef SQLITE_OMIT_AUTORESET +#if SQLITE_OMIT_AUTORESET "OMIT_AUTORESET", #endif -#ifdef SQLITE_OMIT_AUTOVACUUM +#if SQLITE_OMIT_AUTOVACUUM "OMIT_AUTOVACUUM", #endif -#ifdef SQLITE_OMIT_BETWEEN_OPTIMIZATION +#if SQLITE_OMIT_BETWEEN_OPTIMIZATION "OMIT_BETWEEN_OPTIMIZATION", #endif -#ifdef SQLITE_OMIT_BLOB_LITERAL +#if SQLITE_OMIT_BLOB_LITERAL "OMIT_BLOB_LITERAL", #endif -#ifdef SQLITE_OMIT_BTREECOUNT +#if SQLITE_OMIT_BTREECOUNT "OMIT_BTREECOUNT", #endif -#ifdef SQLITE_OMIT_BUILTIN_TEST +#if SQLITE_OMIT_BUILTIN_TEST "OMIT_BUILTIN_TEST", #endif -#ifdef SQLITE_OMIT_CAST +#if SQLITE_OMIT_CAST "OMIT_CAST", #endif -#ifdef SQLITE_OMIT_CHECK +#if SQLITE_OMIT_CHECK "OMIT_CHECK", #endif -#ifdef SQLITE_OMIT_COMPLETE +#if SQLITE_OMIT_COMPLETE "OMIT_COMPLETE", #endif -#ifdef SQLITE_OMIT_COMPOUND_SELECT +#if SQLITE_OMIT_COMPOUND_SELECT "OMIT_COMPOUND_SELECT", #endif -#ifdef SQLITE_OMIT_CTE +#if SQLITE_OMIT_CTE "OMIT_CTE", #endif -#ifdef SQLITE_OMIT_DATETIME_FUNCS +#if SQLITE_OMIT_DATETIME_FUNCS "OMIT_DATETIME_FUNCS", #endif -#ifdef SQLITE_OMIT_DECLTYPE +#if SQLITE_OMIT_DECLTYPE "OMIT_DECLTYPE", #endif -#ifdef SQLITE_OMIT_DEPRECATED +#if SQLITE_OMIT_DEPRECATED "OMIT_DEPRECATED", #endif -#ifdef SQLITE_OMIT_DISKIO +#if SQLITE_OMIT_DISKIO "OMIT_DISKIO", #endif -#ifdef SQLITE_OMIT_EXPLAIN +#if SQLITE_OMIT_EXPLAIN "OMIT_EXPLAIN", #endif -#ifdef SQLITE_OMIT_FLAG_PRAGMAS +#if SQLITE_OMIT_FLAG_PRAGMAS "OMIT_FLAG_PRAGMAS", #endif -#ifdef SQLITE_OMIT_FLOATING_POINT +#if SQLITE_OMIT_FLOATING_POINT "OMIT_FLOATING_POINT", #endif -#ifdef SQLITE_OMIT_FOREIGN_KEY +#if SQLITE_OMIT_FOREIGN_KEY "OMIT_FOREIGN_KEY", #endif -#ifdef SQLITE_OMIT_GET_TABLE +#if SQLITE_OMIT_GET_TABLE "OMIT_GET_TABLE", #endif -#ifdef SQLITE_OMIT_INCRBLOB +#if SQLITE_OMIT_INCRBLOB "OMIT_INCRBLOB", #endif -#ifdef SQLITE_OMIT_INTEGRITY_CHECK +#if SQLITE_OMIT_INTEGRITY_CHECK "OMIT_INTEGRITY_CHECK", #endif -#ifdef SQLITE_OMIT_LIKE_OPTIMIZATION +#if SQLITE_OMIT_LIKE_OPTIMIZATION "OMIT_LIKE_OPTIMIZATION", #endif -#ifdef SQLITE_OMIT_LOAD_EXTENSION +#if SQLITE_OMIT_LOAD_EXTENSION "OMIT_LOAD_EXTENSION", #endif -#ifdef SQLITE_OMIT_LOCALTIME +#if SQLITE_OMIT_LOCALTIME "OMIT_LOCALTIME", #endif -#ifdef SQLITE_OMIT_LOOKASIDE +#if SQLITE_OMIT_LOOKASIDE "OMIT_LOOKASIDE", #endif -#ifdef SQLITE_OMIT_MEMORYDB +#if SQLITE_OMIT_MEMORYDB "OMIT_MEMORYDB", #endif -#ifdef SQLITE_OMIT_OR_OPTIMIZATION +#if SQLITE_OMIT_OR_OPTIMIZATION "OMIT_OR_OPTIMIZATION", #endif -#ifdef SQLITE_OMIT_PAGER_PRAGMAS +#if SQLITE_OMIT_PAGER_PRAGMAS "OMIT_PAGER_PRAGMAS", #endif -#ifdef SQLITE_OMIT_PRAGMA +#if SQLITE_OMIT_PRAGMA "OMIT_PRAGMA", #endif -#ifdef SQLITE_OMIT_PROGRESS_CALLBACK +#if SQLITE_OMIT_PROGRESS_CALLBACK "OMIT_PROGRESS_CALLBACK", #endif -#ifdef SQLITE_OMIT_QUICKBALANCE +#if SQLITE_OMIT_QUICKBALANCE "OMIT_QUICKBALANCE", #endif -#ifdef SQLITE_OMIT_REINDEX +#if SQLITE_OMIT_REINDEX "OMIT_REINDEX", #endif -#ifdef SQLITE_OMIT_SCHEMA_PRAGMAS +#if SQLITE_OMIT_SCHEMA_PRAGMAS "OMIT_SCHEMA_PRAGMAS", #endif -#ifdef SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS +#if SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS "OMIT_SCHEMA_VERSION_PRAGMAS", #endif -#ifdef SQLITE_OMIT_SHARED_CACHE +#if SQLITE_OMIT_SHARED_CACHE "OMIT_SHARED_CACHE", #endif -#ifdef SQLITE_OMIT_SUBQUERY +#if SQLITE_OMIT_SUBQUERY "OMIT_SUBQUERY", #endif -#ifdef SQLITE_OMIT_TCL_VARIABLE +#if SQLITE_OMIT_TCL_VARIABLE "OMIT_TCL_VARIABLE", #endif -#ifdef SQLITE_OMIT_TEMPDB +#if SQLITE_OMIT_TEMPDB "OMIT_TEMPDB", #endif -#ifdef SQLITE_OMIT_TRACE +#if SQLITE_OMIT_TRACE "OMIT_TRACE", #endif -#ifdef SQLITE_OMIT_TRIGGER +#if SQLITE_OMIT_TRIGGER "OMIT_TRIGGER", #endif -#ifdef SQLITE_OMIT_TRUNCATE_OPTIMIZATION +#if SQLITE_OMIT_TRUNCATE_OPTIMIZATION "OMIT_TRUNCATE_OPTIMIZATION", #endif -#ifdef SQLITE_OMIT_UTF16 +#if SQLITE_OMIT_UTF16 "OMIT_UTF16", #endif -#ifdef SQLITE_OMIT_VACUUM +#if SQLITE_OMIT_VACUUM "OMIT_VACUUM", #endif -#ifdef SQLITE_OMIT_VIEW +#if SQLITE_OMIT_VIEW "OMIT_VIEW", #endif -#ifdef SQLITE_OMIT_VIRTUALTABLE +#if SQLITE_OMIT_VIRTUALTABLE "OMIT_VIRTUALTABLE", #endif -#ifdef SQLITE_OMIT_WAL +#if SQLITE_OMIT_WAL "OMIT_WAL", #endif -#ifdef SQLITE_OMIT_WSD +#if SQLITE_OMIT_WSD "OMIT_WSD", #endif -#ifdef SQLITE_OMIT_XFER_OPT +#if SQLITE_OMIT_XFER_OPT "OMIT_XFER_OPT", #endif -#ifdef SQLITE_PERFORMANCE_TRACE +#if SQLITE_PERFORMANCE_TRACE "PERFORMANCE_TRACE", #endif -#ifdef SQLITE_PROXY_DEBUG +#if SQLITE_PROXY_DEBUG "PROXY_DEBUG", #endif -#ifdef SQLITE_RTREE_INT_ONLY +#if SQLITE_RTREE_INT_ONLY "RTREE_INT_ONLY", #endif -#ifdef SQLITE_SECURE_DELETE +#if SQLITE_SECURE_DELETE "SECURE_DELETE", #endif -#ifdef SQLITE_SMALL_STACK +#if SQLITE_SMALL_STACK "SMALL_STACK", #endif -#ifdef SQLITE_SOUNDEX +#if SQLITE_SOUNDEX "SOUNDEX", #endif -#ifdef SQLITE_SYSTEM_MALLOC +#if SQLITE_SYSTEM_MALLOC "SYSTEM_MALLOC", #endif -#ifdef SQLITE_TCL +#if SQLITE_TCL "TCL", #endif #if defined(SQLITE_TEMP_STORE) && !defined(SQLITE_TEMP_STORE_xc) "TEMP_STORE=" CTIMEOPT_VAL(SQLITE_TEMP_STORE), #endif -#ifdef SQLITE_TEST +#if SQLITE_TEST "TEST", #endif #if defined(SQLITE_THREADSAFE) "THREADSAFE=" CTIMEOPT_VAL(SQLITE_THREADSAFE), #endif -#ifdef SQLITE_USE_ALLOCA +#if SQLITE_USE_ALLOCA "USE_ALLOCA", #endif -#ifdef SQLITE_USER_AUTHENTICATION +#if SQLITE_USER_AUTHENTICATION "USER_AUTHENTICATION", #endif -#ifdef SQLITE_WIN32_MALLOC +#if SQLITE_WIN32_MALLOC "WIN32_MALLOC", #endif -#ifdef SQLITE_ZERO_MALLOC +#if SQLITE_ZERO_MALLOC "ZERO_MALLOC" #endif }; @@ -392,7 +392,7 @@ static const char * const azCompileOpt[] = { int sqlite3_compileoption_used(const char *zOptName){ int i, n; -#ifdef SQLITE_ENABLE_API_ARMOR +#if SQLITE_ENABLE_API_ARMOR if( zOptName==0 ){ (void)SQLITE_MISUSE_BKPT; return 0; diff --git a/src/date.c b/src/date.c index d19b633608..5f3f247ca9 100644 --- a/src/date.c +++ b/src/date.c @@ -412,8 +412,9 @@ static void clearYMD_HMS_TZ(DateTime *p){ ** already, check for an MSVC build environment that provides ** localtime_s(). */ -#if !defined(HAVE_LOCALTIME_R) && !defined(HAVE_LOCALTIME_S) && \ - defined(_MSC_VER) && defined(_CRT_INSECURE_DEPRECATE) +#if !HAVE_LOCALTIME_R && !HAVE_LOCALTIME_S \ + && defined(_MSC_VER) && defined(_CRT_INSECURE_DEPRECATE) +#undef HAVE_LOCALTIME_S #define HAVE_LOCALTIME_S 1 #endif @@ -433,8 +434,7 @@ static void clearYMD_HMS_TZ(DateTime *p){ */ static int osLocaltime(time_t *t, struct tm *pTm){ int rc; -#if (!defined(HAVE_LOCALTIME_R) || !HAVE_LOCALTIME_R) \ - && (!defined(HAVE_LOCALTIME_S) || !HAVE_LOCALTIME_S) +#if !HAVE_LOCALTIME_R && !HAVE_LOCALTIME_S struct tm *pX; #if SQLITE_THREADSAFE>0 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); @@ -451,7 +451,7 @@ static int osLocaltime(time_t *t, struct tm *pTm){ #ifndef SQLITE_OMIT_BUILTIN_TEST if( sqlite3GlobalConfig.bLocaltimeFault ) return 1; #endif -#if defined(HAVE_LOCALTIME_R) && HAVE_LOCALTIME_R +#if HAVE_LOCALTIME_R rc = localtime_r(t, pTm)==0; #else rc = localtime_s(pTm, t); @@ -1092,7 +1092,7 @@ static void currentTimeFunc( iT = sqlite3StmtCurrentTime(context); if( iT<=0 ) return; t = iT/1000 - 10000*(sqlite3_int64)21086676; -#ifdef HAVE_GMTIME_R +#if HAVE_GMTIME_R pTm = gmtime_r(&t, &sNow); #else sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER)); diff --git a/src/main.c b/src/main.c index 8af34cc2f1..191d624b78 100644 --- a/src/main.c +++ b/src/main.c @@ -1350,7 +1350,7 @@ static int sqliteDefaultBusyCallback( void *ptr, /* Database connection */ int count /* Number of times table has been busy */ ){ -#if SQLITE_OS_WIN || (defined(HAVE_USLEEP) && HAVE_USLEEP) +#if SQLITE_OS_WIN || HAVE_USLEEP static const u8 delays[] = { 1, 2, 5, 10, 15, 20, 25, 25, 25, 50, 50, 100 }; static const u8 totals[] = diff --git a/src/mem1.c b/src/mem1.c index 11fc1771ed..ec9a4e3a61 100644 --- a/src/mem1.c +++ b/src/mem1.c @@ -79,9 +79,9 @@ static malloc_zone_t* _sqliteZone_; ** The malloc.h header file is needed for malloc_usable_size() function ** on some systems (e.g. Linux). */ -#if defined(HAVE_MALLOC_H) && defined(HAVE_MALLOC_USABLE_SIZE) -# define SQLITE_USE_MALLOC_H -# define SQLITE_USE_MALLOC_USABLE_SIZE +#if HAVE_MALLOC_H && HAVE_MALLOC_USABLE_SIZE +# define SQLITE_USE_MALLOC_H 1 +# define SQLITE_USE_MALLOC_USABLE_SIZE 1 /* ** The MSVCRT has malloc_usable_size(), but it is called _msize(). The ** use of _msize() is automatic, but can be disabled by compiling with diff --git a/src/printf.c b/src/printf.c index ac7b051631..428c959cc7 100644 --- a/src/printf.c +++ b/src/printf.c @@ -14,17 +14,6 @@ */ #include "sqliteInt.h" -/* -** If the strchrnul() library function is available, then set -** HAVE_STRCHRNUL. If that routine is not available, this module -** will supply its own. The built-in version is slower than -** the glibc version so the glibc version is definitely preferred. -*/ -#if !defined(HAVE_STRCHRNUL) -# define HAVE_STRCHRNUL 0 -#endif - - /* ** Conversion types fall into various categories as defined by the ** following enumeration. diff --git a/src/shell.c b/src/shell.c index 7f8a9ef3a6..18313fabd3 100644 --- a/src/shell.c +++ b/src/shell.c @@ -48,17 +48,16 @@ # include #endif -#if defined(HAVE_READLINE) && HAVE_READLINE!=0 +#if HAVE_READLINE # include # include -#else -# undef HAVE_READLINE #endif -#if defined(HAVE_EDITLINE) && !defined(HAVE_READLINE) +#if HAVE_EDITLINE +# undef HAVE_READLINE # define HAVE_READLINE 1 # include #endif -#if !defined(HAVE_READLINE) +#if !HAVE_READLINE # define add_history(X) # define read_history(X) # define write_history(X) @@ -425,7 +424,7 @@ static char *one_input_line(FILE *in, char *zPrior, int isContinuation){ zResult = local_getline(zPrior, in); }else{ zPrompt = isContinuation ? continuePrompt : mainPrompt; -#if defined(HAVE_READLINE) +#if HAVE_READLINE free(zPrior); zResult = readline(zPrompt); if( zResult && *zResult ) add_history(zResult); @@ -4482,7 +4481,7 @@ int main(int argc, char **argv){ sqlite3_snprintf(nHistory, zHistory,"%s/.sqlite_history", zHome); } } -#if defined(HAVE_READLINE) +#if HAVE_READLINE if( zHistory ) read_history(zHistory); #endif rc = process_input(&data, 0); diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 0a1948fef8..e1642a08cc 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -2977,7 +2977,7 @@ int sqlite3CantopenError(int); ** the SQLITE_ENABLE_FTS4 macro to serve as an alias for SQLITE_ENABLE_FTS3. */ #if defined(SQLITE_ENABLE_FTS4) && !defined(SQLITE_ENABLE_FTS3) -# define SQLITE_ENABLE_FTS3 +# define SQLITE_ENABLE_FTS3 1 #endif /* diff --git a/src/test_config.c b/src/test_config.c index 834113b33b..25e6a5698f 100644 --- a/src/test_config.c +++ b/src/test_config.c @@ -41,7 +41,7 @@ ** procedures use this to determine when tests should be omitted. */ static void set_options(Tcl_Interp *interp){ -#ifdef HAVE_MALLOC_USABLE_SIZE +#if HAVE_MALLOC_USABLE_SIZE Tcl_SetVar2(interp, "sqlite_options", "malloc_usable_size", "1", TCL_GLOBAL_ONLY); #else diff --git a/src/util.c b/src/util.c index ab409fa256..6e64242e87 100644 --- a/src/util.c +++ b/src/util.c @@ -17,7 +17,7 @@ */ #include "sqliteInt.h" #include -#ifdef SQLITE_HAVE_ISNAN +#if HAVE_ISNAN || SQLITE_HAVE_ISNAN # include #endif @@ -58,7 +58,7 @@ int sqlite3FaultSim(int iTest){ */ int sqlite3IsNaN(double x){ int rc; /* The value return */ -#if !defined(SQLITE_HAVE_ISNAN) +#if !SQLITE_HAVE_ISNAN && !HAVE_ISNAN /* ** Systems that support the isnan() library function should probably ** make use of it by compiling with -DSQLITE_HAVE_ISNAN. But we have @@ -88,9 +88,9 @@ int sqlite3IsNaN(double x){ volatile double y = x; volatile double z = y; rc = (y!=z); -#else /* if defined(SQLITE_HAVE_ISNAN) */ +#else /* if HAVE_ISNAN */ rc = isnan(x); -#endif /* SQLITE_HAVE_ISNAN */ +#endif /* HAVE_ISNAN */ testcase( rc ); return rc; } diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 1d6ca184ad..76a9dc00ae 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -45,6 +45,19 @@ array set ::Configs [strip_comments { CC=clang -fsanitize=undefined -DSQLITE_ENABLE_STAT4 } + "Have-Not" { + # The "Have-Not" configuration sets all possible -UHAVE_feature options + # in order to verify that the code works even on platforms that lack + # these support services. + -DHAVE_FDATASYNC=0 + -DHAVE_GMTIME_R=0 + -DHAVE_LOCALTIME_R=0 + -DHAVE_LOCALTIME_S=0 + -DHAVE_MALLOC_USABLE_SIZE=0 + -DHAVE_STRCHRNUL=0 + -DHAVE_USLEEP=0 + -DHAVE_UTIME=0 + } "Unlock-Notify" { -O2 -DSQLITE_ENABLE_UNLOCK_NOTIFY @@ -189,6 +202,7 @@ array set ::Platforms [strip_comments { Linux-x86_64 { "Check-Symbols" checksymbols "Debug-One" "mptest test" + "Have-Not" test "Secure-Delete" test "Unlock-Notify" "QUICKTEST_INCLUDE=notify2.test test" "Update-Delete-Limit" test @@ -203,6 +217,7 @@ array set ::Platforms [strip_comments { } Linux-i686 { "Devkit" test + "Have-Not" test "Unlock-Notify" "QUICKTEST_INCLUDE=notify2.test test" "Device-One" test "Device-Two" test @@ -210,14 +225,17 @@ array set ::Platforms [strip_comments { } Darwin-i386 { "Locking-Style" "mptest test" + "Have-Not" test "OS-X" "threadtest fulltest" } Darwin-x86_64 { "Locking-Style" "mptest test" + "Have-Not" test "OS-X" "threadtest fulltest" } "Windows NT-intel" { "Default" "mptest fulltestonly" + "Have-Not" test } # The Failure-Detection platform runs various tests that deliberately @@ -317,9 +335,9 @@ proc run_test_suite {name testtarget config} { regsub -all {#[^\n]*\n} $config \n config foreach arg $config { - if {[string match -D* $arg]} { + if {[regexp {^-[UD]} $arg]} { lappend opts $arg - } elseif {[string match CC=* $arg]} { + } elseif {[regexp {^[A-Z]+=} $arg]} { lappend testtarget $arg } elseif {[regexp {^--(enable|disable)-} $arg]} { lappend configOpts $arg From f7a4a1b8c58f511b4dca992f9a314775a1c3aca0 Mon Sep 17 00:00:00 2001 From: drh Date: Sat, 10 Jan 2015 18:02:45 +0000 Subject: [PATCH 19/34] Make use of the fdatasync() interface if the HAVE_FDATASYNC macro is true. FossilOrigin-Name: 694228e4632c2999efa47ecb49f679c177db02e5 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/os_unix.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 11f65e9adf..a7573aa5d7 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improvements\sto\scompile-time-option\shygiene.\s\sUse\s"#if\sOPTION"\sinstead\sof\n"#ifdef\sOPTION"\sin\scases\swhere\sthat\smakes\ssense,\sso\sthat\s-DOPTION=0\swill\swork.\nAdd\sthe\s"Have-Not"\sconfiguration\sin\sreleasetest.tcl\swhich\sdisables\sall\sof\nthe\s"HAVE_component"\scompile-time\soptions. -D 2015-01-10T16:49:23.031 +C Make\suse\sof\sthe\sfdatasync()\sinterface\sif\sthe\sHAVE_FDATASYNC\smacro\sis\strue. +D 2015-01-10T18:02:45.534 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 876093578650b28af50a20c819993ee779885adb F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -213,7 +213,7 @@ F src/os.c 8fd25588eeba74068d41102d26810e216999b6c8 F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04 F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa -F src/os_unix.c 949cdedc74dbf3c17f2c9743064ce307026f871e +F src/os_unix.c aefeaf915aaef9f81aa2645e0d5d06fa1bd83beb F src/os_win.c 91d3d08e33ec0258d180d4c8255492f47d15e007 F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21 F src/pager.c 4120a49ecd37697e28f5ed807f470b9c0b88410c @@ -1235,7 +1235,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 d6f8c899d8f1bf66a2234e0eb91b259dd64eed31 -R b95d8ce08215c7ec2a42770b5c7b6593 +P 9e92a5ed5aaba20461ed4ce8359d6e34e7773d68 +R 83eb40a0e552094b8653559c8de84718 U drh -Z 921820c75b1deafea4774745e8ce3c77 +Z 928cfbe3ecee3b0dfe5377d27df29516 diff --git a/manifest.uuid b/manifest.uuid index d798d891eb..4fcea9c31a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9e92a5ed5aaba20461ed4ce8359d6e34e7773d68 \ No newline at end of file +694228e4632c2999efa47ecb49f679c177db02e5 \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index 3fcb0cff24..ddd6a802eb 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3386,9 +3386,9 @@ int sqlite3_fullsync_count = 0; ** We do not trust systems to provide a working fdatasync(). Some do. ** Others do no. To be safe, we will stick with the (slightly slower) ** fsync(). If you know that your system does support fdatasync() correctly, -** then simply compile with -Dfdatasync=fdatasync +** then simply compile with -Dfdatasync=fdatasync or -DHAVE_FDATASYNC */ -#if !defined(fdatasync) +#if !defined(fdatasync) && !HAVE_FDATASYNC # define fdatasync fsync #endif From 8567d406098b6716438c01c758c262fd6b4898ca Mon Sep 17 00:00:00 2001 From: drh Date: Sat, 10 Jan 2015 18:22:06 +0000 Subject: [PATCH 20/34] Add detection of the isnan() library function to the configure script. Make the code responsive to the HAVE_ISNAN configuration option. FossilOrigin-Name: 46f3aba2692d74c29ab5c1f24a6daac600fd6af8 --- config.h.in | 3 +++ configure | 3 ++- configure.ac | 2 +- manifest | 18 +++++++++--------- manifest.uuid | 2 +- test/releasetest.tcl | 1 + 6 files changed, 17 insertions(+), 12 deletions(-) diff --git a/config.h.in b/config.h.in index 3d3c8c202a..36fd60781c 100644 --- a/config.h.in +++ b/config.h.in @@ -27,6 +27,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if you have the `isnan' function. */ +#undef HAVE_ISNAN + /* Define to 1 if you have the `localtime_r' function. */ #undef HAVE_LOCALTIME_R diff --git a/configure b/configure index 25a7043b95..4ad61ad8f4 100755 --- a/configure +++ b/configure @@ -12139,7 +12139,8 @@ done -for ac_func in usleep fdatasync localtime_r gmtime_r localtime_s utime malloc_usable_size strchrnul + +for ac_func in fdatasync gmtime_r isnan localtime_r localtime_s malloc_usabel_size strchrnul usleep utime do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 diff --git a/configure.ac b/configure.ac index 39c7a71a16..6a35aa3441 100644 --- a/configure.ac +++ b/configure.ac @@ -109,7 +109,7 @@ AC_CHECK_HEADERS([sys/types.h stdlib.h stdint.h inttypes.h malloc.h]) ######### # Figure out whether or not we have these functions # -AC_CHECK_FUNCS([usleep fdatasync localtime_r gmtime_r localtime_s utime malloc_usable_size strchrnul]) +AC_CHECK_FUNCS([fdatasync gmtime_r isnan localtime_r localtime_s malloc_usabel_size strchrnul usleep utime]) ######### # By default, we use the amalgamation (this may be changed below...) diff --git a/manifest b/manifest index a7573aa5d7..3ecf678cb9 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Make\suse\sof\sthe\sfdatasync()\sinterface\sif\sthe\sHAVE_FDATASYNC\smacro\sis\strue. -D 2015-01-10T18:02:45.534 +C Add\sdetection\sof\sthe\sisnan()\slibrary\sfunction\sto\sthe\sconfigure\sscript.\s\sMake\nthe\scode\sresponsive\sto\sthe\sHAVE_ISNAN\sconfiguration\soption. +D 2015-01-10T18:22:06.081 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 876093578650b28af50a20c819993ee779885adb F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -36,10 +36,10 @@ F autoconf/tea/win/makefile.vc f89d0184d0eee5f7e356ea407964dcd139939928 F autoconf/tea/win/nmakehlp.c 2070e086f39866b353a482d3a14dedaf26196506 F autoconf/tea/win/rules.vc c511f222b80064096b705dbeb97060ee1d6b6d63 F config.guess 226d9a188c6196f3033ffc651cbc9dcee1a42977 -F config.h.in 3e31d7366de5d76ecde79417c34fb469c8fd963d +F config.h.in 42b71ad3fe21c9e88fa59e8458ca1a6bc72eb0c0 F config.sub 9ebe4c3b3dab6431ece34f16828b594fb420da55 -F configure cc8ccb52cba371fef29990f1e33695c25fdcaf86 x -F configure.ac 1d3ece7d3830eb92aaa3933628d0515998d68aa5 +F configure f0438487966ab02dd0357c4ad27f1082e70a4b34 x +F configure.ac 0c94d28b0a839fd0f35ccebded2ea4aed4424d65 F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad F doc/lemon.html 334dbf6621b8fb8790297ec1abf3cfa4621709d1 F doc/pager-invariants.txt 27fed9a70ddad2088750c4a2b493b63853da2710 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl b40c2e3eb7931b925e38d1d18a51fe4a55fc77c2 +F test/releasetest.tcl 13f401c10dd4fe1a2fb811ae6ed27fd7d1300d3c F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1235,7 +1235,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 9e92a5ed5aaba20461ed4ce8359d6e34e7773d68 -R 83eb40a0e552094b8653559c8de84718 +P 694228e4632c2999efa47ecb49f679c177db02e5 +R 332805e27e3ffd90d9186edc59ab2f6e U drh -Z 928cfbe3ecee3b0dfe5377d27df29516 +Z 73760a179fa08b38d3fe890bfb333a58 diff --git a/manifest.uuid b/manifest.uuid index 4fcea9c31a..c03ed43474 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -694228e4632c2999efa47ecb49f679c177db02e5 \ No newline at end of file +46f3aba2692d74c29ab5c1f24a6daac600fd6af8 \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 76a9dc00ae..746fc9bb35 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -51,6 +51,7 @@ array set ::Configs [strip_comments { # these support services. -DHAVE_FDATASYNC=0 -DHAVE_GMTIME_R=0 + -DHAVE_ISNAN=0 -DHAVE_LOCALTIME_R=0 -DHAVE_LOCALTIME_S=0 -DHAVE_MALLOC_USABLE_SIZE=0 From 8d9da63dacde128e546f84cb34392188aab1be83 Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 12 Jan 2015 17:56:06 +0000 Subject: [PATCH 21/34] Add an assert() in order to calm a scan-build warning. FossilOrigin-Name: 11e81ac2a7c917f7c9afc218d104d9870daf9668 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/vdbesort.c | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/manifest b/manifest index 3ecf678cb9..18464b0405 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sdetection\sof\sthe\sisnan()\slibrary\sfunction\sto\sthe\sconfigure\sscript.\s\sMake\nthe\scode\sresponsive\sto\sthe\sHAVE_ISNAN\sconfiguration\soption. -D 2015-01-10T18:22:06.081 +C Add\san\sassert()\sin\sorder\sto\scalm\sa\sscan-build\swarning. +D 2015-01-12T17:56:06.382 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 876093578650b28af50a20c819993ee779885adb F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -298,7 +298,7 @@ F src/vdbeapi.c 4bc511a46b9839392ae0e90844a71dc96d9dbd71 F src/vdbeaux.c 07ef87c6d4b5abdf13ff33babb10205702fdab0a F src/vdbeblob.c 4af4bfb71f6df7778397b4a0ebc1879793276778 F src/vdbemem.c 31d8eabb0cd78bfeab4e5124c7363c3e9e54db9f -F src/vdbesort.c 560bdfd9eb3ae3205196e0d64ccd1de925caa6c7 +F src/vdbesort.c 6d64c5448b64851b99931ede980addc3af70d5e2 F src/vdbetrace.c 7e4222955e07dd707a2f360c0eb73452be1cb010 F src/vtab.c c08ec66f45919eaa726bf88aa53eb08379d607f9 F src/wal.c 85353539f2d9d0c91ebd057c32525b1e1aa3335e @@ -1235,7 +1235,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 694228e4632c2999efa47ecb49f679c177db02e5 -R 332805e27e3ffd90d9186edc59ab2f6e +P 46f3aba2692d74c29ab5c1f24a6daac600fd6af8 +R 92ea1bf6542c9d9c7faa1f3f4f13619f U drh -Z 73760a179fa08b38d3fe890bfb333a58 +Z e7423f8002cbebe040ecb69ba833d201 diff --git a/manifest.uuid b/manifest.uuid index c03ed43474..37e56a13ff 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -46f3aba2692d74c29ab5c1f24a6daac600fd6af8 \ No newline at end of file +11e81ac2a7c917f7c9afc218d104d9870daf9668 \ No newline at end of file diff --git a/src/vdbesort.c b/src/vdbesort.c index d76487d491..5a43a10542 100644 --- a/src/vdbesort.c +++ b/src/vdbesort.c @@ -2414,6 +2414,7 @@ int sqlite3VdbeSorterNext(sqlite3 *db, const VdbeCursor *pCsr, int *pbEof){ }else #endif /*if( !pSorter->bUseThreads )*/ { + assert( pSorter->pMerger!=0 ); assert( pSorter->pMerger->pTask==(&pSorter->aTask[0]) ); rc = vdbeMergeEngineStep(pSorter->pMerger, pbEof); } From 2318d3387d4c0886e94a5bc7804bc8b03439ed1b Mon Sep 17 00:00:00 2001 From: mistachkin Date: Mon, 12 Jan 2015 18:02:52 +0000 Subject: [PATCH 22/34] Work in progress on fixing harmless compiler warnings when using -W4 and MSVC. FossilOrigin-Name: 856dd245ce037f93d5ae2ddeb4fdf949c1e5c8e9 --- Makefile.in | 2 ++ Makefile.msc | 38 +++++++++++++++++++++++++++++++++---- Makefile.vxworks | 2 ++ main.mk | 2 ++ manifest | 36 +++++++++++++++++++---------------- manifest.uuid | 2 +- src/msvc.h | 27 ++++++++++++++++++++++++++ src/shell.c | 7 +++++++ src/sqliteInt.h | 8 ++++++++ tool/lemon.c | 8 ++++---- tool/mksqlite3c-noext.tcl | 1 + tool/mksqlite3c.tcl | 1 + tool/mksqlite3internalh.tcl | 1 + 13 files changed, 110 insertions(+), 25 deletions(-) create mode 100644 src/msvc.h diff --git a/Makefile.in b/Makefile.in index 42caa69835..168bce6602 100644 --- a/Makefile.in +++ b/Makefile.in @@ -234,6 +234,7 @@ SRC = \ $(TOP)/src/mem3.c \ $(TOP)/src/mem5.c \ $(TOP)/src/memjournal.c \ + $(TOP)/src/msvc.h \ $(TOP)/src/mutex.c \ $(TOP)/src/mutex.h \ $(TOP)/src/mutex_noop.c \ @@ -463,6 +464,7 @@ HDR = \ $(TOP)/src/hash.h \ $(TOP)/src/hwtime.h \ keywordhash.h \ + $(TOP)/src/msvc.h \ $(TOP)/src/mutex.h \ opcodes.h \ $(TOP)/src/os.h \ diff --git a/Makefile.msc b/Makefile.msc index 3fc675ee4f..f301048fae 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -16,6 +16,22 @@ TOP = . USE_AMALGAMATION = 1 !ENDIF +# Set this non-0 to enable full warnings (-W4, etc) when compiling. +# +!IFNDEF USE_FULLWARN +USE_FULLWARN = 0 +!ENDIF + +# If necessary, create a list of harmless compiler warnings to disable when +# compiling the build tools. For the SQLite source code itself, warnings, +# if any, will be disabled from within it. +# +!IFNDEF NO_WARN +!IF $(USE_FULLWARN)!=0 +NO_WARN = -wd4054 -wd4055 -wd4100 -wd4210 -wd4702 +!ENDIF +!ENDIF + # Set this non-0 to use the library paths and other options necessary for # Windows Phone 8.1. # @@ -232,7 +248,11 @@ NSDKLIBPATH = $(NSDKLIBPATH:\\=\) # C compiler and options for use in building executables that # will run on the platform that is doing the build. # +!IF $(USE_FULLWARN)!=0 +BCC = $(NCC) -W4 +!ELSE BCC = $(NCC) -W3 +!ENDIF # Check if assembly code listings should be generated for the source # code files to be compiled. @@ -253,7 +273,13 @@ NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)" # will run on the target platform. (BCC and TCC are usually the # same unless your are cross-compiling.) # -TCC = $(CC) -W3 -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src -fp:precise +!IF $(USE_FULLWARN)!=0 +TCC = $(CC) -W4 +!ELSE +TCC = $(CC) -W3 +!ENDIF + +TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src -fp:precise RCC = $(RC) -DSQLITE_OS_WIN=1 -I$(TOP) -I$(TOP)\src # Check if assembly code listings should be generated for the source @@ -706,6 +732,7 @@ SRC = \ $(TOP)\src\mem3.c \ $(TOP)\src\mem5.c \ $(TOP)\src\memjournal.c \ + $(TOP)\src\msvc.h \ $(TOP)\src\mutex.c \ $(TOP)\src\mutex.h \ $(TOP)\src\mutex_noop.c \ @@ -938,6 +965,7 @@ HDR = \ $(TOP)\src\hash.h \ $(TOP)\src\hwtime.h \ keywordhash.h \ + $(TOP)\src\msvc.h \ $(TOP)\src\mutex.h \ opcodes.h \ $(TOP)\src\os.h \ @@ -990,7 +1018,7 @@ libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib sqlite3.exe: $(TOP)\src\shell.c libsqlite3.lib $(LIBRESOBJS) sqlite3.h $(LTLINK) $(READLINE_FLAGS) \ - $(TOP)\src\shell.c \ + -DINCLUDE_MSVC_H=1 $(TOP)\src\shell.c \ /link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS) mptester.exe: $(TOP)\mptest\mptest.c libsqlite3.lib $(LIBRESOBJS) sqlite3.h @@ -1040,7 +1068,8 @@ lempar.c: $(TOP)\src\lempar.c copy $(TOP)\src\lempar.c . lemon.exe: $(TOP)\tool\lemon.c lempar.c - $(BCC) -Daccess=_access -Fe$@ $(TOP)\tool\lemon.c /link $(NLTLINKOPTS) $(NLTLIBPATHS) + $(BCC) $(NO_WARN) -Daccess=_access \ + -Fe$@ $(TOP)\tool\lemon.c /link $(NLTLINKOPTS) $(NLTLIBPATHS) # Rules to build individual *.lo files from generated *.c files. This # applies to: @@ -1311,7 +1340,8 @@ sqlite3.h: $(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION $(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > sqlite3.h mkkeywordhash.exe: $(TOP)\tool\mkkeywordhash.c - $(BCC) -Fe$@ $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)\tool\mkkeywordhash.c /link $(NLTLINKOPTS) $(NLTLIBPATHS) + $(BCC) $(NO_WARN) -Fe$@ $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) \ + $(TOP)\tool\mkkeywordhash.c /link $(NLTLINKOPTS) $(NLTLIBPATHS) keywordhash.h: $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe .\mkkeywordhash.exe > keywordhash.h diff --git a/Makefile.vxworks b/Makefile.vxworks index 0d9c27f635..706261fc00 100644 --- a/Makefile.vxworks +++ b/Makefile.vxworks @@ -253,6 +253,7 @@ SRC = \ $(TOP)/src/mem3.c \ $(TOP)/src/mem5.c \ $(TOP)/src/memjournal.c \ + $(TOP)/src/msvc.h \ $(TOP)/src/mutex.c \ $(TOP)/src/mutex.h \ $(TOP)/src/mutex_noop.c \ @@ -414,6 +415,7 @@ HDR = \ $(TOP)/src/hash.h \ $(TOP)/src/hwtime.h \ keywordhash.h \ + $(TOP)/src/msvc.h \ $(TOP)/src/mutex.h \ opcodes.h \ $(TOP)/src/os.h \ diff --git a/main.mk b/main.mk index e2213bc62c..61ab533ae2 100644 --- a/main.mk +++ b/main.mk @@ -112,6 +112,7 @@ SRC = \ $(TOP)/src/mem3.c \ $(TOP)/src/mem5.c \ $(TOP)/src/memjournal.c \ + $(TOP)/src/msvc.h \ $(TOP)/src/mutex.c \ $(TOP)/src/mutex.h \ $(TOP)/src/mutex_noop.c \ @@ -345,6 +346,7 @@ HDR = \ $(TOP)/src/hash.h \ $(TOP)/src/hwtime.h \ keywordhash.h \ + $(TOP)/src/msvc.h \ $(TOP)/src/mutex.h \ opcodes.h \ $(TOP)/src/os.h \ diff --git a/manifest b/manifest index 863ceeeee8..b5277634ea 100644 --- a/manifest +++ b/manifest @@ -1,10 +1,10 @@ -C Add\sSQLITE_ENABLE_STMT_SCANSTATUS\sto\sthe\sUpdate-Delete-Limit\sconfiguration\nin\sthe\sreleasetest.tcl\sscript. -D 2015-01-09T20:00:21.586 +C Work\sin\sprogress\son\sfixing\sharmless\scompiler\swarnings\swhen\susing\s-W4\sand\sMSVC. +D 2015-01-12T18:02:52.080 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in b40b4c2a3a187c41ee657d3f0e0e0dfe8fd860b5 +F Makefile.in 33a180534a9ba2cf80f5f87e8288c26423d0a8d1 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 -F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09 -F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 +F Makefile.msc 2ed20e3ee252eb85dea357940a2e5e5649f9dd86 +F Makefile.vxworks e1b65dea203f054e71653415bd8f96dcaed47858 F README.md d58e3bebc0a4145e0f2a87994015fdb575a8e866 F VERSION d846487aff892625eb8e75960234e7285f0462fe F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50 @@ -152,7 +152,7 @@ F ext/userauth/userauth.c 5fa3bdb492f481bbc1709fc83c91ebd13460c69e F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8 F magic.txt 8273bf49ba3b0c8559cb2774495390c31fd61c60 -F main.mk 9f8c54fe62b60e0a24a2e65cfc8d2add063dda07 +F main.mk 1d0cf88b6e89249608677215ad36e4f8a231accc F mkopcodec.awk c2ff431854d702cdd2d779c9c0d1f58fa16fa4ea F mkopcodeh.awk c6b3fa301db6ef7ac916b14c60868aeaec1337b5 F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83 @@ -203,6 +203,7 @@ F src/mem2.c f1940d9e91948dd6a908fbb9ce3835c36b5d83c3 F src/mem3.c 61c9d47b792908c532ca3a62b999cf21795c6534 F src/mem5.c 61eeb90134f9a5be6c2e68d8daae7628b25953fb F src/memjournal.c 3eb2c0b51adbd869cb6a44780323f05fa904dc85 +F src/msvc.h e77df50d66fe9d2845c1692bd415f10ed2da7ea6 F src/mutex.c 19bf9acba69ca2f367c3761080f8a9f0cf4670a8 F src/mutex.h 779d588e3b7756ec3ecf7d78cde1d84aba414f85 F src/mutex_noop.c f3f09fd7a2eb4287cfc799753ffc30380e7b71a1 @@ -229,11 +230,11 @@ F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/select.c e4c38c75e36f28aed80a69a725d888751bfd53df -F src/shell.c 1b7cb3efc5ae6fe82e36407508c4a6b00d8edde1 +F src/shell.c 0cebd04b204051652e969773af70feb42cf9bc2b F src/sqlite.h.in 9dfc99d6533d36d6a549c4f3f01cacc8be956ada F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d -F src/sqliteInt.h 5d5716d8b33a61606c6ee10112f4b6df56f42725 +F src/sqliteInt.h f25fe9df72dfee0eedfde4bacd0f02077d557631 F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c 81712116e826b0089bb221b018929536b2b5406f F src/table.c e7a09215315a978057fb42c640f890160dbcc45e @@ -1193,7 +1194,7 @@ F tool/fragck.tcl 5265a95126abcf6ab357f7efa544787e5963f439 F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4 F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5 F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce -F tool/lemon.c 20f3132a1a150d50b022aa0b1fa26bd46aebf7b5 +F tool/lemon.c 1864c4fe4a72b1bb28f1792b60504804fe82c5d2 F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc F tool/logest.c eef612f8adf4d0993dafed0416064cf50d5d33c6 F tool/mkautoconfamal.sh 5dc5010e2e748a9e1bba67baca5956a2c2deda7b @@ -1201,10 +1202,10 @@ F tool/mkkeywordhash.c dfff09dbbfaf950e89af294f48f902181b144670 F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e F tool/mkpragmatab.tcl 07a5124cf2dbafa1b375eefcf8ac4227028b0f8b F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97 -F tool/mksqlite3c-noext.tcl 88a1e3b0c769773fb7a9ebb363ffc603a4ac21d8 -F tool/mksqlite3c.tcl e94bdc37b531bba50d421e82efbe3738d0c1e950 +F tool/mksqlite3c-noext.tcl 9ef48e1748dce7b844f67e2450ff9dfeb0fb4ab5 +F tool/mksqlite3c.tcl cfde806851c413db7689b9cb74a4eeb92539c601 F tool/mksqlite3h.tcl ba24038056f51fde07c0079c41885ab85e2cff12 -F tool/mksqlite3internalh.tcl b6514145a7d5321b47e64e19b8116cc44f973eb1 +F tool/mksqlite3internalh.tcl eb994013e833359137eb53a55acdad0b5ae1049b F tool/mkvsix.tcl 52a4c613707ac34ae9c226e5ccc69cb948556105 F tool/offsets.c fe4262fdfa378e8f5499a42136d17bf3b98f6091 F tool/omittest.tcl 34d7ac01fe4fd18e3637f64abe12c40eca0f6b97 @@ -1235,7 +1236,10 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 88a7a967116a48aeb5fa7014613c0134b1b47bb3 -R 366d7baead37fb35af2c9724ea29fa87 -U drh -Z 19a0bf2d773a4306e8c2ab9a5efe117f +P c70d5edaf6327cb18df5285c3fc21b610f3d3294 +R 88ff3b896a4782d7ebc798cf681238f7 +T *branch * msvcW4 +T *sym-msvcW4 * +T -sym-trunk * +U mistachkin +Z 8d2294254b24b7823d46df8b0b6fe494 diff --git a/manifest.uuid b/manifest.uuid index 2626721cda..7afa69b539 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c70d5edaf6327cb18df5285c3fc21b610f3d3294 \ No newline at end of file +856dd245ce037f93d5ae2ddeb4fdf949c1e5c8e9 \ No newline at end of file diff --git a/src/msvc.h b/src/msvc.h new file mode 100644 index 0000000000..f5d6752ea2 --- /dev/null +++ b/src/msvc.h @@ -0,0 +1,27 @@ +/* +** 2015 January 12 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +****************************************************************************** +** +** This file contains code that is specific to Windows. +*/ +#ifndef _MSVC_H_ +#define _MSVC_H_ + +#if defined(_MSC_VER) +#pragma warning(disable : 4100) +#pragma warning(disable : 4127) +#pragma warning(disable : 4232) +#pragma warning(disable : 4244) +/* #pragma warning(disable : 4701) */ +/* #pragma warning(disable : 4706) */ +#endif + +#endif /* _MSVC_H_ */ diff --git a/src/shell.c b/src/shell.c index 7f8a9ef3a6..b7a8fa8b00 100644 --- a/src/shell.c +++ b/src/shell.c @@ -17,6 +17,13 @@ #define _CRT_SECURE_NO_WARNINGS #endif +/* +** If requested, include the SQLite compiler options file for MSVC. +*/ +#if defined(INCLUDE_MSVC_H) +#include "msvc.h" +#endif + /* ** Enable large-file support for fopen() and friends on unix. */ diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 0a1948fef8..3c591ca1cd 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -15,6 +15,14 @@ #ifndef _SQLITEINT_H_ #define _SQLITEINT_H_ +/* +** Include the header file used to customize the compiler options for MSVC. +** This should be done first so that it can successfully prevent spurious +** compiler warnings due to subsequent content in this file and other files +** that are included by this file. +*/ +#include "msvc.h" + /* ** These #defines should enable >2GB file support on POSIX if the ** underlying operating system supports it. If the OS lacks diff --git a/tool/lemon.c b/tool/lemon.c index 54c155204a..4ada425d69 100644 --- a/tool/lemon.c +++ b/tool/lemon.c @@ -2442,7 +2442,7 @@ to follow the previous rule."); if( x[0]=='{' || x[0]=='\"' || isalnum(x[0]) ){ const char *zOld, *zNew; char *zBuf, *z; - int nOld, n, nLine, nNew, nBack; + int nOld, n, nLine = 0, nNew, nBack; int addLineMacro; char zLine[50]; zNew = x; @@ -2641,7 +2641,7 @@ void Parse(struct lemon *gp) struct pstate ps; FILE *fp; char *filebuf; - int filesize; + unsigned int filesize; int lineno; int c; char *cp, *nextcp; @@ -2775,7 +2775,7 @@ void Parse(struct lemon *gp) c = *cp; *cp = 0; /* Null terminate the token */ parseonetoken(&ps); /* Parse the token */ - *cp = c; /* Restore the buffer */ + *cp = (char)c; /* Restore the buffer */ cp = nextcp; } free(filebuf); /* Release the buffer after parsing */ @@ -3398,7 +3398,7 @@ PRIVATE char *append_str(const char *zText, int n, int p1, int p2){ zText++; n--; }else{ - z[used++] = c; + z[used++] = (char)c; } } z[used] = 0; diff --git a/tool/mksqlite3c-noext.tcl b/tool/mksqlite3c-noext.tcl index f54b347be1..27522265bb 100644 --- a/tool/mksqlite3c-noext.tcl +++ b/tool/mksqlite3c-noext.tcl @@ -96,6 +96,7 @@ foreach hdr { hash.h hwtime.h keywordhash.h + msvc.h mutex.h opcodes.h os_common.h diff --git a/tool/mksqlite3c.tcl b/tool/mksqlite3c.tcl index 72098c7357..1d597a51a0 100644 --- a/tool/mksqlite3c.tcl +++ b/tool/mksqlite3c.tcl @@ -100,6 +100,7 @@ foreach hdr { hash.h hwtime.h keywordhash.h + msvc.h mutex.h opcodes.h os_common.h diff --git a/tool/mksqlite3internalh.tcl b/tool/mksqlite3internalh.tcl index 7e92b3ad7d..8db593fe75 100644 --- a/tool/mksqlite3internalh.tcl +++ b/tool/mksqlite3internalh.tcl @@ -58,6 +58,7 @@ foreach hdr { hash.h hwtime.h keywordhash.h + msvc.h opcodes.h os_common.h os_setup.h From c50428fa06ffb1fc95ff801c22586bd95e9e1d1c Mon Sep 17 00:00:00 2001 From: mistachkin Date: Mon, 12 Jan 2015 18:27:31 +0000 Subject: [PATCH 23/34] Fix comments and add another disabled warning for MSVC. FossilOrigin-Name: 43b6b4cc051e5a801a992c56d2c82abcdcf45cec --- manifest | 15 ++++++--------- manifest.uuid | 2 +- src/msvc.h | 4 ++-- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/manifest b/manifest index b5277634ea..d253e20adc 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Work\sin\sprogress\son\sfixing\sharmless\scompiler\swarnings\swhen\susing\s-W4\sand\sMSVC. -D 2015-01-12T18:02:52.080 +C Fix\scomments\sand\sadd\sanother\sdisabled\swarning\sfor\sMSVC. +D 2015-01-12T18:27:31.115 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 33a180534a9ba2cf80f5f87e8288c26423d0a8d1 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -203,7 +203,7 @@ F src/mem2.c f1940d9e91948dd6a908fbb9ce3835c36b5d83c3 F src/mem3.c 61c9d47b792908c532ca3a62b999cf21795c6534 F src/mem5.c 61eeb90134f9a5be6c2e68d8daae7628b25953fb F src/memjournal.c 3eb2c0b51adbd869cb6a44780323f05fa904dc85 -F src/msvc.h e77df50d66fe9d2845c1692bd415f10ed2da7ea6 +F src/msvc.h f9a7b17a5fbc4ddaca0339128e56aed20256d309 F src/mutex.c 19bf9acba69ca2f367c3761080f8a9f0cf4670a8 F src/mutex.h 779d588e3b7756ec3ecf7d78cde1d84aba414f85 F src/mutex_noop.c f3f09fd7a2eb4287cfc799753ffc30380e7b71a1 @@ -1236,10 +1236,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 c70d5edaf6327cb18df5285c3fc21b610f3d3294 -R 88ff3b896a4782d7ebc798cf681238f7 -T *branch * msvcW4 -T *sym-msvcW4 * -T -sym-trunk * +P 856dd245ce037f93d5ae2ddeb4fdf949c1e5c8e9 +R 306d1e512e997bee8bd0c70d96704bbe U mistachkin -Z 8d2294254b24b7823d46df8b0b6fe494 +Z 37adac17acc7ab7c754a712018c43649 diff --git a/manifest.uuid b/manifest.uuid index 7afa69b539..16e82275b3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -856dd245ce037f93d5ae2ddeb4fdf949c1e5c8e9 \ No newline at end of file +43b6b4cc051e5a801a992c56d2c82abcdcf45cec \ No newline at end of file diff --git a/src/msvc.h b/src/msvc.h index f5d6752ea2..c14437d1e6 100644 --- a/src/msvc.h +++ b/src/msvc.h @@ -10,7 +10,7 @@ ** ****************************************************************************** ** -** This file contains code that is specific to Windows. +** This file contains code that is specific to MSVC. */ #ifndef _MSVC_H_ #define _MSVC_H_ @@ -21,7 +21,7 @@ #pragma warning(disable : 4232) #pragma warning(disable : 4244) /* #pragma warning(disable : 4701) */ -/* #pragma warning(disable : 4706) */ +#pragma warning(disable : 4706) #endif #endif /* _MSVC_H_ */ From 1a51ce78ba8eee882730864ecd483f1f39d28e4c Mon Sep 17 00:00:00 2001 From: mistachkin Date: Mon, 12 Jan 2015 18:38:02 +0000 Subject: [PATCH 24/34] Fix some harmless compiler warnings. FossilOrigin-Name: 2b8eecbfe7935d3d9826fbcd473dd3a49138ad11 --- ext/fts3/fts3.c | 6 +++--- ext/fts3/fts3_tokenize_vtab.c | 2 +- ext/fts3/fts3_write.c | 4 ++-- manifest | 22 +++++++++++----------- manifest.uuid | 2 +- src/delete.c | 4 ++-- src/main.c | 2 +- src/pragma.c | 2 +- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/ext/fts3/fts3.c b/ext/fts3/fts3.c index 2b93c62715..fe28eb2cfe 100644 --- a/ext/fts3/fts3.c +++ b/ext/fts3/fts3.c @@ -1853,7 +1853,7 @@ static int fts3SelectLeaf( sqlite3_int64 *piLeaf, /* Selected leaf node */ sqlite3_int64 *piLeaf2 /* Selected leaf node */ ){ - int rc; /* Return code */ + int rc = SQLITE_OK; /* Return code */ int iHeight; /* Height of this node in tree */ assert( piLeaf || piLeaf2 ); @@ -1864,7 +1864,7 @@ static int fts3SelectLeaf( if( rc==SQLITE_OK && iHeight>1 ){ char *zBlob = 0; /* Blob read from %_segments table */ - int nBlob; /* Size of zBlob in bytes */ + int nBlob = 0; /* Size of zBlob in bytes */ if( piLeaf && piLeaf2 && (*piLeaf!=*piLeaf2) ){ rc = sqlite3Fts3ReadBlock(p, *piLeaf, &zBlob, &nBlob, 0); @@ -3086,7 +3086,7 @@ static int fts3FilterMethod( int nVal, /* Number of elements in apVal */ sqlite3_value **apVal /* Arguments for the indexing scheme */ ){ - int rc; + int rc = SQLITE_OK; char *zSql; /* SQL statement used to access %_content */ int eSearch; Fts3Table *p = (Fts3Table *)pCursor->pVtab; diff --git a/ext/fts3/fts3_tokenize_vtab.c b/ext/fts3/fts3_tokenize_vtab.c index 364852ef82..fb99f8b806 100644 --- a/ext/fts3/fts3_tokenize_vtab.c +++ b/ext/fts3/fts3_tokenize_vtab.c @@ -163,7 +163,7 @@ static int fts3tokConnectMethod( sqlite3_vtab **ppVtab, /* OUT: New sqlite3_vtab object */ char **pzErr /* OUT: sqlite3_malloc'd error message */ ){ - Fts3tokTable *pTab; + Fts3tokTable *pTab = 0; const sqlite3_tokenizer_module *pMod = 0; sqlite3_tokenizer *pTok = 0; int rc; diff --git a/ext/fts3/fts3_write.c b/ext/fts3/fts3_write.c index 0da08c62d8..09294bc45a 100644 --- a/ext/fts3/fts3_write.c +++ b/ext/fts3/fts3_write.c @@ -3082,8 +3082,8 @@ static int fts3PromoteSegments( if( bOk ){ int iIdx = 0; - sqlite3_stmt *pUpdate1; - sqlite3_stmt *pUpdate2; + sqlite3_stmt *pUpdate1 = 0; + sqlite3_stmt *pUpdate2 = 0; if( rc==SQLITE_OK ){ rc = fts3SqlStmt(p, SQL_UPDATE_LEVEL_IDX, &pUpdate1, 0); diff --git a/manifest b/manifest index d253e20adc..3a343f61b9 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\scomments\sand\sadd\sanother\sdisabled\swarning\sfor\sMSVC. -D 2015-01-12T18:27:31.115 +C Fix\ssome\sharmless\scompiler\swarnings. +D 2015-01-12T18:38:02.224 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 33a180534a9ba2cf80f5f87e8288c26423d0a8d1 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -78,7 +78,7 @@ F ext/fts3/README.content fdc666a70d5257a64fee209f97cf89e0e6e32b51 F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a F ext/fts3/README.tokenizers e0a8b81383ea60d0334d274fadf305ea14a8c314 F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d -F ext/fts3/fts3.c 8b6cceb3e0be22da26d83a3cec0e0e337e6b8ec6 +F ext/fts3/fts3.c 5c464816508e40feb3c61f1f5566551764698fc8 F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe F ext/fts3/fts3Int.h 53d4eca1fb23eab00681fb028fb82eb5705c1e21 F ext/fts3/fts3_aux.c 5c211e17a64885faeb16b9ba7772f9d5445c2365 @@ -90,13 +90,13 @@ F ext/fts3/fts3_porter.c 3565faf04b626cddf85f03825e86056a4562c009 F ext/fts3/fts3_snippet.c 51beb5c1498176fd9caccaf1c75b55cb803a985a F ext/fts3/fts3_term.c a521f75132f9a495bdca1bdd45949b3191c52763 F ext/fts3/fts3_test.c 8a3a78c4458b2d7c631fcf4b152a5cd656fa7038 -F ext/fts3/fts3_tokenize_vtab.c 011170fe9eba5ff062f1a31d3188e00267716706 +F ext/fts3/fts3_tokenize_vtab.c becc661223db7898b213f9e8a23d75bac02408c9 F ext/fts3/fts3_tokenizer.c bbdc731bc91338050675c6d1da9ab82147391e16 F ext/fts3/fts3_tokenizer.h 64c6ef6c5272c51ebe60fc607a896e84288fcbc3 F ext/fts3/fts3_tokenizer1.c 5c98225a53705e5ee34824087478cf477bdb7004 F ext/fts3/fts3_unicode.c a93f5edc0aff44ef8b06d7cb55b52026541ca145 F ext/fts3/fts3_unicode2.c c3d01968d497bd7001e7dc774ba75b372738c057 -F ext/fts3/fts3_write.c 8260388626516a7005d06a9dce94f9e55c6c2a41 +F ext/fts3/fts3_write.c 9b3a32cbecf40a1f41cb08c00df8c066c23c7a25 F ext/fts3/fts3speed.tcl b54caf6a18d38174f1a6e84219950d85e98bb1e9 F ext/fts3/mkfts3amal.tcl 252ecb7fe6467854f2aa237bf2c390b74e71f100 F ext/fts3/tool/fts3view.c 3986531f2fc0ceca0c89c31ec7d0589b6adb19d6 @@ -181,7 +181,7 @@ F src/callback.c 7b44ce59674338ad48b0e84e7b72f935ea4f68b0 F src/complete.c 198a0066ba60ab06fc00fba1998d870a4d575463 F src/ctime.c df19848891c8a553c80e6f5a035e768280952d1a F src/date.c 53cedb541686b30eb5495753f0b622909a928780 -F src/delete.c 0750b1eb4d96cd3fb2c798599a3a7c85e92f1417 +F src/delete.c bd1a91ddd247ce13004075251e0b7fe2bf9925ef F src/expr.c 7be80f7dc337329a24df45c2f3bdb2ea3b64c90e F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb F src/fkey.c e0444b61bed271a76840cbe6182df93a9baa3f12 @@ -195,7 +195,7 @@ F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e F src/lempar.c 7274c97d24bb46631e504332ccd3bd1b37841770 F src/loadext.c 86bd4e2fccd520b748cba52492ab60c4a770f660 -F src/main.c b0a7f3f9ff70106b7735f38c602d1b3ca56eb065 +F src/main.c c82bc2650f64edfaf9c103342d0f8c58665213d4 F src/malloc.c 740db54387204c9a2eb67c6d98e68b08e9ef4eab F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem1.c faf615aafd8be74a71494dfa027c113ea5c6615f @@ -223,7 +223,7 @@ F src/parse.y c5d0d964f9ac023e8154cad512e54b0b6058e086 F src/pcache.c d210cf90d04365a74f85d21374dded65af67b0cb F src/pcache.h b44658c9c932d203510279439d891a2a83e12ba8 F src/pcache1.c 1e77432b40b7d3288327d9cdf399dcdfd2b6d3bf -F src/pragma.c bd33aa24456f043bb6f6d32a918bbeed41d8c591 +F src/pragma.c ba149bbbc90783f84815636c509ced8eac11bbcf F src/prepare.c 173a5a499138451b2561614ecb87d78f9f4644b9 F src/printf.c 9e75a6a0b55bf61cfff7d7e19d89834a1b938236 F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 @@ -1236,7 +1236,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 856dd245ce037f93d5ae2ddeb4fdf949c1e5c8e9 -R 306d1e512e997bee8bd0c70d96704bbe +P 43b6b4cc051e5a801a992c56d2c82abcdcf45cec +R bba3af3a356e680f16cb17ee14d2767c U mistachkin -Z 37adac17acc7ab7c754a712018c43649 +Z d67b74d2cb1318ffa320cad7c97c91ba diff --git a/manifest.uuid b/manifest.uuid index 16e82275b3..6c016889c6 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -43b6b4cc051e5a801a992c56d2c82abcdcf45cec \ No newline at end of file +2b8eecbfe7935d3d9826fbcd473dd3a49138ad11 \ No newline at end of file diff --git a/src/delete.c b/src/delete.c index d81dd3f6b4..011fb80dee 100644 --- a/src/delete.c +++ b/src/delete.c @@ -226,8 +226,8 @@ void sqlite3DeleteFrom( WhereInfo *pWInfo; /* Information about the WHERE clause */ Index *pIdx; /* For looping over indices of the table */ int iTabCur; /* Cursor number for the table */ - int iDataCur; /* VDBE cursor for the canonical data source */ - int iIdxCur; /* Cursor number of the first index */ + int iDataCur = 0; /* VDBE cursor for the canonical data source */ + int iIdxCur = 0; /* Cursor number of the first index */ int nIdx; /* Number of indices */ sqlite3 *db; /* Main database structure */ AuthContext sContext; /* Authorization context */ diff --git a/src/main.c b/src/main.c index 8af34cc2f1..625d768996 100644 --- a/src/main.c +++ b/src/main.c @@ -3140,7 +3140,7 @@ int sqlite3_table_column_metadata( char *zErrMsg = 0; Table *pTab = 0; Column *pCol = 0; - int iCol; + int iCol = 0; char const *zDataType = 0; char const *zCollSeq = 0; diff --git a/src/pragma.c b/src/pragma.c index 1312beef04..34830e33a6 100644 --- a/src/pragma.c +++ b/src/pragma.c @@ -727,7 +727,7 @@ void sqlite3Pragma( Token *pId; /* Pointer to token */ char *aFcntl[4]; /* Argument to SQLITE_FCNTL_PRAGMA */ int iDb; /* Database index for */ - int lwr, upr, mid; /* Binary search bounds */ + int lwr, upr, mid = 0; /* Binary search bounds */ int rc; /* return value form SQLITE_FCNTL_PRAGMA */ sqlite3 *db = pParse->db; /* The database connection */ Db *pDb; /* The specific database being pragmaed */ From 7bb6e8e16962d2201a5d61d5e02a52b4d453786c Mon Sep 17 00:00:00 2001 From: mistachkin Date: Mon, 12 Jan 2015 18:52:41 +0000 Subject: [PATCH 25/34] Get things compiling cleanly with MSVC and W4. FossilOrigin-Name: c8725fa5fa361959b0f0a3fb36f204905d6f0ae9 --- ext/rtree/rtree.c | 2 ++ manifest | 16 ++++++++-------- manifest.uuid | 2 +- src/msvc.h | 3 +-- src/vdbe.c | 4 ++-- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/ext/rtree/rtree.c b/ext/rtree/rtree.c index 57b38de03d..058dc96a4c 100644 --- a/ext/rtree/rtree.c +++ b/ext/rtree/rtree.c @@ -2806,6 +2806,8 @@ static int rtreeUpdate( rtreeReference(pRtree); assert(nData>=1); + cell.iRowid = 0; /* Used only to suppress a compiler warning */ + /* Constraint handling. A write operation on an r-tree table may return ** SQLITE_CONSTRAINT for two reasons: ** diff --git a/manifest b/manifest index 3a343f61b9..2e3821137d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\ssome\sharmless\scompiler\swarnings. -D 2015-01-12T18:38:02.224 +C Get\sthings\scompiling\scleanly\swith\sMSVC\sand\sW4. +D 2015-01-12T18:52:41.112 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 33a180534a9ba2cf80f5f87e8288c26423d0a8d1 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -124,7 +124,7 @@ F ext/misc/vfslog.c fe40fab5c077a40477f7e5eba994309ecac6cc95 F ext/misc/vtshim.c babb0dc2bf116029e3e7c9a618b8a1377045303e F ext/misc/wholenumber.c 784b12543d60702ebdd47da936e278aa03076212 F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761 -F ext/rtree/rtree.c a03ebd2480a1a4969cb363bb696d9d911e5a6ecd +F ext/rtree/rtree.c b61e9eab7229a443d0d2029da7624299e19301a2 F ext/rtree/rtree.h 834dbcb82dc85b2481cde6a07cdadfddc99e9b9e F ext/rtree/rtree1.test 541bbcab74613907fea08b2ecdcdd5b7aa724cc9 F ext/rtree/rtree2.test acbb3a4ce0f4fbc2c304d2b4b784cfa161856bba @@ -203,7 +203,7 @@ F src/mem2.c f1940d9e91948dd6a908fbb9ce3835c36b5d83c3 F src/mem3.c 61c9d47b792908c532ca3a62b999cf21795c6534 F src/mem5.c 61eeb90134f9a5be6c2e68d8daae7628b25953fb F src/memjournal.c 3eb2c0b51adbd869cb6a44780323f05fa904dc85 -F src/msvc.h f9a7b17a5fbc4ddaca0339128e56aed20256d309 +F src/msvc.h 546453caaf5227521f1fb87a5033b37e00675608 F src/mutex.c 19bf9acba69ca2f367c3761080f8a9f0cf4670a8 F src/mutex.h 779d588e3b7756ec3ecf7d78cde1d84aba414f85 F src/mutex_noop.c f3f09fd7a2eb4287cfc799753ffc30380e7b71a1 @@ -292,7 +292,7 @@ F src/update.c 3c4ecc282accf12d39edb8d524cf089645e55a13 F src/utf.c fc6b889ba0779b7722634cdeaa25f1930d93820c F src/util.c 3b627daa45c7308c1e36e3dbaa3f9ce7e5c7fa73 F src/vacuum.c 9b30ec729337dd012ed88d4c292922c8ef9cf00c -F src/vdbe.c 1a9e671c9cfc259e4d2affc71f7df4a4c00a842c +F src/vdbe.c ddfc977981cd6324668aa6b114045eb1c677421a F src/vdbe.h 6fc69d9c5e146302c56e163cb4b31d1ee64a18c3 F src/vdbeInt.h 9bb69ff2447c34b6ccc58b34ec35b615f86ead78 F src/vdbeapi.c 4bc511a46b9839392ae0e90844a71dc96d9dbd71 @@ -1236,7 +1236,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 43b6b4cc051e5a801a992c56d2c82abcdcf45cec -R bba3af3a356e680f16cb17ee14d2767c +P 2b8eecbfe7935d3d9826fbcd473dd3a49138ad11 +R 23426bb53239eb240dd8df9d0d219aeb U mistachkin -Z d67b74d2cb1318ffa320cad7c97c91ba +Z 96c406dd077f9e953d8ddb5aba51e0dd diff --git a/manifest.uuid b/manifest.uuid index 6c016889c6..9fb5a9bb7d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2b8eecbfe7935d3d9826fbcd473dd3a49138ad11 \ No newline at end of file +c8725fa5fa361959b0f0a3fb36f204905d6f0ae9 \ No newline at end of file diff --git a/src/msvc.h b/src/msvc.h index c14437d1e6..85951c846a 100644 --- a/src/msvc.h +++ b/src/msvc.h @@ -20,8 +20,7 @@ #pragma warning(disable : 4127) #pragma warning(disable : 4232) #pragma warning(disable : 4244) -/* #pragma warning(disable : 4701) */ #pragma warning(disable : 4706) -#endif +#endif /* defined(_MSC_VER) */ #endif /* _MSVC_H_ */ diff --git a/src/vdbe.c b/src/vdbe.c index 3dac74dfd4..1e0ff96af4 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -3823,8 +3823,8 @@ case OP_Found: { /* jump, in3 */ /* For the OP_NoConflict opcode, take the jump if any of the ** input fields are NULL, since any key with a NULL will not ** conflict */ - for(ii=0; iinField; ii++){ + if( pIdxKey->aMem[ii].flags & MEM_Null ){ pc = pOp->p2 - 1; VdbeBranchTaken(1,2); break; } From 27b2f05335a0fff69656fe54c3904fd3ee670a6e Mon Sep 17 00:00:00 2001 From: mistachkin Date: Mon, 12 Jan 2015 19:49:46 +0000 Subject: [PATCH 26/34] Harmless compiler warning fixes for 'testfixture' and the miscellaneous extensions when built with the MSVC makefile. FossilOrigin-Name: 923fd66031ed1876bc63c3a038f0b8e33678184e --- Makefile.msc | 11 ++++++----- manifest | 26 +++++++++++++------------- manifest.uuid | 2 +- src/msvc.h | 7 +++++++ src/tclsqlite.c | 10 +++++++++- src/test1.c | 8 ++++---- src/test2.c | 2 +- src/test8.c | 6 +++--- src/test_journal.c | 4 +++- src/test_multiplex.c | 2 +- 10 files changed, 48 insertions(+), 30 deletions(-) diff --git a/Makefile.msc b/Makefile.msc index f301048fae..532b35ba5c 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -28,7 +28,8 @@ USE_FULLWARN = 0 # !IFNDEF NO_WARN !IF $(USE_FULLWARN)!=0 -NO_WARN = -wd4054 -wd4055 -wd4100 -wd4210 -wd4702 +NO_WARN = -wd4054 -wd4055 -wd4100 -wd4127 -wd4152 -wd4189 -wd4206 -wd4210 +NO_WARN = $(NO_WARN) -wd4232 -wd4244 -wd4702 -wd4706 !ENDIF !ENDIF @@ -274,7 +275,7 @@ NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)" # same unless your are cross-compiling.) # !IF $(USE_FULLWARN)!=0 -TCC = $(CC) -W4 +TCC = $(CC) -W4 -DINCLUDE_MSVC_H=1 !ELSE TCC = $(CC) -W3 !ENDIF @@ -1017,8 +1018,7 @@ libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib $(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCL:tcl=tclstub) $(TLIBS) sqlite3.exe: $(TOP)\src\shell.c libsqlite3.lib $(LIBRESOBJS) sqlite3.h - $(LTLINK) $(READLINE_FLAGS) \ - -DINCLUDE_MSVC_H=1 $(TOP)\src\shell.c \ + $(LTLINK) $(READLINE_FLAGS) $(TOP)\src\shell.c \ /link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS) mptester.exe: $(TOP)\mptest\mptest.c libsqlite3.lib $(LIBRESOBJS) sqlite3.h @@ -1422,7 +1422,8 @@ rtree.lo: $(TOP)\ext\rtree\rtree.c $(HDR) $(EXTHDR) # hidden when the library is built via the amalgamation). # TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1 -TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE +TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" +TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN) TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2) libsqlite3.lib TESTFIXTURE_SRC1 = $(TESTEXT) $(SQLITE3C) diff --git a/manifest b/manifest index 8d577e9692..d4b0f884cf 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Merge\supdates\sfrom\strunk. -D 2015-01-12T18:52:57.919 +C Harmless\scompiler\swarning\sfixes\sfor\s'testfixture'\sand\sthe\smiscellaneous\sextensions\swhen\sbuilt\swith\sthe\sMSVC\smakefile. +D 2015-01-12T19:49:46.321 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 9efcdb5c6025caea362cdfc38817451170fc6344 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 -F Makefile.msc 2ed20e3ee252eb85dea357940a2e5e5649f9dd86 +F Makefile.msc 42ce34934c4e1c957f194bd76992aa9008c2daa5 F Makefile.vxworks e1b65dea203f054e71653415bd8f96dcaed47858 F README.md d58e3bebc0a4145e0f2a87994015fdb575a8e866 F VERSION d846487aff892625eb8e75960234e7285f0462fe @@ -203,7 +203,7 @@ F src/mem2.c f1940d9e91948dd6a908fbb9ce3835c36b5d83c3 F src/mem3.c 61c9d47b792908c532ca3a62b999cf21795c6534 F src/mem5.c 61eeb90134f9a5be6c2e68d8daae7628b25953fb F src/memjournal.c 3eb2c0b51adbd869cb6a44780323f05fa904dc85 -F src/msvc.h 546453caaf5227521f1fb87a5033b37e00675608 +F src/msvc.h 9dc7aedcf4f19696f2e5aac148a654ed0ddcaf35 F src/mutex.c 19bf9acba69ca2f367c3761080f8a9f0cf4670a8 F src/mutex.h 779d588e3b7756ec3ecf7d78cde1d84aba414f85 F src/mutex_noop.c f3f09fd7a2eb4287cfc799753ffc30380e7b71a1 @@ -238,15 +238,15 @@ F src/sqliteInt.h eaf210295b551d4e40e622aec1b2261c0b28f844 F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c 81712116e826b0089bb221b018929536b2b5406f F src/table.c e7a09215315a978057fb42c640f890160dbcc45e -F src/tclsqlite.c b1d0a181a9f8e8dae960370518a3450db93a6a8c -F src/test1.c 163cff8c4ebdda512e3b055716e3cc7f0e563a44 -F src/test2.c 98049e51a17dc62606a99a9eb95ee477f9996712 +F src/tclsqlite.c 799315b0cdc0f9ca498573c46ea2d678a9cfdde6 +F src/test1.c 093d8b5b54b829dcfebae3181d4406edcc935d90 +F src/test2.c 577961fe48961b2f2e5c8b56ee50c3f459d3359d F src/test3.c 1c0e5d6f080b8e33c1ce8b3078e7013fdbcd560c F src/test4.c 9b32d22f5f150abe23c1830e2057c4037c45b3df F src/test5.c 5a34feec76d9b3a86aab30fd4f6cc9c48cbab4c1 F src/test6.c 41cacf3b0dd180823919bf9e1fbab287c9266723 F src/test7.c 72b732baa5642f795655ba1126ea032af46ecfd2 -F src/test8.c bf3bad9a7df2e7c58d3371ea913abeaedb429a38 +F src/test8.c df8dd4c99c1dd2225cb2a6f334299cddc5dcf1f1 F src/test9.c bea1e8cf52aa93695487badedd6e1886c321ea60 F src/test_async.c 21e11293a2f72080eda70e1124e9102044531cd8 F src/test_autoext.c dea8a01a7153b9adc97bd26161e4226329546e12 @@ -262,10 +262,10 @@ F src/test_hexio.c abfdecb6fa58c354623978efceb088ca18e379cd F src/test_init.c 66b33120ffe9cd853b5a905ec850d51151337b32 F src/test_intarray.c 6c610a21ab8edde85a3a2c7f2b069244ecf4d834 F src/test_intarray.h 9dc57417fb65bc7835cc18548852cc08cc062202 -F src/test_journal.c f5c0a05b7b3d5930db769b5ee6c3766dc2221a64 +F src/test_journal.c de3402cbd600b55b6bac74663135b7a4e159ff66 F src/test_loadext.c a5251f956ab6af21e138dc1f9c0399394a510cb4 F src/test_malloc.c fffc66b2e7743ce93f039187d3fd78664193c664 -F src/test_multiplex.c caadb62cc777268b4f8fb94d5b27b80156c8f7c0 +F src/test_multiplex.c 0ac6d9197e3d4baa530785b882b631c0086351a1 F src/test_multiplex.h c08e4e8f8651f0c5e0509b138ff4d5b43ed1f5d3 F src/test_mutex.c 293042d623ebba969160f471a82aa1551626454f F src/test_onefile.c 0396f220561f3b4eedc450cef26d40c593c69a25 @@ -1236,7 +1236,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 c8725fa5fa361959b0f0a3fb36f204905d6f0ae9 11e81ac2a7c917f7c9afc218d104d9870daf9668 -R 2eb9ddda90091ff81afdfabf278ccd4b +P ca5f2c545216c82486e66d26f55b49cbf351ffdc +R abdafb1ebc48afc63d88753056c322e6 U mistachkin -Z b3ea8767e897ce2d6470ea9439664def +Z bd158ce8f1d3955470f74e8e3dfe7133 diff --git a/manifest.uuid b/manifest.uuid index fd770dd259..118dd4b43c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ca5f2c545216c82486e66d26f55b49cbf351ffdc \ No newline at end of file +923fd66031ed1876bc63c3a038f0b8e33678184e \ No newline at end of file diff --git a/src/msvc.h b/src/msvc.h index 85951c846a..09f518454a 100644 --- a/src/msvc.h +++ b/src/msvc.h @@ -16,10 +16,17 @@ #define _MSVC_H_ #if defined(_MSC_VER) +#pragma warning(disable : 4054) +#pragma warning(disable : 4055) #pragma warning(disable : 4100) #pragma warning(disable : 4127) +#pragma warning(disable : 4152) +#pragma warning(disable : 4189) +#pragma warning(disable : 4206) +#pragma warning(disable : 4210) #pragma warning(disable : 4232) #pragma warning(disable : 4244) +#pragma warning(disable : 4702) #pragma warning(disable : 4706) #endif /* defined(_MSC_VER) */ diff --git a/src/tclsqlite.c b/src/tclsqlite.c index 852f966a85..747017e32e 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -25,6 +25,14 @@ ** hundreds of new commands used for testing ** SQLite. This option implies -DSQLITE_TCLMD5. */ + +/* +** If requested, include the SQLite compiler options file for MSVC. +*/ +#if defined(INCLUDE_MSVC_H) +#include "msvc.h" +#endif + #include "tcl.h" #include @@ -3102,7 +3110,7 @@ static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){ ** The EXTERN macros are required by TCL in order to work on windows. */ EXTERN int Sqlite3_Init(Tcl_Interp *interp){ - int rc = Tcl_InitStubs(interp, "8.4", 0)==0 ? TCL_ERROR : TCL_OK; + int rc = Tcl_InitStubs(interp, "8.4", 0) ? TCL_OK : TCL_ERROR; if( rc==TCL_OK ){ Tcl_CreateObjCommand(interp, "sqlite3", (Tcl_ObjCmdProc*)DbMain, 0, 0); #ifndef SQLITE_3_SUFFIX_ONLY diff --git a/src/test1.c b/src/test1.c index 475473d77c..8f21660c27 100644 --- a/src/test1.c +++ b/src/test1.c @@ -567,7 +567,7 @@ static int test_get_table_printf( Tcl_DString str; int rc; char *zErr = 0; - int nRow, nCol; + int nRow = 0, nCol = 0; char **aResult; int i; char zBuf[30]; @@ -2120,7 +2120,7 @@ static int test_stmt_status( Tcl_Obj *CONST objv[] ){ int iValue; - int i, op, resetFlag; + int i, op = 0, resetFlag; const char *zOpName; sqlite3_stmt *pStmt; @@ -3098,7 +3098,7 @@ static int test_bind_double( ){ sqlite3_stmt *pStmt; int idx; - double value; + double value = 0; int rc; const char *zVal; int i; @@ -5458,7 +5458,7 @@ static int test_limit( { "SQLITE_LIMIT_TOOSMALL", -1, }, { "SQLITE_LIMIT_TOOBIG", SQLITE_LIMIT_WORKER_THREADS+1 }, }; - int i, id; + int i, id = 0; int val; const char *zId; diff --git a/src/test2.c b/src/test2.c index 58f271ff27..7192ddfffb 100644 --- a/src/test2.c +++ b/src/test2.c @@ -310,7 +310,7 @@ static int page_get( ){ Pager *pPager; char zBuf[100]; - DbPage *pPage; + DbPage *pPage = 0; int pgno; int rc; if( argc!=3 ){ diff --git a/src/test8.c b/src/test8.c index 407dd54c79..f37a28ced6 100644 --- a/src/test8.c +++ b/src/test8.c @@ -777,11 +777,11 @@ static int echoBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ sqlite3_stmt *pStmt = 0; Tcl_Interp *interp = pVtab->interp; - int nRow; + int nRow = 0; int useIdx = 0; int rc = SQLITE_OK; int useCost = 0; - double cost; + double cost = 0; int isIgnoreUsable = 0; if( Tcl_GetVar(interp, "echo_module_ignore_usable", TCL_GLOBAL_ONLY) ){ isIgnoreUsable = 1; @@ -927,7 +927,7 @@ int echoUpdate( sqlite3 *db = pVtab->db; int rc = SQLITE_OK; - sqlite3_stmt *pStmt; + sqlite3_stmt *pStmt = 0; char *z = 0; /* SQL statement to execute */ int bindArgZero = 0; /* True to bind apData[0] to sql var no. nData */ int bindArgOne = 0; /* True to bind apData[1] to sql var no. 1 */ diff --git a/src/test_journal.c b/src/test_journal.c index e8701a4eea..f9e5c86c82 100644 --- a/src/test_journal.c +++ b/src/test_journal.c @@ -409,7 +409,9 @@ static int openTransaction(jt_file *pMain, jt_file *pJournal){ if( iOff==PENDING_BYTE ) continue; rc = sqlite3OsRead(pMain->pReal, aData, pMain->nPagesize, iOff); pMain->aCksum[ii] = genCksum(aData, pMain->nPagesize); - if( ii+1==pMain->nPage && rc==SQLITE_IOERR_SHORT_READ ) rc = SQLITE_OK; + if( ii+1==(int)pMain->nPage && rc==SQLITE_IOERR_SHORT_READ ){ + rc = SQLITE_OK; + } } } diff --git a/src/test_multiplex.c b/src/test_multiplex.c index 99819371ce..227864844b 100644 --- a/src/test_multiplex.c +++ b/src/test_multiplex.c @@ -535,7 +535,7 @@ static int multiplexOpen( /* assign pointers to extra space allocated */ memset(pGroup, 0, sz); pMultiplexOpen->pGroup = pGroup; - pGroup->bEnabled = -1; + pGroup->bEnabled = (unsigned char)-1; pGroup->bTruncate = sqlite3_uri_boolean(zUri, "truncate", (flags & SQLITE_OPEN_MAIN_DB)==0); pGroup->szChunk = (int)sqlite3_uri_int64(zUri, "chunksize", From 7bb22ac7ffe89a16df4dd760121781e2edd428c8 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Mon, 12 Jan 2015 19:59:12 +0000 Subject: [PATCH 27/34] Silence some harmless uninitialized local variable warnings. FossilOrigin-Name: 44375a34e59d1b0f0d765a99dcc7e6f30a4be7f7 --- ext/misc/amatch.c | 2 +- ext/misc/spellfix.c | 2 +- manifest | 24 ++++++++++++------------ manifest.uuid | 2 +- src/tclsqlite.c | 4 ++-- src/test_malloc.c | 4 ++-- src/test_multiplex.c | 2 +- src/test_quota.c | 2 +- src/test_vfs.c | 4 ++-- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/ext/misc/amatch.c b/ext/misc/amatch.c index d869dbd8d1..98c01431ba 100644 --- a/ext/misc/amatch.c +++ b/ext/misc/amatch.c @@ -398,7 +398,7 @@ static amatch_avl *amatchAvlInsert(amatch_avl **ppHead, amatch_avl *pNew){ */ static void amatchAvlRemove(amatch_avl **ppHead, amatch_avl *pOld){ amatch_avl **ppParent; - amatch_avl *pBalance; + amatch_avl *pBalance = 0; /* assert( amatchAvlSearch(*ppHead, pOld->zKey)==pOld ); */ ppParent = amatchAvlFromPtr(pOld, ppHead); if( pOld->pBefore==0 && pOld->pAfter==0 ){ diff --git a/ext/misc/spellfix.c b/ext/misc/spellfix.c index 2a26e08391..a6f780584c 100644 --- a/ext/misc/spellfix.c +++ b/ext/misc/spellfix.c @@ -356,7 +356,7 @@ static int substituteCost(char cPrev, char cFrom, char cTo){ static int editdist1(const char *zA, const char *zB, int *pnMatch){ int nA, nB; /* Number of characters in zA[] and zB[] */ int xA, xB; /* Loop counters for zA[] and zB[] */ - char cA, cB; /* Current character of zA and zB */ + char cA = 0, cB; /* Current character of zA and zB */ char cAprev, cBprev; /* Previous character of zA and zB */ char cAnext, cBnext; /* Next character in zA and zB */ int d; /* North-west cost value */ diff --git a/manifest b/manifest index d4b0f884cf..1c214b48a9 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Harmless\scompiler\swarning\sfixes\sfor\s'testfixture'\sand\sthe\smiscellaneous\sextensions\swhen\sbuilt\swith\sthe\sMSVC\smakefile. -D 2015-01-12T19:49:46.321 +C Silence\ssome\sharmless\suninitialized\slocal\svariable\swarnings. +D 2015-01-12T19:59:12.988 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 9efcdb5c6025caea362cdfc38817451170fc6344 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -106,7 +106,7 @@ F ext/fts3/unicode/mkunicode.tcl a2567f9d6ad6779879a2e394c120ad8718557e65 F ext/icu/README.txt d9fbbad0c2f647c3fdf715fc9fd64af53aedfc43 F ext/icu/icu.c d415ccf984defeb9df2c0e1afcfaa2f6dc05eacb F ext/icu/sqliteicu.h 728867a802baa5a96de7495e9689a8e01715ef37 -F ext/misc/amatch.c 678056a4bfcd83c4e82dea81d37543cd1d6dbee1 +F ext/misc/amatch.c 17ba78dc9b33601a40d2a7bc54c748b6f3eb7176 F ext/misc/closure.c 636024302cde41b2bf0c542f81c40c624cfb7012 F ext/misc/compress.c 76e45655f4046e756064ab10c62e18f2eb846b9f F ext/misc/eval.c f971962e92ebb8b0a4e6b62949463ee454d88fa2 @@ -118,7 +118,7 @@ F ext/misc/percentile.c bcbee3c061b884eccb80e21651daaae8e1e43c63 F ext/misc/regexp.c af92cdaa5058fcec1451e49becc7ba44dba023dc F ext/misc/rot13.c 1ac6f95f99b575907b9b09c81a349114cf9be45a F ext/misc/showauth.c 732578f0fe4ce42d577e1c86dc89dd14a006ab52 -F ext/misc/spellfix.c 56739fab8c2ed6a9e2dac5592a88d281a999c43b +F ext/misc/spellfix.c 25810dda37fc904b0772a13efd8ca072fb09e355 F ext/misc/totype.c 4a167594e791abeed95e0a8db028822b5e8fe512 F ext/misc/vfslog.c fe40fab5c077a40477f7e5eba994309ecac6cc95 F ext/misc/vtshim.c babb0dc2bf116029e3e7c9a618b8a1377045303e @@ -238,7 +238,7 @@ F src/sqliteInt.h eaf210295b551d4e40e622aec1b2261c0b28f844 F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c 81712116e826b0089bb221b018929536b2b5406f F src/table.c e7a09215315a978057fb42c640f890160dbcc45e -F src/tclsqlite.c 799315b0cdc0f9ca498573c46ea2d678a9cfdde6 +F src/tclsqlite.c 0bbb44543175ef2033d39780a233f98bf354eff9 F src/test1.c 093d8b5b54b829dcfebae3181d4406edcc935d90 F src/test2.c 577961fe48961b2f2e5c8b56ee50c3f459d3359d F src/test3.c 1c0e5d6f080b8e33c1ce8b3078e7013fdbcd560c @@ -264,14 +264,14 @@ F src/test_intarray.c 6c610a21ab8edde85a3a2c7f2b069244ecf4d834 F src/test_intarray.h 9dc57417fb65bc7835cc18548852cc08cc062202 F src/test_journal.c de3402cbd600b55b6bac74663135b7a4e159ff66 F src/test_loadext.c a5251f956ab6af21e138dc1f9c0399394a510cb4 -F src/test_malloc.c fffc66b2e7743ce93f039187d3fd78664193c664 -F src/test_multiplex.c 0ac6d9197e3d4baa530785b882b631c0086351a1 +F src/test_malloc.c b9495384e74923aefde8311de974bf9b0f5ba570 +F src/test_multiplex.c 72c0ad1e97af3d6d19975bbd81813072b40c7290 F src/test_multiplex.h c08e4e8f8651f0c5e0509b138ff4d5b43ed1f5d3 F src/test_mutex.c 293042d623ebba969160f471a82aa1551626454f F src/test_onefile.c 0396f220561f3b4eedc450cef26d40c593c69a25 F src/test_osinst.c 3d0340bc31a9f3d8a3547e0272373e80f78dde25 F src/test_pcache.c a5cd24730cb43c5b18629043314548c9169abb00 -F src/test_quota.c 65f6348fec0f2b3020c907247fb47556b214abb9 +F src/test_quota.c 180813f43683be5725458fc1ff13ac455d8e722d F src/test_quota.h 2a8ad1952d1d2ca9af0ce0465e56e6c023b5e15d F src/test_rtree.c fdd8d29ca5165c7857987a2ba263fac5c69e231f F src/test_schema.c 2bdba21b82f601da69793e1f1d11bf481a79b091 @@ -282,7 +282,7 @@ F src/test_superlock.c 2b97936ca127d13962c3605dbc9a4ef269c424cd F src/test_syscall.c 2e21ca7f7dc54a028f1967b63f1e76155c356f9b F src/test_tclvar.c f4dc67d5f780707210d6bb0eb6016a431c04c7fa F src/test_thread.c 1e133a40b50e9c035b00174035b846e7eef481cb -F src/test_vfs.c f84075a388527892ff184988f43b69ce69b8083c +F src/test_vfs.c 8ee7be45fe773a150b4015ef957da960179ee43a F src/test_vfstrace.c bab9594adc976cbe696ff3970728830b4c5ed698 F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9 F src/threads.c 2fb3ea4d70d5acf68b539c2489b4adace61cc01b @@ -1236,7 +1236,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 ca5f2c545216c82486e66d26f55b49cbf351ffdc -R abdafb1ebc48afc63d88753056c322e6 +P 923fd66031ed1876bc63c3a038f0b8e33678184e +R 0a4111785ad71573d9bb58b14a50ee38 U mistachkin -Z bd158ce8f1d3955470f74e8e3dfe7133 +Z 81d2738afee83f71ddaa23bd06d31603 diff --git a/manifest.uuid b/manifest.uuid index 118dd4b43c..4d68faf34d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -923fd66031ed1876bc63c3a038f0b8e33678184e \ No newline at end of file +44375a34e59d1b0f0d765a99dcc7e6f30a4be7f7 \ No newline at end of file diff --git a/src/tclsqlite.c b/src/tclsqlite.c index 747017e32e..a912e8aba4 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -1093,10 +1093,10 @@ static int dbPrepareAndBind( SqlPreparedStmt **ppPreStmt /* OUT: Object used to cache statement */ ){ const char *zSql = zIn; /* Pointer to first SQL statement in zIn */ - sqlite3_stmt *pStmt; /* Prepared statement object */ + sqlite3_stmt *pStmt = 0; /* Prepared statement object */ SqlPreparedStmt *pPreStmt; /* Pointer to cached statement */ int nSql; /* Length of zSql in bytes */ - int nVar; /* Number of variables in statement */ + int nVar = 0; /* Number of variables in statement */ int iParm = 0; /* Next free entry in apParm */ char c; int i; diff --git a/src/test_malloc.c b/src/test_malloc.c index 54a89472d0..1ea4de5063 100644 --- a/src/test_malloc.c +++ b/src/test_malloc.c @@ -1338,7 +1338,7 @@ static int test_status( Tcl_Obj *CONST objv[] ){ int rc, iValue, mxValue; - int i, op, resetFlag; + int i, op = 0, resetFlag; const char *zOpName; static const struct { const char *zName; @@ -1395,7 +1395,7 @@ static int test_db_status( Tcl_Obj *CONST objv[] ){ int rc, iValue, mxValue; - int i, op, resetFlag; + int i, op = 0, resetFlag; const char *zOpName; sqlite3 *db; extern int getDbPointer(Tcl_Interp*, const char*, sqlite3**); diff --git a/src/test_multiplex.c b/src/test_multiplex.c index 227864844b..8f204c6694 100644 --- a/src/test_multiplex.c +++ b/src/test_multiplex.c @@ -406,7 +406,7 @@ static void multiplexControlFunc( ){ int rc = SQLITE_OK; sqlite3 *db = sqlite3_context_db_handle(context); - int op; + int op = 0; int iVal; if( !db || argc!=2 ){ diff --git a/src/test_quota.c b/src/test_quota.c index 80ebd0589e..e8e0b34072 100644 --- a/src/test_quota.c +++ b/src/test_quota.c @@ -889,7 +889,7 @@ int sqlite3_quota_set( ** management, update its size. */ int sqlite3_quota_file(const char *zFilename){ - char *zFull; + char *zFull = 0; sqlite3_file *fd; int rc; int outFlags = 0; diff --git a/src/test_vfs.c b/src/test_vfs.c index 7ee2a93453..37081af784 100644 --- a/src/test_vfs.c +++ b/src/test_vfs.c @@ -421,7 +421,7 @@ static int tvfsSync(sqlite3_file *pFile, int flags){ Testvfs *p = (Testvfs *)pFd->pVfs->pAppData; if( p->pScript && p->mask&TESTVFS_SYNC_MASK ){ - char *zFlags; + char *zFlags = 0; switch( flags ){ case SQLITE_SYNC_NORMAL: @@ -1225,7 +1225,7 @@ static int testvfs_obj_cmd( case CMD_CANTOPENERR: case CMD_IOERR: case CMD_FULLERR: { - TestFaultInject *pTest; + TestFaultInject *pTest = 0; int iRet; switch( aSubcmd[i].eCmd ){ From 32562501a158fa84bdc927d15cf2723e8bb10616 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Mon, 12 Jan 2015 20:20:26 +0000 Subject: [PATCH 28/34] Add two more classes of harmless MSVC compiler warnings. FossilOrigin-Name: de30d5b053b8e004418c81945d626cfad315d6ba --- Makefile.msc | 2 +- manifest | 14 +++++++------- manifest.uuid | 2 +- src/msvc.h | 2 ++ 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Makefile.msc b/Makefile.msc index 532b35ba5c..4ebe9fd20c 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -29,7 +29,7 @@ USE_FULLWARN = 0 !IFNDEF NO_WARN !IF $(USE_FULLWARN)!=0 NO_WARN = -wd4054 -wd4055 -wd4100 -wd4127 -wd4152 -wd4189 -wd4206 -wd4210 -NO_WARN = $(NO_WARN) -wd4232 -wd4244 -wd4702 -wd4706 +NO_WARN = $(NO_WARN) -wd4232 -wd4244 -wd4305 -wd4306 -wd4702 -wd4706 !ENDIF !ENDIF diff --git a/manifest b/manifest index 1c214b48a9..12b395a651 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Silence\ssome\sharmless\suninitialized\slocal\svariable\swarnings. -D 2015-01-12T19:59:12.988 +C Add\stwo\smore\sclasses\sof\sharmless\sMSVC\scompiler\swarnings. +D 2015-01-12T20:20:26.134 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 9efcdb5c6025caea362cdfc38817451170fc6344 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 -F Makefile.msc 42ce34934c4e1c957f194bd76992aa9008c2daa5 +F Makefile.msc 4c057774e6138b9023fc16ec05639ddd3329b152 F Makefile.vxworks e1b65dea203f054e71653415bd8f96dcaed47858 F README.md d58e3bebc0a4145e0f2a87994015fdb575a8e866 F VERSION d846487aff892625eb8e75960234e7285f0462fe @@ -203,7 +203,7 @@ F src/mem2.c f1940d9e91948dd6a908fbb9ce3835c36b5d83c3 F src/mem3.c 61c9d47b792908c532ca3a62b999cf21795c6534 F src/mem5.c 61eeb90134f9a5be6c2e68d8daae7628b25953fb F src/memjournal.c 3eb2c0b51adbd869cb6a44780323f05fa904dc85 -F src/msvc.h 9dc7aedcf4f19696f2e5aac148a654ed0ddcaf35 +F src/msvc.h e78002098966e39b2fd9915bd70b7bc3ec8398b7 F src/mutex.c 19bf9acba69ca2f367c3761080f8a9f0cf4670a8 F src/mutex.h 779d588e3b7756ec3ecf7d78cde1d84aba414f85 F src/mutex_noop.c f3f09fd7a2eb4287cfc799753ffc30380e7b71a1 @@ -1236,7 +1236,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 923fd66031ed1876bc63c3a038f0b8e33678184e -R 0a4111785ad71573d9bb58b14a50ee38 +P 44375a34e59d1b0f0d765a99dcc7e6f30a4be7f7 +R 501ee21f088e015683ae00565ce9a69c U mistachkin -Z 81d2738afee83f71ddaa23bd06d31603 +Z bd3651b366d9527562493f67b56ed79e diff --git a/manifest.uuid b/manifest.uuid index 4d68faf34d..45f36f7e41 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -44375a34e59d1b0f0d765a99dcc7e6f30a4be7f7 \ No newline at end of file +de30d5b053b8e004418c81945d626cfad315d6ba \ No newline at end of file diff --git a/src/msvc.h b/src/msvc.h index 09f518454a..4508e6941f 100644 --- a/src/msvc.h +++ b/src/msvc.h @@ -26,6 +26,8 @@ #pragma warning(disable : 4210) #pragma warning(disable : 4232) #pragma warning(disable : 4244) +#pragma warning(disable : 4305) +#pragma warning(disable : 4306) #pragma warning(disable : 4702) #pragma warning(disable : 4706) #endif /* defined(_MSC_VER) */ From 189143d355334b248d7748ae049a08591ec13d47 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Mon, 12 Jan 2015 20:25:33 +0000 Subject: [PATCH 29/34] Fix harmless compiler warning in an assert() statement. FossilOrigin-Name: bdbeed01ddc60a4ab322621fc118cc4767660fd3 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/test_journal.c | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 12b395a651..93b2f587fc 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\stwo\smore\sclasses\sof\sharmless\sMSVC\scompiler\swarnings. -D 2015-01-12T20:20:26.134 +C Fix\sharmless\scompiler\swarning\sin\san\sassert()\sstatement. +D 2015-01-12T20:25:33.360 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 9efcdb5c6025caea362cdfc38817451170fc6344 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -262,7 +262,7 @@ F src/test_hexio.c abfdecb6fa58c354623978efceb088ca18e379cd F src/test_init.c 66b33120ffe9cd853b5a905ec850d51151337b32 F src/test_intarray.c 6c610a21ab8edde85a3a2c7f2b069244ecf4d834 F src/test_intarray.h 9dc57417fb65bc7835cc18548852cc08cc062202 -F src/test_journal.c de3402cbd600b55b6bac74663135b7a4e159ff66 +F src/test_journal.c 5360fbe1d1e4416ca36290562fd5a2e3f70f32aa F src/test_loadext.c a5251f956ab6af21e138dc1f9c0399394a510cb4 F src/test_malloc.c b9495384e74923aefde8311de974bf9b0f5ba570 F src/test_multiplex.c 72c0ad1e97af3d6d19975bbd81813072b40c7290 @@ -1236,7 +1236,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 44375a34e59d1b0f0d765a99dcc7e6f30a4be7f7 -R 501ee21f088e015683ae00565ce9a69c +P de30d5b053b8e004418c81945d626cfad315d6ba +R 79278f99b3f4d9aaeb5b2b5be8f618ce U mistachkin -Z bd3651b366d9527562493f67b56ed79e +Z 02f72f6c4a80a1aa451e44b57450d7f3 diff --git a/manifest.uuid b/manifest.uuid index 45f36f7e41..b8a7124d05 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -de30d5b053b8e004418c81945d626cfad315d6ba \ No newline at end of file +bdbeed01ddc60a4ab322621fc118cc4767660fd3 \ No newline at end of file diff --git a/src/test_journal.c b/src/test_journal.c index f9e5c86c82..6e320b7abb 100644 --- a/src/test_journal.c +++ b/src/test_journal.c @@ -552,7 +552,8 @@ static int jtWrite( */ }else{ u32 pgno = (u32)(iOfst/p->nPagesize + 1); - assert( (iAmt==1||iAmt==p->nPagesize) && ((iOfst+iAmt)%p->nPagesize)==0 ); + assert( (iAmt==1||iAmt==(int)p->nPagesize) && + ((iOfst+iAmt)%p->nPagesize)==0 ); assert( pgno<=p->nPage || p->nSync>0 ); assert( pgno>p->nPage || sqlite3BitvecTest(p->pWritable, pgno) ); } From e0e43029efbc1b12ac90db83ae797b74d41a7eb9 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 13 Jan 2015 01:12:43 +0000 Subject: [PATCH 30/34] Fix the e_walauto.test test module so that it works on both little-endian and big-ending machines. FossilOrigin-Name: 5682db7b871689b9ee764afe070736f378e8ae1b --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/e_walauto.test | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index b5afb1c517..0ced843c65 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sharmless\scompiler\swarnings\swhen\susing\s-W4\swith\sMSVC. -D 2015-01-12T21:43:00.602 +C Fix\sthe\se_walauto.test\stest\smodule\sso\sthat\sit\sworks\son\sboth\slittle-endian\sand\nbig-ending\smachines. +D 2015-01-13T01:12:43.817 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 9efcdb5c6025caea362cdfc38817451170fc6344 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -479,7 +479,7 @@ F test/e_update.test 312cb8f5ccfe41515a6bb092f8ea562a9bd54d52 F test/e_uri.test 5ae33760fb2039c61aa2d90886f1664664173585 F test/e_vacuum.test 5bfbdc21b65c0abf24398d0ba31dc88d93ca77a9 F test/e_wal.test 0967f0b8f1dfda871dc7b9b5574198f1f4f7d69a -F test/e_walauto.test d2dfc6681aade1f1306a8a336f5a258d8b62becd +F test/e_walauto.test ca70cf75c07a6cb1874ced101dd426da76625649 F test/e_walckpt.test 65e29b6631e51f210f83e4ff11571e647ba93608 F test/e_walhook.test da3ea8b3483d1af72190337bda50155a91a4b664 F test/enc.test e54531cd6bf941ee6760be041dff19a104c7acea @@ -1236,7 +1236,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 11e81ac2a7c917f7c9afc218d104d9870daf9668 bdbeed01ddc60a4ab322621fc118cc4767660fd3 -R 79278f99b3f4d9aaeb5b2b5be8f618ce -U mistachkin -Z 24816da0c39ded9b418b6d7a785804dc +P e693e11d1b9265974c32bddba873ea30a4d0b708 +R 5f43a97405384c08e7d2695a40688554 +U drh +Z 3c1c71c98fb9cbeb713c59bb71069029 diff --git a/manifest.uuid b/manifest.uuid index a243cd4a65..c534efe236 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e693e11d1b9265974c32bddba873ea30a4d0b708 \ No newline at end of file +5682db7b871689b9ee764afe070736f378e8ae1b \ No newline at end of file diff --git a/test/e_walauto.test b/test/e_walauto.test index 239adc3b95..b624b2469c 100644 --- a/test/e_walauto.test +++ b/test/e_walauto.test @@ -18,12 +18,12 @@ set testprefix e_walauto proc read_nbackfill {} { seek $::shmfd 96 - binary scan [read $::shmfd 4] i nBackfill + binary scan [read $::shmfd 4] n nBackfill set nBackfill } proc read_mxframe {} { seek $::shmfd 16 - binary scan [read $::shmfd 4] i mxFrame + binary scan [read $::shmfd 4] n mxFrame set mxFrame } From 068a251d9982d7f57694d5b901078b94dc5b0ad0 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 13 Jan 2015 21:26:17 +0000 Subject: [PATCH 31/34] Simplify some code in rtree, to avoid confusing the optimizer in GCC on some macs: gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00). Prior to these changes, compiling with -O3 would cause incorrect code to be generated. The change to the nodeGetCell() routine is key. The other changes are merely cosmetic details discovered while bug hunting. FossilOrigin-Name: 882181ff9dd75f32db266db6e476671021fc567b --- ext/rtree/rtree.c | 12 +++++------- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/ext/rtree/rtree.c b/ext/rtree/rtree.c index 058dc96a4c..201d3cfff2 100644 --- a/ext/rtree/rtree.c +++ b/ext/rtree/rtree.c @@ -369,13 +369,12 @@ static int readInt16(u8 *p){ return (p[0]<<8) + p[1]; } static void readCoord(u8 *p, RtreeCoord *pCoord){ - u32 i = ( + pCoord->u = ( (((u32)p[0]) << 24) + (((u32)p[1]) << 16) + (((u32)p[2]) << 8) + (((u32)p[3]) << 0) ); - *(u32 *)pCoord = i; } static i64 readInt64(u8 *p){ return ( @@ -404,7 +403,7 @@ static int writeCoord(u8 *p, RtreeCoord *pCoord){ u32 i; assert( sizeof(RtreeCoord)==4 ); assert( sizeof(u32)==4 ); - i = *(u32 *)pCoord; + i = pCoord->u; p[0] = (i>>24)&0xFF; p[1] = (i>>16)&0xFF; p[2] = (i>> 8)&0xFF; @@ -735,14 +734,13 @@ static void nodeGetCell( RtreeCell *pCell /* OUT: Write the cell contents here */ ){ u8 *pData; - u8 *pEnd; RtreeCoord *pCoord; + int ii; pCell->iRowid = nodeGetRowid(pRtree, pNode, iCell); pData = pNode->zData + (12 + pRtree->nBytesPerCell*iCell); - pEnd = pData + pRtree->nDim*8; pCoord = pCell->aCoord; - for(; pDatanDim*2; ii++){ + readCoord(&pData[ii*4], &pCoord[ii]); } } diff --git a/manifest b/manifest index 0ced843c65..d2eb0110ac 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\se_walauto.test\stest\smodule\sso\sthat\sit\sworks\son\sboth\slittle-endian\sand\nbig-ending\smachines. -D 2015-01-13T01:12:43.817 +C Simplify\ssome\scode\sin\srtree,\sto\savoid\sconfusing\sthe\soptimizer\sin\sGCC\son\nsome\smacs:\ngcc\sversion\s4.2.1\s(Based\son\sApple\sInc.\sbuild\s5658)\s(LLVM\sbuild\s2335.15.00).\nPrior\sto\sthese\schanges,\scompiling\swith\s-O3\swould\scause\sincorrect\scode\sto\nbe\sgenerated.\s\sThe\schange\sto\sthe\snodeGetCell()\sroutine\sis\skey.\s\sThe\sother\nchanges\sare\smerely\scosmetic\sdetails\sdiscovered\swhile\sbug\shunting. +D 2015-01-13T21:26:17.584 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 9efcdb5c6025caea362cdfc38817451170fc6344 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -124,7 +124,7 @@ F ext/misc/vfslog.c fe40fab5c077a40477f7e5eba994309ecac6cc95 F ext/misc/vtshim.c babb0dc2bf116029e3e7c9a618b8a1377045303e F ext/misc/wholenumber.c 784b12543d60702ebdd47da936e278aa03076212 F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761 -F ext/rtree/rtree.c b61e9eab7229a443d0d2029da7624299e19301a2 +F ext/rtree/rtree.c 14e6239434d4e3f65d3e90320713f26aa24e167f F ext/rtree/rtree.h 834dbcb82dc85b2481cde6a07cdadfddc99e9b9e F ext/rtree/rtree1.test 541bbcab74613907fea08b2ecdcdd5b7aa724cc9 F ext/rtree/rtree2.test acbb3a4ce0f4fbc2c304d2b4b784cfa161856bba @@ -1236,7 +1236,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 e693e11d1b9265974c32bddba873ea30a4d0b708 -R 5f43a97405384c08e7d2695a40688554 +P 5682db7b871689b9ee764afe070736f378e8ae1b +R dfd426dd4e5c9bb35969866ff363968f U drh -Z 3c1c71c98fb9cbeb713c59bb71069029 +Z bd5f3f08ebc84ee22d9c4c92ffb9e94c diff --git a/manifest.uuid b/manifest.uuid index c534efe236..4e9c91e56e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -5682db7b871689b9ee764afe070736f378e8ae1b \ No newline at end of file +882181ff9dd75f32db266db6e476671021fc567b \ No newline at end of file From b43be55e530fbe283b092e40df43f87dbf3926d2 Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 15 Jan 2015 15:47:06 +0000 Subject: [PATCH 32/34] Makefile enhancements: (1) Rename autoconf/tea/configure.in to autoconf/tea/configure.ac so that it works with the latest versions of autoconf. (2) Add the "amalgamation-tarball" targets to Makefile.in and main.mk (renamed from "dist" in the latter case). (3) Update the README.first file in autoconf/ (4) The TOP macro in Makefile.in is now an absolute rather than a relative path. FossilOrigin-Name: 3bafeec934e56f633d0de6890e84fca990e54435 --- Makefile.in | 7 ++- autoconf/README.first | 62 +++------------------ autoconf/tea/{configure.in => configure.ac} | 0 main.mk | 2 +- manifest | 20 +++---- manifest.uuid | 2 +- tool/mkautoconfamal.sh | 5 +- 7 files changed, 28 insertions(+), 70 deletions(-) rename autoconf/tea/{configure.in => configure.ac} (100%) diff --git a/Makefile.in b/Makefile.in index 2d781fc542..3d6e0f250d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -15,7 +15,7 @@ # The toplevel directory of the source tree. This is the directory # that contains this "Makefile.in" and the "configure.in" script. # -TOP = @srcdir@ +TOP = @abs_srcdir@ # C Compiler and options for use in building executables that # will run on the platform that is doing the build. @@ -1006,6 +1006,11 @@ checksymbols: sqlite3.lo nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0 echo '0 errors out of 1 tests' +# Build the amalgamation-autoconf package. +# +amalgamation-tarball: sqlite3.c + TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh + # The next two rules are used to support the "threadtest" target. Building # threadtest runs a few thread-safety tests that are implemented in C. This # target is invoked by the releasetest.tcl script. diff --git a/autoconf/README.first b/autoconf/README.first index 6676228ad6..5c2ea0a70f 100644 --- a/autoconf/README.first +++ b/autoconf/README.first @@ -1,57 +1,11 @@ +This directory contains components use to build an autoconf-ready package +of the SQLite amalgamation: sqlite-autoconf-30XXXXXX.tar.gz -This file describes how to use the files in this directory to create a new -version of the "autoconf-amalgamation" package. - -1. The following files should have executable permission: - - chmod 755 install-sh - chmod 755 missing - chmod 755 depcomp - chmod 755 config.sub - chmod 755 config.guess - -2. Copy new versions of the following SQLite files into this directory: - - sqlite3.c - sqlite3.h - sqlite3ext.h - sqlite3.1 - sqlite3.pc.in - shell.c - -3. Update the SQLite version number in the AC_INIT macro in file - configure.ac: - - AC_INIT(sqlite, 3.6.3, http://www.sqlite.org) - -4. Run the following commands to push the version number change through - to the generated files. - - aclocal - autoconf - automake - -5. Create the tclsqlite3.c file in the tea/generic directory. As follows: - - mkdir -p tea/generic - echo "#ifdef USE_SYSTEM_SQLITE" > tea/generic/tclsqlite3.c - echo "# include " >> tea/generic/tclsqlite3.c - echo "#else" >> tea/generic/tclsqlite3.c - echo "#include \"../../sqlite3.c\"" >> tea/generic/tclsqlite3.c - echo "#endif" >> tea/generic/tclsqlite3.c - cat ../src/tclsqlite.c >> tea/generic/tclsqlite3.c - -6. Update the SQLite version in the AC_INIT macro in file tea/configure.in: - - AC_INIT([sqlite], [3.6.3]) - -7. From the 'tea' directory, run the following commands: - - autoconf - rm -rf autom4te.cache - -8. Run "./configure && make dist". This builds a distribution package - named something like "sqlite-3.6.3.tar.gz". Rename to - "sqlite-amalgamation-3.6.3.tar.gz" and use. +To build the autoconf amalgamation, run from the top-level: + ./configure + make amalgamation-tarball +The amalgamation-tarball target (also available in "main.mk") runs the +script tool/mkautoconfamal.sh which does the work. Refer to that script +for details. diff --git a/autoconf/tea/configure.in b/autoconf/tea/configure.ac similarity index 100% rename from autoconf/tea/configure.in rename to autoconf/tea/configure.ac diff --git a/main.mk b/main.mk index 61ab533ae2..429945b099 100644 --- a/main.mk +++ b/main.mk @@ -690,7 +690,7 @@ checksymbols: sqlite3.o # Build the amalgamation-autoconf package. # -dist: sqlite3.c +amalgamation-tarball: sqlite3.c TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh diff --git a/manifest b/manifest index d2eb0110ac..211a81f047 100644 --- a/manifest +++ b/manifest @@ -1,7 +1,7 @@ -C Simplify\ssome\scode\sin\srtree,\sto\savoid\sconfusing\sthe\soptimizer\sin\sGCC\son\nsome\smacs:\ngcc\sversion\s4.2.1\s(Based\son\sApple\sInc.\sbuild\s5658)\s(LLVM\sbuild\s2335.15.00).\nPrior\sto\sthese\schanges,\scompiling\swith\s-O3\swould\scause\sincorrect\scode\sto\nbe\sgenerated.\s\sThe\schange\sto\sthe\snodeGetCell()\sroutine\sis\skey.\s\sThe\sother\nchanges\sare\smerely\scosmetic\sdetails\sdiscovered\swhile\sbug\shunting. -D 2015-01-13T21:26:17.584 +C Makefile\senhancements:\s\s(1)\sRename\sautoconf/tea/configure.in\sto\nautoconf/tea/configure.ac\sso\sthat\sit\sworks\swith\sthe\slatest\sversions\sof\nautoconf.\s\s(2)\sAdd\sthe\s"amalgamation-tarball"\stargets\sto\sMakefile.in\sand\nmain.mk\s(renamed\sfrom\s"dist"\sin\sthe\slatter\scase).\s\s(3)\sUpdate\sthe\nREADME.first\sfile\sin\sautoconf/\s\s(4)\sThe\sTOP\smacro\nin\sMakefile.in\sis\snow\san\sabsolute\srather\sthan\sa\srelative\spath. +D 2015-01-15T15:47:06.739 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in 9efcdb5c6025caea362cdfc38817451170fc6344 +F Makefile.in 5407a688f4d77a05c18a8142be8ae5a2829dd610 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc 4c057774e6138b9023fc16ec05639ddd3329b152 F Makefile.vxworks e1b65dea203f054e71653415bd8f96dcaed47858 @@ -15,7 +15,7 @@ F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903 F autoconf/Makefile.am 8fc2972d92769cf20ab8e4a73ea901b84d69bf44 F autoconf/README 14458f1046c118efa721aadec5f227e876d3cd38 -F autoconf/README.first 47dd53221023b18c836ab00dba6e00bd86132453 +F autoconf/README.first 6c4f34fe115ff55d4e8dbfa3cecf04a0188292f7 F autoconf/config.guess 94cc57e2a3fdb9c235b362ace86d77e89d188cad x F autoconf/config.sub 1efb390a8fb4bfafd74783a15a8fb5311c84300e x F autoconf/configure.ac ba3e99ba1a8171d0682b68443517088fc5d6f13a @@ -26,7 +26,7 @@ F autoconf/missing d7c9981a81af13370d4ed152b24c0a82b7028585 x F autoconf/tea/Makefile.in d55bcc63832caf0309c2ff80358756116618cfca F autoconf/tea/README 3e9a3c060f29a44344ab50aec506f4db903fb873 F autoconf/tea/aclocal.m4 52c47aac44ce0ddb1f918b6993e8beb8eee88f43 -F autoconf/tea/configure.in 93d43c79e936fb16556e22498177d7e8571efa04 +F autoconf/tea/configure.ac 93d43c79e936fb16556e22498177d7e8571efa04 w autoconf/tea/configure.in F autoconf/tea/doc/sqlite3.n e1fe45d4f5286ee3d0ccc877aca2a0def488e9bb F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523 F autoconf/tea/pkgIndex.tcl.in 3ef61715cf1c7bdcff56947ffadb26bc991ca39d @@ -152,7 +152,7 @@ F ext/userauth/userauth.c 5fa3bdb492f481bbc1709fc83c91ebd13460c69e F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8 F magic.txt 8273bf49ba3b0c8559cb2774495390c31fd61c60 -F main.mk 1d0cf88b6e89249608677215ad36e4f8a231accc +F main.mk e392561ffe17fc4dad945eef852400d5bf2911a0 F mkopcodec.awk c2ff431854d702cdd2d779c9c0d1f58fa16fa4ea F mkopcodeh.awk c6b3fa301db6ef7ac916b14c60868aeaec1337b5 F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83 @@ -1197,7 +1197,7 @@ F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce F tool/lemon.c 1864c4fe4a72b1bb28f1792b60504804fe82c5d2 F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc F tool/logest.c eef612f8adf4d0993dafed0416064cf50d5d33c6 -F tool/mkautoconfamal.sh 5dc5010e2e748a9e1bba67baca5956a2c2deda7b +F tool/mkautoconfamal.sh d1a2da0e15b2ed33d60af35c7e9d483f13a8eb9f F tool/mkkeywordhash.c dfff09dbbfaf950e89af294f48f902181b144670 F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e F tool/mkpragmatab.tcl 07a5124cf2dbafa1b375eefcf8ac4227028b0f8b @@ -1236,7 +1236,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 5682db7b871689b9ee764afe070736f378e8ae1b -R dfd426dd4e5c9bb35969866ff363968f +P 882181ff9dd75f32db266db6e476671021fc567b +R 338e02c689a6b5ce1e561c2a708ea7aa U drh -Z bd5f3f08ebc84ee22d9c4c92ffb9e94c +Z 729b1ea048cd675b3de67a43437130ca diff --git a/manifest.uuid b/manifest.uuid index 4e9c91e56e..4abac69508 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -882181ff9dd75f32db266db6e476671021fc567b \ No newline at end of file +3bafeec934e56f633d0de6890e84fca990e54435 \ No newline at end of file diff --git a/tool/mkautoconfamal.sh b/tool/mkautoconfamal.sh index 4829277234..0c2668c8b7 100644 --- a/tool/mkautoconfamal.sh +++ b/tool/mkautoconfamal.sh @@ -66,9 +66,9 @@ echo "#include \"sqlite3.c\"" >> tea/generic/tclsqlite3.c echo "#endif" >> tea/generic/tclsqlite3.c cat $TOP/src/tclsqlite.c >> tea/generic/tclsqlite3.c -cat tea/configure.in | +cat tea/configure.ac | sed "s/AC_INIT(\[sqlite\], .*)/AC_INIT([sqlite], [$VERSION])/" > tmp -mv tmp tea/configure.in +mv tmp tea/configure.ac cd tea autoconf @@ -80,4 +80,3 @@ tar -xzf sqlite-$VERSION.tar.gz mv sqlite-$VERSION sqlite-autoconf-$ARTIFACT tar -czf sqlite-autoconf-$ARTIFACT.tar.gz sqlite-autoconf-$ARTIFACT mv sqlite-autoconf-$ARTIFACT.tar.gz .. - From 3931112eab2f92eafcd578a39e08c1010d2d4bb1 Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 15 Jan 2015 17:38:35 +0000 Subject: [PATCH 33/34] Fix the spelling of "malloc_usable_size" in configure and configure.ac. FossilOrigin-Name: 8f45217cbafef2297cdcec3fd69f4371dfb83922 --- configure | 2 +- configure.ac | 2 +- manifest | 16 ++++++++-------- manifest.uuid | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/configure b/configure index 4ad61ad8f4..9e639e7f75 100755 --- a/configure +++ b/configure @@ -12140,7 +12140,7 @@ done -for ac_func in fdatasync gmtime_r isnan localtime_r localtime_s malloc_usabel_size strchrnul usleep utime +for ac_func in fdatasync gmtime_r isnan localtime_r localtime_s malloc_usable_size strchrnul usleep utime do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 diff --git a/configure.ac b/configure.ac index 6a35aa3441..00ecf453af 100644 --- a/configure.ac +++ b/configure.ac @@ -109,7 +109,7 @@ AC_CHECK_HEADERS([sys/types.h stdlib.h stdint.h inttypes.h malloc.h]) ######### # Figure out whether or not we have these functions # -AC_CHECK_FUNCS([fdatasync gmtime_r isnan localtime_r localtime_s malloc_usabel_size strchrnul usleep utime]) +AC_CHECK_FUNCS([fdatasync gmtime_r isnan localtime_r localtime_s malloc_usable_size strchrnul usleep utime]) ######### # By default, we use the amalgamation (this may be changed below...) diff --git a/manifest b/manifest index 211a81f047..82c7ce5e99 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Makefile\senhancements:\s\s(1)\sRename\sautoconf/tea/configure.in\sto\nautoconf/tea/configure.ac\sso\sthat\sit\sworks\swith\sthe\slatest\sversions\sof\nautoconf.\s\s(2)\sAdd\sthe\s"amalgamation-tarball"\stargets\sto\sMakefile.in\sand\nmain.mk\s(renamed\sfrom\s"dist"\sin\sthe\slatter\scase).\s\s(3)\sUpdate\sthe\nREADME.first\sfile\sin\sautoconf/\s\s(4)\sThe\sTOP\smacro\nin\sMakefile.in\sis\snow\san\sabsolute\srather\sthan\sa\srelative\spath. -D 2015-01-15T15:47:06.739 +C Fix\sthe\sspelling\sof\s"malloc_usable_size"\sin\sconfigure\sand\sconfigure.ac. +D 2015-01-15T17:38:35.777 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5407a688f4d77a05c18a8142be8ae5a2829dd610 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -26,7 +26,7 @@ F autoconf/missing d7c9981a81af13370d4ed152b24c0a82b7028585 x F autoconf/tea/Makefile.in d55bcc63832caf0309c2ff80358756116618cfca F autoconf/tea/README 3e9a3c060f29a44344ab50aec506f4db903fb873 F autoconf/tea/aclocal.m4 52c47aac44ce0ddb1f918b6993e8beb8eee88f43 -F autoconf/tea/configure.ac 93d43c79e936fb16556e22498177d7e8571efa04 w autoconf/tea/configure.in +F autoconf/tea/configure.ac 93d43c79e936fb16556e22498177d7e8571efa04 F autoconf/tea/doc/sqlite3.n e1fe45d4f5286ee3d0ccc877aca2a0def488e9bb F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523 F autoconf/tea/pkgIndex.tcl.in 3ef61715cf1c7bdcff56947ffadb26bc991ca39d @@ -38,8 +38,8 @@ F autoconf/tea/win/rules.vc c511f222b80064096b705dbeb97060ee1d6b6d63 F config.guess 226d9a188c6196f3033ffc651cbc9dcee1a42977 F config.h.in 42b71ad3fe21c9e88fa59e8458ca1a6bc72eb0c0 F config.sub 9ebe4c3b3dab6431ece34f16828b594fb420da55 -F configure f0438487966ab02dd0357c4ad27f1082e70a4b34 x -F configure.ac 0c94d28b0a839fd0f35ccebded2ea4aed4424d65 +F configure b2882796ddebd33ac4e9d4ccf5c5ca11888fc30e x +F configure.ac 6a8d145aea6d81f0b90013340780e43ed74fd5f4 F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad F doc/lemon.html 334dbf6621b8fb8790297ec1abf3cfa4621709d1 F doc/pager-invariants.txt 27fed9a70ddad2088750c4a2b493b63853da2710 @@ -1236,7 +1236,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 882181ff9dd75f32db266db6e476671021fc567b -R 338e02c689a6b5ce1e561c2a708ea7aa +P 3bafeec934e56f633d0de6890e84fca990e54435 +R 933466cd8ec4e35d692da3aefe1a6703 U drh -Z 729b1ea048cd675b3de67a43437130ca +Z 7b2dc8d2e874235217a285761db4e4a3 diff --git a/manifest.uuid b/manifest.uuid index 4abac69508..06ee62f68b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3bafeec934e56f633d0de6890e84fca990e54435 \ No newline at end of file +8f45217cbafef2297cdcec3fd69f4371dfb83922 \ No newline at end of file From 24bb5de5b002d78c2452533bfdaa9904d3a627ff Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 16 Jan 2015 12:08:06 +0000 Subject: [PATCH 34/34] Version 3.8.8 FossilOrigin-Name: 7d68a42face3ab14ed88407d4331872f5b243fdf --- manifest | 11 +++++++---- manifest.uuid | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/manifest b/manifest index 82c7ce5e99..2d35ff8ff1 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\sspelling\sof\s"malloc_usable_size"\sin\sconfigure\sand\sconfigure.ac. -D 2015-01-15T17:38:35.777 +C Version\s3.8.8 +D 2015-01-16T12:08:06.393 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5407a688f4d77a05c18a8142be8ae5a2829dd610 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -1236,7 +1236,10 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 3bafeec934e56f633d0de6890e84fca990e54435 +P 8f45217cbafef2297cdcec3fd69f4371dfb83922 R 933466cd8ec4e35d692da3aefe1a6703 +T +bgcolor * #d0c0ff +T +sym-release * +T +sym-version-3.8.8 * U drh -Z 7b2dc8d2e874235217a285761db4e4a3 +Z bb546801ed90d1803572e32e58b772a4 diff --git a/manifest.uuid b/manifest.uuid index 06ee62f68b..b043ddc196 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -8f45217cbafef2297cdcec3fd69f4371dfb83922 \ No newline at end of file +7d68a42face3ab14ed88407d4331872f5b243fdf \ No newline at end of file
"); - output_html_string(p->out, azArg[i] ? azArg[i] : p->nullvalue); + output_html_string(p->out, azArg[i] ? azArg[i] : p->nullValue); fprintf(p->out,"