From 636bf9f768347efec1342d45244719981df03fcf Mon Sep 17 00:00:00 2001 From: mistachkin Date: Sat, 19 Jul 2014 20:15:16 +0000 Subject: [PATCH 01/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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 f0a88279bdd40a54003d527e3d42f986ecbd0a69 Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 1 Jan 2015 16:47:43 +0000 Subject: [PATCH 10/69] Fix a harmless compiler warning in rtree. FossilOrigin-Name: 30891c6b8ebe9dfc939f9695bb45a159fbaaf262 --- ext/rtree/rtree.c | 2 +- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ext/rtree/rtree.c b/ext/rtree/rtree.c index 8150538d45..57b38de03d 100644 --- a/ext/rtree/rtree.c +++ b/ext/rtree/rtree.c @@ -1182,7 +1182,7 @@ static RtreeSearchPoint *rtreeEnqueue( pNew = pCur->aPoint + i; pNew->rScore = rScore; pNew->iLevel = iLevel; - assert( iLevel>=0 && iLevel<=RTREE_MAX_DEPTH ); + assert( iLevel<=RTREE_MAX_DEPTH ); while( i>0 ){ RtreeSearchPoint *pParent; j = (i-1)/2; diff --git a/manifest b/manifest index 4094f7cc8a..b7c0812559 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\stwo\stest\scases\sin\smemsubsys1\sso\sthat\sthey\swork\swith\sthe\smmap\spermutation. -D 2015-01-01T14:13:45.725 +C Fix\sa\sharmless\scompiler\swarning\sin\srtree. +D 2015-01-01T16:47:43.069 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 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 57bec53e1a677ab74217fe1f20a58c3a47261d6b +F ext/rtree/rtree.c a03ebd2480a1a4969cb363bb696d9d911e5a6ecd F ext/rtree/rtree.h 834dbcb82dc85b2481cde6a07cdadfddc99e9b9e F ext/rtree/rtree1.test 541bbcab74613907fea08b2ecdcdd5b7aa724cc9 F ext/rtree/rtree2.test acbb3a4ce0f4fbc2c304d2b4b784cfa161856bba @@ -1234,7 +1234,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 5830c557f7ed048056e2faeb82a8705ee7ecfdd7 -R 9ee216f4d87447d224436bd4fa1652bd +P 66269d0d8e49eb3dc7f508714753584f648bb022 +R e5d27e633a5b491c2ea88ea18c8cfd90 U drh -Z f94d536f9021f3614a2a0370bbcf66ff +Z a7e9ba08973a7605802bac8950dbf017 diff --git a/manifest.uuid b/manifest.uuid index 6e46921ab5..c0a63b890d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -66269d0d8e49eb3dc7f508714753584f648bb022 \ No newline at end of file +30891c6b8ebe9dfc939f9695bb45a159fbaaf262 \ No newline at end of file From 7203aed919d3b5118a8aaacbaab9c3d1b8120d36 Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 1 Jan 2015 18:54:23 +0000 Subject: [PATCH 11/69] Fix an error in the computation of the number of hours of runtime for individual test runs in the releasetest.tcl script. FossilOrigin-Name: e2b0ebe21cd8a63927decb645efd2db80bf88379 --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/releasetest.tcl | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index b7c0812559..cba0e35cee 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sharmless\scompiler\swarning\sin\srtree. -D 2015-01-01T16:47:43.069 +C Fix\san\serror\sin\sthe\scomputation\sof\sthe\snumber\sof\shours\sof\sruntime\sfor\nindividual\stest\sruns\sin\sthe\sreleasetest.tcl\sscript. +D 2015-01-01T18:54:23.534 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 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 9440b21870bc25c9303e7a2adc0708257249295a +F test/releasetest.tcl 183f35a18840152f24bfe0a24d9346f815ccd218 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1234,7 +1234,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 66269d0d8e49eb3dc7f508714753584f648bb022 -R e5d27e633a5b491c2ea88ea18c8cfd90 +P 30891c6b8ebe9dfc939f9695bb45a159fbaaf262 +R ff7c096e1b65892104ff528c7034919c U drh -Z a7e9ba08973a7605802bac8950dbf017 +Z 2f878e885c01058106b8fb811cc67e19 diff --git a/manifest.uuid b/manifest.uuid index c0a63b890d..dcdae3e8de 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -30891c6b8ebe9dfc939f9695bb45a159fbaaf262 \ No newline at end of file +e2b0ebe21cd8a63927decb645efd2db80bf88379 \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 96e7ffb4b2..3a9ee3311a 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -287,7 +287,7 @@ proc run_test_suite {name testtarget config} { dryrun cd $origdir if {!$::DRYRUN} { - set hours [expr {($tm2-$tm2)/3600}] + set hours [expr {($tm2-$tm1)/3600}] set minutes [expr {(($tm2-$tm1)/60)%60}] set seconds [expr {($tm2-$tm1)%60}] set tm [format (%02d:%02d:%02d) $hours $minutes $seconds] From 0325d3962ad0cff8513cde30223f9ed930bf17be Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 1 Jan 2015 19:11:22 +0000 Subject: [PATCH 12/69] Enhance the "lemon" executable so that it ignores -f, -W, -O, and -I command-line options. This permits most of the same options that are passed to the compiler to also be harmlessly passed to lemon, and thus simplifies makefiles. FossilOrigin-Name: da408d128b4301d9fc7a3a00f219dce7ed48bc60 --- manifest | 12 ++++++------ manifest.uuid | 2 +- tool/lemon.c | 14 ++++++++++---- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index cba0e35cee..aac11a7aa5 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\san\serror\sin\sthe\scomputation\sof\sthe\snumber\sof\shours\sof\sruntime\sfor\nindividual\stest\sruns\sin\sthe\sreleasetest.tcl\sscript. -D 2015-01-01T18:54:23.534 +C Enhance\sthe\s"lemon"\sexecutable\sso\sthat\sit\signores\s-f,\s-W,\s-O,\sand\s-I\ncommand-line\soptions.\s\sThis\spermits\smost\sof\sthe\ssame\soptions\sthat\sare\spassed\nto\sthe\scompiler\sto\salso\sbe\sharmlessly\spassed\sto\slemon,\sand\sthus\nsimplifies\smakefiles. +D 2015-01-01T19:11:22.522 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -1192,7 +1192,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 3ff0fec22f92dfb54e62eeb48772eddffdbeb0d6 +F tool/lemon.c 20f3132a1a150d50b022aa0b1fa26bd46aebf7b5 F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc F tool/logest.c eef612f8adf4d0993dafed0416064cf50d5d33c6 F tool/mkautoconfamal.sh 5dc5010e2e748a9e1bba67baca5956a2c2deda7b @@ -1234,7 +1234,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 30891c6b8ebe9dfc939f9695bb45a159fbaaf262 -R ff7c096e1b65892104ff528c7034919c +P e2b0ebe21cd8a63927decb645efd2db80bf88379 +R 5d6dc81c5e6fc0ccf7a552bd6bb1dd01 U drh -Z 2f878e885c01058106b8fb811cc67e19 +Z c56b05defbbdeecd31b9d2ca5ed09dfe diff --git a/manifest.uuid b/manifest.uuid index dcdae3e8de..7f420ec644 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e2b0ebe21cd8a63927decb645efd2db80bf88379 \ No newline at end of file +da408d128b4301d9fc7a3a00f219dce7ed48bc60 \ No newline at end of file diff --git a/tool/lemon.c b/tool/lemon.c index 85e94f7007..54c155204a 100644 --- a/tool/lemon.c +++ b/tool/lemon.c @@ -1497,10 +1497,12 @@ int main(int argc, char **argv) {OPT_FLAG, "b", (char*)&basisflag, "Print only the basis in report."}, {OPT_FLAG, "c", (char*)&compress, "Don't compress the action table."}, {OPT_FSTR, "D", (char*)handle_D_option, "Define an %ifdef macro."}, - {OPT_FSTR, "T", (char*)handle_T_option, "Specify a template file."}, + {OPT_FSTR, "f", 0, "Ignored. (Placeholder for -f compiler options.)"}, {OPT_FLAG, "g", (char*)&rpflag, "Print grammar without actions."}, + {OPT_FSTR, "I", 0, "Ignored. (Placeholder for '-I' compiler options.)"}, {OPT_FLAG, "m", (char*)&mhflag, "Output a makeheaders compatible file."}, {OPT_FLAG, "l", (char*)&nolinenosflag, "Do not print #line statements."}, + {OPT_FSTR, "O", 0, "Ignored. (Placeholder for '-O' compiler options.)"}, {OPT_FLAG, "p", (char*)&showPrecedenceConflict, "Show conflicts resolved by precedence rules"}, {OPT_FLAG, "q", (char*)&quiet, "(Quiet) Don't print the report file."}, @@ -1508,6 +1510,8 @@ int main(int argc, char **argv) {OPT_FLAG, "s", (char*)&statistics, "Print parser stats to standard output."}, {OPT_FLAG, "x", (char*)&version, "Print the version number."}, + {OPT_FSTR, "T", (char*)handle_T_option, "Specify a template file."}, + {OPT_FSTR, "W", 0, "Ignored. (Placeholder for '-W' compiler options.)"}, {OPT_FLAG,0,0,0} }; int i; @@ -1812,6 +1816,8 @@ static int handleflags(int i, FILE *err) errline(i,1,err); } errcnt++; + }else if( op[j].arg==0 ){ + /* Ignore this option */ }else if( op[j].type==OPT_FLAG ){ *((int*)op[j].arg) = v; }else if( op[j].type==OPT_FFLAG ){ @@ -2001,17 +2007,17 @@ void OptPrint(){ break; case OPT_INT: case OPT_FINT: - fprintf(errstream," %s=%*s %s\n",op[i].label, + fprintf(errstream," -%s%*s %s\n",op[i].label, (int)(max-lemonStrlen(op[i].label)-9),"",op[i].message); break; case OPT_DBL: case OPT_FDBL: - fprintf(errstream," %s=%*s %s\n",op[i].label, + fprintf(errstream," -%s%*s %s\n",op[i].label, (int)(max-lemonStrlen(op[i].label)-6),"",op[i].message); break; case OPT_STR: case OPT_FSTR: - fprintf(errstream," %s=%*s %s\n",op[i].label, + fprintf(errstream," -%s%*s %s\n",op[i].label, (int)(max-lemonStrlen(op[i].label)-8),"",op[i].message); break; } From 149735d9461c65553b1f49e128211066912fa2af Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 1 Jan 2015 19:53:10 +0000 Subject: [PATCH 13/69] Add the ability to specify an alternative compiler (clang instead of gcc) on the default Makefile. Use this in releasetest.tcl to implement an -fsanitize=undefined test. FossilOrigin-Name: c55c05fe22b9ddb61de55d473a411a11090d3d68 --- Makefile.in | 10 +++++++--- manifest | 14 +++++++------- manifest.uuid | 2 +- test/releasetest.tcl | 12 +++++++++++- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/Makefile.in b/Makefile.in index cd024e950a..f9974d609b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -22,11 +22,15 @@ TOP = @srcdir@ # BCC = @BUILD_CC@ @BUILD_CFLAGS@ -# C Compile and options for use in building executables that +# TCC is the C Compile and options for use in building executables that # will run on the target platform. (BCC and TCC are usually the -# same unless your are cross-compiling.) +# same unless your are cross-compiling.) Separate CC and CFLAGS macros +# are provide so that these aspects of the build process can be changed +# on the "make" command-line. Ex: "make CC=clang CFLAGS=-fsanitize=undefined" # -TCC = @CC@ @CPPFLAGS@ @CFLAGS@ -I. -I${TOP}/src -I${TOP}/ext/rtree +CC = @CC@ +CFLAGS = @CPPFLAGS@ @CFLAGS@ +TCC = $(CC) $(CFLAGS) -I. -I${TOP}/src -I${TOP}/ext/rtree # Define this for the autoconf-based build, so that the code knows it can # include the generated config.h diff --git a/manifest b/manifest index aac11a7aa5..13a4c6435b 100644 --- a/manifest +++ b/manifest @@ -1,7 +1,7 @@ -C Enhance\sthe\s"lemon"\sexecutable\sso\sthat\sit\signores\s-f,\s-W,\s-O,\sand\s-I\ncommand-line\soptions.\s\sThis\spermits\smost\sof\sthe\ssame\soptions\sthat\sare\spassed\nto\sthe\scompiler\sto\salso\sbe\sharmlessly\spassed\sto\slemon,\sand\sthus\nsimplifies\smakefiles. -D 2015-01-01T19:11:22.522 +C Add\sthe\sability\sto\sspecify\san\salternative\scompiler\s(clang\sinstead\sof\sgcc)\non\sthe\sdefault\sMakefile.\s\sUse\sthis\sin\sreleasetest.tcl\sto\simplement\san\n-fsanitize=undefined\stest. +D 2015-01-01T19:53:10.337 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 +F Makefile.in 335e2d3ff0f2455eacbfa3075fc37495e3321410 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 @@ -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 183f35a18840152f24bfe0a24d9346f815ccd218 +F test/releasetest.tcl dbb2dbbf82fbd05e30abac638c382a5b6f808407 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1234,7 +1234,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 e2b0ebe21cd8a63927decb645efd2db80bf88379 -R 5d6dc81c5e6fc0ccf7a552bd6bb1dd01 +P da408d128b4301d9fc7a3a00f219dce7ed48bc60 +R ca09f55008007dc6e5522170a985ac90 U drh -Z c56b05defbbdeecd31b9d2ca5ed09dfe +Z 2d169330368dfa1bfb6338447f689c29 diff --git a/manifest.uuid b/manifest.uuid index 7f420ec644..48bbba87a3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -da408d128b4301d9fc7a3a00f219dce7ed48bc60 \ No newline at end of file +c55c05fe22b9ddb61de55d473a411a11090d3d68 \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 3a9ee3311a..772e5e481a 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -34,7 +34,12 @@ array set ::Configs { } "Ftrapv" { -O2 -ftrapv - -DSQLITE_MAX_ATTACHED=55 + -DSQLITE_MAX_ATTACHED=125 + -DSQLITE_TCL_DEFAULT_FULLMUTEX=1 + } + "Clang-Sanitize" { + CC=clang -fsanitize=undefined + -DSQLITE_MAX_ATTACHED=125 -DSQLITE_TCL_DEFAULT_FULLMUTEX=1 } "Unlock-Notify" { @@ -119,6 +124,7 @@ array set ::Configs { -DSQLITE_ENABLE_LOCKING_STYLE=1 } "OS-X" { + -O1 # Avoid a compiler bug in gcc 4.2.1 build 5658 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_THREADSAFE=2 @@ -166,6 +172,7 @@ array set ::Platforms { "Extra-Robustness" test "Device-Two" test "Ftrapv" test + "Clang-Sanitize" test "No-lookaside" test "Devkit" test "Default" "threadtest fulltest" @@ -244,9 +251,12 @@ proc run_test_suite {name testtarget config} { # set cflags "-g" set opts "" + regsub -all {#[^\n]*\n} $config \n config foreach arg $config { if {[string match -D* $arg]} { lappend opts $arg + } elseif {[string match CC=* $arg]} { + lappend testtarget $arg } else { lappend cflags $arg } From 4081d5da3bddb8b03e4d767df6011998cccbe858 Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 1 Jan 2015 23:02:01 +0000 Subject: [PATCH 14/69] Add logic to releasetest.tcl that detects -fsanitize=undefined errors. Fix a few false-positivies that come up when running the sanitize=undefined test. FossilOrigin-Name: 2835e79a0afec6e4d449ac9340afec068c2d4c11 --- ext/misc/fuzzer.c | 3 ++- manifest | 20 ++++++++++---------- manifest.uuid | 2 +- src/analyze.c | 2 +- src/test8.c | 4 ++-- test/permutations.test | 5 +++++ test/releasetest.tcl | 16 ++++++++++++---- 7 files changed, 33 insertions(+), 19 deletions(-) diff --git a/ext/misc/fuzzer.c b/ext/misc/fuzzer.c index fe41cda8c2..dc03161aaf 100644 --- a/ext/misc/fuzzer.c +++ b/ext/misc/fuzzer.c @@ -342,7 +342,8 @@ static int fuzzerLoadOneRule( rc = SQLITE_NOMEM; }else{ memset(pRule, 0, sizeof(*pRule)); - pRule->zFrom = &pRule->zTo[nTo+1]; + pRule->zFrom = pRule->zTo; + pRule->zFrom += nTo + 1; pRule->nFrom = nFrom; memcpy(pRule->zFrom, zFrom, nFrom+1); memcpy(pRule->zTo, zTo, nTo+1); diff --git a/manifest b/manifest index 13a4c6435b..be8e05d98a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\sability\sto\sspecify\san\salternative\scompiler\s(clang\sinstead\sof\sgcc)\non\sthe\sdefault\sMakefile.\s\sUse\sthis\sin\sreleasetest.tcl\sto\simplement\san\n-fsanitize=undefined\stest. -D 2015-01-01T19:53:10.337 +C Add\slogic\sto\sreleasetest.tcl\sthat\sdetects\s-fsanitize=undefined\serrors.\nFix\sa\sfew\sfalse-positivies\sthat\scome\sup\swhen\srunning\sthe\ssanitize=undefined\ntest. +D 2015-01-01T23:02:01.908 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 335e2d3ff0f2455eacbfa3075fc37495e3321410 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -111,7 +111,7 @@ F ext/misc/closure.c 636024302cde41b2bf0c542f81c40c624cfb7012 F ext/misc/compress.c 76e45655f4046e756064ab10c62e18f2eb846b9f F ext/misc/eval.c f971962e92ebb8b0a4e6b62949463ee454d88fa2 F ext/misc/fileio.c d4171c815d6543a9edef8308aab2951413cd8d0f -F ext/misc/fuzzer.c 136533c53cfce0957f0b48fa11dba27e21c5c01d +F ext/misc/fuzzer.c e3e18f47252c151b5553d7e806f38e757d37c4cc F ext/misc/ieee754.c b0362167289170627659e84173f5d2e8fee8566e F ext/misc/nextchar.c 35c8b8baacb96d92abbb34a83a997b797075b342 F ext/misc/percentile.c bcbee3c061b884eccb80e21651daaae8e1e43c63 @@ -167,7 +167,7 @@ F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b F sqlite3.1 fc7ad8990fc8409983309bb80de8c811a7506786 F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a F src/alter.c ba266a779bc7ce10e52e59e7d3dc79fa342e8fdb -F src/analyze.c 7a2986e6ea8247e5f21aca3d0b584598f58d84fe +F src/analyze.c 91540f835163d5369ccbae78e2e6c74d0dd53c1d F src/attach.c 7f6b3fafa2290b407e4a94dcf1afda7ec0fe394b F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240 F src/backup.c 7ddee9c7d505e07e959a575b18498f17c71e53ea @@ -245,7 +245,7 @@ F src/test4.c 9b32d22f5f150abe23c1830e2057c4037c45b3df F src/test5.c 5a34feec76d9b3a86aab30fd4f6cc9c48cbab4c1 F src/test6.c 41cacf3b0dd180823919bf9e1fbab287c9266723 F src/test7.c 72b732baa5642f795655ba1126ea032af46ecfd2 -F src/test8.c 54ccd7b1df5062f0ecbf50a8f7b618f8b1f13b20 +F src/test8.c bf3bad9a7df2e7c58d3371ea913abeaedb429a38 F src/test9.c bea1e8cf52aa93695487badedd6e1886c321ea60 F src/test_async.c 21e11293a2f72080eda70e1124e9102044531cd8 F src/test_autoext.c dea8a01a7153b9adc97bd26161e4226329546e12 @@ -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 59e2d8aba8c4f5842edba1a10a158b798690d3ba +F test/permutations.test 3a58611f8b703d385015bbe1710c722ff900f2ee F test/pragma.test aa16dedfe01c02c8895169012f7dfde9c163f0d5 F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13 F test/pragma3.test 6f849ccffeee7e496d2f2b5e74152306c0b8757c @@ -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 dbb2dbbf82fbd05e30abac638c382a5b6f808407 +F test/releasetest.tcl facd103f341b2ecb5b86569b7e657d59027bd9dd F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1234,7 +1234,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 da408d128b4301d9fc7a3a00f219dce7ed48bc60 -R ca09f55008007dc6e5522170a985ac90 +P c55c05fe22b9ddb61de55d473a411a11090d3d68 +R e6aaf3935879f250648e86cbf64d3bdf U drh -Z 2d169330368dfa1bfb6338447f689c29 +Z 20260de80f5f5cb2f8311d6a05cba05e diff --git a/manifest.uuid b/manifest.uuid index 48bbba87a3..b69d1dbdb9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c55c05fe22b9ddb61de55d473a411a11090d3d68 \ No newline at end of file +2835e79a0afec6e4d449ac9340afec068c2d4c11 \ No newline at end of file diff --git a/src/analyze.c b/src/analyze.c index e483807116..fec2bdb39d 100644 --- a/src/analyze.c +++ b/src/analyze.c @@ -448,7 +448,7 @@ static void statInit( p->mxSample = mxSample; p->nPSample = (tRowcnt)(sqlite3_value_int64(argv[2])/(mxSample/3+1) + 1); p->current.anLt = &p->current.anEq[nColUp]; - p->iPrn = nCol*0x689e962d ^ sqlite3_value_int(argv[2])*0xd0944565; + p->iPrn = 0x689e962d*(u32)nCol ^ 0xd0944565*(u32)sqlite3_value_int(argv[2]); /* Set up the Stat4Accum.a[] and aBest[] arrays */ p->a = (struct Stat4Sample*)&p->current.anLt[nColUp]; diff --git a/src/test8.c b/src/test8.c index 8bc835d638..407dd54c79 100644 --- a/src/test8.c +++ b/src/test8.c @@ -648,12 +648,12 @@ static int echoRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){ ** indeed the hash of the supplied idxStr. */ static int hashString(const char *zString){ - int val = 0; + u32 val = 0; int ii; for(ii=0; zString[ii]; ii++){ val = (val << 3) + (int)zString[ii]; } - return val; + return (int)(val&0x7fffffff); } /* diff --git a/test/permutations.test b/test/permutations.test index fea70a60e8..232e8f9704 100644 --- a/test/permutations.test +++ b/test/permutations.test @@ -118,6 +118,11 @@ set allquicktests [test_set $alltests -exclude { if {[info exists ::env(QUICKTEST_INCLUDE)]} { set allquicktests [concat $allquicktests $::env(QUICKTEST_INCLUDE)] } +if {[info exists ::env(QUICKTEST_OMIT)]} { + foreach x [split $::env(QUICKTEST_OMIT) ,] { + regsub -all \\y$x\\y $allquicktests {} allquicktests + } +} ############################################################################# # Start of tests diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 772e5e481a..342a4069b9 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -37,10 +37,9 @@ array set ::Configs { -DSQLITE_MAX_ATTACHED=125 -DSQLITE_TCL_DEFAULT_FULLMUTEX=1 } - "Clang-Sanitize" { + "Sanitize" { CC=clang -fsanitize=undefined - -DSQLITE_MAX_ATTACHED=125 - -DSQLITE_TCL_DEFAULT_FULLMUTEX=1 + -DSQLITE_ENABLE_STAT4 } "Unlock-Notify" { -O2 @@ -72,6 +71,7 @@ array set ::Configs { -DSQLITE_ENABLE_ATOMIC_WRITE=1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1 + -DSQLITE_ENABLE_STAT4 } "Debug-One" { -O2 @@ -84,6 +84,7 @@ array set ::Configs { -DSQLITE_ENABLE_MEMSYS5=1 -DSQLITE_ENABLE_MEMSYS3=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 + -DSQLITE_ENABLE_STAT4 } "Device-One" { -O2 @@ -172,7 +173,7 @@ array set ::Platforms { "Extra-Robustness" test "Device-Two" test "Ftrapv" test - "Clang-Sanitize" test + "Sanitize" {QUICKTEST_OMIT=func4.test,nan.test test} "No-lookaside" test "Devkit" test "Default" "threadtest fulltest" @@ -235,6 +236,13 @@ proc count_tests_and_errors {logfile rcVar errmsgVar} { set errmsg $line } } + if {[regexp {runtime error: +(.*)} $line all msg]} { + incr ::NERRCASE + if {$rc==0} { + set rc 1 + set errmsg $msg + } + } } close $fd if {!$seen} { From 3bd1791dfb535b7137070f81f470bc784eae1943 Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 2 Jan 2015 15:55:29 +0000 Subject: [PATCH 15/69] Add the SQLITE_CONFIG_PMASZ start-time option. FossilOrigin-Name: acb0d1e8324f19da3d4d577d58748848de1bcef7 --- manifest | 30 +++++++++++++++--------------- manifest.uuid | 2 +- src/global.c | 8 ++++++++ src/main.c | 5 +++++ src/sqlite.h.in | 12 ++++++++++++ src/sqliteInt.h | 1 + src/test_malloc.c | 29 +++++++++++++++++++++++++++++ src/vdbesort.c | 14 +++++--------- test/sort.test | 5 +++++ test/sort2.test | 5 +++++ test/sort4.test | 6 ++++++ test/sortfault.test | 6 ++++++ 12 files changed, 98 insertions(+), 25 deletions(-) diff --git a/manifest b/manifest index be8e05d98a..5142e98f04 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\slogic\sto\sreleasetest.tcl\sthat\sdetects\s-fsanitize=undefined\serrors.\nFix\sa\sfew\sfalse-positivies\sthat\scome\sup\swhen\srunning\sthe\ssanitize=undefined\ntest. -D 2015-01-01T23:02:01.908 +C Add\sthe\sSQLITE_CONFIG_PMASZ\sstart-time\soption. +D 2015-01-02T15:55:29.645 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 335e2d3ff0f2455eacbfa3075fc37495e3321410 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -186,7 +186,7 @@ F src/expr.c 00da3072f362b06f39ce4052baa1d4ce2bb36d1c F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb F src/fkey.c e0444b61bed271a76840cbe6182df93a9baa3f12 F src/func.c 6d3c4ebd72aa7923ce9b110a7dc15f9b8c548430 -F src/global.c 6ded36dda9466fc1c9a3c5492ded81d79bf3977d +F src/global.c 12561d70a1b25f67b21154622bb1723426724f75 F src/hash.c 4263fbc955f26c2e8cdc0cf214bc42435aa4e4f5 F src/hash.h c8f3c31722cf3277d03713909761e152a5b81094 F src/hwtime.h d32741c8f4df852c7d959236615444e2b1063b08 @@ -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 fa2128ef7d6a3dcd6770b2b1f3c284b696f11a2a +F src/main.c b0a7f3f9ff70106b7735f38c602d1b3ca56eb065 F src/malloc.c 740db54387204c9a2eb67c6d98e68b08e9ef4eab F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem1.c faf615aafd8be74a71494dfa027c113ea5c6615f @@ -230,10 +230,10 @@ F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/select.c f377fb8a5c73c10678ea74f3400f7913943e3d75 F src/shell.c 45d9c9bd7cde07845af957f2d849933b990773cf -F src/sqlite.h.in 47cb601ed2b2ea7f01119e2763185c809d8e82fa +F src/sqlite.h.in ed799ff5c814227c7957eb4f4a217f67fdc0da48 F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d -F src/sqliteInt.h d36da9a07130cae13cbfee0986bf20028cb01465 +F src/sqliteInt.h 3e0079855cb7b3c85dffac5bcbb1cd712ac62e65 F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c 81712116e826b0089bb221b018929536b2b5406f F src/table.c e7a09215315a978057fb42c640f890160dbcc45e @@ -263,7 +263,7 @@ F src/test_intarray.c 6c610a21ab8edde85a3a2c7f2b069244ecf4d834 F src/test_intarray.h 9dc57417fb65bc7835cc18548852cc08cc062202 F src/test_journal.c f5c0a05b7b3d5930db769b5ee6c3766dc2221a64 F src/test_loadext.c a5251f956ab6af21e138dc1f9c0399394a510cb4 -F src/test_malloc.c ba34143f941a9d74b30bbffc8818389bb73a1ca2 +F src/test_malloc.c fffc66b2e7743ce93f039187d3fd78664193c664 F src/test_multiplex.c caadb62cc777268b4f8fb94d5b27b80156c8f7c0 F src/test_multiplex.h c08e4e8f8651f0c5e0509b138ff4d5b43ed1f5d3 F src/test_mutex.c 293042d623ebba969160f471a82aa1551626454f @@ -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 80e40d889ebb536cb7a5ac4c12fa2a4662bc9181 +F src/vdbesort.c fc1aa0d1a8b539bf3a272945d02c9f9ede93039b F src/vdbetrace.c 7e4222955e07dd707a2f360c0eb73452be1cb010 F src/vtab.c c08ec66f45919eaa726bf88aa53eb08379d607f9 F src/wal.c 85353539f2d9d0c91ebd057c32525b1e1aa3335e @@ -869,12 +869,12 @@ F test/skipscan5.test 67817a4b6857c47e0e33ba3e506da6f23ef68de2 F test/skipscan6.test 5866039d03a56f5bd0b3d172a012074a1d90a15b F test/soak.test 0b5b6375c9f4110c828070b826b3b4b0bb65cd5f F test/softheap1.test 40562fe6cac6d9827b7b42b86d45aedf12c15e24 -F test/sort.test c4400e7533748f6bd7413851ff148645e82b9e2d -F test/sort2.test 84a92eebf697feee9c6697746918c7d67373eea1 +F test/sort.test 3f492e5b7be1d3f756728d2ff6edf4f6091e84cb +F test/sort2.test 37afbc03f5559f2eb0f18940b55d38dfbb5172ac F test/sort3.test 6178ade30810ac9166fcdf14b7065e49c0f534e2 -F test/sort4.test 6c37d85f7cd28d50cce222fcab84ccd771e105cb +F test/sort4.test d5e8903194ae551551349ce25dc8d0b40ca2b9c3 F test/sort5.test a448240a42b49239edc00f85d6d7ac7a1b261e1f -F test/sortfault.test b8e35177f97438b930ee87c9419ca2599e8073e1 +F test/sortfault.test d4ccf606a0c77498e2beb542764fd9394acb4d66 F test/speed1.test f2974a91d79f58507ada01864c0e323093065452 F test/speed1p.explain d841e650a04728b39e6740296b852dccdca9b2cb F test/speed1p.test b180e98609c7677382cf618c0ec9b69f789033a8 @@ -1234,7 +1234,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 c55c05fe22b9ddb61de55d473a411a11090d3d68 -R e6aaf3935879f250648e86cbf64d3bdf +P 2835e79a0afec6e4d449ac9340afec068c2d4c11 +R 382d23526375da181cc875b46066d9ad U drh -Z 20260de80f5f5cb2f8311d6a05cba05e +Z bc81c476960284f7c54d9feff6b6453a diff --git a/manifest.uuid b/manifest.uuid index b69d1dbdb9..4fa42f8241 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2835e79a0afec6e4d449ac9340afec068c2d4c11 \ No newline at end of file +acb0d1e8324f19da3d4d577d58748848de1bcef7 \ No newline at end of file diff --git a/src/global.c b/src/global.c index 4bc8edb3bc..c7043bba48 100644 --- a/src/global.c +++ b/src/global.c @@ -152,6 +152,13 @@ const unsigned char sqlite3CtypeMap[256] = { # define SQLITE_ALLOW_COVERING_INDEX_SCAN 1 #endif +/* The minimum PMA size is set to this value multiplied by the database +** page size in bytes. +*/ +#ifndef SQLITE_SORTER_PMASZ +# define SQLITE_SORTER_PMASZ 250 +#endif + /* ** The following singleton contains the global configuration for ** the SQLite library. @@ -182,6 +189,7 @@ SQLITE_WSD struct Sqlite3Config sqlite3Config = { 0, /* nPage */ 0, /* mxParserStack */ 0, /* sharedCacheEnabled */ + SQLITE_SORTER_PMASZ, /* szPma */ /* All the rest should always be initialized to zero */ 0, /* isInit */ 0, /* inProgress */ diff --git a/src/main.c b/src/main.c index 3220cfe8f6..8af34cc2f1 100644 --- a/src/main.c +++ b/src/main.c @@ -594,6 +594,11 @@ int sqlite3_config(int op, ...){ } #endif + case SQLITE_CONFIG_PMASZ: { + sqlite3GlobalConfig.szPma = va_arg(ap, unsigned int); + break; + } + default: { rc = SQLITE_ERROR; break; diff --git a/src/sqlite.h.in b/src/sqlite.h.in index b525b396f4..e13ee0acc9 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -1745,6 +1745,17 @@ struct sqlite3_mem_methods { ** bytes per page required for each page in [SQLITE_CONFIG_PAGECACHE]. ** The amount of extra space required can change depending on the compiler, ** target platform, and SQLite version. +** +** [[SQLITE_CONFIG_PMASZ]] +**
SQLITE_CONFIG_PMASZ +**
^The SQLITE_CONFIG_PMASZ option takes a single parameter which +** is an unsigned integer and sets the "Minimum PMA Size" for the multithreaded +** sorter to that integer. The default minimum PMA Size is set by the +** [SQLITE_SORTER_PMASZ] compile-time option. New threads are launched +** to help with sort operations when multithreaded sorting +** is enabled (using the [PRAGMA threads] command) and the amount of content +** to be sorted exceeds the page size times the minimum of the +** [PRAGMA cache_size] setting and this value. ** */ #define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */ @@ -1771,6 +1782,7 @@ struct sqlite3_mem_methods { #define SQLITE_CONFIG_MMAP_SIZE 22 /* sqlite3_int64, sqlite3_int64 */ #define SQLITE_CONFIG_WIN32_HEAPSIZE 23 /* int nByte */ #define SQLITE_CONFIG_PCACHE_HDRSZ 24 /* int *psz */ +#define SQLITE_CONFIG_PMASZ 25 /* unsigned int szPma */ /* ** CAPI3REF: Database Connection Configuration Options diff --git a/src/sqliteInt.h b/src/sqliteInt.h index d90089ba0e..4a4137f0f6 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -2839,6 +2839,7 @@ struct Sqlite3Config { int nPage; /* Number of pages in pPage[] */ int mxParserStack; /* maximum depth of the parser stack */ int sharedCacheEnabled; /* true if shared-cache mode enabled */ + u32 szPma; /* Maximum Sorter PMA size */ /* The above might be initialized to non-zero. The following need to always ** initially be zero, however. */ int isInit; /* True after initialization has finished */ diff --git a/src/test_malloc.c b/src/test_malloc.c index bd0a3d1ffd..54a89472d0 100644 --- a/src/test_malloc.c +++ b/src/test_malloc.c @@ -1260,6 +1260,34 @@ static int test_config_cis( return TCL_OK; } +/* +** Usage: sqlite3_config_pmasz INTEGER +** +** Set the minimum PMA size. +*/ +static int test_config_pmasz( + void * clientData, + Tcl_Interp *interp, + int objc, + Tcl_Obj *CONST objv[] +){ + int rc; + int iPmaSz; + + if( objc!=2 ){ + Tcl_WrongNumArgs(interp, 1, objv, "BOOL"); + return TCL_ERROR; + } + if( Tcl_GetIntFromObj(interp, objv[1], &iPmaSz) ){ + return TCL_ERROR; + } + + rc = sqlite3_config(SQLITE_CONFIG_PMASZ, iPmaSz); + Tcl_SetResult(interp, (char *)sqlite3ErrName(rc), TCL_VOLATILE); + + return TCL_OK; +} + /* ** Usage: sqlite3_dump_memsys3 FILENAME @@ -1514,6 +1542,7 @@ int Sqlitetest_malloc_Init(Tcl_Interp *interp){ { "sqlite3_config_error", test_config_error ,0 }, { "sqlite3_config_uri", test_config_uri ,0 }, { "sqlite3_config_cis", test_config_cis ,0 }, + { "sqlite3_config_pmasz", test_config_pmasz ,0 }, { "sqlite3_db_config_lookaside",test_db_config_lookaside ,0 }, { "sqlite3_dump_memsys3", test_dump_memsys3 ,3 }, { "sqlite3_dump_memsys5", test_dump_memsys3 ,5 }, diff --git a/src/vdbesort.c b/src/vdbesort.c index d022af9af6..0d16324e2a 100644 --- a/src/vdbesort.c +++ b/src/vdbesort.c @@ -152,7 +152,7 @@ ** to a level 0 PMA. The purpose of this limit is to prevent various integer ** overflows. 512MiB. */ -#define SQLITE_MAX_MXPMASIZE (1<<29) +#define SQLITE_MAX_PMASZ (1<<29) /* ** Private objects used by the sorter @@ -448,11 +448,6 @@ struct SorterRecord { */ #define SRVAL(p) ((void*)((SorterRecord*)(p) + 1)) -/* The minimum PMA size is set to this value multiplied by the database -** page size in bytes. */ -#ifndef SQLITE_SORTER_PMASZ -# define SQLITE_SORTER_PMASZ 10 -#endif /* Maximum number of PMAs that a single MergeEngine can merge */ #define SORTER_MAX_MERGE_COUNT 16 @@ -851,10 +846,11 @@ int sqlite3VdbeSorterInit( } if( !sqlite3TempInMemory(db) ){ - pSorter->mnPmaSize = SQLITE_SORTER_PMASZ * pgsz; + u32 szPma = sqlite3GlobalConfig.szPma; + pSorter->mnPmaSize = szPma * pgsz; mxCache = db->aDb[0].pSchema->cache_size; - if( mxCachemxPmaSize = MIN((i64)mxCache*pgsz, SQLITE_MAX_MXPMASIZE); + if( mxCachemxPmaSize = MIN((i64)mxCache*pgsz, SQLITE_MAX_PMASZ); /* EVIDENCE-OF: R-26747-61719 When the application provides any amount of ** scratch memory using SQLITE_CONFIG_SCRATCH, SQLite avoids unnecessary diff --git a/test/sort.test b/test/sort.test index be2a6f531c..21b11d6c88 100644 --- a/test/sort.test +++ b/test/sort.test @@ -16,6 +16,11 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix sort +db close +sqlite3_shutdown +sqlite3_config_pmasz 10 +sqlite3_initialize +sqlite3 db test.db # Create a bunch of data to sort against # diff --git a/test/sort2.test b/test/sort2.test index a4c55c9f24..890025a5d0 100644 --- a/test/sort2.test +++ b/test/sort2.test @@ -17,6 +17,11 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix sort2 +db close +sqlite3_shutdown +sqlite3_config_pmasz 10 +sqlite3_initialize +sqlite3 db test.db foreach {tn script} { 1 { } diff --git a/test/sort4.test b/test/sort4.test index 01fcbfee95..7b913610da 100644 --- a/test/sort4.test +++ b/test/sort4.test @@ -17,6 +17,12 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix sort4 +db close +sqlite3_shutdown +sqlite3_config_pmasz 10 +sqlite3_initialize +sqlite3 db test.db + # Configure the sorter to use 3 background threads. db eval {PRAGMA threads=3} diff --git a/test/sortfault.test b/test/sortfault.test index a1983ac1c0..f9fe2be48a 100644 --- a/test/sortfault.test +++ b/test/sortfault.test @@ -17,6 +17,12 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix sortfault +db close +sqlite3_shutdown +sqlite3_config_pmasz 10 +sqlite3_initialize +sqlite3 db test.db + do_execsql_test 1.0 { PRAGMA cache_size = 5; From b96ef649216c3d8346ec3b56f6ddd502c5acf5af Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 2 Jan 2015 21:54:32 +0000 Subject: [PATCH 16/69] Fix a harmless compiler warning. FossilOrigin-Name: e0de580726a0ed35565783ed14440ef9bcdc3a3d --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/vdbesort.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 5142e98f04..5379e5a405 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\sSQLITE_CONFIG_PMASZ\sstart-time\soption. -D 2015-01-02T15:55:29.645 +C Fix\sa\sharmless\scompiler\swarning. +D 2015-01-02T21:54:32.064 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 335e2d3ff0f2455eacbfa3075fc37495e3321410 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 fc1aa0d1a8b539bf3a272945d02c9f9ede93039b +F src/vdbesort.c 560bdfd9eb3ae3205196e0d64ccd1de925caa6c7 F src/vdbetrace.c 7e4222955e07dd707a2f360c0eb73452be1cb010 F src/vtab.c c08ec66f45919eaa726bf88aa53eb08379d607f9 F src/wal.c 85353539f2d9d0c91ebd057c32525b1e1aa3335e @@ -1234,7 +1234,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 2835e79a0afec6e4d449ac9340afec068c2d4c11 -R 382d23526375da181cc875b46066d9ad +P acb0d1e8324f19da3d4d577d58748848de1bcef7 +R d42b2335f1c6a43df94caae9f8ce1686 U drh -Z bc81c476960284f7c54d9feff6b6453a +Z 834db2bdaa5aa08321cd4ddc946d3c7f diff --git a/manifest.uuid b/manifest.uuid index 4fa42f8241..18234cd356 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -acb0d1e8324f19da3d4d577d58748848de1bcef7 \ No newline at end of file +e0de580726a0ed35565783ed14440ef9bcdc3a3d \ No newline at end of file diff --git a/src/vdbesort.c b/src/vdbesort.c index 0d16324e2a..d76487d491 100644 --- a/src/vdbesort.c +++ b/src/vdbesort.c @@ -849,7 +849,7 @@ int sqlite3VdbeSorterInit( u32 szPma = sqlite3GlobalConfig.szPma; pSorter->mnPmaSize = szPma * pgsz; mxCache = db->aDb[0].pSchema->cache_size; - if( mxCachemxPmaSize = MIN((i64)mxCache*pgsz, SQLITE_MAX_PMASZ); /* EVIDENCE-OF: R-26747-61719 When the application provides any amount of From a780d8d767ec8d34dc481f78dc37059aac7bc6a8 Mon Sep 17 00:00:00 2001 From: drh Date: Sat, 3 Jan 2015 18:59:17 +0000 Subject: [PATCH 17/69] In releasetest.tcl, omit the CC=clang text from the label on Sanitize tests, so that the label fits on an 80-character line. FossilOrigin-Name: 23d4c07eb81db5a5c6beb56b5820f0b6501f1fb6 --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/releasetest.tcl | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 5379e5a405..7158c3bb7a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sharmless\scompiler\swarning. -D 2015-01-02T21:54:32.064 +C In\sreleasetest.tcl,\somit\sthe\sCC=clang\stext\sfrom\sthe\slabel\son\sSanitize\stests,\nso\sthat\sthe\slabel\sfits\son\san\s80-character\sline. +D 2015-01-03T18:59:17.732 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 335e2d3ff0f2455eacbfa3075fc37495e3321410 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 facd103f341b2ecb5b86569b7e657d59027bd9dd +F test/releasetest.tcl fcdb3fb8a84218cbc0d8d65c00375851e05d1966 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1234,7 +1234,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 acb0d1e8324f19da3d4d577d58748848de1bcef7 -R d42b2335f1c6a43df94caae9f8ce1686 +P e0de580726a0ed35565783ed14440ef9bcdc3a3d +R f6cee47d01cb42bf3184c460b0355569 U drh -Z 834db2bdaa5aa08321cd4ddc946d3c7f +Z f9858d5c3468a9943c6533c5ebc7e99c diff --git a/manifest.uuid b/manifest.uuid index 18234cd356..49b92f4c8b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e0de580726a0ed35565783ed14440ef9bcdc3a3d \ No newline at end of file +23d4c07eb81db5a5c6beb56b5820f0b6501f1fb6 \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 342a4069b9..24665f6f67 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -259,6 +259,8 @@ proc run_test_suite {name testtarget config} { # set cflags "-g" set opts "" + set title ${name}($testtarget) + regsub -all {#[^\n]*\n} $config \n config foreach arg $config { if {[string match -D* $arg]} { @@ -286,7 +288,6 @@ proc run_test_suite {name testtarget config} { dryrun file mkdir $dir if {!$::DRYRUN} { - set title ${name}($testtarget) set n [string length $title] puts -nonewline "${title}[string repeat . [expr {63-$n}]]" flush stdout From b87fbed5a3e62b584acc335d6727b4fe5b0e719f Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 5 Jan 2015 15:48:45 +0000 Subject: [PATCH 18/69] Remove some needless recursion from compound SELECT processing. FossilOrigin-Name: fe677d13f03e24fa667efc0c2e7f5bbb99521791 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/select.c | 39 ++++++++++++++++++++------------------- 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/manifest b/manifest index 7158c3bb7a..58de159748 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C In\sreleasetest.tcl,\somit\sthe\sCC=clang\stext\sfrom\sthe\slabel\son\sSanitize\stests,\nso\sthat\sthe\slabel\sfits\son\san\s80-character\sline. -D 2015-01-03T18:59:17.732 +C Remove\ssome\sneedless\srecursion\sfrom\scompound\sSELECT\sprocessing. +D 2015-01-05T15:48:45.607 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 335e2d3ff0f2455eacbfa3075fc37495e3321410 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -228,7 +228,7 @@ F src/printf.c 9e75a6a0b55bf61cfff7d7e19d89834a1b938236 F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e -F src/select.c f377fb8a5c73c10678ea74f3400f7913943e3d75 +F src/select.c 28cf616a8791ff154be86bd9a3f888440f618e78 F src/shell.c 45d9c9bd7cde07845af957f2d849933b990773cf F src/sqlite.h.in ed799ff5c814227c7957eb4f4a217f67fdc0da48 F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad @@ -1234,7 +1234,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 e0de580726a0ed35565783ed14440ef9bcdc3a3d -R f6cee47d01cb42bf3184c460b0355569 +P 23d4c07eb81db5a5c6beb56b5820f0b6501f1fb6 +R 11413a03283b5c5b28fd422ab566eba3 U drh -Z f9858d5c3468a9943c6533c5ebc7e99c +Z 4fbaf4abfb36941c7ce4c15be9a07b21 diff --git a/manifest.uuid b/manifest.uuid index 49b92f4c8b..7801476f7e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -23d4c07eb81db5a5c6beb56b5820f0b6501f1fb6 \ No newline at end of file +fe677d13f03e24fa667efc0c2e7f5bbb99521791 \ No newline at end of file diff --git a/src/select.c b/src/select.c index 070ac00410..bc4f8a37c3 100644 --- a/src/select.c +++ b/src/select.c @@ -58,20 +58,25 @@ struct SortCtx { #define SORTFLAG_UseSorter 0x01 /* Use SorterOpen instead of OpenEphemeral */ /* -** Delete all the content of a Select structure but do not deallocate -** the select structure itself. +** Delete all the content of a Select structure. Deallocate the structure +** itself only if bFree is true. */ -static void clearSelect(sqlite3 *db, Select *p){ - sqlite3ExprListDelete(db, p->pEList); - sqlite3SrcListDelete(db, p->pSrc); - sqlite3ExprDelete(db, p->pWhere); - sqlite3ExprListDelete(db, p->pGroupBy); - sqlite3ExprDelete(db, p->pHaving); - sqlite3ExprListDelete(db, p->pOrderBy); - sqlite3SelectDelete(db, p->pPrior); - sqlite3ExprDelete(db, p->pLimit); - sqlite3ExprDelete(db, p->pOffset); - sqlite3WithDelete(db, p->pWith); +static void clearSelect(sqlite3 *db, Select *p, int bFree){ + while( p ){ + Select *pPrior = p->pPrior; + sqlite3ExprListDelete(db, p->pEList); + sqlite3SrcListDelete(db, p->pSrc); + sqlite3ExprDelete(db, p->pWhere); + sqlite3ExprListDelete(db, p->pGroupBy); + sqlite3ExprDelete(db, p->pHaving); + sqlite3ExprListDelete(db, p->pOrderBy); + sqlite3ExprDelete(db, p->pLimit); + sqlite3ExprDelete(db, p->pOffset); + sqlite3WithDelete(db, p->pWith); + if( bFree ) sqlite3DbFree(db, p); + p = pPrior; + bFree = 1; + } } /* @@ -130,8 +135,7 @@ Select *sqlite3SelectNew( pNew->addrOpenEphm[0] = -1; pNew->addrOpenEphm[1] = -1; if( db->mallocFailed ) { - clearSelect(db, pNew); - if( pNew!=&standin ) sqlite3DbFree(db, pNew); + clearSelect(db, pNew, pNew!=&standin); pNew = 0; }else{ assert( pNew->pSrc!=0 || pParse->nErr>0 ); @@ -156,10 +160,7 @@ void sqlite3SelectSetName(Select *p, const char *zName){ ** Delete the given Select structure and all of its substructures. */ void sqlite3SelectDelete(sqlite3 *db, Select *p){ - if( p ){ - clearSelect(db, p); - sqlite3DbFree(db, p); - } + clearSelect(db, p, 1); } /* From a0c01768f05ee8d27563724e02fdd17d5bf48a3d Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 5 Jan 2015 16:27:43 +0000 Subject: [PATCH 19/69] Towards getting INSERT statements to except many VALUE terms (more than the limit imposed by SQLITE_LIMIT_COMPOUND_SELECT). This check-in segfaults on a stack overflow. And it is slow. FossilOrigin-Name: c9d65f739ad56f016c676e79aa39080be3fe868a --- manifest | 16 +- manifest.uuid | 2 +- src/parse.y | 6 +- test/selectG.test | 1008 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 1023 insertions(+), 9 deletions(-) create mode 100644 test/selectG.test diff --git a/manifest b/manifest index 58de159748..6cb20c1817 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\ssome\sneedless\srecursion\sfrom\scompound\sSELECT\sprocessing. -D 2015-01-05T15:48:45.607 +C Towards\sgetting\sINSERT\sstatements\sto\sexcept\smany\sVALUE\sterms\s(more\sthan\nthe\slimit\simposed\sby\sSQLITE_LIMIT_COMPOUND_SELECT).\s\sThis\scheck-in\ssegfaults\non\sa\sstack\soverflow.\s\sAnd\sit\sis\sslow. +D 2015-01-05T16:27:43.075 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 335e2d3ff0f2455eacbfa3075fc37495e3321410 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -218,7 +218,7 @@ F src/os_win.c 91d3d08e33ec0258d180d4c8255492f47d15e007 F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21 F src/pager.c 4120a49ecd37697e28f5ed807f470b9c0b88410c F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77 -F src/parse.y 5dfead8aed90cb0c7c1115898ee2266804daff45 +F src/parse.y 075cad65e0393df1362b87e5cd766220b880f3a7 F src/pcache.c b83d160ce81ca101f98f0d27498e6d6bd49f1599 F src/pcache.h b44658c9c932d203510279439d891a2a83e12ba8 F src/pcache1.c 1e77432b40b7d3288327d9cdf399dcdfd2b6d3bf @@ -840,6 +840,7 @@ F test/selectC.test 871fb55d884d3de5943c4057ebd22c2459e71977 F test/selectD.test b0f02a04ef7737decb24e08be2c39b9664b43394 F test/selectE.test fc02a1eb04c8eb537091482644b7d778ae8759b7 F test/selectF.test 21c94e6438f76537b72532fa9fd4710cdd455fc3 +F test/selectG.test 6425730374fb1ebf9897b64db5a2c2550eff6ee7 F test/server1.test 46803bd3fe8b99b30dbc5ff38ffc756f5c13a118 F test/shared.test 1da9dbad400cee0d93f252ccf76e1ae007a63746 F test/shared2.test 03eb4a8d372e290107d34b6ce1809919a698e879 @@ -1234,7 +1235,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 23d4c07eb81db5a5c6beb56b5820f0b6501f1fb6 -R 11413a03283b5c5b28fd422ab566eba3 +P fe677d13f03e24fa667efc0c2e7f5bbb99521791 +R 54acf3852000e5cc7341ca33524e221b +T *branch * many-VALUEs +T *sym-many-VALUEs * +T -sym-trunk * U drh -Z 4fbaf4abfb36941c7ce4c15be9a07b21 +Z 9fc3f9e17e26a0964cf77234a16c2176 diff --git a/manifest.uuid b/manifest.uuid index 7801476f7e..32e2f42e5e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -fe677d13f03e24fa667efc0c2e7f5bbb99521791 \ No newline at end of file +c9d65f739ad56f016c676e79aa39080be3fe868a \ No newline at end of file diff --git a/src/parse.y b/src/parse.y index 877827e68d..4dbdbdea26 100644 --- a/src/parse.y +++ b/src/parse.y @@ -420,8 +420,10 @@ select(A) ::= with(W) selectnowith(X). { pLoop->pNext = pNext; pLoop->selFlags |= SF_Compound; } - mxSelect = pParse->db->aLimit[SQLITE_LIMIT_COMPOUND_SELECT]; - if( mxSelect && cnt>mxSelect ){ + if( (p->selFlags & SF_Values)==0 + && (mxSelect = pParse->db->aLimit[SQLITE_LIMIT_COMPOUND_SELECT])>0 + && cnt>mxSelect + ){ sqlite3ErrorMsg(pParse, "too many terms in compound SELECT"); } } diff --git a/test/selectG.test b/test/selectG.test new file mode 100644 index 0000000000..01b4b02cba --- /dev/null +++ b/test/selectG.test @@ -0,0 +1,1008 @@ +# 2015-01-05 +# +# 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 verifies that INSERT operations with a very large number of +# VALUE terms works and does not hit the SQLITE_LIMIT_COMPOUND_SELECT limit. +# + +set testdir [file dirname $argv0] +source $testdir/tester.tcl +set testprefix selectG + +do_execsql_test 100 { + CREATE TABLE t1(x); + INSERT INTO t1(x) VALUES(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12), + (13),(14),(15),(16),(17),(18),(19),(20),(21),(22),(23),(24),(25),(26), + (27),(28),(29),(30),(31),(32),(33),(34),(35),(36),(37),(38),(39),(40), + (41),(42),(43),(44),(45),(46),(47),(48),(49),(50),(51),(52),(53),(54), + (55),(56),(57),(58),(59),(60),(61),(62),(63),(64),(65),(66),(67),(68), + (69),(70),(71),(72),(73),(74),(75),(76),(77),(78),(79),(80),(81),(82), + (83),(84),(85),(86),(87),(88),(89),(90),(91),(92),(93),(94),(95),(96), + (97),(98),(99),(100),(101),(102),(103),(104),(105),(106),(107),(108), + (109),(110),(111),(112),(113),(114),(115),(116),(117),(118),(119),(120), + (121),(122),(123),(124),(125),(126),(127),(128),(129),(130),(131),(132), + (133),(134),(135),(136),(137),(138),(139),(140),(141),(142),(143),(144), + (145),(146),(147),(148),(149),(150),(151),(152),(153),(154),(155),(156), + (157),(158),(159),(160),(161),(162),(163),(164),(165),(166),(167),(168), + (169),(170),(171),(172),(173),(174),(175),(176),(177),(178),(179),(180), + (181),(182),(183),(184),(185),(186),(187),(188),(189),(190),(191),(192), + (193),(194),(195),(196),(197),(198),(199),(200),(201),(202),(203),(204), + (205),(206),(207),(208),(209),(210),(211),(212),(213),(214),(215),(216), + (217),(218),(219),(220),(221),(222),(223),(224),(225),(226),(227),(228), + (229),(230),(231),(232),(233),(234),(235),(236),(237),(238),(239),(240), + (241),(242),(243),(244),(245),(246),(247),(248),(249),(250),(251),(252), + (253),(254),(255),(256),(257),(258),(259),(260),(261),(262),(263),(264), + (265),(266),(267),(268),(269),(270),(271),(272),(273),(274),(275),(276), + (277),(278),(279),(280),(281),(282),(283),(284),(285),(286),(287),(288), + (289),(290),(291),(292),(293),(294),(295),(296),(297),(298),(299),(300), + (301),(302),(303),(304),(305),(306),(307),(308),(309),(310),(311),(312), + (313),(314),(315),(316),(317),(318),(319),(320),(321),(322),(323),(324), + (325),(326),(327),(328),(329),(330),(331),(332),(333),(334),(335),(336), + (337),(338),(339),(340),(341),(342),(343),(344),(345),(346),(347),(348), + (349),(350),(351),(352),(353),(354),(355),(356),(357),(358),(359),(360), + (361),(362),(363),(364),(365),(366),(367),(368),(369),(370),(371),(372), + (373),(374),(375),(376),(377),(378),(379),(380),(381),(382),(383),(384), + (385),(386),(387),(388),(389),(390),(391),(392),(393),(394),(395),(396), + (397),(398),(399),(400),(401),(402),(403),(404),(405),(406),(407),(408), + (409),(410),(411),(412),(413),(414),(415),(416),(417),(418),(419),(420), + (421),(422),(423),(424),(425),(426),(427),(428),(429),(430),(431),(432), + (433),(434),(435),(436),(437),(438),(439),(440),(441),(442),(443),(444), + (445),(446),(447),(448),(449),(450),(451),(452),(453),(454),(455),(456), + (457),(458),(459),(460),(461),(462),(463),(464),(465),(466),(467),(468), + (469),(470),(471),(472),(473),(474),(475),(476),(477),(478),(479),(480), + (481),(482),(483),(484),(485),(486),(487),(488),(489),(490),(491),(492), + (493),(494),(495),(496),(497),(498),(499),(500),(501),(502),(503),(504), + (505),(506),(507),(508),(509),(510),(511),(512),(513),(514),(515),(516), + (517),(518),(519),(520),(521),(522),(523),(524),(525),(526),(527),(528), + (529),(530),(531),(532),(533),(534),(535),(536),(537),(538),(539),(540), + (541),(542),(543),(544),(545),(546),(547),(548),(549),(550),(551),(552), + (553),(554),(555),(556),(557),(558),(559),(560),(561),(562),(563),(564), + (565),(566),(567),(568),(569),(570),(571),(572),(573),(574),(575),(576), + (577),(578),(579),(580),(581),(582),(583),(584),(585),(586),(587),(588), + (589),(590),(591),(592),(593),(594),(595),(596),(597),(598),(599),(600), + (601),(602),(603),(604),(605),(606),(607),(608),(609),(610),(611),(612), + (613),(614),(615),(616),(617),(618),(619),(620),(621),(622),(623),(624), + (625),(626),(627),(628),(629),(630),(631),(632),(633),(634),(635),(636), + (637),(638),(639),(640),(641),(642),(643),(644),(645),(646),(647),(648), + (649),(650),(651),(652),(653),(654),(655),(656),(657),(658),(659),(660), + (661),(662),(663),(664),(665),(666),(667),(668),(669),(670),(671),(672), + (673),(674),(675),(676),(677),(678),(679),(680),(681),(682),(683),(684), + (685),(686),(687),(688),(689),(690),(691),(692),(693),(694),(695),(696), + (697),(698),(699),(700),(701),(702),(703),(704),(705),(706),(707),(708), + (709),(710),(711),(712),(713),(714),(715),(716),(717),(718),(719),(720), + (721),(722),(723),(724),(725),(726),(727),(728),(729),(730),(731),(732), + (733),(734),(735),(736),(737),(738),(739),(740),(741),(742),(743),(744), + (745),(746),(747),(748),(749),(750),(751),(752),(753),(754),(755),(756), + (757),(758),(759),(760),(761),(762),(763),(764),(765),(766),(767),(768), + (769),(770),(771),(772),(773),(774),(775),(776),(777),(778),(779),(780), + (781),(782),(783),(784),(785),(786),(787),(788),(789),(790),(791),(792), + (793),(794),(795),(796),(797),(798),(799),(800),(801),(802),(803),(804), + (805),(806),(807),(808),(809),(810),(811),(812),(813),(814),(815),(816), + (817),(818),(819),(820),(821),(822),(823),(824),(825),(826),(827),(828), + (829),(830),(831),(832),(833),(834),(835),(836),(837),(838),(839),(840), + (841),(842),(843),(844),(845),(846),(847),(848),(849),(850),(851),(852), + (853),(854),(855),(856),(857),(858),(859),(860),(861),(862),(863),(864), + (865),(866),(867),(868),(869),(870),(871),(872),(873),(874),(875),(876), + (877),(878),(879),(880),(881),(882),(883),(884),(885),(886),(887),(888), + (889),(890),(891),(892),(893),(894),(895),(896),(897),(898),(899),(900), + (901),(902),(903),(904),(905),(906),(907),(908),(909),(910),(911),(912), + (913),(914),(915),(916),(917),(918),(919),(920),(921),(922),(923),(924), + (925),(926),(927),(928),(929),(930),(931),(932),(933),(934),(935),(936), + (937),(938),(939),(940),(941),(942),(943),(944),(945),(946),(947),(948), + (949),(950),(951),(952),(953),(954),(955),(956),(957),(958),(959),(960), + (961),(962),(963),(964),(965),(966),(967),(968),(969),(970),(971),(972), + (973),(974),(975),(976),(977),(978),(979),(980),(981),(982),(983),(984), + (985),(986),(987),(988),(989),(990),(991),(992),(993),(994),(995),(996), + (997),(998),(999),(1000),(1001),(1002),(1003),(1004),(1005),(1006),(1007), + (1008),(1009),(1010),(1011),(1012),(1013),(1014),(1015),(1016),(1017), + (1018),(1019),(1020),(1021),(1022),(1023),(1024),(1025),(1026),(1027), + (1028),(1029),(1030),(1031),(1032),(1033),(1034),(1035),(1036),(1037), + (1038),(1039),(1040),(1041),(1042),(1043),(1044),(1045),(1046),(1047), + (1048),(1049),(1050),(1051),(1052),(1053),(1054),(1055),(1056),(1057), + (1058),(1059),(1060),(1061),(1062),(1063),(1064),(1065),(1066),(1067), + (1068),(1069),(1070),(1071),(1072),(1073),(1074),(1075),(1076),(1077), + (1078),(1079),(1080),(1081),(1082),(1083),(1084),(1085),(1086),(1087), + (1088),(1089),(1090),(1091),(1092),(1093),(1094),(1095),(1096),(1097), + (1098),(1099),(1100),(1101),(1102),(1103),(1104),(1105),(1106),(1107), + (1108),(1109),(1110),(1111),(1112),(1113),(1114),(1115),(1116),(1117), + (1118),(1119),(1120),(1121),(1122),(1123),(1124),(1125),(1126),(1127), + (1128),(1129),(1130),(1131),(1132),(1133),(1134),(1135),(1136),(1137), + (1138),(1139),(1140),(1141),(1142),(1143),(1144),(1145),(1146),(1147), + (1148),(1149),(1150),(1151),(1152),(1153),(1154),(1155),(1156),(1157), + (1158),(1159),(1160),(1161),(1162),(1163),(1164),(1165),(1166),(1167), + (1168),(1169),(1170),(1171),(1172),(1173),(1174),(1175),(1176),(1177), + (1178),(1179),(1180),(1181),(1182),(1183),(1184),(1185),(1186),(1187), + (1188),(1189),(1190),(1191),(1192),(1193),(1194),(1195),(1196),(1197), + (1198),(1199),(1200),(1201),(1202),(1203),(1204),(1205),(1206),(1207), + (1208),(1209),(1210),(1211),(1212),(1213),(1214),(1215),(1216),(1217), + (1218),(1219),(1220),(1221),(1222),(1223),(1224),(1225),(1226),(1227), + (1228),(1229),(1230),(1231),(1232),(1233),(1234),(1235),(1236),(1237), + (1238),(1239),(1240),(1241),(1242),(1243),(1244),(1245),(1246),(1247), + (1248),(1249),(1250),(1251),(1252),(1253),(1254),(1255),(1256),(1257), + (1258),(1259),(1260),(1261),(1262),(1263),(1264),(1265),(1266),(1267), + (1268),(1269),(1270),(1271),(1272),(1273),(1274),(1275),(1276),(1277), + (1278),(1279),(1280),(1281),(1282),(1283),(1284),(1285),(1286),(1287), + (1288),(1289),(1290),(1291),(1292),(1293),(1294),(1295),(1296),(1297), + (1298),(1299),(1300),(1301),(1302),(1303),(1304),(1305),(1306),(1307), + (1308),(1309),(1310),(1311),(1312),(1313),(1314),(1315),(1316),(1317), + (1318),(1319),(1320),(1321),(1322),(1323),(1324),(1325),(1326),(1327), + (1328),(1329),(1330),(1331),(1332),(1333),(1334),(1335),(1336),(1337), + (1338),(1339),(1340),(1341),(1342),(1343),(1344),(1345),(1346),(1347), + (1348),(1349),(1350),(1351),(1352),(1353),(1354),(1355),(1356),(1357), + (1358),(1359),(1360),(1361),(1362),(1363),(1364),(1365),(1366),(1367), + (1368),(1369),(1370),(1371),(1372),(1373),(1374),(1375),(1376),(1377), + (1378),(1379),(1380),(1381),(1382),(1383),(1384),(1385),(1386),(1387), + (1388),(1389),(1390),(1391),(1392),(1393),(1394),(1395),(1396),(1397), + (1398),(1399),(1400),(1401),(1402),(1403),(1404),(1405),(1406),(1407), + (1408),(1409),(1410),(1411),(1412),(1413),(1414),(1415),(1416),(1417), + (1418),(1419),(1420),(1421),(1422),(1423),(1424),(1425),(1426),(1427), + (1428),(1429),(1430),(1431),(1432),(1433),(1434),(1435),(1436),(1437), + (1438),(1439),(1440),(1441),(1442),(1443),(1444),(1445),(1446),(1447), + (1448),(1449),(1450),(1451),(1452),(1453),(1454),(1455),(1456),(1457), + (1458),(1459),(1460),(1461),(1462),(1463),(1464),(1465),(1466),(1467), + (1468),(1469),(1470),(1471),(1472),(1473),(1474),(1475),(1476),(1477), + (1478),(1479),(1480),(1481),(1482),(1483),(1484),(1485),(1486),(1487), + (1488),(1489),(1490),(1491),(1492),(1493),(1494),(1495),(1496),(1497), + (1498),(1499),(1500),(1501),(1502),(1503),(1504),(1505),(1506),(1507), + (1508),(1509),(1510),(1511),(1512),(1513),(1514),(1515),(1516),(1517), + (1518),(1519),(1520),(1521),(1522),(1523),(1524),(1525),(1526),(1527), + (1528),(1529),(1530),(1531),(1532),(1533),(1534),(1535),(1536),(1537), + (1538),(1539),(1540),(1541),(1542),(1543),(1544),(1545),(1546),(1547), + (1548),(1549),(1550),(1551),(1552),(1553),(1554),(1555),(1556),(1557), + (1558),(1559),(1560),(1561),(1562),(1563),(1564),(1565),(1566),(1567), + (1568),(1569),(1570),(1571),(1572),(1573),(1574),(1575),(1576),(1577), + (1578),(1579),(1580),(1581),(1582),(1583),(1584),(1585),(1586),(1587), + (1588),(1589),(1590),(1591),(1592),(1593),(1594),(1595),(1596),(1597), + (1598),(1599),(1600),(1601),(1602),(1603),(1604),(1605),(1606),(1607), + (1608),(1609),(1610),(1611),(1612),(1613),(1614),(1615),(1616),(1617), + (1618),(1619),(1620),(1621),(1622),(1623),(1624),(1625),(1626),(1627), + (1628),(1629),(1630),(1631),(1632),(1633),(1634),(1635),(1636),(1637), + (1638),(1639),(1640),(1641),(1642),(1643),(1644),(1645),(1646),(1647), + (1648),(1649),(1650),(1651),(1652),(1653),(1654),(1655),(1656),(1657), + (1658),(1659),(1660),(1661),(1662),(1663),(1664),(1665),(1666),(1667), + (1668),(1669),(1670),(1671),(1672),(1673),(1674),(1675),(1676),(1677), + (1678),(1679),(1680),(1681),(1682),(1683),(1684),(1685),(1686),(1687), + (1688),(1689),(1690),(1691),(1692),(1693),(1694),(1695),(1696),(1697), + (1698),(1699),(1700),(1701),(1702),(1703),(1704),(1705),(1706),(1707), + (1708),(1709),(1710),(1711),(1712),(1713),(1714),(1715),(1716),(1717), + (1718),(1719),(1720),(1721),(1722),(1723),(1724),(1725),(1726),(1727), + (1728),(1729),(1730),(1731),(1732),(1733),(1734),(1735),(1736),(1737), + (1738),(1739),(1740),(1741),(1742),(1743),(1744),(1745),(1746),(1747), + (1748),(1749),(1750),(1751),(1752),(1753),(1754),(1755),(1756),(1757), + (1758),(1759),(1760),(1761),(1762),(1763),(1764),(1765),(1766),(1767), + (1768),(1769),(1770),(1771),(1772),(1773),(1774),(1775),(1776),(1777), + (1778),(1779),(1780),(1781),(1782),(1783),(1784),(1785),(1786),(1787), + (1788),(1789),(1790),(1791),(1792),(1793),(1794),(1795),(1796),(1797), + (1798),(1799),(1800),(1801),(1802),(1803),(1804),(1805),(1806),(1807), + (1808),(1809),(1810),(1811),(1812),(1813),(1814),(1815),(1816),(1817), + (1818),(1819),(1820),(1821),(1822),(1823),(1824),(1825),(1826),(1827), + (1828),(1829),(1830),(1831),(1832),(1833),(1834),(1835),(1836),(1837), + (1838),(1839),(1840),(1841),(1842),(1843),(1844),(1845),(1846),(1847), + (1848),(1849),(1850),(1851),(1852),(1853),(1854),(1855),(1856),(1857), + (1858),(1859),(1860),(1861),(1862),(1863),(1864),(1865),(1866),(1867), + (1868),(1869),(1870),(1871),(1872),(1873),(1874),(1875),(1876),(1877), + (1878),(1879),(1880),(1881),(1882),(1883),(1884),(1885),(1886),(1887), + (1888),(1889),(1890),(1891),(1892),(1893),(1894),(1895),(1896),(1897), + (1898),(1899),(1900),(1901),(1902),(1903),(1904),(1905),(1906),(1907), + (1908),(1909),(1910),(1911),(1912),(1913),(1914),(1915),(1916),(1917), + (1918),(1919),(1920),(1921),(1922),(1923),(1924),(1925),(1926),(1927), + (1928),(1929),(1930),(1931),(1932),(1933),(1934),(1935),(1936),(1937), + (1938),(1939),(1940),(1941),(1942),(1943),(1944),(1945),(1946),(1947), + (1948),(1949),(1950),(1951),(1952),(1953),(1954),(1955),(1956),(1957), + (1958),(1959),(1960),(1961),(1962),(1963),(1964),(1965),(1966),(1967), + (1968),(1969),(1970),(1971),(1972),(1973),(1974),(1975),(1976),(1977), + (1978),(1979),(1980),(1981),(1982),(1983),(1984),(1985),(1986),(1987), + (1988),(1989),(1990),(1991),(1992),(1993),(1994),(1995),(1996),(1997), + (1998),(1999),(2000),(2001),(2002),(2003),(2004),(2005),(2006),(2007), + (2008),(2009),(2010),(2011),(2012),(2013),(2014),(2015),(2016),(2017), + (2018),(2019),(2020),(2021),(2022),(2023),(2024),(2025),(2026),(2027), + (2028),(2029),(2030),(2031),(2032),(2033),(2034),(2035),(2036),(2037), + (2038),(2039),(2040),(2041),(2042),(2043),(2044),(2045),(2046),(2047), + (2048),(2049),(2050),(2051),(2052),(2053),(2054),(2055),(2056),(2057), + (2058),(2059),(2060),(2061),(2062),(2063),(2064),(2065),(2066),(2067), + (2068),(2069),(2070),(2071),(2072),(2073),(2074),(2075),(2076),(2077), + (2078),(2079),(2080),(2081),(2082),(2083),(2084),(2085),(2086),(2087), + (2088),(2089),(2090),(2091),(2092),(2093),(2094),(2095),(2096),(2097), + (2098),(2099),(2100),(2101),(2102),(2103),(2104),(2105),(2106),(2107), + (2108),(2109),(2110),(2111),(2112),(2113),(2114),(2115),(2116),(2117), + (2118),(2119),(2120),(2121),(2122),(2123),(2124),(2125),(2126),(2127), + (2128),(2129),(2130),(2131),(2132),(2133),(2134),(2135),(2136),(2137), + (2138),(2139),(2140),(2141),(2142),(2143),(2144),(2145),(2146),(2147), + (2148),(2149),(2150),(2151),(2152),(2153),(2154),(2155),(2156),(2157), + (2158),(2159),(2160),(2161),(2162),(2163),(2164),(2165),(2166),(2167), + (2168),(2169),(2170),(2171),(2172),(2173),(2174),(2175),(2176),(2177), + (2178),(2179),(2180),(2181),(2182),(2183),(2184),(2185),(2186),(2187), + (2188),(2189),(2190),(2191),(2192),(2193),(2194),(2195),(2196),(2197), + (2198),(2199),(2200),(2201),(2202),(2203),(2204),(2205),(2206),(2207), + (2208),(2209),(2210),(2211),(2212),(2213),(2214),(2215),(2216),(2217), + (2218),(2219),(2220),(2221),(2222),(2223),(2224),(2225),(2226),(2227), + (2228),(2229),(2230),(2231),(2232),(2233),(2234),(2235),(2236),(2237), + (2238),(2239),(2240),(2241),(2242),(2243),(2244),(2245),(2246),(2247), + (2248),(2249),(2250),(2251),(2252),(2253),(2254),(2255),(2256),(2257), + (2258),(2259),(2260),(2261),(2262),(2263),(2264),(2265),(2266),(2267), + (2268),(2269),(2270),(2271),(2272),(2273),(2274),(2275),(2276),(2277), + (2278),(2279),(2280),(2281),(2282),(2283),(2284),(2285),(2286),(2287), + (2288),(2289),(2290),(2291),(2292),(2293),(2294),(2295),(2296),(2297), + (2298),(2299),(2300),(2301),(2302),(2303),(2304),(2305),(2306),(2307), + (2308),(2309),(2310),(2311),(2312),(2313),(2314),(2315),(2316),(2317), + (2318),(2319),(2320),(2321),(2322),(2323),(2324),(2325),(2326),(2327), + (2328),(2329),(2330),(2331),(2332),(2333),(2334),(2335),(2336),(2337), + (2338),(2339),(2340),(2341),(2342),(2343),(2344),(2345),(2346),(2347), + (2348),(2349),(2350),(2351),(2352),(2353),(2354),(2355),(2356),(2357), + (2358),(2359),(2360),(2361),(2362),(2363),(2364),(2365),(2366),(2367), + (2368),(2369),(2370),(2371),(2372),(2373),(2374),(2375),(2376),(2377), + (2378),(2379),(2380),(2381),(2382),(2383),(2384),(2385),(2386),(2387), + (2388),(2389),(2390),(2391),(2392),(2393),(2394),(2395),(2396),(2397), + (2398),(2399),(2400),(2401),(2402),(2403),(2404),(2405),(2406),(2407), + (2408),(2409),(2410),(2411),(2412),(2413),(2414),(2415),(2416),(2417), + (2418),(2419),(2420),(2421),(2422),(2423),(2424),(2425),(2426),(2427), + (2428),(2429),(2430),(2431),(2432),(2433),(2434),(2435),(2436),(2437), + (2438),(2439),(2440),(2441),(2442),(2443),(2444),(2445),(2446),(2447), + (2448),(2449),(2450),(2451),(2452),(2453),(2454),(2455),(2456),(2457), + (2458),(2459),(2460),(2461),(2462),(2463),(2464),(2465),(2466),(2467), + (2468),(2469),(2470),(2471),(2472),(2473),(2474),(2475),(2476),(2477), + (2478),(2479),(2480),(2481),(2482),(2483),(2484),(2485),(2486),(2487), + (2488),(2489),(2490),(2491),(2492),(2493),(2494),(2495),(2496),(2497), + (2498),(2499),(2500),(2501),(2502),(2503),(2504),(2505),(2506),(2507), + (2508),(2509),(2510),(2511),(2512),(2513),(2514),(2515),(2516),(2517), + (2518),(2519),(2520),(2521),(2522),(2523),(2524),(2525),(2526),(2527), + (2528),(2529),(2530),(2531),(2532),(2533),(2534),(2535),(2536),(2537), + (2538),(2539),(2540),(2541),(2542),(2543),(2544),(2545),(2546),(2547), + (2548),(2549),(2550),(2551),(2552),(2553),(2554),(2555),(2556),(2557), + (2558),(2559),(2560),(2561),(2562),(2563),(2564),(2565),(2566),(2567), + (2568),(2569),(2570),(2571),(2572),(2573),(2574),(2575),(2576),(2577), + (2578),(2579),(2580),(2581),(2582),(2583),(2584),(2585),(2586),(2587), + (2588),(2589),(2590),(2591),(2592),(2593),(2594),(2595),(2596),(2597), + (2598),(2599),(2600),(2601),(2602),(2603),(2604),(2605),(2606),(2607), + (2608),(2609),(2610),(2611),(2612),(2613),(2614),(2615),(2616),(2617), + (2618),(2619),(2620),(2621),(2622),(2623),(2624),(2625),(2626),(2627), + (2628),(2629),(2630),(2631),(2632),(2633),(2634),(2635),(2636),(2637), + (2638),(2639),(2640),(2641),(2642),(2643),(2644),(2645),(2646),(2647), + (2648),(2649),(2650),(2651),(2652),(2653),(2654),(2655),(2656),(2657), + (2658),(2659),(2660),(2661),(2662),(2663),(2664),(2665),(2666),(2667), + (2668),(2669),(2670),(2671),(2672),(2673),(2674),(2675),(2676),(2677), + (2678),(2679),(2680),(2681),(2682),(2683),(2684),(2685),(2686),(2687), + (2688),(2689),(2690),(2691),(2692),(2693),(2694),(2695),(2696),(2697), + (2698),(2699),(2700),(2701),(2702),(2703),(2704),(2705),(2706),(2707), + (2708),(2709),(2710),(2711),(2712),(2713),(2714),(2715),(2716),(2717), + (2718),(2719),(2720),(2721),(2722),(2723),(2724),(2725),(2726),(2727), + (2728),(2729),(2730),(2731),(2732),(2733),(2734),(2735),(2736),(2737), + (2738),(2739),(2740),(2741),(2742),(2743),(2744),(2745),(2746),(2747), + (2748),(2749),(2750),(2751),(2752),(2753),(2754),(2755),(2756),(2757), + (2758),(2759),(2760),(2761),(2762),(2763),(2764),(2765),(2766),(2767), + (2768),(2769),(2770),(2771),(2772),(2773),(2774),(2775),(2776),(2777), + (2778),(2779),(2780),(2781),(2782),(2783),(2784),(2785),(2786),(2787), + (2788),(2789),(2790),(2791),(2792),(2793),(2794),(2795),(2796),(2797), + (2798),(2799),(2800),(2801),(2802),(2803),(2804),(2805),(2806),(2807), + (2808),(2809),(2810),(2811),(2812),(2813),(2814),(2815),(2816),(2817), + (2818),(2819),(2820),(2821),(2822),(2823),(2824),(2825),(2826),(2827), + (2828),(2829),(2830),(2831),(2832),(2833),(2834),(2835),(2836),(2837), + (2838),(2839),(2840),(2841),(2842),(2843),(2844),(2845),(2846),(2847), + (2848),(2849),(2850),(2851),(2852),(2853),(2854),(2855),(2856),(2857), + (2858),(2859),(2860),(2861),(2862),(2863),(2864),(2865),(2866),(2867), + (2868),(2869),(2870),(2871),(2872),(2873),(2874),(2875),(2876),(2877), + (2878),(2879),(2880),(2881),(2882),(2883),(2884),(2885),(2886),(2887), + (2888),(2889),(2890),(2891),(2892),(2893),(2894),(2895),(2896),(2897), + (2898),(2899),(2900),(2901),(2902),(2903),(2904),(2905),(2906),(2907), + (2908),(2909),(2910),(2911),(2912),(2913),(2914),(2915),(2916),(2917), + (2918),(2919),(2920),(2921),(2922),(2923),(2924),(2925),(2926),(2927), + (2928),(2929),(2930),(2931),(2932),(2933),(2934),(2935),(2936),(2937), + (2938),(2939),(2940),(2941),(2942),(2943),(2944),(2945),(2946),(2947), + (2948),(2949),(2950),(2951),(2952),(2953),(2954),(2955),(2956),(2957), + (2958),(2959),(2960),(2961),(2962),(2963),(2964),(2965),(2966),(2967), + (2968),(2969),(2970),(2971),(2972),(2973),(2974),(2975),(2976),(2977), + (2978),(2979),(2980),(2981),(2982),(2983),(2984),(2985),(2986),(2987), + (2988),(2989),(2990),(2991),(2992),(2993),(2994),(2995),(2996),(2997), + (2998),(2999),(3000),(3001),(3002),(3003),(3004),(3005),(3006),(3007), + (3008),(3009),(3010),(3011),(3012),(3013),(3014),(3015),(3016),(3017), + (3018),(3019),(3020),(3021),(3022),(3023),(3024),(3025),(3026),(3027), + (3028),(3029),(3030),(3031),(3032),(3033),(3034),(3035),(3036),(3037), + (3038),(3039),(3040),(3041),(3042),(3043),(3044),(3045),(3046),(3047), + (3048),(3049),(3050),(3051),(3052),(3053),(3054),(3055),(3056),(3057), + (3058),(3059),(3060),(3061),(3062),(3063),(3064),(3065),(3066),(3067), + (3068),(3069),(3070),(3071),(3072),(3073),(3074),(3075),(3076),(3077), + (3078),(3079),(3080),(3081),(3082),(3083),(3084),(3085),(3086),(3087), + (3088),(3089),(3090),(3091),(3092),(3093),(3094),(3095),(3096),(3097), + (3098),(3099),(3100),(3101),(3102),(3103),(3104),(3105),(3106),(3107), + (3108),(3109),(3110),(3111),(3112),(3113),(3114),(3115),(3116),(3117), + (3118),(3119),(3120),(3121),(3122),(3123),(3124),(3125),(3126),(3127), + (3128),(3129),(3130),(3131),(3132),(3133),(3134),(3135),(3136),(3137), + (3138),(3139),(3140),(3141),(3142),(3143),(3144),(3145),(3146),(3147), + (3148),(3149),(3150),(3151),(3152),(3153),(3154),(3155),(3156),(3157), + (3158),(3159),(3160),(3161),(3162),(3163),(3164),(3165),(3166),(3167), + (3168),(3169),(3170),(3171),(3172),(3173),(3174),(3175),(3176),(3177), + (3178),(3179),(3180),(3181),(3182),(3183),(3184),(3185),(3186),(3187), + (3188),(3189),(3190),(3191),(3192),(3193),(3194),(3195),(3196),(3197), + (3198),(3199),(3200),(3201),(3202),(3203),(3204),(3205),(3206),(3207), + (3208),(3209),(3210),(3211),(3212),(3213),(3214),(3215),(3216),(3217), + (3218),(3219),(3220),(3221),(3222),(3223),(3224),(3225),(3226),(3227), + (3228),(3229),(3230),(3231),(3232),(3233),(3234),(3235),(3236),(3237), + (3238),(3239),(3240),(3241),(3242),(3243),(3244),(3245),(3246),(3247), + (3248),(3249),(3250),(3251),(3252),(3253),(3254),(3255),(3256),(3257), + (3258),(3259),(3260),(3261),(3262),(3263),(3264),(3265),(3266),(3267), + (3268),(3269),(3270),(3271),(3272),(3273),(3274),(3275),(3276),(3277), + (3278),(3279),(3280),(3281),(3282),(3283),(3284),(3285),(3286),(3287), + (3288),(3289),(3290),(3291),(3292),(3293),(3294),(3295),(3296),(3297), + (3298),(3299),(3300),(3301),(3302),(3303),(3304),(3305),(3306),(3307), + (3308),(3309),(3310),(3311),(3312),(3313),(3314),(3315),(3316),(3317), + (3318),(3319),(3320),(3321),(3322),(3323),(3324),(3325),(3326),(3327), + (3328),(3329),(3330),(3331),(3332),(3333),(3334),(3335),(3336),(3337), + (3338),(3339),(3340),(3341),(3342),(3343),(3344),(3345),(3346),(3347), + (3348),(3349),(3350),(3351),(3352),(3353),(3354),(3355),(3356),(3357), + (3358),(3359),(3360),(3361),(3362),(3363),(3364),(3365),(3366),(3367), + (3368),(3369),(3370),(3371),(3372),(3373),(3374),(3375),(3376),(3377), + (3378),(3379),(3380),(3381),(3382),(3383),(3384),(3385),(3386),(3387), + (3388),(3389),(3390),(3391),(3392),(3393),(3394),(3395),(3396),(3397), + (3398),(3399),(3400),(3401),(3402),(3403),(3404),(3405),(3406),(3407), + (3408),(3409),(3410),(3411),(3412),(3413),(3414),(3415),(3416),(3417), + (3418),(3419),(3420),(3421),(3422),(3423),(3424),(3425),(3426),(3427), + (3428),(3429),(3430),(3431),(3432),(3433),(3434),(3435),(3436),(3437), + (3438),(3439),(3440),(3441),(3442),(3443),(3444),(3445),(3446),(3447), + (3448),(3449),(3450),(3451),(3452),(3453),(3454),(3455),(3456),(3457), + (3458),(3459),(3460),(3461),(3462),(3463),(3464),(3465),(3466),(3467), + (3468),(3469),(3470),(3471),(3472),(3473),(3474),(3475),(3476),(3477), + (3478),(3479),(3480),(3481),(3482),(3483),(3484),(3485),(3486),(3487), + (3488),(3489),(3490),(3491),(3492),(3493),(3494),(3495),(3496),(3497), + (3498),(3499),(3500),(3501),(3502),(3503),(3504),(3505),(3506),(3507), + (3508),(3509),(3510),(3511),(3512),(3513),(3514),(3515),(3516),(3517), + (3518),(3519),(3520),(3521),(3522),(3523),(3524),(3525),(3526),(3527), + (3528),(3529),(3530),(3531),(3532),(3533),(3534),(3535),(3536),(3537), + (3538),(3539),(3540),(3541),(3542),(3543),(3544),(3545),(3546),(3547), + (3548),(3549),(3550),(3551),(3552),(3553),(3554),(3555),(3556),(3557), + (3558),(3559),(3560),(3561),(3562),(3563),(3564),(3565),(3566),(3567), + (3568),(3569),(3570),(3571),(3572),(3573),(3574),(3575),(3576),(3577), + (3578),(3579),(3580),(3581),(3582),(3583),(3584),(3585),(3586),(3587), + (3588),(3589),(3590),(3591),(3592),(3593),(3594),(3595),(3596),(3597), + (3598),(3599),(3600),(3601),(3602),(3603),(3604),(3605),(3606),(3607), + (3608),(3609),(3610),(3611),(3612),(3613),(3614),(3615),(3616),(3617), + (3618),(3619),(3620),(3621),(3622),(3623),(3624),(3625),(3626),(3627), + (3628),(3629),(3630),(3631),(3632),(3633),(3634),(3635),(3636),(3637), + (3638),(3639),(3640),(3641),(3642),(3643),(3644),(3645),(3646),(3647), + (3648),(3649),(3650),(3651),(3652),(3653),(3654),(3655),(3656),(3657), + (3658),(3659),(3660),(3661),(3662),(3663),(3664),(3665),(3666),(3667), + (3668),(3669),(3670),(3671),(3672),(3673),(3674),(3675),(3676),(3677), + (3678),(3679),(3680),(3681),(3682),(3683),(3684),(3685),(3686),(3687), + (3688),(3689),(3690),(3691),(3692),(3693),(3694),(3695),(3696),(3697), + (3698),(3699),(3700),(3701),(3702),(3703),(3704),(3705),(3706),(3707), + (3708),(3709),(3710),(3711),(3712),(3713),(3714),(3715),(3716),(3717), + (3718),(3719),(3720),(3721),(3722),(3723),(3724),(3725),(3726),(3727), + (3728),(3729),(3730),(3731),(3732),(3733),(3734),(3735),(3736),(3737), + (3738),(3739),(3740),(3741),(3742),(3743),(3744),(3745),(3746),(3747), + (3748),(3749),(3750),(3751),(3752),(3753),(3754),(3755),(3756),(3757), + (3758),(3759),(3760),(3761),(3762),(3763),(3764),(3765),(3766),(3767), + (3768),(3769),(3770),(3771),(3772),(3773),(3774),(3775),(3776),(3777), + (3778),(3779),(3780),(3781),(3782),(3783),(3784),(3785),(3786),(3787), + (3788),(3789),(3790),(3791),(3792),(3793),(3794),(3795),(3796),(3797), + (3798),(3799),(3800),(3801),(3802),(3803),(3804),(3805),(3806),(3807), + (3808),(3809),(3810),(3811),(3812),(3813),(3814),(3815),(3816),(3817), + (3818),(3819),(3820),(3821),(3822),(3823),(3824),(3825),(3826),(3827), + (3828),(3829),(3830),(3831),(3832),(3833),(3834),(3835),(3836),(3837), + (3838),(3839),(3840),(3841),(3842),(3843),(3844),(3845),(3846),(3847), + (3848),(3849),(3850),(3851),(3852),(3853),(3854),(3855),(3856),(3857), + (3858),(3859),(3860),(3861),(3862),(3863),(3864),(3865),(3866),(3867), + (3868),(3869),(3870),(3871),(3872),(3873),(3874),(3875),(3876),(3877), + (3878),(3879),(3880),(3881),(3882),(3883),(3884),(3885),(3886),(3887), + (3888),(3889),(3890),(3891),(3892),(3893),(3894),(3895),(3896),(3897), + (3898),(3899),(3900),(3901),(3902),(3903),(3904),(3905),(3906),(3907), + (3908),(3909),(3910),(3911),(3912),(3913),(3914),(3915),(3916),(3917), + (3918),(3919),(3920),(3921),(3922),(3923),(3924),(3925),(3926),(3927), + (3928),(3929),(3930),(3931),(3932),(3933),(3934),(3935),(3936),(3937), + (3938),(3939),(3940),(3941),(3942),(3943),(3944),(3945),(3946),(3947), + (3948),(3949),(3950),(3951),(3952),(3953),(3954),(3955),(3956),(3957), + (3958),(3959),(3960),(3961),(3962),(3963),(3964),(3965),(3966),(3967), + (3968),(3969),(3970),(3971),(3972),(3973),(3974),(3975),(3976),(3977), + (3978),(3979),(3980),(3981),(3982),(3983),(3984),(3985),(3986),(3987), + (3988),(3989),(3990),(3991),(3992),(3993),(3994),(3995),(3996),(3997), + (3998),(3999),(4000),(4001),(4002),(4003),(4004),(4005),(4006),(4007), + (4008),(4009),(4010),(4011),(4012),(4013),(4014),(4015),(4016),(4017), + (4018),(4019),(4020),(4021),(4022),(4023),(4024),(4025),(4026),(4027), + (4028),(4029),(4030),(4031),(4032),(4033),(4034),(4035),(4036),(4037), + (4038),(4039),(4040),(4041),(4042),(4043),(4044),(4045),(4046),(4047), + (4048),(4049),(4050),(4051),(4052),(4053),(4054),(4055),(4056),(4057), + (4058),(4059),(4060),(4061),(4062),(4063),(4064),(4065),(4066),(4067), + (4068),(4069),(4070),(4071),(4072),(4073),(4074),(4075),(4076),(4077), + (4078),(4079),(4080),(4081),(4082),(4083),(4084),(4085),(4086),(4087), + (4088),(4089),(4090),(4091),(4092),(4093),(4094),(4095),(4096),(4097), + (4098),(4099),(4100),(4101),(4102),(4103),(4104),(4105),(4106),(4107), + (4108),(4109),(4110),(4111),(4112),(4113),(4114),(4115),(4116),(4117), + (4118),(4119),(4120),(4121),(4122),(4123),(4124),(4125),(4126),(4127), + (4128),(4129),(4130),(4131),(4132),(4133),(4134),(4135),(4136),(4137), + (4138),(4139),(4140),(4141),(4142),(4143),(4144),(4145),(4146),(4147), + (4148),(4149),(4150),(4151),(4152),(4153),(4154),(4155),(4156),(4157), + (4158),(4159),(4160),(4161),(4162),(4163),(4164),(4165),(4166),(4167), + (4168),(4169),(4170),(4171),(4172),(4173),(4174),(4175),(4176),(4177), + (4178),(4179),(4180),(4181),(4182),(4183),(4184),(4185),(4186),(4187), + (4188),(4189),(4190),(4191),(4192),(4193),(4194),(4195),(4196),(4197), + (4198),(4199),(4200),(4201),(4202),(4203),(4204),(4205),(4206),(4207), + (4208),(4209),(4210),(4211),(4212),(4213),(4214),(4215),(4216),(4217), + (4218),(4219),(4220),(4221),(4222),(4223),(4224),(4225),(4226),(4227), + (4228),(4229),(4230),(4231),(4232),(4233),(4234),(4235),(4236),(4237), + (4238),(4239),(4240),(4241),(4242),(4243),(4244),(4245),(4246),(4247), + (4248),(4249),(4250),(4251),(4252),(4253),(4254),(4255),(4256),(4257), + (4258),(4259),(4260),(4261),(4262),(4263),(4264),(4265),(4266),(4267), + (4268),(4269),(4270),(4271),(4272),(4273),(4274),(4275),(4276),(4277), + (4278),(4279),(4280),(4281),(4282),(4283),(4284),(4285),(4286),(4287), + (4288),(4289),(4290),(4291),(4292),(4293),(4294),(4295),(4296),(4297), + (4298),(4299),(4300),(4301),(4302),(4303),(4304),(4305),(4306),(4307), + (4308),(4309),(4310),(4311),(4312),(4313),(4314),(4315),(4316),(4317), + (4318),(4319),(4320),(4321),(4322),(4323),(4324),(4325),(4326),(4327), + (4328),(4329),(4330),(4331),(4332),(4333),(4334),(4335),(4336),(4337), + (4338),(4339),(4340),(4341),(4342),(4343),(4344),(4345),(4346),(4347), + (4348),(4349),(4350),(4351),(4352),(4353),(4354),(4355),(4356),(4357), + (4358),(4359),(4360),(4361),(4362),(4363),(4364),(4365),(4366),(4367), + (4368),(4369),(4370),(4371),(4372),(4373),(4374),(4375),(4376),(4377), + (4378),(4379),(4380),(4381),(4382),(4383),(4384),(4385),(4386),(4387), + (4388),(4389),(4390),(4391),(4392),(4393),(4394),(4395),(4396),(4397), + (4398),(4399),(4400),(4401),(4402),(4403),(4404),(4405),(4406),(4407), + (4408),(4409),(4410),(4411),(4412),(4413),(4414),(4415),(4416),(4417), + (4418),(4419),(4420),(4421),(4422),(4423),(4424),(4425),(4426),(4427), + (4428),(4429),(4430),(4431),(4432),(4433),(4434),(4435),(4436),(4437), + (4438),(4439),(4440),(4441),(4442),(4443),(4444),(4445),(4446),(4447), + (4448),(4449),(4450),(4451),(4452),(4453),(4454),(4455),(4456),(4457), + (4458),(4459),(4460),(4461),(4462),(4463),(4464),(4465),(4466),(4467), + (4468),(4469),(4470),(4471),(4472),(4473),(4474),(4475),(4476),(4477), + (4478),(4479),(4480),(4481),(4482),(4483),(4484),(4485),(4486),(4487), + (4488),(4489),(4490),(4491),(4492),(4493),(4494),(4495),(4496),(4497), + (4498),(4499),(4500),(4501),(4502),(4503),(4504),(4505),(4506),(4507), + (4508),(4509),(4510),(4511),(4512),(4513),(4514),(4515),(4516),(4517), + (4518),(4519),(4520),(4521),(4522),(4523),(4524),(4525),(4526),(4527), + (4528),(4529),(4530),(4531),(4532),(4533),(4534),(4535),(4536),(4537), + (4538),(4539),(4540),(4541),(4542),(4543),(4544),(4545),(4546),(4547), + (4548),(4549),(4550),(4551),(4552),(4553),(4554),(4555),(4556),(4557), + (4558),(4559),(4560),(4561),(4562),(4563),(4564),(4565),(4566),(4567), + (4568),(4569),(4570),(4571),(4572),(4573),(4574),(4575),(4576),(4577), + (4578),(4579),(4580),(4581),(4582),(4583),(4584),(4585),(4586),(4587), + (4588),(4589),(4590),(4591),(4592),(4593),(4594),(4595),(4596),(4597), + (4598),(4599),(4600),(4601),(4602),(4603),(4604),(4605),(4606),(4607), + (4608),(4609),(4610),(4611),(4612),(4613),(4614),(4615),(4616),(4617), + (4618),(4619),(4620),(4621),(4622),(4623),(4624),(4625),(4626),(4627), + (4628),(4629),(4630),(4631),(4632),(4633),(4634),(4635),(4636),(4637), + (4638),(4639),(4640),(4641),(4642),(4643),(4644),(4645),(4646),(4647), + (4648),(4649),(4650),(4651),(4652),(4653),(4654),(4655),(4656),(4657), + (4658),(4659),(4660),(4661),(4662),(4663),(4664),(4665),(4666),(4667), + (4668),(4669),(4670),(4671),(4672),(4673),(4674),(4675),(4676),(4677), + (4678),(4679),(4680),(4681),(4682),(4683),(4684),(4685),(4686),(4687), + (4688),(4689),(4690),(4691),(4692),(4693),(4694),(4695),(4696),(4697), + (4698),(4699),(4700),(4701),(4702),(4703),(4704),(4705),(4706),(4707), + (4708),(4709),(4710),(4711),(4712),(4713),(4714),(4715),(4716),(4717), + (4718),(4719),(4720),(4721),(4722),(4723),(4724),(4725),(4726),(4727), + (4728),(4729),(4730),(4731),(4732),(4733),(4734),(4735),(4736),(4737), + (4738),(4739),(4740),(4741),(4742),(4743),(4744),(4745),(4746),(4747), + (4748),(4749),(4750),(4751),(4752),(4753),(4754),(4755),(4756),(4757), + (4758),(4759),(4760),(4761),(4762),(4763),(4764),(4765),(4766),(4767), + (4768),(4769),(4770),(4771),(4772),(4773),(4774),(4775),(4776),(4777), + (4778),(4779),(4780),(4781),(4782),(4783),(4784),(4785),(4786),(4787), + (4788),(4789),(4790),(4791),(4792),(4793),(4794),(4795),(4796),(4797), + (4798),(4799),(4800),(4801),(4802),(4803),(4804),(4805),(4806),(4807), + (4808),(4809),(4810),(4811),(4812),(4813),(4814),(4815),(4816),(4817), + (4818),(4819),(4820),(4821),(4822),(4823),(4824),(4825),(4826),(4827), + (4828),(4829),(4830),(4831),(4832),(4833),(4834),(4835),(4836),(4837), + (4838),(4839),(4840),(4841),(4842),(4843),(4844),(4845),(4846),(4847), + (4848),(4849),(4850),(4851),(4852),(4853),(4854),(4855),(4856),(4857), + (4858),(4859),(4860),(4861),(4862),(4863),(4864),(4865),(4866),(4867), + (4868),(4869),(4870),(4871),(4872),(4873),(4874),(4875),(4876),(4877), + (4878),(4879),(4880),(4881),(4882),(4883),(4884),(4885),(4886),(4887), + (4888),(4889),(4890),(4891),(4892),(4893),(4894),(4895),(4896),(4897), + (4898),(4899),(4900),(4901),(4902),(4903),(4904),(4905),(4906),(4907), + (4908),(4909),(4910),(4911),(4912),(4913),(4914),(4915),(4916),(4917), + (4918),(4919),(4920),(4921),(4922),(4923),(4924),(4925),(4926),(4927), + (4928),(4929),(4930),(4931),(4932),(4933),(4934),(4935),(4936),(4937), + (4938),(4939),(4940),(4941),(4942),(4943),(4944),(4945),(4946),(4947), + (4948),(4949),(4950),(4951),(4952),(4953),(4954),(4955),(4956),(4957), + (4958),(4959),(4960),(4961),(4962),(4963),(4964),(4965),(4966),(4967), + (4968),(4969),(4970),(4971),(4972),(4973),(4974),(4975),(4976),(4977), + (4978),(4979),(4980),(4981),(4982),(4983),(4984),(4985),(4986),(4987), + (4988),(4989),(4990),(4991),(4992),(4993),(4994),(4995),(4996),(4997), + (4998),(4999),(5000),(5001),(5002),(5003),(5004),(5005),(5006),(5007), + (5008),(5009),(5010),(5011),(5012),(5013),(5014),(5015),(5016),(5017), + (5018),(5019),(5020),(5021),(5022),(5023),(5024),(5025),(5026),(5027), + (5028),(5029),(5030),(5031),(5032),(5033),(5034),(5035),(5036),(5037), + (5038),(5039),(5040),(5041),(5042),(5043),(5044),(5045),(5046),(5047), + (5048),(5049),(5050),(5051),(5052),(5053),(5054),(5055),(5056),(5057), + (5058),(5059),(5060),(5061),(5062),(5063),(5064),(5065),(5066),(5067), + (5068),(5069),(5070),(5071),(5072),(5073),(5074),(5075),(5076),(5077), + (5078),(5079),(5080),(5081),(5082),(5083),(5084),(5085),(5086),(5087), + (5088),(5089),(5090),(5091),(5092),(5093),(5094),(5095),(5096),(5097), + (5098),(5099),(5100),(5101),(5102),(5103),(5104),(5105),(5106),(5107), + (5108),(5109),(5110),(5111),(5112),(5113),(5114),(5115),(5116),(5117), + (5118),(5119),(5120),(5121),(5122),(5123),(5124),(5125),(5126),(5127), + (5128),(5129),(5130),(5131),(5132),(5133),(5134),(5135),(5136),(5137), + (5138),(5139),(5140),(5141),(5142),(5143),(5144),(5145),(5146),(5147), + (5148),(5149),(5150),(5151),(5152),(5153),(5154),(5155),(5156),(5157), + (5158),(5159),(5160),(5161),(5162),(5163),(5164),(5165),(5166),(5167), + (5168),(5169),(5170),(5171),(5172),(5173),(5174),(5175),(5176),(5177), + (5178),(5179),(5180),(5181),(5182),(5183),(5184),(5185),(5186),(5187), + (5188),(5189),(5190),(5191),(5192),(5193),(5194),(5195),(5196),(5197), + (5198),(5199),(5200),(5201),(5202),(5203),(5204),(5205),(5206),(5207), + (5208),(5209),(5210),(5211),(5212),(5213),(5214),(5215),(5216),(5217), + (5218),(5219),(5220),(5221),(5222),(5223),(5224),(5225),(5226),(5227), + (5228),(5229),(5230),(5231),(5232),(5233),(5234),(5235),(5236),(5237), + (5238),(5239),(5240),(5241),(5242),(5243),(5244),(5245),(5246),(5247), + (5248),(5249),(5250),(5251),(5252),(5253),(5254),(5255),(5256),(5257), + (5258),(5259),(5260),(5261),(5262),(5263),(5264),(5265),(5266),(5267), + (5268),(5269),(5270),(5271),(5272),(5273),(5274),(5275),(5276),(5277), + (5278),(5279),(5280),(5281),(5282),(5283),(5284),(5285),(5286),(5287), + (5288),(5289),(5290),(5291),(5292),(5293),(5294),(5295),(5296),(5297), + (5298),(5299),(5300),(5301),(5302),(5303),(5304),(5305),(5306),(5307), + (5308),(5309),(5310),(5311),(5312),(5313),(5314),(5315),(5316),(5317), + (5318),(5319),(5320),(5321),(5322),(5323),(5324),(5325),(5326),(5327), + (5328),(5329),(5330),(5331),(5332),(5333),(5334),(5335),(5336),(5337), + (5338),(5339),(5340),(5341),(5342),(5343),(5344),(5345),(5346),(5347), + (5348),(5349),(5350),(5351),(5352),(5353),(5354),(5355),(5356),(5357), + (5358),(5359),(5360),(5361),(5362),(5363),(5364),(5365),(5366),(5367), + (5368),(5369),(5370),(5371),(5372),(5373),(5374),(5375),(5376),(5377), + (5378),(5379),(5380),(5381),(5382),(5383),(5384),(5385),(5386),(5387), + (5388),(5389),(5390),(5391),(5392),(5393),(5394),(5395),(5396),(5397), + (5398),(5399),(5400),(5401),(5402),(5403),(5404),(5405),(5406),(5407), + (5408),(5409),(5410),(5411),(5412),(5413),(5414),(5415),(5416),(5417), + (5418),(5419),(5420),(5421),(5422),(5423),(5424),(5425),(5426),(5427), + (5428),(5429),(5430),(5431),(5432),(5433),(5434),(5435),(5436),(5437), + (5438),(5439),(5440),(5441),(5442),(5443),(5444),(5445),(5446),(5447), + (5448),(5449),(5450),(5451),(5452),(5453),(5454),(5455),(5456),(5457), + (5458),(5459),(5460),(5461),(5462),(5463),(5464),(5465),(5466),(5467), + (5468),(5469),(5470),(5471),(5472),(5473),(5474),(5475),(5476),(5477), + (5478),(5479),(5480),(5481),(5482),(5483),(5484),(5485),(5486),(5487), + (5488),(5489),(5490),(5491),(5492),(5493),(5494),(5495),(5496),(5497), + (5498),(5499),(5500),(5501),(5502),(5503),(5504),(5505),(5506),(5507), + (5508),(5509),(5510),(5511),(5512),(5513),(5514),(5515),(5516),(5517), + (5518),(5519),(5520),(5521),(5522),(5523),(5524),(5525),(5526),(5527), + (5528),(5529),(5530),(5531),(5532),(5533),(5534),(5535),(5536),(5537), + (5538),(5539),(5540),(5541),(5542),(5543),(5544),(5545),(5546),(5547), + (5548),(5549),(5550),(5551),(5552),(5553),(5554),(5555),(5556),(5557), + (5558),(5559),(5560),(5561),(5562),(5563),(5564),(5565),(5566),(5567), + (5568),(5569),(5570),(5571),(5572),(5573),(5574),(5575),(5576),(5577), + (5578),(5579),(5580),(5581),(5582),(5583),(5584),(5585),(5586),(5587), + (5588),(5589),(5590),(5591),(5592),(5593),(5594),(5595),(5596),(5597), + (5598),(5599),(5600),(5601),(5602),(5603),(5604),(5605),(5606),(5607), + (5608),(5609),(5610),(5611),(5612),(5613),(5614),(5615),(5616),(5617), + (5618),(5619),(5620),(5621),(5622),(5623),(5624),(5625),(5626),(5627), + (5628),(5629),(5630),(5631),(5632),(5633),(5634),(5635),(5636),(5637), + (5638),(5639),(5640),(5641),(5642),(5643),(5644),(5645),(5646),(5647), + (5648),(5649),(5650),(5651),(5652),(5653),(5654),(5655),(5656),(5657), + (5658),(5659),(5660),(5661),(5662),(5663),(5664),(5665),(5666),(5667), + (5668),(5669),(5670),(5671),(5672),(5673),(5674),(5675),(5676),(5677), + (5678),(5679),(5680),(5681),(5682),(5683),(5684),(5685),(5686),(5687), + (5688),(5689),(5690),(5691),(5692),(5693),(5694),(5695),(5696),(5697), + (5698),(5699),(5700),(5701),(5702),(5703),(5704),(5705),(5706),(5707), + (5708),(5709),(5710),(5711),(5712),(5713),(5714),(5715),(5716),(5717), + (5718),(5719),(5720),(5721),(5722),(5723),(5724),(5725),(5726),(5727), + (5728),(5729),(5730),(5731),(5732),(5733),(5734),(5735),(5736),(5737), + (5738),(5739),(5740),(5741),(5742),(5743),(5744),(5745),(5746),(5747), + (5748),(5749),(5750),(5751),(5752),(5753),(5754),(5755),(5756),(5757), + (5758),(5759),(5760),(5761),(5762),(5763),(5764),(5765),(5766),(5767), + (5768),(5769),(5770),(5771),(5772),(5773),(5774),(5775),(5776),(5777), + (5778),(5779),(5780),(5781),(5782),(5783),(5784),(5785),(5786),(5787), + (5788),(5789),(5790),(5791),(5792),(5793),(5794),(5795),(5796),(5797), + (5798),(5799),(5800),(5801),(5802),(5803),(5804),(5805),(5806),(5807), + (5808),(5809),(5810),(5811),(5812),(5813),(5814),(5815),(5816),(5817), + (5818),(5819),(5820),(5821),(5822),(5823),(5824),(5825),(5826),(5827), + (5828),(5829),(5830),(5831),(5832),(5833),(5834),(5835),(5836),(5837), + (5838),(5839),(5840),(5841),(5842),(5843),(5844),(5845),(5846),(5847), + (5848),(5849),(5850),(5851),(5852),(5853),(5854),(5855),(5856),(5857), + (5858),(5859),(5860),(5861),(5862),(5863),(5864),(5865),(5866),(5867), + (5868),(5869),(5870),(5871),(5872),(5873),(5874),(5875),(5876),(5877), + (5878),(5879),(5880),(5881),(5882),(5883),(5884),(5885),(5886),(5887), + (5888),(5889),(5890),(5891),(5892),(5893),(5894),(5895),(5896),(5897), + (5898),(5899),(5900),(5901),(5902),(5903),(5904),(5905),(5906),(5907), + (5908),(5909),(5910),(5911),(5912),(5913),(5914),(5915),(5916),(5917), + (5918),(5919),(5920),(5921),(5922),(5923),(5924),(5925),(5926),(5927), + (5928),(5929),(5930),(5931),(5932),(5933),(5934),(5935),(5936),(5937), + (5938),(5939),(5940),(5941),(5942),(5943),(5944),(5945),(5946),(5947), + (5948),(5949),(5950),(5951),(5952),(5953),(5954),(5955),(5956),(5957), + (5958),(5959),(5960),(5961),(5962),(5963),(5964),(5965),(5966),(5967), + (5968),(5969),(5970),(5971),(5972),(5973),(5974),(5975),(5976),(5977), + (5978),(5979),(5980),(5981),(5982),(5983),(5984),(5985),(5986),(5987), + (5988),(5989),(5990),(5991),(5992),(5993),(5994),(5995),(5996),(5997), + (5998),(5999),(6000),(6001),(6002),(6003),(6004),(6005),(6006),(6007), + (6008),(6009),(6010),(6011),(6012),(6013),(6014),(6015),(6016),(6017), + (6018),(6019),(6020),(6021),(6022),(6023),(6024),(6025),(6026),(6027), + (6028),(6029),(6030),(6031),(6032),(6033),(6034),(6035),(6036),(6037), + (6038),(6039),(6040),(6041),(6042),(6043),(6044),(6045),(6046),(6047), + (6048),(6049),(6050),(6051),(6052),(6053),(6054),(6055),(6056),(6057), + (6058),(6059),(6060),(6061),(6062),(6063),(6064),(6065),(6066),(6067), + (6068),(6069),(6070),(6071),(6072),(6073),(6074),(6075),(6076),(6077), + (6078),(6079),(6080),(6081),(6082),(6083),(6084),(6085),(6086),(6087), + (6088),(6089),(6090),(6091),(6092),(6093),(6094),(6095),(6096),(6097), + (6098),(6099),(6100),(6101),(6102),(6103),(6104),(6105),(6106),(6107), + (6108),(6109),(6110),(6111),(6112),(6113),(6114),(6115),(6116),(6117), + (6118),(6119),(6120),(6121),(6122),(6123),(6124),(6125),(6126),(6127), + (6128),(6129),(6130),(6131),(6132),(6133),(6134),(6135),(6136),(6137), + (6138),(6139),(6140),(6141),(6142),(6143),(6144),(6145),(6146),(6147), + (6148),(6149),(6150),(6151),(6152),(6153),(6154),(6155),(6156),(6157), + (6158),(6159),(6160),(6161),(6162),(6163),(6164),(6165),(6166),(6167), + (6168),(6169),(6170),(6171),(6172),(6173),(6174),(6175),(6176),(6177), + (6178),(6179),(6180),(6181),(6182),(6183),(6184),(6185),(6186),(6187), + (6188),(6189),(6190),(6191),(6192),(6193),(6194),(6195),(6196),(6197), + (6198),(6199),(6200),(6201),(6202),(6203),(6204),(6205),(6206),(6207), + (6208),(6209),(6210),(6211),(6212),(6213),(6214),(6215),(6216),(6217), + (6218),(6219),(6220),(6221),(6222),(6223),(6224),(6225),(6226),(6227), + (6228),(6229),(6230),(6231),(6232),(6233),(6234),(6235),(6236),(6237), + (6238),(6239),(6240),(6241),(6242),(6243),(6244),(6245),(6246),(6247), + (6248),(6249),(6250),(6251),(6252),(6253),(6254),(6255),(6256),(6257), + (6258),(6259),(6260),(6261),(6262),(6263),(6264),(6265),(6266),(6267), + (6268),(6269),(6270),(6271),(6272),(6273),(6274),(6275),(6276),(6277), + (6278),(6279),(6280),(6281),(6282),(6283),(6284),(6285),(6286),(6287), + (6288),(6289),(6290),(6291),(6292),(6293),(6294),(6295),(6296),(6297), + (6298),(6299),(6300),(6301),(6302),(6303),(6304),(6305),(6306),(6307), + (6308),(6309),(6310),(6311),(6312),(6313),(6314),(6315),(6316),(6317), + (6318),(6319),(6320),(6321),(6322),(6323),(6324),(6325),(6326),(6327), + (6328),(6329),(6330),(6331),(6332),(6333),(6334),(6335),(6336),(6337), + (6338),(6339),(6340),(6341),(6342),(6343),(6344),(6345),(6346),(6347), + (6348),(6349),(6350),(6351),(6352),(6353),(6354),(6355),(6356),(6357), + (6358),(6359),(6360),(6361),(6362),(6363),(6364),(6365),(6366),(6367), + (6368),(6369),(6370),(6371),(6372),(6373),(6374),(6375),(6376),(6377), + (6378),(6379),(6380),(6381),(6382),(6383),(6384),(6385),(6386),(6387), + (6388),(6389),(6390),(6391),(6392),(6393),(6394),(6395),(6396),(6397), + (6398),(6399),(6400),(6401),(6402),(6403),(6404),(6405),(6406),(6407), + (6408),(6409),(6410),(6411),(6412),(6413),(6414),(6415),(6416),(6417), + (6418),(6419),(6420),(6421),(6422),(6423),(6424),(6425),(6426),(6427), + (6428),(6429),(6430),(6431),(6432),(6433),(6434),(6435),(6436),(6437), + (6438),(6439),(6440),(6441),(6442),(6443),(6444),(6445),(6446),(6447), + (6448),(6449),(6450),(6451),(6452),(6453),(6454),(6455),(6456),(6457), + (6458),(6459),(6460),(6461),(6462),(6463),(6464),(6465),(6466),(6467), + (6468),(6469),(6470),(6471),(6472),(6473),(6474),(6475),(6476),(6477), + (6478),(6479),(6480),(6481),(6482),(6483),(6484),(6485),(6486),(6487), + (6488),(6489),(6490),(6491),(6492),(6493),(6494),(6495),(6496),(6497), + (6498),(6499),(6500),(6501),(6502),(6503),(6504),(6505),(6506),(6507), + (6508),(6509),(6510),(6511),(6512),(6513),(6514),(6515),(6516),(6517), + (6518),(6519),(6520),(6521),(6522),(6523),(6524),(6525),(6526),(6527), + (6528),(6529),(6530),(6531),(6532),(6533),(6534),(6535),(6536),(6537), + (6538),(6539),(6540),(6541),(6542),(6543),(6544),(6545),(6546),(6547), + (6548),(6549),(6550),(6551),(6552),(6553),(6554),(6555),(6556),(6557), + (6558),(6559),(6560),(6561),(6562),(6563),(6564),(6565),(6566),(6567), + (6568),(6569),(6570),(6571),(6572),(6573),(6574),(6575),(6576),(6577), + (6578),(6579),(6580),(6581),(6582),(6583),(6584),(6585),(6586),(6587), + (6588),(6589),(6590),(6591),(6592),(6593),(6594),(6595),(6596),(6597), + (6598),(6599),(6600),(6601),(6602),(6603),(6604),(6605),(6606),(6607), + (6608),(6609),(6610),(6611),(6612),(6613),(6614),(6615),(6616),(6617), + (6618),(6619),(6620),(6621),(6622),(6623),(6624),(6625),(6626),(6627), + (6628),(6629),(6630),(6631),(6632),(6633),(6634),(6635),(6636),(6637), + (6638),(6639),(6640),(6641),(6642),(6643),(6644),(6645),(6646),(6647), + (6648),(6649),(6650),(6651),(6652),(6653),(6654),(6655),(6656),(6657), + (6658),(6659),(6660),(6661),(6662),(6663),(6664),(6665),(6666),(6667), + (6668),(6669),(6670),(6671),(6672),(6673),(6674),(6675),(6676),(6677), + (6678),(6679),(6680),(6681),(6682),(6683),(6684),(6685),(6686),(6687), + (6688),(6689),(6690),(6691),(6692),(6693),(6694),(6695),(6696),(6697), + (6698),(6699),(6700),(6701),(6702),(6703),(6704),(6705),(6706),(6707), + (6708),(6709),(6710),(6711),(6712),(6713),(6714),(6715),(6716),(6717), + (6718),(6719),(6720),(6721),(6722),(6723),(6724),(6725),(6726),(6727), + (6728),(6729),(6730),(6731),(6732),(6733),(6734),(6735),(6736),(6737), + (6738),(6739),(6740),(6741),(6742),(6743),(6744),(6745),(6746),(6747), + (6748),(6749),(6750),(6751),(6752),(6753),(6754),(6755),(6756),(6757), + (6758),(6759),(6760),(6761),(6762),(6763),(6764),(6765),(6766),(6767), + (6768),(6769),(6770),(6771),(6772),(6773),(6774),(6775),(6776),(6777), + (6778),(6779),(6780),(6781),(6782),(6783),(6784),(6785),(6786),(6787), + (6788),(6789),(6790),(6791),(6792),(6793),(6794),(6795),(6796),(6797), + (6798),(6799),(6800),(6801),(6802),(6803),(6804),(6805),(6806),(6807), + (6808),(6809),(6810),(6811),(6812),(6813),(6814),(6815),(6816),(6817), + (6818),(6819),(6820),(6821),(6822),(6823),(6824),(6825),(6826),(6827), + (6828),(6829),(6830),(6831),(6832),(6833),(6834),(6835),(6836),(6837), + (6838),(6839),(6840),(6841),(6842),(6843),(6844),(6845),(6846),(6847), + (6848),(6849),(6850),(6851),(6852),(6853),(6854),(6855),(6856),(6857), + (6858),(6859),(6860),(6861),(6862),(6863),(6864),(6865),(6866),(6867), + (6868),(6869),(6870),(6871),(6872),(6873),(6874),(6875),(6876),(6877), + (6878),(6879),(6880),(6881),(6882),(6883),(6884),(6885),(6886),(6887), + (6888),(6889),(6890),(6891),(6892),(6893),(6894),(6895),(6896),(6897), + (6898),(6899),(6900),(6901),(6902),(6903),(6904),(6905),(6906),(6907), + (6908),(6909),(6910),(6911),(6912),(6913),(6914),(6915),(6916),(6917), + (6918),(6919),(6920),(6921),(6922),(6923),(6924),(6925),(6926),(6927), + (6928),(6929),(6930),(6931),(6932),(6933),(6934),(6935),(6936),(6937), + (6938),(6939),(6940),(6941),(6942),(6943),(6944),(6945),(6946),(6947), + (6948),(6949),(6950),(6951),(6952),(6953),(6954),(6955),(6956),(6957), + (6958),(6959),(6960),(6961),(6962),(6963),(6964),(6965),(6966),(6967), + (6968),(6969),(6970),(6971),(6972),(6973),(6974),(6975),(6976),(6977), + (6978),(6979),(6980),(6981),(6982),(6983),(6984),(6985),(6986),(6987), + (6988),(6989),(6990),(6991),(6992),(6993),(6994),(6995),(6996),(6997), + (6998),(6999),(7000),(7001),(7002),(7003),(7004),(7005),(7006),(7007), + (7008),(7009),(7010),(7011),(7012),(7013),(7014),(7015),(7016),(7017), + (7018),(7019),(7020),(7021),(7022),(7023),(7024),(7025),(7026),(7027), + (7028),(7029),(7030),(7031),(7032),(7033),(7034),(7035),(7036),(7037), + (7038),(7039),(7040),(7041),(7042),(7043),(7044),(7045),(7046),(7047), + (7048),(7049),(7050),(7051),(7052),(7053),(7054),(7055),(7056),(7057), + (7058),(7059),(7060),(7061),(7062),(7063),(7064),(7065),(7066),(7067), + (7068),(7069),(7070),(7071),(7072),(7073),(7074),(7075),(7076),(7077), + (7078),(7079),(7080),(7081),(7082),(7083),(7084),(7085),(7086),(7087), + (7088),(7089),(7090),(7091),(7092),(7093),(7094),(7095),(7096),(7097), + (7098),(7099),(7100),(7101),(7102),(7103),(7104),(7105),(7106),(7107), + (7108),(7109),(7110),(7111),(7112),(7113),(7114),(7115),(7116),(7117), + (7118),(7119),(7120),(7121),(7122),(7123),(7124),(7125),(7126),(7127), + (7128),(7129),(7130),(7131),(7132),(7133),(7134),(7135),(7136),(7137), + (7138),(7139),(7140),(7141),(7142),(7143),(7144),(7145),(7146),(7147), + (7148),(7149),(7150),(7151),(7152),(7153),(7154),(7155),(7156),(7157), + (7158),(7159),(7160),(7161),(7162),(7163),(7164),(7165),(7166),(7167), + (7168),(7169),(7170),(7171),(7172),(7173),(7174),(7175),(7176),(7177), + (7178),(7179),(7180),(7181),(7182),(7183),(7184),(7185),(7186),(7187), + (7188),(7189),(7190),(7191),(7192),(7193),(7194),(7195),(7196),(7197), + (7198),(7199),(7200),(7201),(7202),(7203),(7204),(7205),(7206),(7207), + (7208),(7209),(7210),(7211),(7212),(7213),(7214),(7215),(7216),(7217), + (7218),(7219),(7220),(7221),(7222),(7223),(7224),(7225),(7226),(7227), + (7228),(7229),(7230),(7231),(7232),(7233),(7234),(7235),(7236),(7237), + (7238),(7239),(7240),(7241),(7242),(7243),(7244),(7245),(7246),(7247), + (7248),(7249),(7250),(7251),(7252),(7253),(7254),(7255),(7256),(7257), + (7258),(7259),(7260),(7261),(7262),(7263),(7264),(7265),(7266),(7267), + (7268),(7269),(7270),(7271),(7272),(7273),(7274),(7275),(7276),(7277), + (7278),(7279),(7280),(7281),(7282),(7283),(7284),(7285),(7286),(7287), + (7288),(7289),(7290),(7291),(7292),(7293),(7294),(7295),(7296),(7297), + (7298),(7299),(7300),(7301),(7302),(7303),(7304),(7305),(7306),(7307), + (7308),(7309),(7310),(7311),(7312),(7313),(7314),(7315),(7316),(7317), + (7318),(7319),(7320),(7321),(7322),(7323),(7324),(7325),(7326),(7327), + (7328),(7329),(7330),(7331),(7332),(7333),(7334),(7335),(7336),(7337), + (7338),(7339),(7340),(7341),(7342),(7343),(7344),(7345),(7346),(7347), + (7348),(7349),(7350),(7351),(7352),(7353),(7354),(7355),(7356),(7357), + (7358),(7359),(7360),(7361),(7362),(7363),(7364),(7365),(7366),(7367), + (7368),(7369),(7370),(7371),(7372),(7373),(7374),(7375),(7376),(7377), + (7378),(7379),(7380),(7381),(7382),(7383),(7384),(7385),(7386),(7387), + (7388),(7389),(7390),(7391),(7392),(7393),(7394),(7395),(7396),(7397), + (7398),(7399),(7400),(7401),(7402),(7403),(7404),(7405),(7406),(7407), + (7408),(7409),(7410),(7411),(7412),(7413),(7414),(7415),(7416),(7417), + (7418),(7419),(7420),(7421),(7422),(7423),(7424),(7425),(7426),(7427), + (7428),(7429),(7430),(7431),(7432),(7433),(7434),(7435),(7436),(7437), + (7438),(7439),(7440),(7441),(7442),(7443),(7444),(7445),(7446),(7447), + (7448),(7449),(7450),(7451),(7452),(7453),(7454),(7455),(7456),(7457), + (7458),(7459),(7460),(7461),(7462),(7463),(7464),(7465),(7466),(7467), + (7468),(7469),(7470),(7471),(7472),(7473),(7474),(7475),(7476),(7477), + (7478),(7479),(7480),(7481),(7482),(7483),(7484),(7485),(7486),(7487), + (7488),(7489),(7490),(7491),(7492),(7493),(7494),(7495),(7496),(7497), + (7498),(7499),(7500),(7501),(7502),(7503),(7504),(7505),(7506),(7507), + (7508),(7509),(7510),(7511),(7512),(7513),(7514),(7515),(7516),(7517), + (7518),(7519),(7520),(7521),(7522),(7523),(7524),(7525),(7526),(7527), + (7528),(7529),(7530),(7531),(7532),(7533),(7534),(7535),(7536),(7537), + (7538),(7539),(7540),(7541),(7542),(7543),(7544),(7545),(7546),(7547), + (7548),(7549),(7550),(7551),(7552),(7553),(7554),(7555),(7556),(7557), + (7558),(7559),(7560),(7561),(7562),(7563),(7564),(7565),(7566),(7567), + (7568),(7569),(7570),(7571),(7572),(7573),(7574),(7575),(7576),(7577), + (7578),(7579),(7580),(7581),(7582),(7583),(7584),(7585),(7586),(7587), + (7588),(7589),(7590),(7591),(7592),(7593),(7594),(7595),(7596),(7597), + (7598),(7599),(7600),(7601),(7602),(7603),(7604),(7605),(7606),(7607), + (7608),(7609),(7610),(7611),(7612),(7613),(7614),(7615),(7616),(7617), + (7618),(7619),(7620),(7621),(7622),(7623),(7624),(7625),(7626),(7627), + (7628),(7629),(7630),(7631),(7632),(7633),(7634),(7635),(7636),(7637), + (7638),(7639),(7640),(7641),(7642),(7643),(7644),(7645),(7646),(7647), + (7648),(7649),(7650),(7651),(7652),(7653),(7654),(7655),(7656),(7657), + (7658),(7659),(7660),(7661),(7662),(7663),(7664),(7665),(7666),(7667), + (7668),(7669),(7670),(7671),(7672),(7673),(7674),(7675),(7676),(7677), + (7678),(7679),(7680),(7681),(7682),(7683),(7684),(7685),(7686),(7687), + (7688),(7689),(7690),(7691),(7692),(7693),(7694),(7695),(7696),(7697), + (7698),(7699),(7700),(7701),(7702),(7703),(7704),(7705),(7706),(7707), + (7708),(7709),(7710),(7711),(7712),(7713),(7714),(7715),(7716),(7717), + (7718),(7719),(7720),(7721),(7722),(7723),(7724),(7725),(7726),(7727), + (7728),(7729),(7730),(7731),(7732),(7733),(7734),(7735),(7736),(7737), + (7738),(7739),(7740),(7741),(7742),(7743),(7744),(7745),(7746),(7747), + (7748),(7749),(7750),(7751),(7752),(7753),(7754),(7755),(7756),(7757), + (7758),(7759),(7760),(7761),(7762),(7763),(7764),(7765),(7766),(7767), + (7768),(7769),(7770),(7771),(7772),(7773),(7774),(7775),(7776),(7777), + (7778),(7779),(7780),(7781),(7782),(7783),(7784),(7785),(7786),(7787), + (7788),(7789),(7790),(7791),(7792),(7793),(7794),(7795),(7796),(7797), + (7798),(7799),(7800),(7801),(7802),(7803),(7804),(7805),(7806),(7807), + (7808),(7809),(7810),(7811),(7812),(7813),(7814),(7815),(7816),(7817), + (7818),(7819),(7820),(7821),(7822),(7823),(7824),(7825),(7826),(7827), + (7828),(7829),(7830),(7831),(7832),(7833),(7834),(7835),(7836),(7837), + (7838),(7839),(7840),(7841),(7842),(7843),(7844),(7845),(7846),(7847), + (7848),(7849),(7850),(7851),(7852),(7853),(7854),(7855),(7856),(7857), + (7858),(7859),(7860),(7861),(7862),(7863),(7864),(7865),(7866),(7867), + (7868),(7869),(7870),(7871),(7872),(7873),(7874),(7875),(7876),(7877), + (7878),(7879),(7880),(7881),(7882),(7883),(7884),(7885),(7886),(7887), + (7888),(7889),(7890),(7891),(7892),(7893),(7894),(7895),(7896),(7897), + (7898),(7899),(7900),(7901),(7902),(7903),(7904),(7905),(7906),(7907), + (7908),(7909),(7910),(7911),(7912),(7913),(7914),(7915),(7916),(7917), + (7918),(7919),(7920),(7921),(7922),(7923),(7924),(7925),(7926),(7927), + (7928),(7929),(7930),(7931),(7932),(7933),(7934),(7935),(7936),(7937), + (7938),(7939),(7940),(7941),(7942),(7943),(7944),(7945),(7946),(7947), + (7948),(7949),(7950),(7951),(7952),(7953),(7954),(7955),(7956),(7957), + (7958),(7959),(7960),(7961),(7962),(7963),(7964),(7965),(7966),(7967), + (7968),(7969),(7970),(7971),(7972),(7973),(7974),(7975),(7976),(7977), + (7978),(7979),(7980),(7981),(7982),(7983),(7984),(7985),(7986),(7987), + (7988),(7989),(7990),(7991),(7992),(7993),(7994),(7995),(7996),(7997), + (7998),(7999),(8000),(8001),(8002),(8003),(8004),(8005),(8006),(8007), + (8008),(8009),(8010),(8011),(8012),(8013),(8014),(8015),(8016),(8017), + (8018),(8019),(8020),(8021),(8022),(8023),(8024),(8025),(8026),(8027), + (8028),(8029),(8030),(8031),(8032),(8033),(8034),(8035),(8036),(8037), + (8038),(8039),(8040),(8041),(8042),(8043),(8044),(8045),(8046),(8047), + (8048),(8049),(8050),(8051),(8052),(8053),(8054),(8055),(8056),(8057), + (8058),(8059),(8060),(8061),(8062),(8063),(8064),(8065),(8066),(8067), + (8068),(8069),(8070),(8071),(8072),(8073),(8074),(8075),(8076),(8077), + (8078),(8079),(8080),(8081),(8082),(8083),(8084),(8085),(8086),(8087), + (8088),(8089),(8090),(8091),(8092),(8093),(8094),(8095),(8096),(8097), + (8098),(8099),(8100),(8101),(8102),(8103),(8104),(8105),(8106),(8107), + (8108),(8109),(8110),(8111),(8112),(8113),(8114),(8115),(8116),(8117), + (8118),(8119),(8120),(8121),(8122),(8123),(8124),(8125),(8126),(8127), + (8128),(8129),(8130),(8131),(8132),(8133),(8134),(8135),(8136),(8137), + (8138),(8139),(8140),(8141),(8142),(8143),(8144),(8145),(8146),(8147), + (8148),(8149),(8150),(8151),(8152),(8153),(8154),(8155),(8156),(8157), + (8158),(8159),(8160),(8161),(8162),(8163),(8164),(8165),(8166),(8167), + (8168),(8169),(8170),(8171),(8172),(8173),(8174),(8175),(8176),(8177), + (8178),(8179),(8180),(8181),(8182),(8183),(8184),(8185),(8186),(8187), + (8188),(8189),(8190),(8191),(8192),(8193),(8194),(8195),(8196),(8197), + (8198),(8199),(8200),(8201),(8202),(8203),(8204),(8205),(8206),(8207), + (8208),(8209),(8210),(8211),(8212),(8213),(8214),(8215),(8216),(8217), + (8218),(8219),(8220),(8221),(8222),(8223),(8224),(8225),(8226),(8227), + (8228),(8229),(8230),(8231),(8232),(8233),(8234),(8235),(8236),(8237), + (8238),(8239),(8240),(8241),(8242),(8243),(8244),(8245),(8246),(8247), + (8248),(8249),(8250),(8251),(8252),(8253),(8254),(8255),(8256),(8257), + (8258),(8259),(8260),(8261),(8262),(8263),(8264),(8265),(8266),(8267), + (8268),(8269),(8270),(8271),(8272),(8273),(8274),(8275),(8276),(8277), + (8278),(8279),(8280),(8281),(8282),(8283),(8284),(8285),(8286),(8287), + (8288),(8289),(8290),(8291),(8292),(8293),(8294),(8295),(8296),(8297), + (8298),(8299),(8300),(8301),(8302),(8303),(8304),(8305),(8306),(8307), + (8308),(8309),(8310),(8311),(8312),(8313),(8314),(8315),(8316),(8317), + (8318),(8319),(8320),(8321),(8322),(8323),(8324),(8325),(8326),(8327), + (8328),(8329),(8330),(8331),(8332),(8333),(8334),(8335),(8336),(8337), + (8338),(8339),(8340),(8341),(8342),(8343),(8344),(8345),(8346),(8347), + (8348),(8349),(8350),(8351),(8352),(8353),(8354),(8355),(8356),(8357), + (8358),(8359),(8360),(8361),(8362),(8363),(8364),(8365),(8366),(8367), + (8368),(8369),(8370),(8371),(8372),(8373),(8374),(8375),(8376),(8377), + (8378),(8379),(8380),(8381),(8382),(8383),(8384),(8385),(8386),(8387), + (8388),(8389),(8390),(8391),(8392),(8393),(8394),(8395),(8396),(8397), + (8398),(8399),(8400),(8401),(8402),(8403),(8404),(8405),(8406),(8407), + (8408),(8409),(8410),(8411),(8412),(8413),(8414),(8415),(8416),(8417), + (8418),(8419),(8420),(8421),(8422),(8423),(8424),(8425),(8426),(8427), + (8428),(8429),(8430),(8431),(8432),(8433),(8434),(8435),(8436),(8437), + (8438),(8439),(8440),(8441),(8442),(8443),(8444),(8445),(8446),(8447), + (8448),(8449),(8450),(8451),(8452),(8453),(8454),(8455),(8456),(8457), + (8458),(8459),(8460),(8461),(8462),(8463),(8464),(8465),(8466),(8467), + (8468),(8469),(8470),(8471),(8472),(8473),(8474),(8475),(8476),(8477), + (8478),(8479),(8480),(8481),(8482),(8483),(8484),(8485),(8486),(8487), + (8488),(8489),(8490),(8491),(8492),(8493),(8494),(8495),(8496),(8497), + (8498),(8499),(8500),(8501),(8502),(8503),(8504),(8505),(8506),(8507), + (8508),(8509),(8510),(8511),(8512),(8513),(8514),(8515),(8516),(8517), + (8518),(8519),(8520),(8521),(8522),(8523),(8524),(8525),(8526),(8527), + (8528),(8529),(8530),(8531),(8532),(8533),(8534),(8535),(8536),(8537), + (8538),(8539),(8540),(8541),(8542),(8543),(8544),(8545),(8546),(8547), + (8548),(8549),(8550),(8551),(8552),(8553),(8554),(8555),(8556),(8557), + (8558),(8559),(8560),(8561),(8562),(8563),(8564),(8565),(8566),(8567), + (8568),(8569),(8570),(8571),(8572),(8573),(8574),(8575),(8576),(8577), + (8578),(8579),(8580),(8581),(8582),(8583),(8584),(8585),(8586),(8587), + (8588),(8589),(8590),(8591),(8592),(8593),(8594),(8595),(8596),(8597), + (8598),(8599),(8600),(8601),(8602),(8603),(8604),(8605),(8606),(8607), + (8608),(8609),(8610),(8611),(8612),(8613),(8614),(8615),(8616),(8617), + (8618),(8619),(8620),(8621),(8622),(8623),(8624),(8625),(8626),(8627), + (8628),(8629),(8630),(8631),(8632),(8633),(8634),(8635),(8636),(8637), + (8638),(8639),(8640),(8641),(8642),(8643),(8644),(8645),(8646),(8647), + (8648),(8649),(8650),(8651),(8652),(8653),(8654),(8655),(8656),(8657), + (8658),(8659),(8660),(8661),(8662),(8663),(8664),(8665),(8666),(8667), + (8668),(8669),(8670),(8671),(8672),(8673),(8674),(8675),(8676),(8677), + (8678),(8679),(8680),(8681),(8682),(8683),(8684),(8685),(8686),(8687), + (8688),(8689),(8690),(8691),(8692),(8693),(8694),(8695),(8696),(8697), + (8698),(8699),(8700),(8701),(8702),(8703),(8704),(8705),(8706),(8707), + (8708),(8709),(8710),(8711),(8712),(8713),(8714),(8715),(8716),(8717), + (8718),(8719),(8720),(8721),(8722),(8723),(8724),(8725),(8726),(8727), + (8728),(8729),(8730),(8731),(8732),(8733),(8734),(8735),(8736),(8737), + (8738),(8739),(8740),(8741),(8742),(8743),(8744),(8745),(8746),(8747), + (8748),(8749),(8750),(8751),(8752),(8753),(8754),(8755),(8756),(8757), + (8758),(8759),(8760),(8761),(8762),(8763),(8764),(8765),(8766),(8767), + (8768),(8769),(8770),(8771),(8772),(8773),(8774),(8775),(8776),(8777), + (8778),(8779),(8780),(8781),(8782),(8783),(8784),(8785),(8786),(8787), + (8788),(8789),(8790),(8791),(8792),(8793),(8794),(8795),(8796),(8797), + (8798),(8799),(8800),(8801),(8802),(8803),(8804),(8805),(8806),(8807), + (8808),(8809),(8810),(8811),(8812),(8813),(8814),(8815),(8816),(8817), + (8818),(8819),(8820),(8821),(8822),(8823),(8824),(8825),(8826),(8827), + (8828),(8829),(8830),(8831),(8832),(8833),(8834),(8835),(8836),(8837), + (8838),(8839),(8840),(8841),(8842),(8843),(8844),(8845),(8846),(8847), + (8848),(8849),(8850),(8851),(8852),(8853),(8854),(8855),(8856),(8857), + (8858),(8859),(8860),(8861),(8862),(8863),(8864),(8865),(8866),(8867), + (8868),(8869),(8870),(8871),(8872),(8873),(8874),(8875),(8876),(8877), + (8878),(8879),(8880),(8881),(8882),(8883),(8884),(8885),(8886),(8887), + (8888),(8889),(8890),(8891),(8892),(8893),(8894),(8895),(8896),(8897), + (8898),(8899),(8900),(8901),(8902),(8903),(8904),(8905),(8906),(8907), + (8908),(8909),(8910),(8911),(8912),(8913),(8914),(8915),(8916),(8917), + (8918),(8919),(8920),(8921),(8922),(8923),(8924),(8925),(8926),(8927), + (8928),(8929),(8930),(8931),(8932),(8933),(8934),(8935),(8936),(8937), + (8938),(8939),(8940),(8941),(8942),(8943),(8944),(8945),(8946),(8947), + (8948),(8949),(8950),(8951),(8952),(8953),(8954),(8955),(8956),(8957), + (8958),(8959),(8960),(8961),(8962),(8963),(8964),(8965),(8966),(8967), + (8968),(8969),(8970),(8971),(8972),(8973),(8974),(8975),(8976),(8977), + (8978),(8979),(8980),(8981),(8982),(8983),(8984),(8985),(8986),(8987), + (8988),(8989),(8990),(8991),(8992),(8993),(8994),(8995),(8996),(8997), + (8998),(8999),(9000),(9001),(9002),(9003),(9004),(9005),(9006),(9007), + (9008),(9009),(9010),(9011),(9012),(9013),(9014),(9015),(9016),(9017), + (9018),(9019),(9020),(9021),(9022),(9023),(9024),(9025),(9026),(9027), + (9028),(9029),(9030),(9031),(9032),(9033),(9034),(9035),(9036),(9037), + (9038),(9039),(9040),(9041),(9042),(9043),(9044),(9045),(9046),(9047), + (9048),(9049),(9050),(9051),(9052),(9053),(9054),(9055),(9056),(9057), + (9058),(9059),(9060),(9061),(9062),(9063),(9064),(9065),(9066),(9067), + (9068),(9069),(9070),(9071),(9072),(9073),(9074),(9075),(9076),(9077), + (9078),(9079),(9080),(9081),(9082),(9083),(9084),(9085),(9086),(9087), + (9088),(9089),(9090),(9091),(9092),(9093),(9094),(9095),(9096),(9097), + (9098),(9099),(9100),(9101),(9102),(9103),(9104),(9105),(9106),(9107), + (9108),(9109),(9110),(9111),(9112),(9113),(9114),(9115),(9116),(9117), + (9118),(9119),(9120),(9121),(9122),(9123),(9124),(9125),(9126),(9127), + (9128),(9129),(9130),(9131),(9132),(9133),(9134),(9135),(9136),(9137), + (9138),(9139),(9140),(9141),(9142),(9143),(9144),(9145),(9146),(9147), + (9148),(9149),(9150),(9151),(9152),(9153),(9154),(9155),(9156),(9157), + (9158),(9159),(9160),(9161),(9162),(9163),(9164),(9165),(9166),(9167), + (9168),(9169),(9170),(9171),(9172),(9173),(9174),(9175),(9176),(9177), + (9178),(9179),(9180),(9181),(9182),(9183),(9184),(9185),(9186),(9187), + (9188),(9189),(9190),(9191),(9192),(9193),(9194),(9195),(9196),(9197), + (9198),(9199),(9200),(9201),(9202),(9203),(9204),(9205),(9206),(9207), + (9208),(9209),(9210),(9211),(9212),(9213),(9214),(9215),(9216),(9217), + (9218),(9219),(9220),(9221),(9222),(9223),(9224),(9225),(9226),(9227), + (9228),(9229),(9230),(9231),(9232),(9233),(9234),(9235),(9236),(9237), + (9238),(9239),(9240),(9241),(9242),(9243),(9244),(9245),(9246),(9247), + (9248),(9249),(9250),(9251),(9252),(9253),(9254),(9255),(9256),(9257), + (9258),(9259),(9260),(9261),(9262),(9263),(9264),(9265),(9266),(9267), + (9268),(9269),(9270),(9271),(9272),(9273),(9274),(9275),(9276),(9277), + (9278),(9279),(9280),(9281),(9282),(9283),(9284),(9285),(9286),(9287), + (9288),(9289),(9290),(9291),(9292),(9293),(9294),(9295),(9296),(9297), + (9298),(9299),(9300),(9301),(9302),(9303),(9304),(9305),(9306),(9307), + (9308),(9309),(9310),(9311),(9312),(9313),(9314),(9315),(9316),(9317), + (9318),(9319),(9320),(9321),(9322),(9323),(9324),(9325),(9326),(9327), + (9328),(9329),(9330),(9331),(9332),(9333),(9334),(9335),(9336),(9337), + (9338),(9339),(9340),(9341),(9342),(9343),(9344),(9345),(9346),(9347), + (9348),(9349),(9350),(9351),(9352),(9353),(9354),(9355),(9356),(9357), + (9358),(9359),(9360),(9361),(9362),(9363),(9364),(9365),(9366),(9367), + (9368),(9369),(9370),(9371),(9372),(9373),(9374),(9375),(9376),(9377), + (9378),(9379),(9380),(9381),(9382),(9383),(9384),(9385),(9386),(9387), + (9388),(9389),(9390),(9391),(9392),(9393),(9394),(9395),(9396),(9397), + (9398),(9399),(9400),(9401),(9402),(9403),(9404),(9405),(9406),(9407), + (9408),(9409),(9410),(9411),(9412),(9413),(9414),(9415),(9416),(9417), + (9418),(9419),(9420),(9421),(9422),(9423),(9424),(9425),(9426),(9427), + (9428),(9429),(9430),(9431),(9432),(9433),(9434),(9435),(9436),(9437), + (9438),(9439),(9440),(9441),(9442),(9443),(9444),(9445),(9446),(9447), + (9448),(9449),(9450),(9451),(9452),(9453),(9454),(9455),(9456),(9457), + (9458),(9459),(9460),(9461),(9462),(9463),(9464),(9465),(9466),(9467), + (9468),(9469),(9470),(9471),(9472),(9473),(9474),(9475),(9476),(9477), + (9478),(9479),(9480),(9481),(9482),(9483),(9484),(9485),(9486),(9487), + (9488),(9489),(9490),(9491),(9492),(9493),(9494),(9495),(9496),(9497), + (9498),(9499),(9500),(9501),(9502),(9503),(9504),(9505),(9506),(9507), + (9508),(9509),(9510),(9511),(9512),(9513),(9514),(9515),(9516),(9517), + (9518),(9519),(9520),(9521),(9522),(9523),(9524),(9525),(9526),(9527), + (9528),(9529),(9530),(9531),(9532),(9533),(9534),(9535),(9536),(9537), + (9538),(9539),(9540),(9541),(9542),(9543),(9544),(9545),(9546),(9547), + (9548),(9549),(9550),(9551),(9552),(9553),(9554),(9555),(9556),(9557), + (9558),(9559),(9560),(9561),(9562),(9563),(9564),(9565),(9566),(9567), + (9568),(9569),(9570),(9571),(9572),(9573),(9574),(9575),(9576),(9577), + (9578),(9579),(9580),(9581),(9582),(9583),(9584),(9585),(9586),(9587), + (9588),(9589),(9590),(9591),(9592),(9593),(9594),(9595),(9596),(9597), + (9598),(9599),(9600),(9601),(9602),(9603),(9604),(9605),(9606),(9607), + (9608),(9609),(9610),(9611),(9612),(9613),(9614),(9615),(9616),(9617), + (9618),(9619),(9620),(9621),(9622),(9623),(9624),(9625),(9626),(9627), + (9628),(9629),(9630),(9631),(9632),(9633),(9634),(9635),(9636),(9637), + (9638),(9639),(9640),(9641),(9642),(9643),(9644),(9645),(9646),(9647), + (9648),(9649),(9650),(9651),(9652),(9653),(9654),(9655),(9656),(9657), + (9658),(9659),(9660),(9661),(9662),(9663),(9664),(9665),(9666),(9667), + (9668),(9669),(9670),(9671),(9672),(9673),(9674),(9675),(9676),(9677), + (9678),(9679),(9680),(9681),(9682),(9683),(9684),(9685),(9686),(9687), + (9688),(9689),(9690),(9691),(9692),(9693),(9694),(9695),(9696),(9697), + (9698),(9699),(9700),(9701),(9702),(9703),(9704),(9705),(9706),(9707), + (9708),(9709),(9710),(9711),(9712),(9713),(9714),(9715),(9716),(9717), + (9718),(9719),(9720),(9721),(9722),(9723),(9724),(9725),(9726),(9727), + (9728),(9729),(9730),(9731),(9732),(9733),(9734),(9735),(9736),(9737), + (9738),(9739),(9740),(9741),(9742),(9743),(9744),(9745),(9746),(9747), + (9748),(9749),(9750),(9751),(9752),(9753),(9754),(9755),(9756),(9757), + (9758),(9759),(9760),(9761),(9762),(9763),(9764),(9765),(9766),(9767), + (9768),(9769),(9770),(9771),(9772),(9773),(9774),(9775),(9776),(9777), + (9778),(9779),(9780),(9781),(9782),(9783),(9784),(9785),(9786),(9787), + (9788),(9789),(9790),(9791),(9792),(9793),(9794),(9795),(9796),(9797), + (9798),(9799),(9800),(9801),(9802),(9803),(9804),(9805),(9806),(9807), + (9808),(9809),(9810),(9811),(9812),(9813),(9814),(9815),(9816),(9817), + (9818),(9819),(9820),(9821),(9822),(9823),(9824),(9825),(9826),(9827), + (9828),(9829),(9830),(9831),(9832),(9833),(9834),(9835),(9836),(9837), + (9838),(9839),(9840),(9841),(9842),(9843),(9844),(9845),(9846),(9847), + (9848),(9849),(9850),(9851),(9852),(9853),(9854),(9855),(9856),(9857), + (9858),(9859),(9860),(9861),(9862),(9863),(9864),(9865),(9866),(9867), + (9868),(9869),(9870),(9871),(9872),(9873),(9874),(9875),(9876),(9877), + (9878),(9879),(9880),(9881),(9882),(9883),(9884),(9885),(9886),(9887), + (9888),(9889),(9890),(9891),(9892),(9893),(9894),(9895),(9896),(9897), + (9898),(9899),(9900),(9901),(9902),(9903),(9904),(9905),(9906),(9907), + (9908),(9909),(9910),(9911),(9912),(9913),(9914),(9915),(9916),(9917), + (9918),(9919),(9920),(9921),(9922),(9923),(9924),(9925),(9926),(9927), + (9928),(9929),(9930),(9931),(9932),(9933),(9934),(9935),(9936),(9937), + (9938),(9939),(9940),(9941),(9942),(9943),(9944),(9945),(9946),(9947), + (9948),(9949),(9950),(9951),(9952),(9953),(9954),(9955),(9956),(9957), + (9958),(9959),(9960),(9961),(9962),(9963),(9964),(9965),(9966),(9967), + (9968),(9969),(9970),(9971),(9972),(9973),(9974),(9975),(9976),(9977), + (9978),(9979),(9980),(9981),(9982),(9983),(9984),(9985),(9986),(9987), + (9988),(9989),(9990),(9991),(9992),(9993),(9994),(9995),(9996),(9997), + (9998),(9999),(10000); + SELECT count(*), min(x), max(x), sum(x) FROM t1; +} {10000 1 10000 50005000} + +finish_test From 45f54a57783d85907d4a262dd36bfa376fcba876 Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 5 Jan 2015 19:16:42 +0000 Subject: [PATCH 20/69] Handle compound-select statements originating from VALUES clauses as a special case that does not use recursion. FossilOrigin-Name: 9ce9e43af38e6bc362734463d4bfc40ff0c98f8f --- manifest | 19 ++++++------- manifest.uuid | 2 +- src/parse.y | 10 +++++-- src/select.c | 74 +++++++++++++++++++++++++++++++++++++++++++++---- src/sqliteInt.h | 2 +- 5 files changed, 85 insertions(+), 22 deletions(-) diff --git a/manifest b/manifest index 6cb20c1817..d9ca18ff03 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Towards\sgetting\sINSERT\sstatements\sto\sexcept\smany\sVALUE\sterms\s(more\sthan\nthe\slimit\simposed\sby\sSQLITE_LIMIT_COMPOUND_SELECT).\s\sThis\scheck-in\ssegfaults\non\sa\sstack\soverflow.\s\sAnd\sit\sis\sslow. -D 2015-01-05T16:27:43.075 +C Handle\scompound-select\sstatements\soriginating\sfrom\sVALUES\sclauses\sas\sa\nspecial\scase\sthat\sdoes\snot\suse\srecursion. +D 2015-01-05T19:16:42.892 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 335e2d3ff0f2455eacbfa3075fc37495e3321410 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -218,7 +218,7 @@ F src/os_win.c 91d3d08e33ec0258d180d4c8255492f47d15e007 F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21 F src/pager.c 4120a49ecd37697e28f5ed807f470b9c0b88410c F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77 -F src/parse.y 075cad65e0393df1362b87e5cd766220b880f3a7 +F src/parse.y c5d0d964f9ac023e8154cad512e54b0b6058e086 F src/pcache.c b83d160ce81ca101f98f0d27498e6d6bd49f1599 F src/pcache.h b44658c9c932d203510279439d891a2a83e12ba8 F src/pcache1.c 1e77432b40b7d3288327d9cdf399dcdfd2b6d3bf @@ -228,12 +228,12 @@ F src/printf.c 9e75a6a0b55bf61cfff7d7e19d89834a1b938236 F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e -F src/select.c 28cf616a8791ff154be86bd9a3f888440f618e78 +F src/select.c 4776e16d19296f0f93ecd9431dca8bc3e3182714 F src/shell.c 45d9c9bd7cde07845af957f2d849933b990773cf F src/sqlite.h.in ed799ff5c814227c7957eb4f4a217f67fdc0da48 F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d -F src/sqliteInt.h 3e0079855cb7b3c85dffac5bcbb1cd712ac62e65 +F src/sqliteInt.h 5d5716d8b33a61606c6ee10112f4b6df56f42725 F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c 81712116e826b0089bb221b018929536b2b5406f F src/table.c e7a09215315a978057fb42c640f890160dbcc45e @@ -1235,10 +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 fe677d13f03e24fa667efc0c2e7f5bbb99521791 -R 54acf3852000e5cc7341ca33524e221b -T *branch * many-VALUEs -T *sym-many-VALUEs * -T -sym-trunk * +P c9d65f739ad56f016c676e79aa39080be3fe868a +R 382474f6cec467234b3ff04ac38978b4 U drh -Z 9fc3f9e17e26a0964cf77234a16c2176 +Z 33ab3e676dc0271c6784ea259fd00ed6 diff --git a/manifest.uuid b/manifest.uuid index 32e2f42e5e..e3a83ccf8f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c9d65f739ad56f016c676e79aa39080be3fe868a \ No newline at end of file +9ce9e43af38e6bc362734463d4bfc40ff0c98f8f \ No newline at end of file diff --git a/src/parse.y b/src/parse.y index 4dbdbdea26..544888a228 100644 --- a/src/parse.y +++ b/src/parse.y @@ -415,14 +415,18 @@ select(A) ::= with(W) selectnowith(X). { int cnt = 0, mxSelect; p->pWith = W; if( p->pPrior ){ + u16 allValues = SF_Values; pNext = 0; for(pLoop=p; pLoop; pNext=pLoop, pLoop=pLoop->pPrior, cnt++){ pLoop->pNext = pNext; pLoop->selFlags |= SF_Compound; + allValues &= pLoop->selFlags; } - if( (p->selFlags & SF_Values)==0 - && (mxSelect = pParse->db->aLimit[SQLITE_LIMIT_COMPOUND_SELECT])>0 - && cnt>mxSelect + if( allValues ){ + p->selFlags |= SF_AllValues; + }else if( + (mxSelect = pParse->db->aLimit[SQLITE_LIMIT_COMPOUND_SELECT])>0 + && cnt>mxSelect ){ sqlite3ErrorMsg(pParse, "too many terms in compound SELECT"); } diff --git a/src/select.c b/src/select.c index bc4f8a37c3..5de489b86e 100644 --- a/src/select.c +++ b/src/select.c @@ -2076,6 +2076,66 @@ static int multiSelectOrderBy( SelectDest *pDest /* What to do with query results */ ); +/* +** Error message for when two or more terms of a compound select have different +** size result sets. +*/ +static void selectWrongNumTermsError(Parse *pParse, Select *p){ + if( p->selFlags & SF_Values ){ + sqlite3ErrorMsg(pParse, "all VALUES must have the same number of terms"); + }else{ + sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s" + " do not have the same number of result columns", selectOpName(p->op)); + } +} + +/* +** Handle the special case of a compound-select that originates from a +** VALUES clause. By handling this as a special case, we avoid deep +** recursion, and thus do not need to enforce the SQLITE_LIMIT_COMPOUND_SELECT +** on a VALUES clause. +** +** Because the Select object originates from a VALUES clause: +** (1) It has no LIMIT or OFFSET +** (2) All terms are UNION ALL +** (3) There is no ORDER BY clause +*/ +static int multiSelectValues( + Parse *pParse, /* Parsing context */ + Select *p, /* The right-most of SELECTs to be coded */ + SelectDest *pDest /* What to do with query results */ +){ + Select *pPrior; + int nExpr = p->pEList->nExpr; + int nRow = 1; + int rc = 0; + assert( p->pNext==0 ); + assert( p->selFlags & SF_AllValues ); + do{ + assert( p->selFlags & SF_Values ); + assert( p->op==TK_ALL || (p->op==TK_SELECT && p->pPrior==0) ); + assert( p->pLimit==0 ); + assert( p->pOffset==0 ); + if( p->pEList->nExpr!=nExpr ){ + selectWrongNumTermsError(pParse, p); + return 1; + } + if( p->pPrior==0 ) break; + assert( p->pPrior->pNext==p ); + p = p->pPrior; + nRow++; + }while(1); + while( p ){ + pPrior = p->pPrior; + p->pPrior = 0; + rc = sqlite3Select(pParse, p, pDest); + p->pPrior = pPrior; + if( rc ) break; + p->nSelectRow = nRow; + p = p->pNext; + } + return rc; +} /* ** This routine is called to process a compound query form from @@ -2157,17 +2217,19 @@ static int multiSelect( dest.eDest = SRT_Table; } + /* Special handling for a compound-select that originates as a VALUES clause. + */ + if( p->selFlags & SF_AllValues ){ + rc = multiSelectValues(pParse, p, &dest); + goto multi_select_end; + } + /* Make sure all SELECTs in the statement have the same number of elements ** in their result sets. */ assert( p->pEList && pPrior->pEList ); if( p->pEList->nExpr!=pPrior->pEList->nExpr ){ - if( p->selFlags & SF_Values ){ - sqlite3ErrorMsg(pParse, "all VALUES must have the same number of terms"); - }else{ - sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s" - " do not have the same number of result columns", selectOpName(p->op)); - } + selectWrongNumTermsError(pParse, p); rc = 1; goto multi_select_end; } diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 4a4137f0f6..0a1948fef8 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -2349,7 +2349,7 @@ struct Select { #define SF_HasTypeInfo 0x0020 /* FROM subqueries have Table metadata */ #define SF_Compound 0x0040 /* Part of a compound query */ #define SF_Values 0x0080 /* Synthesized from VALUES clause */ - /* 0x0100 NOT USED */ +#define SF_AllValues 0x0100 /* All terms of compound are VALUES */ #define SF_NestedFrom 0x0200 /* Part of a parenthesized FROM clause */ #define SF_MaybeConvert 0x0400 /* Need convertCompoundSelectToSubquery() */ #define SF_Recursive 0x0800 /* The recursive part of a recursive CTE */ From 3afd2b4d6d6b449ff668e7f78068ba2048dd58b3 Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 5 Jan 2015 20:04:51 +0000 Subject: [PATCH 21/69] Avoid O(N*N) behavior with very long lists of VALUES. FossilOrigin-Name: ee30fb35217f3429ee89aaad7c19f29710420e4c --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/select.c | 8 ++++++-- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index d9ca18ff03..1131d6525b 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Handle\scompound-select\sstatements\soriginating\sfrom\sVALUES\sclauses\sas\sa\nspecial\scase\sthat\sdoes\snot\suse\srecursion. -D 2015-01-05T19:16:42.892 +C Avoid\sO(N*N)\sbehavior\swith\svery\slong\slists\sof\sVALUES. +D 2015-01-05T20:04:51.191 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 335e2d3ff0f2455eacbfa3075fc37495e3321410 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -228,7 +228,7 @@ F src/printf.c 9e75a6a0b55bf61cfff7d7e19d89834a1b938236 F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e -F src/select.c 4776e16d19296f0f93ecd9431dca8bc3e3182714 +F src/select.c e4c38c75e36f28aed80a69a725d888751bfd53df F src/shell.c 45d9c9bd7cde07845af957f2d849933b990773cf F src/sqlite.h.in ed799ff5c814227c7957eb4f4a217f67fdc0da48 F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad @@ -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 c9d65f739ad56f016c676e79aa39080be3fe868a -R 382474f6cec467234b3ff04ac38978b4 +P 9ce9e43af38e6bc362734463d4bfc40ff0c98f8f +R 7d358a2d55ab9540987f678e54c3928e U drh -Z 33ab3e676dc0271c6784ea259fd00ed6 +Z 9bf53124e75790b3e22f8f45574d11c9 diff --git a/manifest.uuid b/manifest.uuid index e3a83ccf8f..c565f584a5 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9ce9e43af38e6bc362734463d4bfc40ff0c98f8f \ No newline at end of file +ee30fb35217f3429ee89aaad7c19f29710420e4c \ No newline at end of file diff --git a/src/select.c b/src/select.c index 5de489b86e..78b1caea8d 100644 --- a/src/select.c +++ b/src/select.c @@ -4115,7 +4115,9 @@ static int selectExpander(Walker *pWalker, Select *p){ } pTabList = p->pSrc; pEList = p->pEList; - sqlite3WithPush(pParse, findRightmost(p)->pWith, 0); + if( pWalker->xSelectCallback2==selectPopWith ){ + sqlite3WithPush(pParse, findRightmost(p)->pWith, 0); + } /* Make sure cursor numbers have been assigned to all entries in ** the FROM clause of the SELECT statement. @@ -4406,7 +4408,9 @@ static void sqlite3SelectExpand(Parse *pParse, Select *pSelect){ sqlite3WalkSelect(&w, pSelect); } w.xSelectCallback = selectExpander; - w.xSelectCallback2 = selectPopWith; + if( (pSelect->selFlags & SF_AllValues)==0 ){ + w.xSelectCallback2 = selectPopWith; + } sqlite3WalkSelect(&w, pSelect); } From 6fab3d469adcebf213dd561c621d18d01f9a0413 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 6 Jan 2015 16:53:49 +0000 Subject: [PATCH 22/69] Improved and more rigorous test of large VALUES clauses. FossilOrigin-Name: 6917d9f437224229fa103c847c2df87ade64e1e9 --- manifest | 13 +- manifest.uuid | 2 +- test/selectG.test | 1005 +-------------------------------------------- 3 files changed, 25 insertions(+), 995 deletions(-) diff --git a/manifest b/manifest index 757ebba6c7..4563309ff7 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Enhance\s"INSERT\sINTO\s...\sVALUES"\sso\sthat\sthe\snumber\sof\srows\sin\sthe\sVALUES\sclause\nis\snot\slimited\sby\sSQLITE_LIMIT_COMPOUND_SELECT,\sand\sso\sthat\sthe\sstack\sdepth\nis\sconstant\sregardless\sof\sthe\snumber\sof\srows\sin\sVALUES. -D 2015-01-05T20:13:49.895 +C Improved\sand\smore\srigorous\stest\sof\slarge\sVALUES\sclauses. +D 2015-01-06T16:53:49.824 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 335e2d3ff0f2455eacbfa3075fc37495e3321410 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -840,7 +840,7 @@ F test/selectC.test 871fb55d884d3de5943c4057ebd22c2459e71977 F test/selectD.test b0f02a04ef7737decb24e08be2c39b9664b43394 F test/selectE.test fc02a1eb04c8eb537091482644b7d778ae8759b7 F test/selectF.test 21c94e6438f76537b72532fa9fd4710cdd455fc3 -F test/selectG.test 6425730374fb1ebf9897b64db5a2c2550eff6ee7 +F test/selectG.test e8600e379589e85e9fefd2fe4d44a4cdd63f6982 F test/server1.test 46803bd3fe8b99b30dbc5ff38ffc756f5c13a118 F test/shared.test 1da9dbad400cee0d93f252ccf76e1ae007a63746 F test/shared2.test 03eb4a8d372e290107d34b6ce1809919a698e879 @@ -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 fe677d13f03e24fa667efc0c2e7f5bbb99521791 ee30fb35217f3429ee89aaad7c19f29710420e4c -R 7d358a2d55ab9540987f678e54c3928e -T +closed ee30fb35217f3429ee89aaad7c19f29710420e4c +P e1c4a359aacfce97eb1652624789e71981e0d263 +R e91ef90a16bba44cf708262fb6cb820b U drh -Z cdc7cc4706725ec9fb1dc2fba8453ff0 +Z 19b2f03fd6d61f381622fb62b54f6f32 diff --git a/manifest.uuid b/manifest.uuid index 7dc9c816e6..0767c77fe9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e1c4a359aacfce97eb1652624789e71981e0d263 \ No newline at end of file +6917d9f437224229fa103c847c2df87ade64e1e9 \ No newline at end of file diff --git a/test/selectG.test b/test/selectG.test index 01b4b02cba..86d89b121b 100644 --- a/test/selectG.test +++ b/test/selectG.test @@ -17,992 +17,23 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix selectG -do_execsql_test 100 { - CREATE TABLE t1(x); - INSERT INTO t1(x) VALUES(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12), - (13),(14),(15),(16),(17),(18),(19),(20),(21),(22),(23),(24),(25),(26), - (27),(28),(29),(30),(31),(32),(33),(34),(35),(36),(37),(38),(39),(40), - (41),(42),(43),(44),(45),(46),(47),(48),(49),(50),(51),(52),(53),(54), - (55),(56),(57),(58),(59),(60),(61),(62),(63),(64),(65),(66),(67),(68), - (69),(70),(71),(72),(73),(74),(75),(76),(77),(78),(79),(80),(81),(82), - (83),(84),(85),(86),(87),(88),(89),(90),(91),(92),(93),(94),(95),(96), - (97),(98),(99),(100),(101),(102),(103),(104),(105),(106),(107),(108), - (109),(110),(111),(112),(113),(114),(115),(116),(117),(118),(119),(120), - (121),(122),(123),(124),(125),(126),(127),(128),(129),(130),(131),(132), - (133),(134),(135),(136),(137),(138),(139),(140),(141),(142),(143),(144), - (145),(146),(147),(148),(149),(150),(151),(152),(153),(154),(155),(156), - (157),(158),(159),(160),(161),(162),(163),(164),(165),(166),(167),(168), - (169),(170),(171),(172),(173),(174),(175),(176),(177),(178),(179),(180), - (181),(182),(183),(184),(185),(186),(187),(188),(189),(190),(191),(192), - (193),(194),(195),(196),(197),(198),(199),(200),(201),(202),(203),(204), - (205),(206),(207),(208),(209),(210),(211),(212),(213),(214),(215),(216), - (217),(218),(219),(220),(221),(222),(223),(224),(225),(226),(227),(228), - (229),(230),(231),(232),(233),(234),(235),(236),(237),(238),(239),(240), - (241),(242),(243),(244),(245),(246),(247),(248),(249),(250),(251),(252), - (253),(254),(255),(256),(257),(258),(259),(260),(261),(262),(263),(264), - (265),(266),(267),(268),(269),(270),(271),(272),(273),(274),(275),(276), - (277),(278),(279),(280),(281),(282),(283),(284),(285),(286),(287),(288), - (289),(290),(291),(292),(293),(294),(295),(296),(297),(298),(299),(300), - (301),(302),(303),(304),(305),(306),(307),(308),(309),(310),(311),(312), - (313),(314),(315),(316),(317),(318),(319),(320),(321),(322),(323),(324), - (325),(326),(327),(328),(329),(330),(331),(332),(333),(334),(335),(336), - (337),(338),(339),(340),(341),(342),(343),(344),(345),(346),(347),(348), - (349),(350),(351),(352),(353),(354),(355),(356),(357),(358),(359),(360), - (361),(362),(363),(364),(365),(366),(367),(368),(369),(370),(371),(372), - (373),(374),(375),(376),(377),(378),(379),(380),(381),(382),(383),(384), - (385),(386),(387),(388),(389),(390),(391),(392),(393),(394),(395),(396), - (397),(398),(399),(400),(401),(402),(403),(404),(405),(406),(407),(408), - (409),(410),(411),(412),(413),(414),(415),(416),(417),(418),(419),(420), - (421),(422),(423),(424),(425),(426),(427),(428),(429),(430),(431),(432), - (433),(434),(435),(436),(437),(438),(439),(440),(441),(442),(443),(444), - (445),(446),(447),(448),(449),(450),(451),(452),(453),(454),(455),(456), - (457),(458),(459),(460),(461),(462),(463),(464),(465),(466),(467),(468), - (469),(470),(471),(472),(473),(474),(475),(476),(477),(478),(479),(480), - (481),(482),(483),(484),(485),(486),(487),(488),(489),(490),(491),(492), - (493),(494),(495),(496),(497),(498),(499),(500),(501),(502),(503),(504), - (505),(506),(507),(508),(509),(510),(511),(512),(513),(514),(515),(516), - (517),(518),(519),(520),(521),(522),(523),(524),(525),(526),(527),(528), - (529),(530),(531),(532),(533),(534),(535),(536),(537),(538),(539),(540), - (541),(542),(543),(544),(545),(546),(547),(548),(549),(550),(551),(552), - (553),(554),(555),(556),(557),(558),(559),(560),(561),(562),(563),(564), - (565),(566),(567),(568),(569),(570),(571),(572),(573),(574),(575),(576), - (577),(578),(579),(580),(581),(582),(583),(584),(585),(586),(587),(588), - (589),(590),(591),(592),(593),(594),(595),(596),(597),(598),(599),(600), - (601),(602),(603),(604),(605),(606),(607),(608),(609),(610),(611),(612), - (613),(614),(615),(616),(617),(618),(619),(620),(621),(622),(623),(624), - (625),(626),(627),(628),(629),(630),(631),(632),(633),(634),(635),(636), - (637),(638),(639),(640),(641),(642),(643),(644),(645),(646),(647),(648), - (649),(650),(651),(652),(653),(654),(655),(656),(657),(658),(659),(660), - (661),(662),(663),(664),(665),(666),(667),(668),(669),(670),(671),(672), - (673),(674),(675),(676),(677),(678),(679),(680),(681),(682),(683),(684), - (685),(686),(687),(688),(689),(690),(691),(692),(693),(694),(695),(696), - (697),(698),(699),(700),(701),(702),(703),(704),(705),(706),(707),(708), - (709),(710),(711),(712),(713),(714),(715),(716),(717),(718),(719),(720), - (721),(722),(723),(724),(725),(726),(727),(728),(729),(730),(731),(732), - (733),(734),(735),(736),(737),(738),(739),(740),(741),(742),(743),(744), - (745),(746),(747),(748),(749),(750),(751),(752),(753),(754),(755),(756), - (757),(758),(759),(760),(761),(762),(763),(764),(765),(766),(767),(768), - (769),(770),(771),(772),(773),(774),(775),(776),(777),(778),(779),(780), - (781),(782),(783),(784),(785),(786),(787),(788),(789),(790),(791),(792), - (793),(794),(795),(796),(797),(798),(799),(800),(801),(802),(803),(804), - (805),(806),(807),(808),(809),(810),(811),(812),(813),(814),(815),(816), - (817),(818),(819),(820),(821),(822),(823),(824),(825),(826),(827),(828), - (829),(830),(831),(832),(833),(834),(835),(836),(837),(838),(839),(840), - (841),(842),(843),(844),(845),(846),(847),(848),(849),(850),(851),(852), - (853),(854),(855),(856),(857),(858),(859),(860),(861),(862),(863),(864), - (865),(866),(867),(868),(869),(870),(871),(872),(873),(874),(875),(876), - (877),(878),(879),(880),(881),(882),(883),(884),(885),(886),(887),(888), - (889),(890),(891),(892),(893),(894),(895),(896),(897),(898),(899),(900), - (901),(902),(903),(904),(905),(906),(907),(908),(909),(910),(911),(912), - (913),(914),(915),(916),(917),(918),(919),(920),(921),(922),(923),(924), - (925),(926),(927),(928),(929),(930),(931),(932),(933),(934),(935),(936), - (937),(938),(939),(940),(941),(942),(943),(944),(945),(946),(947),(948), - (949),(950),(951),(952),(953),(954),(955),(956),(957),(958),(959),(960), - (961),(962),(963),(964),(965),(966),(967),(968),(969),(970),(971),(972), - (973),(974),(975),(976),(977),(978),(979),(980),(981),(982),(983),(984), - (985),(986),(987),(988),(989),(990),(991),(992),(993),(994),(995),(996), - (997),(998),(999),(1000),(1001),(1002),(1003),(1004),(1005),(1006),(1007), - (1008),(1009),(1010),(1011),(1012),(1013),(1014),(1015),(1016),(1017), - (1018),(1019),(1020),(1021),(1022),(1023),(1024),(1025),(1026),(1027), - (1028),(1029),(1030),(1031),(1032),(1033),(1034),(1035),(1036),(1037), - (1038),(1039),(1040),(1041),(1042),(1043),(1044),(1045),(1046),(1047), - (1048),(1049),(1050),(1051),(1052),(1053),(1054),(1055),(1056),(1057), - (1058),(1059),(1060),(1061),(1062),(1063),(1064),(1065),(1066),(1067), - (1068),(1069),(1070),(1071),(1072),(1073),(1074),(1075),(1076),(1077), - (1078),(1079),(1080),(1081),(1082),(1083),(1084),(1085),(1086),(1087), - (1088),(1089),(1090),(1091),(1092),(1093),(1094),(1095),(1096),(1097), - (1098),(1099),(1100),(1101),(1102),(1103),(1104),(1105),(1106),(1107), - (1108),(1109),(1110),(1111),(1112),(1113),(1114),(1115),(1116),(1117), - (1118),(1119),(1120),(1121),(1122),(1123),(1124),(1125),(1126),(1127), - (1128),(1129),(1130),(1131),(1132),(1133),(1134),(1135),(1136),(1137), - (1138),(1139),(1140),(1141),(1142),(1143),(1144),(1145),(1146),(1147), - (1148),(1149),(1150),(1151),(1152),(1153),(1154),(1155),(1156),(1157), - (1158),(1159),(1160),(1161),(1162),(1163),(1164),(1165),(1166),(1167), - (1168),(1169),(1170),(1171),(1172),(1173),(1174),(1175),(1176),(1177), - (1178),(1179),(1180),(1181),(1182),(1183),(1184),(1185),(1186),(1187), - (1188),(1189),(1190),(1191),(1192),(1193),(1194),(1195),(1196),(1197), - (1198),(1199),(1200),(1201),(1202),(1203),(1204),(1205),(1206),(1207), - (1208),(1209),(1210),(1211),(1212),(1213),(1214),(1215),(1216),(1217), - (1218),(1219),(1220),(1221),(1222),(1223),(1224),(1225),(1226),(1227), - (1228),(1229),(1230),(1231),(1232),(1233),(1234),(1235),(1236),(1237), - (1238),(1239),(1240),(1241),(1242),(1243),(1244),(1245),(1246),(1247), - (1248),(1249),(1250),(1251),(1252),(1253),(1254),(1255),(1256),(1257), - (1258),(1259),(1260),(1261),(1262),(1263),(1264),(1265),(1266),(1267), - (1268),(1269),(1270),(1271),(1272),(1273),(1274),(1275),(1276),(1277), - (1278),(1279),(1280),(1281),(1282),(1283),(1284),(1285),(1286),(1287), - (1288),(1289),(1290),(1291),(1292),(1293),(1294),(1295),(1296),(1297), - (1298),(1299),(1300),(1301),(1302),(1303),(1304),(1305),(1306),(1307), - (1308),(1309),(1310),(1311),(1312),(1313),(1314),(1315),(1316),(1317), - (1318),(1319),(1320),(1321),(1322),(1323),(1324),(1325),(1326),(1327), - (1328),(1329),(1330),(1331),(1332),(1333),(1334),(1335),(1336),(1337), - (1338),(1339),(1340),(1341),(1342),(1343),(1344),(1345),(1346),(1347), - (1348),(1349),(1350),(1351),(1352),(1353),(1354),(1355),(1356),(1357), - (1358),(1359),(1360),(1361),(1362),(1363),(1364),(1365),(1366),(1367), - (1368),(1369),(1370),(1371),(1372),(1373),(1374),(1375),(1376),(1377), - (1378),(1379),(1380),(1381),(1382),(1383),(1384),(1385),(1386),(1387), - (1388),(1389),(1390),(1391),(1392),(1393),(1394),(1395),(1396),(1397), - (1398),(1399),(1400),(1401),(1402),(1403),(1404),(1405),(1406),(1407), - (1408),(1409),(1410),(1411),(1412),(1413),(1414),(1415),(1416),(1417), - (1418),(1419),(1420),(1421),(1422),(1423),(1424),(1425),(1426),(1427), - (1428),(1429),(1430),(1431),(1432),(1433),(1434),(1435),(1436),(1437), - (1438),(1439),(1440),(1441),(1442),(1443),(1444),(1445),(1446),(1447), - (1448),(1449),(1450),(1451),(1452),(1453),(1454),(1455),(1456),(1457), - (1458),(1459),(1460),(1461),(1462),(1463),(1464),(1465),(1466),(1467), - (1468),(1469),(1470),(1471),(1472),(1473),(1474),(1475),(1476),(1477), - (1478),(1479),(1480),(1481),(1482),(1483),(1484),(1485),(1486),(1487), - (1488),(1489),(1490),(1491),(1492),(1493),(1494),(1495),(1496),(1497), - (1498),(1499),(1500),(1501),(1502),(1503),(1504),(1505),(1506),(1507), - (1508),(1509),(1510),(1511),(1512),(1513),(1514),(1515),(1516),(1517), - (1518),(1519),(1520),(1521),(1522),(1523),(1524),(1525),(1526),(1527), - (1528),(1529),(1530),(1531),(1532),(1533),(1534),(1535),(1536),(1537), - (1538),(1539),(1540),(1541),(1542),(1543),(1544),(1545),(1546),(1547), - (1548),(1549),(1550),(1551),(1552),(1553),(1554),(1555),(1556),(1557), - (1558),(1559),(1560),(1561),(1562),(1563),(1564),(1565),(1566),(1567), - (1568),(1569),(1570),(1571),(1572),(1573),(1574),(1575),(1576),(1577), - (1578),(1579),(1580),(1581),(1582),(1583),(1584),(1585),(1586),(1587), - (1588),(1589),(1590),(1591),(1592),(1593),(1594),(1595),(1596),(1597), - (1598),(1599),(1600),(1601),(1602),(1603),(1604),(1605),(1606),(1607), - (1608),(1609),(1610),(1611),(1612),(1613),(1614),(1615),(1616),(1617), - (1618),(1619),(1620),(1621),(1622),(1623),(1624),(1625),(1626),(1627), - (1628),(1629),(1630),(1631),(1632),(1633),(1634),(1635),(1636),(1637), - (1638),(1639),(1640),(1641),(1642),(1643),(1644),(1645),(1646),(1647), - (1648),(1649),(1650),(1651),(1652),(1653),(1654),(1655),(1656),(1657), - (1658),(1659),(1660),(1661),(1662),(1663),(1664),(1665),(1666),(1667), - (1668),(1669),(1670),(1671),(1672),(1673),(1674),(1675),(1676),(1677), - (1678),(1679),(1680),(1681),(1682),(1683),(1684),(1685),(1686),(1687), - (1688),(1689),(1690),(1691),(1692),(1693),(1694),(1695),(1696),(1697), - (1698),(1699),(1700),(1701),(1702),(1703),(1704),(1705),(1706),(1707), - (1708),(1709),(1710),(1711),(1712),(1713),(1714),(1715),(1716),(1717), - (1718),(1719),(1720),(1721),(1722),(1723),(1724),(1725),(1726),(1727), - (1728),(1729),(1730),(1731),(1732),(1733),(1734),(1735),(1736),(1737), - (1738),(1739),(1740),(1741),(1742),(1743),(1744),(1745),(1746),(1747), - (1748),(1749),(1750),(1751),(1752),(1753),(1754),(1755),(1756),(1757), - (1758),(1759),(1760),(1761),(1762),(1763),(1764),(1765),(1766),(1767), - (1768),(1769),(1770),(1771),(1772),(1773),(1774),(1775),(1776),(1777), - (1778),(1779),(1780),(1781),(1782),(1783),(1784),(1785),(1786),(1787), - (1788),(1789),(1790),(1791),(1792),(1793),(1794),(1795),(1796),(1797), - (1798),(1799),(1800),(1801),(1802),(1803),(1804),(1805),(1806),(1807), - (1808),(1809),(1810),(1811),(1812),(1813),(1814),(1815),(1816),(1817), - (1818),(1819),(1820),(1821),(1822),(1823),(1824),(1825),(1826),(1827), - (1828),(1829),(1830),(1831),(1832),(1833),(1834),(1835),(1836),(1837), - (1838),(1839),(1840),(1841),(1842),(1843),(1844),(1845),(1846),(1847), - (1848),(1849),(1850),(1851),(1852),(1853),(1854),(1855),(1856),(1857), - (1858),(1859),(1860),(1861),(1862),(1863),(1864),(1865),(1866),(1867), - (1868),(1869),(1870),(1871),(1872),(1873),(1874),(1875),(1876),(1877), - (1878),(1879),(1880),(1881),(1882),(1883),(1884),(1885),(1886),(1887), - (1888),(1889),(1890),(1891),(1892),(1893),(1894),(1895),(1896),(1897), - (1898),(1899),(1900),(1901),(1902),(1903),(1904),(1905),(1906),(1907), - (1908),(1909),(1910),(1911),(1912),(1913),(1914),(1915),(1916),(1917), - (1918),(1919),(1920),(1921),(1922),(1923),(1924),(1925),(1926),(1927), - (1928),(1929),(1930),(1931),(1932),(1933),(1934),(1935),(1936),(1937), - (1938),(1939),(1940),(1941),(1942),(1943),(1944),(1945),(1946),(1947), - (1948),(1949),(1950),(1951),(1952),(1953),(1954),(1955),(1956),(1957), - (1958),(1959),(1960),(1961),(1962),(1963),(1964),(1965),(1966),(1967), - (1968),(1969),(1970),(1971),(1972),(1973),(1974),(1975),(1976),(1977), - (1978),(1979),(1980),(1981),(1982),(1983),(1984),(1985),(1986),(1987), - (1988),(1989),(1990),(1991),(1992),(1993),(1994),(1995),(1996),(1997), - (1998),(1999),(2000),(2001),(2002),(2003),(2004),(2005),(2006),(2007), - (2008),(2009),(2010),(2011),(2012),(2013),(2014),(2015),(2016),(2017), - (2018),(2019),(2020),(2021),(2022),(2023),(2024),(2025),(2026),(2027), - (2028),(2029),(2030),(2031),(2032),(2033),(2034),(2035),(2036),(2037), - (2038),(2039),(2040),(2041),(2042),(2043),(2044),(2045),(2046),(2047), - (2048),(2049),(2050),(2051),(2052),(2053),(2054),(2055),(2056),(2057), - (2058),(2059),(2060),(2061),(2062),(2063),(2064),(2065),(2066),(2067), - (2068),(2069),(2070),(2071),(2072),(2073),(2074),(2075),(2076),(2077), - (2078),(2079),(2080),(2081),(2082),(2083),(2084),(2085),(2086),(2087), - (2088),(2089),(2090),(2091),(2092),(2093),(2094),(2095),(2096),(2097), - (2098),(2099),(2100),(2101),(2102),(2103),(2104),(2105),(2106),(2107), - (2108),(2109),(2110),(2111),(2112),(2113),(2114),(2115),(2116),(2117), - (2118),(2119),(2120),(2121),(2122),(2123),(2124),(2125),(2126),(2127), - (2128),(2129),(2130),(2131),(2132),(2133),(2134),(2135),(2136),(2137), - (2138),(2139),(2140),(2141),(2142),(2143),(2144),(2145),(2146),(2147), - (2148),(2149),(2150),(2151),(2152),(2153),(2154),(2155),(2156),(2157), - (2158),(2159),(2160),(2161),(2162),(2163),(2164),(2165),(2166),(2167), - (2168),(2169),(2170),(2171),(2172),(2173),(2174),(2175),(2176),(2177), - (2178),(2179),(2180),(2181),(2182),(2183),(2184),(2185),(2186),(2187), - (2188),(2189),(2190),(2191),(2192),(2193),(2194),(2195),(2196),(2197), - (2198),(2199),(2200),(2201),(2202),(2203),(2204),(2205),(2206),(2207), - (2208),(2209),(2210),(2211),(2212),(2213),(2214),(2215),(2216),(2217), - (2218),(2219),(2220),(2221),(2222),(2223),(2224),(2225),(2226),(2227), - (2228),(2229),(2230),(2231),(2232),(2233),(2234),(2235),(2236),(2237), - (2238),(2239),(2240),(2241),(2242),(2243),(2244),(2245),(2246),(2247), - (2248),(2249),(2250),(2251),(2252),(2253),(2254),(2255),(2256),(2257), - (2258),(2259),(2260),(2261),(2262),(2263),(2264),(2265),(2266),(2267), - (2268),(2269),(2270),(2271),(2272),(2273),(2274),(2275),(2276),(2277), - (2278),(2279),(2280),(2281),(2282),(2283),(2284),(2285),(2286),(2287), - (2288),(2289),(2290),(2291),(2292),(2293),(2294),(2295),(2296),(2297), - (2298),(2299),(2300),(2301),(2302),(2303),(2304),(2305),(2306),(2307), - (2308),(2309),(2310),(2311),(2312),(2313),(2314),(2315),(2316),(2317), - (2318),(2319),(2320),(2321),(2322),(2323),(2324),(2325),(2326),(2327), - (2328),(2329),(2330),(2331),(2332),(2333),(2334),(2335),(2336),(2337), - (2338),(2339),(2340),(2341),(2342),(2343),(2344),(2345),(2346),(2347), - (2348),(2349),(2350),(2351),(2352),(2353),(2354),(2355),(2356),(2357), - (2358),(2359),(2360),(2361),(2362),(2363),(2364),(2365),(2366),(2367), - (2368),(2369),(2370),(2371),(2372),(2373),(2374),(2375),(2376),(2377), - (2378),(2379),(2380),(2381),(2382),(2383),(2384),(2385),(2386),(2387), - (2388),(2389),(2390),(2391),(2392),(2393),(2394),(2395),(2396),(2397), - (2398),(2399),(2400),(2401),(2402),(2403),(2404),(2405),(2406),(2407), - (2408),(2409),(2410),(2411),(2412),(2413),(2414),(2415),(2416),(2417), - (2418),(2419),(2420),(2421),(2422),(2423),(2424),(2425),(2426),(2427), - (2428),(2429),(2430),(2431),(2432),(2433),(2434),(2435),(2436),(2437), - (2438),(2439),(2440),(2441),(2442),(2443),(2444),(2445),(2446),(2447), - (2448),(2449),(2450),(2451),(2452),(2453),(2454),(2455),(2456),(2457), - (2458),(2459),(2460),(2461),(2462),(2463),(2464),(2465),(2466),(2467), - (2468),(2469),(2470),(2471),(2472),(2473),(2474),(2475),(2476),(2477), - (2478),(2479),(2480),(2481),(2482),(2483),(2484),(2485),(2486),(2487), - (2488),(2489),(2490),(2491),(2492),(2493),(2494),(2495),(2496),(2497), - (2498),(2499),(2500),(2501),(2502),(2503),(2504),(2505),(2506),(2507), - (2508),(2509),(2510),(2511),(2512),(2513),(2514),(2515),(2516),(2517), - (2518),(2519),(2520),(2521),(2522),(2523),(2524),(2525),(2526),(2527), - (2528),(2529),(2530),(2531),(2532),(2533),(2534),(2535),(2536),(2537), - (2538),(2539),(2540),(2541),(2542),(2543),(2544),(2545),(2546),(2547), - (2548),(2549),(2550),(2551),(2552),(2553),(2554),(2555),(2556),(2557), - (2558),(2559),(2560),(2561),(2562),(2563),(2564),(2565),(2566),(2567), - (2568),(2569),(2570),(2571),(2572),(2573),(2574),(2575),(2576),(2577), - (2578),(2579),(2580),(2581),(2582),(2583),(2584),(2585),(2586),(2587), - (2588),(2589),(2590),(2591),(2592),(2593),(2594),(2595),(2596),(2597), - (2598),(2599),(2600),(2601),(2602),(2603),(2604),(2605),(2606),(2607), - (2608),(2609),(2610),(2611),(2612),(2613),(2614),(2615),(2616),(2617), - (2618),(2619),(2620),(2621),(2622),(2623),(2624),(2625),(2626),(2627), - (2628),(2629),(2630),(2631),(2632),(2633),(2634),(2635),(2636),(2637), - (2638),(2639),(2640),(2641),(2642),(2643),(2644),(2645),(2646),(2647), - (2648),(2649),(2650),(2651),(2652),(2653),(2654),(2655),(2656),(2657), - (2658),(2659),(2660),(2661),(2662),(2663),(2664),(2665),(2666),(2667), - (2668),(2669),(2670),(2671),(2672),(2673),(2674),(2675),(2676),(2677), - (2678),(2679),(2680),(2681),(2682),(2683),(2684),(2685),(2686),(2687), - (2688),(2689),(2690),(2691),(2692),(2693),(2694),(2695),(2696),(2697), - (2698),(2699),(2700),(2701),(2702),(2703),(2704),(2705),(2706),(2707), - (2708),(2709),(2710),(2711),(2712),(2713),(2714),(2715),(2716),(2717), - (2718),(2719),(2720),(2721),(2722),(2723),(2724),(2725),(2726),(2727), - (2728),(2729),(2730),(2731),(2732),(2733),(2734),(2735),(2736),(2737), - (2738),(2739),(2740),(2741),(2742),(2743),(2744),(2745),(2746),(2747), - (2748),(2749),(2750),(2751),(2752),(2753),(2754),(2755),(2756),(2757), - (2758),(2759),(2760),(2761),(2762),(2763),(2764),(2765),(2766),(2767), - (2768),(2769),(2770),(2771),(2772),(2773),(2774),(2775),(2776),(2777), - (2778),(2779),(2780),(2781),(2782),(2783),(2784),(2785),(2786),(2787), - (2788),(2789),(2790),(2791),(2792),(2793),(2794),(2795),(2796),(2797), - (2798),(2799),(2800),(2801),(2802),(2803),(2804),(2805),(2806),(2807), - (2808),(2809),(2810),(2811),(2812),(2813),(2814),(2815),(2816),(2817), - (2818),(2819),(2820),(2821),(2822),(2823),(2824),(2825),(2826),(2827), - (2828),(2829),(2830),(2831),(2832),(2833),(2834),(2835),(2836),(2837), - (2838),(2839),(2840),(2841),(2842),(2843),(2844),(2845),(2846),(2847), - (2848),(2849),(2850),(2851),(2852),(2853),(2854),(2855),(2856),(2857), - (2858),(2859),(2860),(2861),(2862),(2863),(2864),(2865),(2866),(2867), - (2868),(2869),(2870),(2871),(2872),(2873),(2874),(2875),(2876),(2877), - (2878),(2879),(2880),(2881),(2882),(2883),(2884),(2885),(2886),(2887), - (2888),(2889),(2890),(2891),(2892),(2893),(2894),(2895),(2896),(2897), - (2898),(2899),(2900),(2901),(2902),(2903),(2904),(2905),(2906),(2907), - (2908),(2909),(2910),(2911),(2912),(2913),(2914),(2915),(2916),(2917), - (2918),(2919),(2920),(2921),(2922),(2923),(2924),(2925),(2926),(2927), - (2928),(2929),(2930),(2931),(2932),(2933),(2934),(2935),(2936),(2937), - (2938),(2939),(2940),(2941),(2942),(2943),(2944),(2945),(2946),(2947), - (2948),(2949),(2950),(2951),(2952),(2953),(2954),(2955),(2956),(2957), - (2958),(2959),(2960),(2961),(2962),(2963),(2964),(2965),(2966),(2967), - (2968),(2969),(2970),(2971),(2972),(2973),(2974),(2975),(2976),(2977), - (2978),(2979),(2980),(2981),(2982),(2983),(2984),(2985),(2986),(2987), - (2988),(2989),(2990),(2991),(2992),(2993),(2994),(2995),(2996),(2997), - (2998),(2999),(3000),(3001),(3002),(3003),(3004),(3005),(3006),(3007), - (3008),(3009),(3010),(3011),(3012),(3013),(3014),(3015),(3016),(3017), - (3018),(3019),(3020),(3021),(3022),(3023),(3024),(3025),(3026),(3027), - (3028),(3029),(3030),(3031),(3032),(3033),(3034),(3035),(3036),(3037), - (3038),(3039),(3040),(3041),(3042),(3043),(3044),(3045),(3046),(3047), - (3048),(3049),(3050),(3051),(3052),(3053),(3054),(3055),(3056),(3057), - (3058),(3059),(3060),(3061),(3062),(3063),(3064),(3065),(3066),(3067), - (3068),(3069),(3070),(3071),(3072),(3073),(3074),(3075),(3076),(3077), - (3078),(3079),(3080),(3081),(3082),(3083),(3084),(3085),(3086),(3087), - (3088),(3089),(3090),(3091),(3092),(3093),(3094),(3095),(3096),(3097), - (3098),(3099),(3100),(3101),(3102),(3103),(3104),(3105),(3106),(3107), - (3108),(3109),(3110),(3111),(3112),(3113),(3114),(3115),(3116),(3117), - (3118),(3119),(3120),(3121),(3122),(3123),(3124),(3125),(3126),(3127), - (3128),(3129),(3130),(3131),(3132),(3133),(3134),(3135),(3136),(3137), - (3138),(3139),(3140),(3141),(3142),(3143),(3144),(3145),(3146),(3147), - (3148),(3149),(3150),(3151),(3152),(3153),(3154),(3155),(3156),(3157), - (3158),(3159),(3160),(3161),(3162),(3163),(3164),(3165),(3166),(3167), - (3168),(3169),(3170),(3171),(3172),(3173),(3174),(3175),(3176),(3177), - (3178),(3179),(3180),(3181),(3182),(3183),(3184),(3185),(3186),(3187), - (3188),(3189),(3190),(3191),(3192),(3193),(3194),(3195),(3196),(3197), - (3198),(3199),(3200),(3201),(3202),(3203),(3204),(3205),(3206),(3207), - (3208),(3209),(3210),(3211),(3212),(3213),(3214),(3215),(3216),(3217), - (3218),(3219),(3220),(3221),(3222),(3223),(3224),(3225),(3226),(3227), - (3228),(3229),(3230),(3231),(3232),(3233),(3234),(3235),(3236),(3237), - (3238),(3239),(3240),(3241),(3242),(3243),(3244),(3245),(3246),(3247), - (3248),(3249),(3250),(3251),(3252),(3253),(3254),(3255),(3256),(3257), - (3258),(3259),(3260),(3261),(3262),(3263),(3264),(3265),(3266),(3267), - (3268),(3269),(3270),(3271),(3272),(3273),(3274),(3275),(3276),(3277), - (3278),(3279),(3280),(3281),(3282),(3283),(3284),(3285),(3286),(3287), - (3288),(3289),(3290),(3291),(3292),(3293),(3294),(3295),(3296),(3297), - (3298),(3299),(3300),(3301),(3302),(3303),(3304),(3305),(3306),(3307), - (3308),(3309),(3310),(3311),(3312),(3313),(3314),(3315),(3316),(3317), - (3318),(3319),(3320),(3321),(3322),(3323),(3324),(3325),(3326),(3327), - (3328),(3329),(3330),(3331),(3332),(3333),(3334),(3335),(3336),(3337), - (3338),(3339),(3340),(3341),(3342),(3343),(3344),(3345),(3346),(3347), - (3348),(3349),(3350),(3351),(3352),(3353),(3354),(3355),(3356),(3357), - (3358),(3359),(3360),(3361),(3362),(3363),(3364),(3365),(3366),(3367), - (3368),(3369),(3370),(3371),(3372),(3373),(3374),(3375),(3376),(3377), - (3378),(3379),(3380),(3381),(3382),(3383),(3384),(3385),(3386),(3387), - (3388),(3389),(3390),(3391),(3392),(3393),(3394),(3395),(3396),(3397), - (3398),(3399),(3400),(3401),(3402),(3403),(3404),(3405),(3406),(3407), - (3408),(3409),(3410),(3411),(3412),(3413),(3414),(3415),(3416),(3417), - (3418),(3419),(3420),(3421),(3422),(3423),(3424),(3425),(3426),(3427), - (3428),(3429),(3430),(3431),(3432),(3433),(3434),(3435),(3436),(3437), - (3438),(3439),(3440),(3441),(3442),(3443),(3444),(3445),(3446),(3447), - (3448),(3449),(3450),(3451),(3452),(3453),(3454),(3455),(3456),(3457), - (3458),(3459),(3460),(3461),(3462),(3463),(3464),(3465),(3466),(3467), - (3468),(3469),(3470),(3471),(3472),(3473),(3474),(3475),(3476),(3477), - (3478),(3479),(3480),(3481),(3482),(3483),(3484),(3485),(3486),(3487), - (3488),(3489),(3490),(3491),(3492),(3493),(3494),(3495),(3496),(3497), - (3498),(3499),(3500),(3501),(3502),(3503),(3504),(3505),(3506),(3507), - (3508),(3509),(3510),(3511),(3512),(3513),(3514),(3515),(3516),(3517), - (3518),(3519),(3520),(3521),(3522),(3523),(3524),(3525),(3526),(3527), - (3528),(3529),(3530),(3531),(3532),(3533),(3534),(3535),(3536),(3537), - (3538),(3539),(3540),(3541),(3542),(3543),(3544),(3545),(3546),(3547), - (3548),(3549),(3550),(3551),(3552),(3553),(3554),(3555),(3556),(3557), - (3558),(3559),(3560),(3561),(3562),(3563),(3564),(3565),(3566),(3567), - (3568),(3569),(3570),(3571),(3572),(3573),(3574),(3575),(3576),(3577), - (3578),(3579),(3580),(3581),(3582),(3583),(3584),(3585),(3586),(3587), - (3588),(3589),(3590),(3591),(3592),(3593),(3594),(3595),(3596),(3597), - (3598),(3599),(3600),(3601),(3602),(3603),(3604),(3605),(3606),(3607), - (3608),(3609),(3610),(3611),(3612),(3613),(3614),(3615),(3616),(3617), - (3618),(3619),(3620),(3621),(3622),(3623),(3624),(3625),(3626),(3627), - (3628),(3629),(3630),(3631),(3632),(3633),(3634),(3635),(3636),(3637), - (3638),(3639),(3640),(3641),(3642),(3643),(3644),(3645),(3646),(3647), - (3648),(3649),(3650),(3651),(3652),(3653),(3654),(3655),(3656),(3657), - (3658),(3659),(3660),(3661),(3662),(3663),(3664),(3665),(3666),(3667), - (3668),(3669),(3670),(3671),(3672),(3673),(3674),(3675),(3676),(3677), - (3678),(3679),(3680),(3681),(3682),(3683),(3684),(3685),(3686),(3687), - (3688),(3689),(3690),(3691),(3692),(3693),(3694),(3695),(3696),(3697), - (3698),(3699),(3700),(3701),(3702),(3703),(3704),(3705),(3706),(3707), - (3708),(3709),(3710),(3711),(3712),(3713),(3714),(3715),(3716),(3717), - (3718),(3719),(3720),(3721),(3722),(3723),(3724),(3725),(3726),(3727), - (3728),(3729),(3730),(3731),(3732),(3733),(3734),(3735),(3736),(3737), - (3738),(3739),(3740),(3741),(3742),(3743),(3744),(3745),(3746),(3747), - (3748),(3749),(3750),(3751),(3752),(3753),(3754),(3755),(3756),(3757), - (3758),(3759),(3760),(3761),(3762),(3763),(3764),(3765),(3766),(3767), - (3768),(3769),(3770),(3771),(3772),(3773),(3774),(3775),(3776),(3777), - (3778),(3779),(3780),(3781),(3782),(3783),(3784),(3785),(3786),(3787), - (3788),(3789),(3790),(3791),(3792),(3793),(3794),(3795),(3796),(3797), - (3798),(3799),(3800),(3801),(3802),(3803),(3804),(3805),(3806),(3807), - (3808),(3809),(3810),(3811),(3812),(3813),(3814),(3815),(3816),(3817), - (3818),(3819),(3820),(3821),(3822),(3823),(3824),(3825),(3826),(3827), - (3828),(3829),(3830),(3831),(3832),(3833),(3834),(3835),(3836),(3837), - (3838),(3839),(3840),(3841),(3842),(3843),(3844),(3845),(3846),(3847), - (3848),(3849),(3850),(3851),(3852),(3853),(3854),(3855),(3856),(3857), - (3858),(3859),(3860),(3861),(3862),(3863),(3864),(3865),(3866),(3867), - (3868),(3869),(3870),(3871),(3872),(3873),(3874),(3875),(3876),(3877), - (3878),(3879),(3880),(3881),(3882),(3883),(3884),(3885),(3886),(3887), - (3888),(3889),(3890),(3891),(3892),(3893),(3894),(3895),(3896),(3897), - (3898),(3899),(3900),(3901),(3902),(3903),(3904),(3905),(3906),(3907), - (3908),(3909),(3910),(3911),(3912),(3913),(3914),(3915),(3916),(3917), - (3918),(3919),(3920),(3921),(3922),(3923),(3924),(3925),(3926),(3927), - (3928),(3929),(3930),(3931),(3932),(3933),(3934),(3935),(3936),(3937), - (3938),(3939),(3940),(3941),(3942),(3943),(3944),(3945),(3946),(3947), - (3948),(3949),(3950),(3951),(3952),(3953),(3954),(3955),(3956),(3957), - (3958),(3959),(3960),(3961),(3962),(3963),(3964),(3965),(3966),(3967), - (3968),(3969),(3970),(3971),(3972),(3973),(3974),(3975),(3976),(3977), - (3978),(3979),(3980),(3981),(3982),(3983),(3984),(3985),(3986),(3987), - (3988),(3989),(3990),(3991),(3992),(3993),(3994),(3995),(3996),(3997), - (3998),(3999),(4000),(4001),(4002),(4003),(4004),(4005),(4006),(4007), - (4008),(4009),(4010),(4011),(4012),(4013),(4014),(4015),(4016),(4017), - (4018),(4019),(4020),(4021),(4022),(4023),(4024),(4025),(4026),(4027), - (4028),(4029),(4030),(4031),(4032),(4033),(4034),(4035),(4036),(4037), - (4038),(4039),(4040),(4041),(4042),(4043),(4044),(4045),(4046),(4047), - (4048),(4049),(4050),(4051),(4052),(4053),(4054),(4055),(4056),(4057), - (4058),(4059),(4060),(4061),(4062),(4063),(4064),(4065),(4066),(4067), - (4068),(4069),(4070),(4071),(4072),(4073),(4074),(4075),(4076),(4077), - (4078),(4079),(4080),(4081),(4082),(4083),(4084),(4085),(4086),(4087), - (4088),(4089),(4090),(4091),(4092),(4093),(4094),(4095),(4096),(4097), - (4098),(4099),(4100),(4101),(4102),(4103),(4104),(4105),(4106),(4107), - (4108),(4109),(4110),(4111),(4112),(4113),(4114),(4115),(4116),(4117), - (4118),(4119),(4120),(4121),(4122),(4123),(4124),(4125),(4126),(4127), - (4128),(4129),(4130),(4131),(4132),(4133),(4134),(4135),(4136),(4137), - (4138),(4139),(4140),(4141),(4142),(4143),(4144),(4145),(4146),(4147), - (4148),(4149),(4150),(4151),(4152),(4153),(4154),(4155),(4156),(4157), - (4158),(4159),(4160),(4161),(4162),(4163),(4164),(4165),(4166),(4167), - (4168),(4169),(4170),(4171),(4172),(4173),(4174),(4175),(4176),(4177), - (4178),(4179),(4180),(4181),(4182),(4183),(4184),(4185),(4186),(4187), - (4188),(4189),(4190),(4191),(4192),(4193),(4194),(4195),(4196),(4197), - (4198),(4199),(4200),(4201),(4202),(4203),(4204),(4205),(4206),(4207), - (4208),(4209),(4210),(4211),(4212),(4213),(4214),(4215),(4216),(4217), - (4218),(4219),(4220),(4221),(4222),(4223),(4224),(4225),(4226),(4227), - (4228),(4229),(4230),(4231),(4232),(4233),(4234),(4235),(4236),(4237), - (4238),(4239),(4240),(4241),(4242),(4243),(4244),(4245),(4246),(4247), - (4248),(4249),(4250),(4251),(4252),(4253),(4254),(4255),(4256),(4257), - (4258),(4259),(4260),(4261),(4262),(4263),(4264),(4265),(4266),(4267), - (4268),(4269),(4270),(4271),(4272),(4273),(4274),(4275),(4276),(4277), - (4278),(4279),(4280),(4281),(4282),(4283),(4284),(4285),(4286),(4287), - (4288),(4289),(4290),(4291),(4292),(4293),(4294),(4295),(4296),(4297), - (4298),(4299),(4300),(4301),(4302),(4303),(4304),(4305),(4306),(4307), - (4308),(4309),(4310),(4311),(4312),(4313),(4314),(4315),(4316),(4317), - (4318),(4319),(4320),(4321),(4322),(4323),(4324),(4325),(4326),(4327), - (4328),(4329),(4330),(4331),(4332),(4333),(4334),(4335),(4336),(4337), - (4338),(4339),(4340),(4341),(4342),(4343),(4344),(4345),(4346),(4347), - (4348),(4349),(4350),(4351),(4352),(4353),(4354),(4355),(4356),(4357), - (4358),(4359),(4360),(4361),(4362),(4363),(4364),(4365),(4366),(4367), - (4368),(4369),(4370),(4371),(4372),(4373),(4374),(4375),(4376),(4377), - (4378),(4379),(4380),(4381),(4382),(4383),(4384),(4385),(4386),(4387), - (4388),(4389),(4390),(4391),(4392),(4393),(4394),(4395),(4396),(4397), - (4398),(4399),(4400),(4401),(4402),(4403),(4404),(4405),(4406),(4407), - (4408),(4409),(4410),(4411),(4412),(4413),(4414),(4415),(4416),(4417), - (4418),(4419),(4420),(4421),(4422),(4423),(4424),(4425),(4426),(4427), - (4428),(4429),(4430),(4431),(4432),(4433),(4434),(4435),(4436),(4437), - (4438),(4439),(4440),(4441),(4442),(4443),(4444),(4445),(4446),(4447), - (4448),(4449),(4450),(4451),(4452),(4453),(4454),(4455),(4456),(4457), - (4458),(4459),(4460),(4461),(4462),(4463),(4464),(4465),(4466),(4467), - (4468),(4469),(4470),(4471),(4472),(4473),(4474),(4475),(4476),(4477), - (4478),(4479),(4480),(4481),(4482),(4483),(4484),(4485),(4486),(4487), - (4488),(4489),(4490),(4491),(4492),(4493),(4494),(4495),(4496),(4497), - (4498),(4499),(4500),(4501),(4502),(4503),(4504),(4505),(4506),(4507), - (4508),(4509),(4510),(4511),(4512),(4513),(4514),(4515),(4516),(4517), - (4518),(4519),(4520),(4521),(4522),(4523),(4524),(4525),(4526),(4527), - (4528),(4529),(4530),(4531),(4532),(4533),(4534),(4535),(4536),(4537), - (4538),(4539),(4540),(4541),(4542),(4543),(4544),(4545),(4546),(4547), - (4548),(4549),(4550),(4551),(4552),(4553),(4554),(4555),(4556),(4557), - (4558),(4559),(4560),(4561),(4562),(4563),(4564),(4565),(4566),(4567), - (4568),(4569),(4570),(4571),(4572),(4573),(4574),(4575),(4576),(4577), - (4578),(4579),(4580),(4581),(4582),(4583),(4584),(4585),(4586),(4587), - (4588),(4589),(4590),(4591),(4592),(4593),(4594),(4595),(4596),(4597), - (4598),(4599),(4600),(4601),(4602),(4603),(4604),(4605),(4606),(4607), - (4608),(4609),(4610),(4611),(4612),(4613),(4614),(4615),(4616),(4617), - (4618),(4619),(4620),(4621),(4622),(4623),(4624),(4625),(4626),(4627), - (4628),(4629),(4630),(4631),(4632),(4633),(4634),(4635),(4636),(4637), - (4638),(4639),(4640),(4641),(4642),(4643),(4644),(4645),(4646),(4647), - (4648),(4649),(4650),(4651),(4652),(4653),(4654),(4655),(4656),(4657), - (4658),(4659),(4660),(4661),(4662),(4663),(4664),(4665),(4666),(4667), - (4668),(4669),(4670),(4671),(4672),(4673),(4674),(4675),(4676),(4677), - (4678),(4679),(4680),(4681),(4682),(4683),(4684),(4685),(4686),(4687), - (4688),(4689),(4690),(4691),(4692),(4693),(4694),(4695),(4696),(4697), - (4698),(4699),(4700),(4701),(4702),(4703),(4704),(4705),(4706),(4707), - (4708),(4709),(4710),(4711),(4712),(4713),(4714),(4715),(4716),(4717), - (4718),(4719),(4720),(4721),(4722),(4723),(4724),(4725),(4726),(4727), - (4728),(4729),(4730),(4731),(4732),(4733),(4734),(4735),(4736),(4737), - (4738),(4739),(4740),(4741),(4742),(4743),(4744),(4745),(4746),(4747), - (4748),(4749),(4750),(4751),(4752),(4753),(4754),(4755),(4756),(4757), - (4758),(4759),(4760),(4761),(4762),(4763),(4764),(4765),(4766),(4767), - (4768),(4769),(4770),(4771),(4772),(4773),(4774),(4775),(4776),(4777), - (4778),(4779),(4780),(4781),(4782),(4783),(4784),(4785),(4786),(4787), - (4788),(4789),(4790),(4791),(4792),(4793),(4794),(4795),(4796),(4797), - (4798),(4799),(4800),(4801),(4802),(4803),(4804),(4805),(4806),(4807), - (4808),(4809),(4810),(4811),(4812),(4813),(4814),(4815),(4816),(4817), - (4818),(4819),(4820),(4821),(4822),(4823),(4824),(4825),(4826),(4827), - (4828),(4829),(4830),(4831),(4832),(4833),(4834),(4835),(4836),(4837), - (4838),(4839),(4840),(4841),(4842),(4843),(4844),(4845),(4846),(4847), - (4848),(4849),(4850),(4851),(4852),(4853),(4854),(4855),(4856),(4857), - (4858),(4859),(4860),(4861),(4862),(4863),(4864),(4865),(4866),(4867), - (4868),(4869),(4870),(4871),(4872),(4873),(4874),(4875),(4876),(4877), - (4878),(4879),(4880),(4881),(4882),(4883),(4884),(4885),(4886),(4887), - (4888),(4889),(4890),(4891),(4892),(4893),(4894),(4895),(4896),(4897), - (4898),(4899),(4900),(4901),(4902),(4903),(4904),(4905),(4906),(4907), - (4908),(4909),(4910),(4911),(4912),(4913),(4914),(4915),(4916),(4917), - (4918),(4919),(4920),(4921),(4922),(4923),(4924),(4925),(4926),(4927), - (4928),(4929),(4930),(4931),(4932),(4933),(4934),(4935),(4936),(4937), - (4938),(4939),(4940),(4941),(4942),(4943),(4944),(4945),(4946),(4947), - (4948),(4949),(4950),(4951),(4952),(4953),(4954),(4955),(4956),(4957), - (4958),(4959),(4960),(4961),(4962),(4963),(4964),(4965),(4966),(4967), - (4968),(4969),(4970),(4971),(4972),(4973),(4974),(4975),(4976),(4977), - (4978),(4979),(4980),(4981),(4982),(4983),(4984),(4985),(4986),(4987), - (4988),(4989),(4990),(4991),(4992),(4993),(4994),(4995),(4996),(4997), - (4998),(4999),(5000),(5001),(5002),(5003),(5004),(5005),(5006),(5007), - (5008),(5009),(5010),(5011),(5012),(5013),(5014),(5015),(5016),(5017), - (5018),(5019),(5020),(5021),(5022),(5023),(5024),(5025),(5026),(5027), - (5028),(5029),(5030),(5031),(5032),(5033),(5034),(5035),(5036),(5037), - (5038),(5039),(5040),(5041),(5042),(5043),(5044),(5045),(5046),(5047), - (5048),(5049),(5050),(5051),(5052),(5053),(5054),(5055),(5056),(5057), - (5058),(5059),(5060),(5061),(5062),(5063),(5064),(5065),(5066),(5067), - (5068),(5069),(5070),(5071),(5072),(5073),(5074),(5075),(5076),(5077), - (5078),(5079),(5080),(5081),(5082),(5083),(5084),(5085),(5086),(5087), - (5088),(5089),(5090),(5091),(5092),(5093),(5094),(5095),(5096),(5097), - (5098),(5099),(5100),(5101),(5102),(5103),(5104),(5105),(5106),(5107), - (5108),(5109),(5110),(5111),(5112),(5113),(5114),(5115),(5116),(5117), - (5118),(5119),(5120),(5121),(5122),(5123),(5124),(5125),(5126),(5127), - (5128),(5129),(5130),(5131),(5132),(5133),(5134),(5135),(5136),(5137), - (5138),(5139),(5140),(5141),(5142),(5143),(5144),(5145),(5146),(5147), - (5148),(5149),(5150),(5151),(5152),(5153),(5154),(5155),(5156),(5157), - (5158),(5159),(5160),(5161),(5162),(5163),(5164),(5165),(5166),(5167), - (5168),(5169),(5170),(5171),(5172),(5173),(5174),(5175),(5176),(5177), - (5178),(5179),(5180),(5181),(5182),(5183),(5184),(5185),(5186),(5187), - (5188),(5189),(5190),(5191),(5192),(5193),(5194),(5195),(5196),(5197), - (5198),(5199),(5200),(5201),(5202),(5203),(5204),(5205),(5206),(5207), - (5208),(5209),(5210),(5211),(5212),(5213),(5214),(5215),(5216),(5217), - (5218),(5219),(5220),(5221),(5222),(5223),(5224),(5225),(5226),(5227), - (5228),(5229),(5230),(5231),(5232),(5233),(5234),(5235),(5236),(5237), - (5238),(5239),(5240),(5241),(5242),(5243),(5244),(5245),(5246),(5247), - (5248),(5249),(5250),(5251),(5252),(5253),(5254),(5255),(5256),(5257), - (5258),(5259),(5260),(5261),(5262),(5263),(5264),(5265),(5266),(5267), - (5268),(5269),(5270),(5271),(5272),(5273),(5274),(5275),(5276),(5277), - (5278),(5279),(5280),(5281),(5282),(5283),(5284),(5285),(5286),(5287), - (5288),(5289),(5290),(5291),(5292),(5293),(5294),(5295),(5296),(5297), - (5298),(5299),(5300),(5301),(5302),(5303),(5304),(5305),(5306),(5307), - (5308),(5309),(5310),(5311),(5312),(5313),(5314),(5315),(5316),(5317), - (5318),(5319),(5320),(5321),(5322),(5323),(5324),(5325),(5326),(5327), - (5328),(5329),(5330),(5331),(5332),(5333),(5334),(5335),(5336),(5337), - (5338),(5339),(5340),(5341),(5342),(5343),(5344),(5345),(5346),(5347), - (5348),(5349),(5350),(5351),(5352),(5353),(5354),(5355),(5356),(5357), - (5358),(5359),(5360),(5361),(5362),(5363),(5364),(5365),(5366),(5367), - (5368),(5369),(5370),(5371),(5372),(5373),(5374),(5375),(5376),(5377), - (5378),(5379),(5380),(5381),(5382),(5383),(5384),(5385),(5386),(5387), - (5388),(5389),(5390),(5391),(5392),(5393),(5394),(5395),(5396),(5397), - (5398),(5399),(5400),(5401),(5402),(5403),(5404),(5405),(5406),(5407), - (5408),(5409),(5410),(5411),(5412),(5413),(5414),(5415),(5416),(5417), - (5418),(5419),(5420),(5421),(5422),(5423),(5424),(5425),(5426),(5427), - (5428),(5429),(5430),(5431),(5432),(5433),(5434),(5435),(5436),(5437), - (5438),(5439),(5440),(5441),(5442),(5443),(5444),(5445),(5446),(5447), - (5448),(5449),(5450),(5451),(5452),(5453),(5454),(5455),(5456),(5457), - (5458),(5459),(5460),(5461),(5462),(5463),(5464),(5465),(5466),(5467), - (5468),(5469),(5470),(5471),(5472),(5473),(5474),(5475),(5476),(5477), - (5478),(5479),(5480),(5481),(5482),(5483),(5484),(5485),(5486),(5487), - (5488),(5489),(5490),(5491),(5492),(5493),(5494),(5495),(5496),(5497), - (5498),(5499),(5500),(5501),(5502),(5503),(5504),(5505),(5506),(5507), - (5508),(5509),(5510),(5511),(5512),(5513),(5514),(5515),(5516),(5517), - (5518),(5519),(5520),(5521),(5522),(5523),(5524),(5525),(5526),(5527), - (5528),(5529),(5530),(5531),(5532),(5533),(5534),(5535),(5536),(5537), - (5538),(5539),(5540),(5541),(5542),(5543),(5544),(5545),(5546),(5547), - (5548),(5549),(5550),(5551),(5552),(5553),(5554),(5555),(5556),(5557), - (5558),(5559),(5560),(5561),(5562),(5563),(5564),(5565),(5566),(5567), - (5568),(5569),(5570),(5571),(5572),(5573),(5574),(5575),(5576),(5577), - (5578),(5579),(5580),(5581),(5582),(5583),(5584),(5585),(5586),(5587), - (5588),(5589),(5590),(5591),(5592),(5593),(5594),(5595),(5596),(5597), - (5598),(5599),(5600),(5601),(5602),(5603),(5604),(5605),(5606),(5607), - (5608),(5609),(5610),(5611),(5612),(5613),(5614),(5615),(5616),(5617), - (5618),(5619),(5620),(5621),(5622),(5623),(5624),(5625),(5626),(5627), - (5628),(5629),(5630),(5631),(5632),(5633),(5634),(5635),(5636),(5637), - (5638),(5639),(5640),(5641),(5642),(5643),(5644),(5645),(5646),(5647), - (5648),(5649),(5650),(5651),(5652),(5653),(5654),(5655),(5656),(5657), - (5658),(5659),(5660),(5661),(5662),(5663),(5664),(5665),(5666),(5667), - (5668),(5669),(5670),(5671),(5672),(5673),(5674),(5675),(5676),(5677), - (5678),(5679),(5680),(5681),(5682),(5683),(5684),(5685),(5686),(5687), - (5688),(5689),(5690),(5691),(5692),(5693),(5694),(5695),(5696),(5697), - (5698),(5699),(5700),(5701),(5702),(5703),(5704),(5705),(5706),(5707), - (5708),(5709),(5710),(5711),(5712),(5713),(5714),(5715),(5716),(5717), - (5718),(5719),(5720),(5721),(5722),(5723),(5724),(5725),(5726),(5727), - (5728),(5729),(5730),(5731),(5732),(5733),(5734),(5735),(5736),(5737), - (5738),(5739),(5740),(5741),(5742),(5743),(5744),(5745),(5746),(5747), - (5748),(5749),(5750),(5751),(5752),(5753),(5754),(5755),(5756),(5757), - (5758),(5759),(5760),(5761),(5762),(5763),(5764),(5765),(5766),(5767), - (5768),(5769),(5770),(5771),(5772),(5773),(5774),(5775),(5776),(5777), - (5778),(5779),(5780),(5781),(5782),(5783),(5784),(5785),(5786),(5787), - (5788),(5789),(5790),(5791),(5792),(5793),(5794),(5795),(5796),(5797), - (5798),(5799),(5800),(5801),(5802),(5803),(5804),(5805),(5806),(5807), - (5808),(5809),(5810),(5811),(5812),(5813),(5814),(5815),(5816),(5817), - (5818),(5819),(5820),(5821),(5822),(5823),(5824),(5825),(5826),(5827), - (5828),(5829),(5830),(5831),(5832),(5833),(5834),(5835),(5836),(5837), - (5838),(5839),(5840),(5841),(5842),(5843),(5844),(5845),(5846),(5847), - (5848),(5849),(5850),(5851),(5852),(5853),(5854),(5855),(5856),(5857), - (5858),(5859),(5860),(5861),(5862),(5863),(5864),(5865),(5866),(5867), - (5868),(5869),(5870),(5871),(5872),(5873),(5874),(5875),(5876),(5877), - (5878),(5879),(5880),(5881),(5882),(5883),(5884),(5885),(5886),(5887), - (5888),(5889),(5890),(5891),(5892),(5893),(5894),(5895),(5896),(5897), - (5898),(5899),(5900),(5901),(5902),(5903),(5904),(5905),(5906),(5907), - (5908),(5909),(5910),(5911),(5912),(5913),(5914),(5915),(5916),(5917), - (5918),(5919),(5920),(5921),(5922),(5923),(5924),(5925),(5926),(5927), - (5928),(5929),(5930),(5931),(5932),(5933),(5934),(5935),(5936),(5937), - (5938),(5939),(5940),(5941),(5942),(5943),(5944),(5945),(5946),(5947), - (5948),(5949),(5950),(5951),(5952),(5953),(5954),(5955),(5956),(5957), - (5958),(5959),(5960),(5961),(5962),(5963),(5964),(5965),(5966),(5967), - (5968),(5969),(5970),(5971),(5972),(5973),(5974),(5975),(5976),(5977), - (5978),(5979),(5980),(5981),(5982),(5983),(5984),(5985),(5986),(5987), - (5988),(5989),(5990),(5991),(5992),(5993),(5994),(5995),(5996),(5997), - (5998),(5999),(6000),(6001),(6002),(6003),(6004),(6005),(6006),(6007), - (6008),(6009),(6010),(6011),(6012),(6013),(6014),(6015),(6016),(6017), - (6018),(6019),(6020),(6021),(6022),(6023),(6024),(6025),(6026),(6027), - (6028),(6029),(6030),(6031),(6032),(6033),(6034),(6035),(6036),(6037), - (6038),(6039),(6040),(6041),(6042),(6043),(6044),(6045),(6046),(6047), - (6048),(6049),(6050),(6051),(6052),(6053),(6054),(6055),(6056),(6057), - (6058),(6059),(6060),(6061),(6062),(6063),(6064),(6065),(6066),(6067), - (6068),(6069),(6070),(6071),(6072),(6073),(6074),(6075),(6076),(6077), - (6078),(6079),(6080),(6081),(6082),(6083),(6084),(6085),(6086),(6087), - (6088),(6089),(6090),(6091),(6092),(6093),(6094),(6095),(6096),(6097), - (6098),(6099),(6100),(6101),(6102),(6103),(6104),(6105),(6106),(6107), - (6108),(6109),(6110),(6111),(6112),(6113),(6114),(6115),(6116),(6117), - (6118),(6119),(6120),(6121),(6122),(6123),(6124),(6125),(6126),(6127), - (6128),(6129),(6130),(6131),(6132),(6133),(6134),(6135),(6136),(6137), - (6138),(6139),(6140),(6141),(6142),(6143),(6144),(6145),(6146),(6147), - (6148),(6149),(6150),(6151),(6152),(6153),(6154),(6155),(6156),(6157), - (6158),(6159),(6160),(6161),(6162),(6163),(6164),(6165),(6166),(6167), - (6168),(6169),(6170),(6171),(6172),(6173),(6174),(6175),(6176),(6177), - (6178),(6179),(6180),(6181),(6182),(6183),(6184),(6185),(6186),(6187), - (6188),(6189),(6190),(6191),(6192),(6193),(6194),(6195),(6196),(6197), - (6198),(6199),(6200),(6201),(6202),(6203),(6204),(6205),(6206),(6207), - (6208),(6209),(6210),(6211),(6212),(6213),(6214),(6215),(6216),(6217), - (6218),(6219),(6220),(6221),(6222),(6223),(6224),(6225),(6226),(6227), - (6228),(6229),(6230),(6231),(6232),(6233),(6234),(6235),(6236),(6237), - (6238),(6239),(6240),(6241),(6242),(6243),(6244),(6245),(6246),(6247), - (6248),(6249),(6250),(6251),(6252),(6253),(6254),(6255),(6256),(6257), - (6258),(6259),(6260),(6261),(6262),(6263),(6264),(6265),(6266),(6267), - (6268),(6269),(6270),(6271),(6272),(6273),(6274),(6275),(6276),(6277), - (6278),(6279),(6280),(6281),(6282),(6283),(6284),(6285),(6286),(6287), - (6288),(6289),(6290),(6291),(6292),(6293),(6294),(6295),(6296),(6297), - (6298),(6299),(6300),(6301),(6302),(6303),(6304),(6305),(6306),(6307), - (6308),(6309),(6310),(6311),(6312),(6313),(6314),(6315),(6316),(6317), - (6318),(6319),(6320),(6321),(6322),(6323),(6324),(6325),(6326),(6327), - (6328),(6329),(6330),(6331),(6332),(6333),(6334),(6335),(6336),(6337), - (6338),(6339),(6340),(6341),(6342),(6343),(6344),(6345),(6346),(6347), - (6348),(6349),(6350),(6351),(6352),(6353),(6354),(6355),(6356),(6357), - (6358),(6359),(6360),(6361),(6362),(6363),(6364),(6365),(6366),(6367), - (6368),(6369),(6370),(6371),(6372),(6373),(6374),(6375),(6376),(6377), - (6378),(6379),(6380),(6381),(6382),(6383),(6384),(6385),(6386),(6387), - (6388),(6389),(6390),(6391),(6392),(6393),(6394),(6395),(6396),(6397), - (6398),(6399),(6400),(6401),(6402),(6403),(6404),(6405),(6406),(6407), - (6408),(6409),(6410),(6411),(6412),(6413),(6414),(6415),(6416),(6417), - (6418),(6419),(6420),(6421),(6422),(6423),(6424),(6425),(6426),(6427), - (6428),(6429),(6430),(6431),(6432),(6433),(6434),(6435),(6436),(6437), - (6438),(6439),(6440),(6441),(6442),(6443),(6444),(6445),(6446),(6447), - (6448),(6449),(6450),(6451),(6452),(6453),(6454),(6455),(6456),(6457), - (6458),(6459),(6460),(6461),(6462),(6463),(6464),(6465),(6466),(6467), - (6468),(6469),(6470),(6471),(6472),(6473),(6474),(6475),(6476),(6477), - (6478),(6479),(6480),(6481),(6482),(6483),(6484),(6485),(6486),(6487), - (6488),(6489),(6490),(6491),(6492),(6493),(6494),(6495),(6496),(6497), - (6498),(6499),(6500),(6501),(6502),(6503),(6504),(6505),(6506),(6507), - (6508),(6509),(6510),(6511),(6512),(6513),(6514),(6515),(6516),(6517), - (6518),(6519),(6520),(6521),(6522),(6523),(6524),(6525),(6526),(6527), - (6528),(6529),(6530),(6531),(6532),(6533),(6534),(6535),(6536),(6537), - (6538),(6539),(6540),(6541),(6542),(6543),(6544),(6545),(6546),(6547), - (6548),(6549),(6550),(6551),(6552),(6553),(6554),(6555),(6556),(6557), - (6558),(6559),(6560),(6561),(6562),(6563),(6564),(6565),(6566),(6567), - (6568),(6569),(6570),(6571),(6572),(6573),(6574),(6575),(6576),(6577), - (6578),(6579),(6580),(6581),(6582),(6583),(6584),(6585),(6586),(6587), - (6588),(6589),(6590),(6591),(6592),(6593),(6594),(6595),(6596),(6597), - (6598),(6599),(6600),(6601),(6602),(6603),(6604),(6605),(6606),(6607), - (6608),(6609),(6610),(6611),(6612),(6613),(6614),(6615),(6616),(6617), - (6618),(6619),(6620),(6621),(6622),(6623),(6624),(6625),(6626),(6627), - (6628),(6629),(6630),(6631),(6632),(6633),(6634),(6635),(6636),(6637), - (6638),(6639),(6640),(6641),(6642),(6643),(6644),(6645),(6646),(6647), - (6648),(6649),(6650),(6651),(6652),(6653),(6654),(6655),(6656),(6657), - (6658),(6659),(6660),(6661),(6662),(6663),(6664),(6665),(6666),(6667), - (6668),(6669),(6670),(6671),(6672),(6673),(6674),(6675),(6676),(6677), - (6678),(6679),(6680),(6681),(6682),(6683),(6684),(6685),(6686),(6687), - (6688),(6689),(6690),(6691),(6692),(6693),(6694),(6695),(6696),(6697), - (6698),(6699),(6700),(6701),(6702),(6703),(6704),(6705),(6706),(6707), - (6708),(6709),(6710),(6711),(6712),(6713),(6714),(6715),(6716),(6717), - (6718),(6719),(6720),(6721),(6722),(6723),(6724),(6725),(6726),(6727), - (6728),(6729),(6730),(6731),(6732),(6733),(6734),(6735),(6736),(6737), - (6738),(6739),(6740),(6741),(6742),(6743),(6744),(6745),(6746),(6747), - (6748),(6749),(6750),(6751),(6752),(6753),(6754),(6755),(6756),(6757), - (6758),(6759),(6760),(6761),(6762),(6763),(6764),(6765),(6766),(6767), - (6768),(6769),(6770),(6771),(6772),(6773),(6774),(6775),(6776),(6777), - (6778),(6779),(6780),(6781),(6782),(6783),(6784),(6785),(6786),(6787), - (6788),(6789),(6790),(6791),(6792),(6793),(6794),(6795),(6796),(6797), - (6798),(6799),(6800),(6801),(6802),(6803),(6804),(6805),(6806),(6807), - (6808),(6809),(6810),(6811),(6812),(6813),(6814),(6815),(6816),(6817), - (6818),(6819),(6820),(6821),(6822),(6823),(6824),(6825),(6826),(6827), - (6828),(6829),(6830),(6831),(6832),(6833),(6834),(6835),(6836),(6837), - (6838),(6839),(6840),(6841),(6842),(6843),(6844),(6845),(6846),(6847), - (6848),(6849),(6850),(6851),(6852),(6853),(6854),(6855),(6856),(6857), - (6858),(6859),(6860),(6861),(6862),(6863),(6864),(6865),(6866),(6867), - (6868),(6869),(6870),(6871),(6872),(6873),(6874),(6875),(6876),(6877), - (6878),(6879),(6880),(6881),(6882),(6883),(6884),(6885),(6886),(6887), - (6888),(6889),(6890),(6891),(6892),(6893),(6894),(6895),(6896),(6897), - (6898),(6899),(6900),(6901),(6902),(6903),(6904),(6905),(6906),(6907), - (6908),(6909),(6910),(6911),(6912),(6913),(6914),(6915),(6916),(6917), - (6918),(6919),(6920),(6921),(6922),(6923),(6924),(6925),(6926),(6927), - (6928),(6929),(6930),(6931),(6932),(6933),(6934),(6935),(6936),(6937), - (6938),(6939),(6940),(6941),(6942),(6943),(6944),(6945),(6946),(6947), - (6948),(6949),(6950),(6951),(6952),(6953),(6954),(6955),(6956),(6957), - (6958),(6959),(6960),(6961),(6962),(6963),(6964),(6965),(6966),(6967), - (6968),(6969),(6970),(6971),(6972),(6973),(6974),(6975),(6976),(6977), - (6978),(6979),(6980),(6981),(6982),(6983),(6984),(6985),(6986),(6987), - (6988),(6989),(6990),(6991),(6992),(6993),(6994),(6995),(6996),(6997), - (6998),(6999),(7000),(7001),(7002),(7003),(7004),(7005),(7006),(7007), - (7008),(7009),(7010),(7011),(7012),(7013),(7014),(7015),(7016),(7017), - (7018),(7019),(7020),(7021),(7022),(7023),(7024),(7025),(7026),(7027), - (7028),(7029),(7030),(7031),(7032),(7033),(7034),(7035),(7036),(7037), - (7038),(7039),(7040),(7041),(7042),(7043),(7044),(7045),(7046),(7047), - (7048),(7049),(7050),(7051),(7052),(7053),(7054),(7055),(7056),(7057), - (7058),(7059),(7060),(7061),(7062),(7063),(7064),(7065),(7066),(7067), - (7068),(7069),(7070),(7071),(7072),(7073),(7074),(7075),(7076),(7077), - (7078),(7079),(7080),(7081),(7082),(7083),(7084),(7085),(7086),(7087), - (7088),(7089),(7090),(7091),(7092),(7093),(7094),(7095),(7096),(7097), - (7098),(7099),(7100),(7101),(7102),(7103),(7104),(7105),(7106),(7107), - (7108),(7109),(7110),(7111),(7112),(7113),(7114),(7115),(7116),(7117), - (7118),(7119),(7120),(7121),(7122),(7123),(7124),(7125),(7126),(7127), - (7128),(7129),(7130),(7131),(7132),(7133),(7134),(7135),(7136),(7137), - (7138),(7139),(7140),(7141),(7142),(7143),(7144),(7145),(7146),(7147), - (7148),(7149),(7150),(7151),(7152),(7153),(7154),(7155),(7156),(7157), - (7158),(7159),(7160),(7161),(7162),(7163),(7164),(7165),(7166),(7167), - (7168),(7169),(7170),(7171),(7172),(7173),(7174),(7175),(7176),(7177), - (7178),(7179),(7180),(7181),(7182),(7183),(7184),(7185),(7186),(7187), - (7188),(7189),(7190),(7191),(7192),(7193),(7194),(7195),(7196),(7197), - (7198),(7199),(7200),(7201),(7202),(7203),(7204),(7205),(7206),(7207), - (7208),(7209),(7210),(7211),(7212),(7213),(7214),(7215),(7216),(7217), - (7218),(7219),(7220),(7221),(7222),(7223),(7224),(7225),(7226),(7227), - (7228),(7229),(7230),(7231),(7232),(7233),(7234),(7235),(7236),(7237), - (7238),(7239),(7240),(7241),(7242),(7243),(7244),(7245),(7246),(7247), - (7248),(7249),(7250),(7251),(7252),(7253),(7254),(7255),(7256),(7257), - (7258),(7259),(7260),(7261),(7262),(7263),(7264),(7265),(7266),(7267), - (7268),(7269),(7270),(7271),(7272),(7273),(7274),(7275),(7276),(7277), - (7278),(7279),(7280),(7281),(7282),(7283),(7284),(7285),(7286),(7287), - (7288),(7289),(7290),(7291),(7292),(7293),(7294),(7295),(7296),(7297), - (7298),(7299),(7300),(7301),(7302),(7303),(7304),(7305),(7306),(7307), - (7308),(7309),(7310),(7311),(7312),(7313),(7314),(7315),(7316),(7317), - (7318),(7319),(7320),(7321),(7322),(7323),(7324),(7325),(7326),(7327), - (7328),(7329),(7330),(7331),(7332),(7333),(7334),(7335),(7336),(7337), - (7338),(7339),(7340),(7341),(7342),(7343),(7344),(7345),(7346),(7347), - (7348),(7349),(7350),(7351),(7352),(7353),(7354),(7355),(7356),(7357), - (7358),(7359),(7360),(7361),(7362),(7363),(7364),(7365),(7366),(7367), - (7368),(7369),(7370),(7371),(7372),(7373),(7374),(7375),(7376),(7377), - (7378),(7379),(7380),(7381),(7382),(7383),(7384),(7385),(7386),(7387), - (7388),(7389),(7390),(7391),(7392),(7393),(7394),(7395),(7396),(7397), - (7398),(7399),(7400),(7401),(7402),(7403),(7404),(7405),(7406),(7407), - (7408),(7409),(7410),(7411),(7412),(7413),(7414),(7415),(7416),(7417), - (7418),(7419),(7420),(7421),(7422),(7423),(7424),(7425),(7426),(7427), - (7428),(7429),(7430),(7431),(7432),(7433),(7434),(7435),(7436),(7437), - (7438),(7439),(7440),(7441),(7442),(7443),(7444),(7445),(7446),(7447), - (7448),(7449),(7450),(7451),(7452),(7453),(7454),(7455),(7456),(7457), - (7458),(7459),(7460),(7461),(7462),(7463),(7464),(7465),(7466),(7467), - (7468),(7469),(7470),(7471),(7472),(7473),(7474),(7475),(7476),(7477), - (7478),(7479),(7480),(7481),(7482),(7483),(7484),(7485),(7486),(7487), - (7488),(7489),(7490),(7491),(7492),(7493),(7494),(7495),(7496),(7497), - (7498),(7499),(7500),(7501),(7502),(7503),(7504),(7505),(7506),(7507), - (7508),(7509),(7510),(7511),(7512),(7513),(7514),(7515),(7516),(7517), - (7518),(7519),(7520),(7521),(7522),(7523),(7524),(7525),(7526),(7527), - (7528),(7529),(7530),(7531),(7532),(7533),(7534),(7535),(7536),(7537), - (7538),(7539),(7540),(7541),(7542),(7543),(7544),(7545),(7546),(7547), - (7548),(7549),(7550),(7551),(7552),(7553),(7554),(7555),(7556),(7557), - (7558),(7559),(7560),(7561),(7562),(7563),(7564),(7565),(7566),(7567), - (7568),(7569),(7570),(7571),(7572),(7573),(7574),(7575),(7576),(7577), - (7578),(7579),(7580),(7581),(7582),(7583),(7584),(7585),(7586),(7587), - (7588),(7589),(7590),(7591),(7592),(7593),(7594),(7595),(7596),(7597), - (7598),(7599),(7600),(7601),(7602),(7603),(7604),(7605),(7606),(7607), - (7608),(7609),(7610),(7611),(7612),(7613),(7614),(7615),(7616),(7617), - (7618),(7619),(7620),(7621),(7622),(7623),(7624),(7625),(7626),(7627), - (7628),(7629),(7630),(7631),(7632),(7633),(7634),(7635),(7636),(7637), - (7638),(7639),(7640),(7641),(7642),(7643),(7644),(7645),(7646),(7647), - (7648),(7649),(7650),(7651),(7652),(7653),(7654),(7655),(7656),(7657), - (7658),(7659),(7660),(7661),(7662),(7663),(7664),(7665),(7666),(7667), - (7668),(7669),(7670),(7671),(7672),(7673),(7674),(7675),(7676),(7677), - (7678),(7679),(7680),(7681),(7682),(7683),(7684),(7685),(7686),(7687), - (7688),(7689),(7690),(7691),(7692),(7693),(7694),(7695),(7696),(7697), - (7698),(7699),(7700),(7701),(7702),(7703),(7704),(7705),(7706),(7707), - (7708),(7709),(7710),(7711),(7712),(7713),(7714),(7715),(7716),(7717), - (7718),(7719),(7720),(7721),(7722),(7723),(7724),(7725),(7726),(7727), - (7728),(7729),(7730),(7731),(7732),(7733),(7734),(7735),(7736),(7737), - (7738),(7739),(7740),(7741),(7742),(7743),(7744),(7745),(7746),(7747), - (7748),(7749),(7750),(7751),(7752),(7753),(7754),(7755),(7756),(7757), - (7758),(7759),(7760),(7761),(7762),(7763),(7764),(7765),(7766),(7767), - (7768),(7769),(7770),(7771),(7772),(7773),(7774),(7775),(7776),(7777), - (7778),(7779),(7780),(7781),(7782),(7783),(7784),(7785),(7786),(7787), - (7788),(7789),(7790),(7791),(7792),(7793),(7794),(7795),(7796),(7797), - (7798),(7799),(7800),(7801),(7802),(7803),(7804),(7805),(7806),(7807), - (7808),(7809),(7810),(7811),(7812),(7813),(7814),(7815),(7816),(7817), - (7818),(7819),(7820),(7821),(7822),(7823),(7824),(7825),(7826),(7827), - (7828),(7829),(7830),(7831),(7832),(7833),(7834),(7835),(7836),(7837), - (7838),(7839),(7840),(7841),(7842),(7843),(7844),(7845),(7846),(7847), - (7848),(7849),(7850),(7851),(7852),(7853),(7854),(7855),(7856),(7857), - (7858),(7859),(7860),(7861),(7862),(7863),(7864),(7865),(7866),(7867), - (7868),(7869),(7870),(7871),(7872),(7873),(7874),(7875),(7876),(7877), - (7878),(7879),(7880),(7881),(7882),(7883),(7884),(7885),(7886),(7887), - (7888),(7889),(7890),(7891),(7892),(7893),(7894),(7895),(7896),(7897), - (7898),(7899),(7900),(7901),(7902),(7903),(7904),(7905),(7906),(7907), - (7908),(7909),(7910),(7911),(7912),(7913),(7914),(7915),(7916),(7917), - (7918),(7919),(7920),(7921),(7922),(7923),(7924),(7925),(7926),(7927), - (7928),(7929),(7930),(7931),(7932),(7933),(7934),(7935),(7936),(7937), - (7938),(7939),(7940),(7941),(7942),(7943),(7944),(7945),(7946),(7947), - (7948),(7949),(7950),(7951),(7952),(7953),(7954),(7955),(7956),(7957), - (7958),(7959),(7960),(7961),(7962),(7963),(7964),(7965),(7966),(7967), - (7968),(7969),(7970),(7971),(7972),(7973),(7974),(7975),(7976),(7977), - (7978),(7979),(7980),(7981),(7982),(7983),(7984),(7985),(7986),(7987), - (7988),(7989),(7990),(7991),(7992),(7993),(7994),(7995),(7996),(7997), - (7998),(7999),(8000),(8001),(8002),(8003),(8004),(8005),(8006),(8007), - (8008),(8009),(8010),(8011),(8012),(8013),(8014),(8015),(8016),(8017), - (8018),(8019),(8020),(8021),(8022),(8023),(8024),(8025),(8026),(8027), - (8028),(8029),(8030),(8031),(8032),(8033),(8034),(8035),(8036),(8037), - (8038),(8039),(8040),(8041),(8042),(8043),(8044),(8045),(8046),(8047), - (8048),(8049),(8050),(8051),(8052),(8053),(8054),(8055),(8056),(8057), - (8058),(8059),(8060),(8061),(8062),(8063),(8064),(8065),(8066),(8067), - (8068),(8069),(8070),(8071),(8072),(8073),(8074),(8075),(8076),(8077), - (8078),(8079),(8080),(8081),(8082),(8083),(8084),(8085),(8086),(8087), - (8088),(8089),(8090),(8091),(8092),(8093),(8094),(8095),(8096),(8097), - (8098),(8099),(8100),(8101),(8102),(8103),(8104),(8105),(8106),(8107), - (8108),(8109),(8110),(8111),(8112),(8113),(8114),(8115),(8116),(8117), - (8118),(8119),(8120),(8121),(8122),(8123),(8124),(8125),(8126),(8127), - (8128),(8129),(8130),(8131),(8132),(8133),(8134),(8135),(8136),(8137), - (8138),(8139),(8140),(8141),(8142),(8143),(8144),(8145),(8146),(8147), - (8148),(8149),(8150),(8151),(8152),(8153),(8154),(8155),(8156),(8157), - (8158),(8159),(8160),(8161),(8162),(8163),(8164),(8165),(8166),(8167), - (8168),(8169),(8170),(8171),(8172),(8173),(8174),(8175),(8176),(8177), - (8178),(8179),(8180),(8181),(8182),(8183),(8184),(8185),(8186),(8187), - (8188),(8189),(8190),(8191),(8192),(8193),(8194),(8195),(8196),(8197), - (8198),(8199),(8200),(8201),(8202),(8203),(8204),(8205),(8206),(8207), - (8208),(8209),(8210),(8211),(8212),(8213),(8214),(8215),(8216),(8217), - (8218),(8219),(8220),(8221),(8222),(8223),(8224),(8225),(8226),(8227), - (8228),(8229),(8230),(8231),(8232),(8233),(8234),(8235),(8236),(8237), - (8238),(8239),(8240),(8241),(8242),(8243),(8244),(8245),(8246),(8247), - (8248),(8249),(8250),(8251),(8252),(8253),(8254),(8255),(8256),(8257), - (8258),(8259),(8260),(8261),(8262),(8263),(8264),(8265),(8266),(8267), - (8268),(8269),(8270),(8271),(8272),(8273),(8274),(8275),(8276),(8277), - (8278),(8279),(8280),(8281),(8282),(8283),(8284),(8285),(8286),(8287), - (8288),(8289),(8290),(8291),(8292),(8293),(8294),(8295),(8296),(8297), - (8298),(8299),(8300),(8301),(8302),(8303),(8304),(8305),(8306),(8307), - (8308),(8309),(8310),(8311),(8312),(8313),(8314),(8315),(8316),(8317), - (8318),(8319),(8320),(8321),(8322),(8323),(8324),(8325),(8326),(8327), - (8328),(8329),(8330),(8331),(8332),(8333),(8334),(8335),(8336),(8337), - (8338),(8339),(8340),(8341),(8342),(8343),(8344),(8345),(8346),(8347), - (8348),(8349),(8350),(8351),(8352),(8353),(8354),(8355),(8356),(8357), - (8358),(8359),(8360),(8361),(8362),(8363),(8364),(8365),(8366),(8367), - (8368),(8369),(8370),(8371),(8372),(8373),(8374),(8375),(8376),(8377), - (8378),(8379),(8380),(8381),(8382),(8383),(8384),(8385),(8386),(8387), - (8388),(8389),(8390),(8391),(8392),(8393),(8394),(8395),(8396),(8397), - (8398),(8399),(8400),(8401),(8402),(8403),(8404),(8405),(8406),(8407), - (8408),(8409),(8410),(8411),(8412),(8413),(8414),(8415),(8416),(8417), - (8418),(8419),(8420),(8421),(8422),(8423),(8424),(8425),(8426),(8427), - (8428),(8429),(8430),(8431),(8432),(8433),(8434),(8435),(8436),(8437), - (8438),(8439),(8440),(8441),(8442),(8443),(8444),(8445),(8446),(8447), - (8448),(8449),(8450),(8451),(8452),(8453),(8454),(8455),(8456),(8457), - (8458),(8459),(8460),(8461),(8462),(8463),(8464),(8465),(8466),(8467), - (8468),(8469),(8470),(8471),(8472),(8473),(8474),(8475),(8476),(8477), - (8478),(8479),(8480),(8481),(8482),(8483),(8484),(8485),(8486),(8487), - (8488),(8489),(8490),(8491),(8492),(8493),(8494),(8495),(8496),(8497), - (8498),(8499),(8500),(8501),(8502),(8503),(8504),(8505),(8506),(8507), - (8508),(8509),(8510),(8511),(8512),(8513),(8514),(8515),(8516),(8517), - (8518),(8519),(8520),(8521),(8522),(8523),(8524),(8525),(8526),(8527), - (8528),(8529),(8530),(8531),(8532),(8533),(8534),(8535),(8536),(8537), - (8538),(8539),(8540),(8541),(8542),(8543),(8544),(8545),(8546),(8547), - (8548),(8549),(8550),(8551),(8552),(8553),(8554),(8555),(8556),(8557), - (8558),(8559),(8560),(8561),(8562),(8563),(8564),(8565),(8566),(8567), - (8568),(8569),(8570),(8571),(8572),(8573),(8574),(8575),(8576),(8577), - (8578),(8579),(8580),(8581),(8582),(8583),(8584),(8585),(8586),(8587), - (8588),(8589),(8590),(8591),(8592),(8593),(8594),(8595),(8596),(8597), - (8598),(8599),(8600),(8601),(8602),(8603),(8604),(8605),(8606),(8607), - (8608),(8609),(8610),(8611),(8612),(8613),(8614),(8615),(8616),(8617), - (8618),(8619),(8620),(8621),(8622),(8623),(8624),(8625),(8626),(8627), - (8628),(8629),(8630),(8631),(8632),(8633),(8634),(8635),(8636),(8637), - (8638),(8639),(8640),(8641),(8642),(8643),(8644),(8645),(8646),(8647), - (8648),(8649),(8650),(8651),(8652),(8653),(8654),(8655),(8656),(8657), - (8658),(8659),(8660),(8661),(8662),(8663),(8664),(8665),(8666),(8667), - (8668),(8669),(8670),(8671),(8672),(8673),(8674),(8675),(8676),(8677), - (8678),(8679),(8680),(8681),(8682),(8683),(8684),(8685),(8686),(8687), - (8688),(8689),(8690),(8691),(8692),(8693),(8694),(8695),(8696),(8697), - (8698),(8699),(8700),(8701),(8702),(8703),(8704),(8705),(8706),(8707), - (8708),(8709),(8710),(8711),(8712),(8713),(8714),(8715),(8716),(8717), - (8718),(8719),(8720),(8721),(8722),(8723),(8724),(8725),(8726),(8727), - (8728),(8729),(8730),(8731),(8732),(8733),(8734),(8735),(8736),(8737), - (8738),(8739),(8740),(8741),(8742),(8743),(8744),(8745),(8746),(8747), - (8748),(8749),(8750),(8751),(8752),(8753),(8754),(8755),(8756),(8757), - (8758),(8759),(8760),(8761),(8762),(8763),(8764),(8765),(8766),(8767), - (8768),(8769),(8770),(8771),(8772),(8773),(8774),(8775),(8776),(8777), - (8778),(8779),(8780),(8781),(8782),(8783),(8784),(8785),(8786),(8787), - (8788),(8789),(8790),(8791),(8792),(8793),(8794),(8795),(8796),(8797), - (8798),(8799),(8800),(8801),(8802),(8803),(8804),(8805),(8806),(8807), - (8808),(8809),(8810),(8811),(8812),(8813),(8814),(8815),(8816),(8817), - (8818),(8819),(8820),(8821),(8822),(8823),(8824),(8825),(8826),(8827), - (8828),(8829),(8830),(8831),(8832),(8833),(8834),(8835),(8836),(8837), - (8838),(8839),(8840),(8841),(8842),(8843),(8844),(8845),(8846),(8847), - (8848),(8849),(8850),(8851),(8852),(8853),(8854),(8855),(8856),(8857), - (8858),(8859),(8860),(8861),(8862),(8863),(8864),(8865),(8866),(8867), - (8868),(8869),(8870),(8871),(8872),(8873),(8874),(8875),(8876),(8877), - (8878),(8879),(8880),(8881),(8882),(8883),(8884),(8885),(8886),(8887), - (8888),(8889),(8890),(8891),(8892),(8893),(8894),(8895),(8896),(8897), - (8898),(8899),(8900),(8901),(8902),(8903),(8904),(8905),(8906),(8907), - (8908),(8909),(8910),(8911),(8912),(8913),(8914),(8915),(8916),(8917), - (8918),(8919),(8920),(8921),(8922),(8923),(8924),(8925),(8926),(8927), - (8928),(8929),(8930),(8931),(8932),(8933),(8934),(8935),(8936),(8937), - (8938),(8939),(8940),(8941),(8942),(8943),(8944),(8945),(8946),(8947), - (8948),(8949),(8950),(8951),(8952),(8953),(8954),(8955),(8956),(8957), - (8958),(8959),(8960),(8961),(8962),(8963),(8964),(8965),(8966),(8967), - (8968),(8969),(8970),(8971),(8972),(8973),(8974),(8975),(8976),(8977), - (8978),(8979),(8980),(8981),(8982),(8983),(8984),(8985),(8986),(8987), - (8988),(8989),(8990),(8991),(8992),(8993),(8994),(8995),(8996),(8997), - (8998),(8999),(9000),(9001),(9002),(9003),(9004),(9005),(9006),(9007), - (9008),(9009),(9010),(9011),(9012),(9013),(9014),(9015),(9016),(9017), - (9018),(9019),(9020),(9021),(9022),(9023),(9024),(9025),(9026),(9027), - (9028),(9029),(9030),(9031),(9032),(9033),(9034),(9035),(9036),(9037), - (9038),(9039),(9040),(9041),(9042),(9043),(9044),(9045),(9046),(9047), - (9048),(9049),(9050),(9051),(9052),(9053),(9054),(9055),(9056),(9057), - (9058),(9059),(9060),(9061),(9062),(9063),(9064),(9065),(9066),(9067), - (9068),(9069),(9070),(9071),(9072),(9073),(9074),(9075),(9076),(9077), - (9078),(9079),(9080),(9081),(9082),(9083),(9084),(9085),(9086),(9087), - (9088),(9089),(9090),(9091),(9092),(9093),(9094),(9095),(9096),(9097), - (9098),(9099),(9100),(9101),(9102),(9103),(9104),(9105),(9106),(9107), - (9108),(9109),(9110),(9111),(9112),(9113),(9114),(9115),(9116),(9117), - (9118),(9119),(9120),(9121),(9122),(9123),(9124),(9125),(9126),(9127), - (9128),(9129),(9130),(9131),(9132),(9133),(9134),(9135),(9136),(9137), - (9138),(9139),(9140),(9141),(9142),(9143),(9144),(9145),(9146),(9147), - (9148),(9149),(9150),(9151),(9152),(9153),(9154),(9155),(9156),(9157), - (9158),(9159),(9160),(9161),(9162),(9163),(9164),(9165),(9166),(9167), - (9168),(9169),(9170),(9171),(9172),(9173),(9174),(9175),(9176),(9177), - (9178),(9179),(9180),(9181),(9182),(9183),(9184),(9185),(9186),(9187), - (9188),(9189),(9190),(9191),(9192),(9193),(9194),(9195),(9196),(9197), - (9198),(9199),(9200),(9201),(9202),(9203),(9204),(9205),(9206),(9207), - (9208),(9209),(9210),(9211),(9212),(9213),(9214),(9215),(9216),(9217), - (9218),(9219),(9220),(9221),(9222),(9223),(9224),(9225),(9226),(9227), - (9228),(9229),(9230),(9231),(9232),(9233),(9234),(9235),(9236),(9237), - (9238),(9239),(9240),(9241),(9242),(9243),(9244),(9245),(9246),(9247), - (9248),(9249),(9250),(9251),(9252),(9253),(9254),(9255),(9256),(9257), - (9258),(9259),(9260),(9261),(9262),(9263),(9264),(9265),(9266),(9267), - (9268),(9269),(9270),(9271),(9272),(9273),(9274),(9275),(9276),(9277), - (9278),(9279),(9280),(9281),(9282),(9283),(9284),(9285),(9286),(9287), - (9288),(9289),(9290),(9291),(9292),(9293),(9294),(9295),(9296),(9297), - (9298),(9299),(9300),(9301),(9302),(9303),(9304),(9305),(9306),(9307), - (9308),(9309),(9310),(9311),(9312),(9313),(9314),(9315),(9316),(9317), - (9318),(9319),(9320),(9321),(9322),(9323),(9324),(9325),(9326),(9327), - (9328),(9329),(9330),(9331),(9332),(9333),(9334),(9335),(9336),(9337), - (9338),(9339),(9340),(9341),(9342),(9343),(9344),(9345),(9346),(9347), - (9348),(9349),(9350),(9351),(9352),(9353),(9354),(9355),(9356),(9357), - (9358),(9359),(9360),(9361),(9362),(9363),(9364),(9365),(9366),(9367), - (9368),(9369),(9370),(9371),(9372),(9373),(9374),(9375),(9376),(9377), - (9378),(9379),(9380),(9381),(9382),(9383),(9384),(9385),(9386),(9387), - (9388),(9389),(9390),(9391),(9392),(9393),(9394),(9395),(9396),(9397), - (9398),(9399),(9400),(9401),(9402),(9403),(9404),(9405),(9406),(9407), - (9408),(9409),(9410),(9411),(9412),(9413),(9414),(9415),(9416),(9417), - (9418),(9419),(9420),(9421),(9422),(9423),(9424),(9425),(9426),(9427), - (9428),(9429),(9430),(9431),(9432),(9433),(9434),(9435),(9436),(9437), - (9438),(9439),(9440),(9441),(9442),(9443),(9444),(9445),(9446),(9447), - (9448),(9449),(9450),(9451),(9452),(9453),(9454),(9455),(9456),(9457), - (9458),(9459),(9460),(9461),(9462),(9463),(9464),(9465),(9466),(9467), - (9468),(9469),(9470),(9471),(9472),(9473),(9474),(9475),(9476),(9477), - (9478),(9479),(9480),(9481),(9482),(9483),(9484),(9485),(9486),(9487), - (9488),(9489),(9490),(9491),(9492),(9493),(9494),(9495),(9496),(9497), - (9498),(9499),(9500),(9501),(9502),(9503),(9504),(9505),(9506),(9507), - (9508),(9509),(9510),(9511),(9512),(9513),(9514),(9515),(9516),(9517), - (9518),(9519),(9520),(9521),(9522),(9523),(9524),(9525),(9526),(9527), - (9528),(9529),(9530),(9531),(9532),(9533),(9534),(9535),(9536),(9537), - (9538),(9539),(9540),(9541),(9542),(9543),(9544),(9545),(9546),(9547), - (9548),(9549),(9550),(9551),(9552),(9553),(9554),(9555),(9556),(9557), - (9558),(9559),(9560),(9561),(9562),(9563),(9564),(9565),(9566),(9567), - (9568),(9569),(9570),(9571),(9572),(9573),(9574),(9575),(9576),(9577), - (9578),(9579),(9580),(9581),(9582),(9583),(9584),(9585),(9586),(9587), - (9588),(9589),(9590),(9591),(9592),(9593),(9594),(9595),(9596),(9597), - (9598),(9599),(9600),(9601),(9602),(9603),(9604),(9605),(9606),(9607), - (9608),(9609),(9610),(9611),(9612),(9613),(9614),(9615),(9616),(9617), - (9618),(9619),(9620),(9621),(9622),(9623),(9624),(9625),(9626),(9627), - (9628),(9629),(9630),(9631),(9632),(9633),(9634),(9635),(9636),(9637), - (9638),(9639),(9640),(9641),(9642),(9643),(9644),(9645),(9646),(9647), - (9648),(9649),(9650),(9651),(9652),(9653),(9654),(9655),(9656),(9657), - (9658),(9659),(9660),(9661),(9662),(9663),(9664),(9665),(9666),(9667), - (9668),(9669),(9670),(9671),(9672),(9673),(9674),(9675),(9676),(9677), - (9678),(9679),(9680),(9681),(9682),(9683),(9684),(9685),(9686),(9687), - (9688),(9689),(9690),(9691),(9692),(9693),(9694),(9695),(9696),(9697), - (9698),(9699),(9700),(9701),(9702),(9703),(9704),(9705),(9706),(9707), - (9708),(9709),(9710),(9711),(9712),(9713),(9714),(9715),(9716),(9717), - (9718),(9719),(9720),(9721),(9722),(9723),(9724),(9725),(9726),(9727), - (9728),(9729),(9730),(9731),(9732),(9733),(9734),(9735),(9736),(9737), - (9738),(9739),(9740),(9741),(9742),(9743),(9744),(9745),(9746),(9747), - (9748),(9749),(9750),(9751),(9752),(9753),(9754),(9755),(9756),(9757), - (9758),(9759),(9760),(9761),(9762),(9763),(9764),(9765),(9766),(9767), - (9768),(9769),(9770),(9771),(9772),(9773),(9774),(9775),(9776),(9777), - (9778),(9779),(9780),(9781),(9782),(9783),(9784),(9785),(9786),(9787), - (9788),(9789),(9790),(9791),(9792),(9793),(9794),(9795),(9796),(9797), - (9798),(9799),(9800),(9801),(9802),(9803),(9804),(9805),(9806),(9807), - (9808),(9809),(9810),(9811),(9812),(9813),(9814),(9815),(9816),(9817), - (9818),(9819),(9820),(9821),(9822),(9823),(9824),(9825),(9826),(9827), - (9828),(9829),(9830),(9831),(9832),(9833),(9834),(9835),(9836),(9837), - (9838),(9839),(9840),(9841),(9842),(9843),(9844),(9845),(9846),(9847), - (9848),(9849),(9850),(9851),(9852),(9853),(9854),(9855),(9856),(9857), - (9858),(9859),(9860),(9861),(9862),(9863),(9864),(9865),(9866),(9867), - (9868),(9869),(9870),(9871),(9872),(9873),(9874),(9875),(9876),(9877), - (9878),(9879),(9880),(9881),(9882),(9883),(9884),(9885),(9886),(9887), - (9888),(9889),(9890),(9891),(9892),(9893),(9894),(9895),(9896),(9897), - (9898),(9899),(9900),(9901),(9902),(9903),(9904),(9905),(9906),(9907), - (9908),(9909),(9910),(9911),(9912),(9913),(9914),(9915),(9916),(9917), - (9918),(9919),(9920),(9921),(9922),(9923),(9924),(9925),(9926),(9927), - (9928),(9929),(9930),(9931),(9932),(9933),(9934),(9935),(9936),(9937), - (9938),(9939),(9940),(9941),(9942),(9943),(9944),(9945),(9946),(9947), - (9948),(9949),(9950),(9951),(9952),(9953),(9954),(9955),(9956),(9957), - (9958),(9959),(9960),(9961),(9962),(9963),(9964),(9965),(9966),(9967), - (9968),(9969),(9970),(9971),(9972),(9973),(9974),(9975),(9976),(9977), - (9978),(9979),(9980),(9981),(9982),(9983),(9984),(9985),(9986),(9987), - (9988),(9989),(9990),(9991),(9992),(9993),(9994),(9995),(9996),(9997), - (9998),(9999),(10000); - SELECT count(*), min(x), max(x), sum(x) FROM t1; -} {10000 1 10000 50005000} +# Do an INSERT with a VALUES clause that contains 100,000 entries. Verify +# that this insert happens quickly (in less than 10 seconds). Actually, the +# insert will normally happen in less than 0.5 seconds on a workstation, but +# we allow plenty of overhead for slower machines. The speed test checks +# for an O(N*N) inefficiency that was once in the code and that would make +# the insert run for over a minute. +# +do_test 100 { + set sql "CREATE TABLE t1(x);\nINSERT INTO t1(x) VALUES" + for {set i 1} {$i<100000} {incr i} { + append sql "($i)," + } + append sql "($i);" + set microsec [lindex [time {db eval $sql}] 0] + db eval { + SELECT count(x), sum(x), avg(x), $microsec<10000000 FROM t1; + } +} {100000 5000050000 50000.5 1} finish_test From ef3d66cb0133dcd1b07548d771fd48d4607d32cf Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 6 Jan 2015 21:31:47 +0000 Subject: [PATCH 23/69] Fix a problem in the unix implementation of FCNTL_SIZE_HINT on systems that do not support posix_fallocate(). FossilOrigin-Name: af20eae1e6f608e4e61a07c3d14cf88c12751353 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/os_unix.c | 7 ++++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index 4563309ff7..b0a012638e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improved\sand\smore\srigorous\stest\sof\slarge\sVALUES\sclauses. -D 2015-01-06T16:53:49.824 +C Fix\sa\sproblem\sin\sthe\sunix\simplementation\sof\sFCNTL_SIZE_HINT\son\ssystems\sthat\sdo\snot\ssupport\sposix_fallocate(). +D 2015-01-06T21:31:47.399 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 335e2d3ff0f2455eacbfa3075fc37495e3321410 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 08c0346d2ea5e5ffd5b1a796f9becf1976d648d7 +F src/os_unix.c 949cdedc74dbf3c17f2c9743064ce307026f871e 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 e1c4a359aacfce97eb1652624789e71981e0d263 -R e91ef90a16bba44cf708262fb6cb820b -U drh -Z 19b2f03fd6d61f381622fb62b54f6f32 +P 6917d9f437224229fa103c847c2df87ade64e1e9 +R 0111aab44e1e45e62cc43cdb1ef5ac44 +U dan +Z 3770b6339e7a7811d980a8c39cc67da5 diff --git a/manifest.uuid b/manifest.uuid index 0767c77fe9..4550f6b084 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6917d9f437224229fa103c847c2df87ade64e1e9 \ No newline at end of file +af20eae1e6f608e4e61a07c3d14cf88c12751353 \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index f802d9cd19..3fcb0cff24 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3717,6 +3717,7 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){ ** that do not have a real fallocate() call. */ int nBlk = buf.st_blksize; /* File-system block size */ + int nWrite = 0; /* Number of bytes written by seekAndWrite */ i64 iWrite; /* Next offset to write to */ iWrite = ((buf.st_size + 2*nBlk - 1)/nBlk)*nBlk-1; @@ -3724,11 +3725,11 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){ assert( (iWrite/nBlk)==((buf.st_size+nBlk-1)/nBlk) ); assert( ((iWrite+1)%nBlk)==0 ); for(/*no-op*/; iWrite Date: Wed, 7 Jan 2015 14:09:41 +0000 Subject: [PATCH 24/69] Add a valgrind test to the Linux-x86_64 platform in releasetest.tcl. FossilOrigin-Name: 4b6df035561add4e304fb56dd70ae4d413d6bd5d --- Makefile.in | 3 +++ manifest | 16 ++++++++-------- manifest.uuid | 2 +- test/releasetest.tcl | 22 +++++++++++++++++----- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/Makefile.in b/Makefile.in index f9974d609b..7cf30bd617 100644 --- a/Makefile.in +++ b/Makefile.in @@ -943,6 +943,9 @@ fulltestonly: testfixture$(TEXE) sqlite3$(TEXE) test: testfixture$(TEXE) sqlite3$(TEXE) ./testfixture$(TEXE) $(TOP)/test/veryquick.test +valgrindtest: testfixture sqlite3 + valgrind -v ./testfixture $(TOP)/test/permutations.test valgrind + sqlite3_analyzer.c: sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl echo "#define TCLSH 2" > $@ cat sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c >> $@ diff --git a/manifest b/manifest index b0a012638e..87287d687c 100644 --- a/manifest +++ b/manifest @@ -1,7 +1,7 @@ -C Fix\sa\sproblem\sin\sthe\sunix\simplementation\sof\sFCNTL_SIZE_HINT\son\ssystems\sthat\sdo\snot\ssupport\sposix_fallocate(). -D 2015-01-06T21:31:47.399 +C Add\sa\svalgrind\stest\sto\sthe\sLinux-x86_64\splatform\sin\sreleasetest.tcl. +D 2015-01-07T14:09:41.228 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in 335e2d3ff0f2455eacbfa3075fc37495e3321410 +F Makefile.in f33d4a67b9471dd46283e0a3d61b0fdd763881ef F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 @@ -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 fcdb3fb8a84218cbc0d8d65c00375851e05d1966 +F test/releasetest.tcl 0c48488235152e5e1fff0a9799e0c0783575c3d7 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 6917d9f437224229fa103c847c2df87ade64e1e9 -R 0111aab44e1e45e62cc43cdb1ef5ac44 -U dan -Z 3770b6339e7a7811d980a8c39cc67da5 +P af20eae1e6f608e4e61a07c3d14cf88c12751353 +R e86fb760bae561a09a9e3d3b43363ec9 +U drh +Z 86d9cb70a3b84146b850d94589825104 diff --git a/manifest.uuid b/manifest.uuid index 4550f6b084..a15217c001 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -af20eae1e6f608e4e61a07c3d14cf88c12751353 \ No newline at end of file +4b6df035561add4e304fb56dd70ae4d413d6bd5d \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 24665f6f67..afcde27fd7 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -155,12 +155,16 @@ array set ::Configs { -DSQLITE_DISABLE_FTS4_DEFERRED -DSQLITE_ENABLE_RTREE } - "No-lookaside" { -DSQLITE_TEST_REALLOC_STRESS=1 -DSQLITE_OMIT_LOOKASIDE=1 -DHAVE_USLEEP=1 } + "Valgrind" { + -DSQLITE_ENABLE_STAT4 + -DSQLITE_ENABLE_FTS4 + -DSQLITE_ENABLE_RTREE + } } array set ::Platforms { @@ -172,10 +176,11 @@ array set ::Platforms { "Update-Delete-Limit" test "Extra-Robustness" test "Device-Two" test - "Ftrapv" test - "Sanitize" {QUICKTEST_OMIT=func4.test,nan.test test} "No-lookaside" test "Devkit" test + "Ftrapv" test + "Sanitize" {QUICKTEST_OMIT=func4.test,nan.test test} + "Valgrind" valgrindtest "Default" "threadtest fulltest" "Device-One" fulltest } @@ -243,6 +248,13 @@ proc count_tests_and_errors {logfile rcVar errmsgVar} { set errmsg $msg } } + if {[regexp {ERROR SUMMARY: (\d+) errors.*} $line all cnt] && $cnt>0} { + incr ::NERRCASE + if {$rc==0} { + set rc 1 + set errmsg $all + } + } } close $fd if {!$seen} { @@ -328,7 +340,7 @@ proc configureCommand {} { if {$::tcl_platform(platform)=="windows"} { lappend result sh } - lappend result $::SRCDIR/configure -enable-load-extension >& test.log + lappend result $::SRCDIR/configure --enable-load-extension >& test.log } # The following procedure returns the "make" command to be executed for the @@ -478,7 +490,7 @@ proc main {argv} { # If the configuration included the SQLITE_DEBUG option, then remove # it and run veryquick.test. If it did not include the SQLITE_DEBUG option # add it and run veryquick.test. - if {$target!="checksymbols" && !$::BUILDONLY} { + if {$target!="checksymbols" && $target!="valgrindtest" && !$::BUILDONLY} { set debug_idx [lsearch -glob $config_options -DSQLITE_DEBUG*] set xtarget $target regsub -all {fulltest[a-z]*} $xtarget test xtarget From 8f45555ddcc74d99e16a15a247730707d8e9ec2a Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 7 Jan 2015 14:41:18 +0000 Subject: [PATCH 25/69] In releasetest.tcl, change the --dryrun option to work as it does in multitest.tcl of TH3. Add the new --trace option that work like the --dryrun option used to work. Add the ability to specify additional configure-script options in the Config array, and create configurations that use --disable-shared and --disable-amalgamation for testing. FossilOrigin-Name: be17ef03f1d74187f7d3b5d72a12fc00db513c8e --- Makefile.in | 2 +- manifest | 14 ++++++------- manifest.uuid | 2 +- test/releasetest.tcl | 47 +++++++++++++++++++++++++++++--------------- 4 files changed, 40 insertions(+), 25 deletions(-) diff --git a/Makefile.in b/Makefile.in index 7cf30bd617..ec84b49dd3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -30,7 +30,7 @@ BCC = @BUILD_CC@ @BUILD_CFLAGS@ # CC = @CC@ CFLAGS = @CPPFLAGS@ @CFLAGS@ -TCC = $(CC) $(CFLAGS) -I. -I${TOP}/src -I${TOP}/ext/rtree +TCC = $(CC) $(CFLAGS) -I. -I${TOP}/src -I${TOP}/ext/rtree -I${TOP}/ext/fts3 # Define this for the autoconf-based build, so that the code knows it can # include the generated config.h diff --git a/manifest b/manifest index 87287d687c..6f382e7241 100644 --- a/manifest +++ b/manifest @@ -1,7 +1,7 @@ -C Add\sa\svalgrind\stest\sto\sthe\sLinux-x86_64\splatform\sin\sreleasetest.tcl. -D 2015-01-07T14:09:41.228 +C In\sreleasetest.tcl,\schange\sthe\s--dryrun\soption\sto\swork\sas\sit\sdoes\sin\nmultitest.tcl\sof\sTH3.\s\sAdd\sthe\snew\s--trace\soption\sthat\swork\slike\sthe\s--dryrun\noption\sused\sto\swork.\s\sAdd\sthe\sability\sto\sspecify\sadditional\sconfigure-script\noptions\sin\sthe\sConfig\sarray,\sand\screate\sconfigurations\sthat\suse\n--disable-shared\sand\s--disable-amalgamation\sfor\stesting. +D 2015-01-07T14:41:18.624 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in f33d4a67b9471dd46283e0a3d61b0fdd763881ef +F Makefile.in 93b5a564234f87ded60df9bc196f163bb9d7ff44 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 @@ -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 0c48488235152e5e1fff0a9799e0c0783575c3d7 +F test/releasetest.tcl 64eaa07598cac0967311d5cacecba576ef4bc804 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 af20eae1e6f608e4e61a07c3d14cf88c12751353 -R e86fb760bae561a09a9e3d3b43363ec9 +P 4b6df035561add4e304fb56dd70ae4d413d6bd5d +R 7d9365389be9392e1fae2ffe15873ec9 U drh -Z 86d9cb70a3b84146b850d94589825104 +Z d0f9eda3b9de9b98c9c5ee62f0202409 diff --git a/manifest.uuid b/manifest.uuid index a15217c001..f2f7259a06 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -4b6df035561add4e304fb56dd70ae4d413d6bd5d \ No newline at end of file +be17ef03f1d74187f7d3b5d72a12fc00db513c8e \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index afcde27fd7..22c37c1721 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -31,6 +31,7 @@ of the SQLite source tree. array set ::Configs { "Default" { -O2 + --disable-amalgamation } "Ftrapv" { -O2 -ftrapv @@ -74,6 +75,7 @@ array set ::Configs { -DSQLITE_ENABLE_STAT4 } "Debug-One" { + --disable-shared -O2 -DSQLITE_DEBUG=1 -DSQLITE_MEMDEBUG=1 @@ -272,6 +274,7 @@ proc run_test_suite {name testtarget config} { set cflags "-g" set opts "" set title ${name}($testtarget) + set configOpts "" regsub -all {#[^\n]*\n} $config \n config foreach arg $config { @@ -279,6 +282,8 @@ proc run_test_suite {name testtarget config} { lappend opts $arg } elseif {[string match CC=* $arg]} { lappend testtarget $arg + } elseif {[regexp {^--(enable|disable)-} $arg]} { + lappend configOpts $arg } else { lappend cflags $arg } @@ -298,26 +303,27 @@ proc run_test_suite {name testtarget config} { append opts " -DSQLITE_OS_UNIX=1" } - dryrun file mkdir $dir - if {!$::DRYRUN} { + if {!$::TRACE} { set n [string length $title] puts -nonewline "${title}[string repeat . [expr {63-$n}]]" flush stdout } + set rc 0 set tm1 [clock seconds] set origdir [pwd] - dryrun cd $dir + trace_cmd file mkdir $dir + trace_cmd cd $dir set errmsg {} - set rc [catch [configureCommand]] + set rc [catch [configureCommand $configOpts]] if {!$rc} { set rc [catch [makeCommand $testtarget $cflags $opts]] count_tests_and_errors test.log rc errmsg } + trace_cmd cd $origdir set tm2 [clock seconds] - dryrun cd $origdir - if {!$::DRYRUN} { + if {!$::TRACE} { set hours [expr {($tm2-$tm1)/3600}] set minutes [expr {(($tm2-$tm1)/60)%60}] set seconds [expr {($tm2-$tm1)%60}] @@ -335,33 +341,36 @@ proc run_test_suite {name testtarget config} { # The following procedure returns the "configure" command to be exectued for # the current platform, which may be Windows (via MinGW, etc). # -proc configureCommand {} { - set result [list dryrun exec] +proc configureCommand {opts} { + set result [list trace_cmd exec] if {$::tcl_platform(platform)=="windows"} { lappend result sh } - lappend result $::SRCDIR/configure --enable-load-extension >& test.log + lappend result $::SRCDIR/configure --enable-load-extension + foreach x $opts {lappend result $x} + lappend result >& test.log } # The following procedure returns the "make" command to be executed for the # specified targets, compiler flags, and options. # proc makeCommand { targets cflags opts } { - set result [list dryrun exec make clean] + set result [list trace_cmd exec make clean] foreach target $targets { lappend result $target } lappend result CFLAGS=$cflags OPTS=$opts >>& test.log } -# The following procedure either prints its arguments (if ::DRYRUN is true) -# or executes the command of its arguments in the calling context -# (if ::DRYRUN is false). +# The following procedure prints its arguments if ::TRACE is true. +# And it executes the command of its arguments in the calling context +# if ::DRYRUN is false. # -proc dryrun {args} { - if {$::DRYRUN} { +proc trace_cmd {args} { + if {$::TRACE} { puts $args - } else { + } + if {!$::DRYRUN} { uplevel 1 $args } } @@ -378,6 +387,7 @@ proc process_options {argv} { set ::BUILDONLY 0 set ::DRYRUN 0 set ::EXEC exec + set ::TRACE 0 set config {} set platform $::tcl_platform(os)-$::tcl_platform(machine) @@ -412,6 +422,10 @@ proc process_options {argv} { set ::DRYRUN 1 } + -trace { + set ::TRACE 1 + } + -info { puts "Command-line Options:" puts " --srcdir $::SRCDIR" @@ -420,6 +434,7 @@ proc process_options {argv} { if {$::QUICK} {puts " --quick"} if {$::BUILDONLY} {puts " --buildonly"} if {$::DRYRUN} {puts " --dryrun"} + if {$::TRACE} {puts " --trace"} puts "\nAvailable --platform options:" foreach y [lsort [array names ::Platforms]] { puts " [list $y]" From b13160f71fe55d8e59443dec57597865e7a1e838 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Wed, 7 Jan 2015 18:11:29 +0000 Subject: [PATCH 26/69] Fix threads-enabled builds on Windows when the amalgamation is not in use. FossilOrigin-Name: 9b92a4d2b6585d5fdf20330e4138081df58960e9 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/threads.c | 3 +++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 6f382e7241..aa7213d9fe 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C In\sreleasetest.tcl,\schange\sthe\s--dryrun\soption\sto\swork\sas\sit\sdoes\sin\nmultitest.tcl\sof\sTH3.\s\sAdd\sthe\snew\s--trace\soption\sthat\swork\slike\sthe\s--dryrun\noption\sused\sto\swork.\s\sAdd\sthe\sability\sto\sspecify\sadditional\sconfigure-script\noptions\sin\sthe\sConfig\sarray,\sand\screate\sconfigurations\sthat\suse\n--disable-shared\sand\s--disable-amalgamation\sfor\stesting. -D 2015-01-07T14:41:18.624 +C Fix\sthreads-enabled\sbuilds\son\sWindows\swhen\sthe\samalgamation\sis\snot\sin\suse. +D 2015-01-07T18:11:29.002 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 93b5a564234f87ded60df9bc196f163bb9d7ff44 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -284,7 +284,7 @@ F src/test_thread.c 1e133a40b50e9c035b00174035b846e7eef481cb F src/test_vfs.c f84075a388527892ff184988f43b69ce69b8083c F src/test_vfstrace.c bab9594adc976cbe696ff3970728830b4c5ed698 F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9 -F src/threads.c 6de09362b657f19ba83e5fa521ee715787ce9fee +F src/threads.c 2fb3ea4d70d5acf68b539c2489b4adace61cc01b F src/tokenize.c e00458c9938072b0ea711c850b8dcf4ddcb5fe18 F src/trigger.c 25571661fdeae8c7f975ff40ffec205520a3f92f F src/update.c 3c4ecc282accf12d39edb8d524cf089645e55a13 @@ -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 4b6df035561add4e304fb56dd70ae4d413d6bd5d -R 7d9365389be9392e1fae2ffe15873ec9 -U drh -Z d0f9eda3b9de9b98c9c5ee62f0202409 +P be17ef03f1d74187f7d3b5d72a12fc00db513c8e +R c017e1263e3a1543e8b0c9af20b82a8a +U mistachkin +Z 825ab427837e393aa1593ac0c51b1252 diff --git a/manifest.uuid b/manifest.uuid index f2f7259a06..334b0c9c1f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -be17ef03f1d74187f7d3b5d72a12fc00db513c8e \ No newline at end of file +9b92a4d2b6585d5fdf20330e4138081df58960e9 \ No newline at end of file diff --git a/src/threads.c b/src/threads.c index 18d7320a12..16f52498c3 100644 --- a/src/threads.c +++ b/src/threads.c @@ -26,6 +26,9 @@ ** single-threaded if desired. */ #include "sqliteInt.h" +#if SQLITE_OS_WIN +# include "os_win.h" +#endif #if SQLITE_MAX_WORKER_THREADS>0 From d3a720e11e6ffe5def9117eef5893c07899975c4 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Wed, 7 Jan 2015 18:19:09 +0000 Subject: [PATCH 27/69] Modify the valgrind target to be consistent with regard to target suffixes. FossilOrigin-Name: dc4aa7321262ace43d985a227ad052dfca7db6c7 --- Makefile.in | 4 ++-- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile.in b/Makefile.in index ec84b49dd3..5d89b0aae7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -943,8 +943,8 @@ fulltestonly: testfixture$(TEXE) sqlite3$(TEXE) test: testfixture$(TEXE) sqlite3$(TEXE) ./testfixture$(TEXE) $(TOP)/test/veryquick.test -valgrindtest: testfixture sqlite3 - valgrind -v ./testfixture $(TOP)/test/permutations.test valgrind +valgrindtest: testfixture$(TEXE) sqlite3$(TEXE) + valgrind -v ./testfixture$(TEXE) $(TOP)/test/permutations.test valgrind sqlite3_analyzer.c: sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl echo "#define TCLSH 2" > $@ diff --git a/manifest b/manifest index aa7213d9fe..ca91d79350 100644 --- a/manifest +++ b/manifest @@ -1,7 +1,7 @@ -C Fix\sthreads-enabled\sbuilds\son\sWindows\swhen\sthe\samalgamation\sis\snot\sin\suse. -D 2015-01-07T18:11:29.002 +C Modify\sthe\svalgrind\starget\sto\sbe\sconsistent\swith\sregard\sto\starget\ssuffixes. +D 2015-01-07T18:19:09.561 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in 93b5a564234f87ded60df9bc196f163bb9d7ff44 +F Makefile.in 3a2b5f8356e11591b2a7b23ce444654424591d06 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 @@ -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 be17ef03f1d74187f7d3b5d72a12fc00db513c8e -R c017e1263e3a1543e8b0c9af20b82a8a +P 9b92a4d2b6585d5fdf20330e4138081df58960e9 +R 57542d62cffe2d566b148ef68993a058 U mistachkin -Z 825ab427837e393aa1593ac0c51b1252 +Z 0f5a5e7af0d0c3b98a248d1911e08a19 diff --git a/manifest.uuid b/manifest.uuid index 334b0c9c1f..958d9156d6 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9b92a4d2b6585d5fdf20330e4138081df58960e9 \ No newline at end of file +dc4aa7321262ace43d985a227ad052dfca7db6c7 \ No newline at end of file From f167a402849eef7bb4748f9f4625f73831d8c052 Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 7 Jan 2015 18:44:59 +0000 Subject: [PATCH 28/69] In releasetest.tcl, copy certain command-line arguments (-g, -D..., etc) down into each test run. FossilOrigin-Name: 889864b58af1e51fb148af2d6a5cef4950f373f4 --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/releasetest.tcl | 12 ++++++++++-- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index ca91d79350..5b1acd49e6 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Modify\sthe\svalgrind\starget\sto\sbe\sconsistent\swith\sregard\sto\starget\ssuffixes. -D 2015-01-07T18:19:09.561 +C In\sreleasetest.tcl,\scopy\scertain\scommand-line\sarguments\s(-g,\s-D...,\setc)\ndown\sinto\seach\stest\srun. +D 2015-01-07T18:44:59.340 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 3a2b5f8356e11591b2a7b23ce444654424591d06 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 64eaa07598cac0967311d5cacecba576ef4bc804 +F test/releasetest.tcl 8c0d89629ba78ebaf5a9f8323d7bfbe931e7bf08 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 9b92a4d2b6585d5fdf20330e4138081df58960e9 -R 57542d62cffe2d566b148ef68993a058 -U mistachkin -Z 0f5a5e7af0d0c3b98a248d1911e08a19 +P dc4aa7321262ace43d985a227ad052dfca7db6c7 +R 29f0edba48a2f5a2bdf9b5bce9d63229 +U drh +Z 2d1cb7c03d7ff18e565521b6e31d33d6 diff --git a/manifest.uuid b/manifest.uuid index 958d9156d6..626643329b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -dc4aa7321262ace43d985a227ad052dfca7db6c7 \ No newline at end of file +889864b58af1e51fb148af2d6a5cef4950f373f4 \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 22c37c1721..f2f49e61d7 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -394,7 +394,7 @@ proc process_options {argv} { for {set i 0} {$i < [llength $argv]} {incr i} { set x [lindex $argv $i] if {[regexp {^--[a-z]} $x]} {set x [string range $x 1 end]} - switch -- $x { + switch -glob -- $x { -srcdir { incr i set ::SRCDIR [file normalize [lindex $argv $i]] @@ -445,6 +445,13 @@ proc process_options {argv} { } exit } + -g - + -D* - + -enable-* - + -disable-* - + *=* { + lappend ::EXTRACONFIG [lindex $argv $i] + } default { puts stderr "" @@ -486,6 +493,7 @@ proc process_options {argv} { proc main {argv} { # Process any command line options. + set ::EXTRACONFIG {} process_options $argv puts [string repeat * 79] @@ -497,7 +505,7 @@ proc main {argv} { foreach {zConfig target} $::CONFIGLIST { if {$::QUICK} {set target test} if {$::BUILDONLY} {set target testfixture} - set config_options $::Configs($zConfig) + set config_options [concat $::Configs($zConfig) $::EXTRACONFIG] incr NTEST run_test_suite $zConfig $target $config_options From 46350078eb4c0ca514f55ab7d0c1c8419ee31350 Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 7 Jan 2015 19:38:49 +0000 Subject: [PATCH 29/69] In releasetest.tcl, always use --disable-shared together with --disable-amalgamation because mingw generates a binary that crashes and cannot be debugged using gdb if you don't. FossilOrigin-Name: 19982439418fbd36c91853cf9e09a66606f293fc --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/releasetest.tcl | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 5b1acd49e6..643c4b0538 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C In\sreleasetest.tcl,\scopy\scertain\scommand-line\sarguments\s(-g,\s-D...,\setc)\ndown\sinto\seach\stest\srun. -D 2015-01-07T18:44:59.340 +C In\sreleasetest.tcl,\salways\suse\s--disable-shared\stogether\swith\n--disable-amalgamation\sbecause\smingw\sgenerates\sa\sbinary\sthat\scrashes\sand\ncannot\sbe\sdebugged\susing\sgdb\sif\syou\sdon't. +D 2015-01-07T19:38:49.154 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 3a2b5f8356e11591b2a7b23ce444654424591d06 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 8c0d89629ba78ebaf5a9f8323d7bfbe931e7bf08 +F test/releasetest.tcl ed0bbb989509c727ef485986a239f13a431ff01f 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 dc4aa7321262ace43d985a227ad052dfca7db6c7 -R 29f0edba48a2f5a2bdf9b5bce9d63229 +P 889864b58af1e51fb148af2d6a5cef4950f373f4 +R 26902a8eca2abb38182891a95ae86cbf U drh -Z 2d1cb7c03d7ff18e565521b6e31d33d6 +Z e594c5678dcb940c76bf74543898ae24 diff --git a/manifest.uuid b/manifest.uuid index 626643329b..0a8eace1f4 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -889864b58af1e51fb148af2d6a5cef4950f373f4 \ No newline at end of file +19982439418fbd36c91853cf9e09a66606f293fc \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index f2f49e61d7..ec1e6b2889 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -31,7 +31,7 @@ of the SQLite source tree. array set ::Configs { "Default" { -O2 - --disable-amalgamation + --disable-amalgamation --disable-shared } "Ftrapv" { -O2 -ftrapv From 5bfff9d2f66d8f0e6955028c4c7ef4afc20975df Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 8 Jan 2015 01:05:42 +0000 Subject: [PATCH 30/69] In releasetest.tcl: add options --veryquick and pass-through compiler optimization settings (ex: -O0). Collect the SQLite version number from the main.test output and show it during the summary report at the end. FossilOrigin-Name: e7e7bc1d9a5c19571e7d87ad345b98c27a826fbd --- Makefile.in | 17 ++++++++++++++++- manifest | 16 ++++++++-------- manifest.uuid | 2 +- test/main.test | 6 ++++++ test/releasetest.tcl | 39 +++++++++++++++++++++++++++++++++------ 5 files changed, 64 insertions(+), 16 deletions(-) diff --git a/Makefile.in b/Makefile.in index 5d89b0aae7..5b52e0fe2d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -930,22 +930,37 @@ testfixture$(TEXE): $(TESTFIXTURE_SRC) $(LTLINK) -DSQLITE_NO_SYNC=1 $(TEMP_STORE) $(TESTFIXTURE_FLAGS) \ -o $@ $(TESTFIXTURE_SRC) $(LIBTCL) $(TLIBS) - +# A very detailed test running most or all test cases fulltest: testfixture$(TEXE) sqlite3$(TEXE) ./testfixture$(TEXE) $(TOP)/test/all.test +# Really really long testing soaktest: testfixture$(TEXE) sqlite3$(TEXE) ./testfixture$(TEXE) $(TOP)/test/all.test -soak=1 +# Do extra testing but not aeverything. fulltestonly: testfixture$(TEXE) sqlite3$(TEXE) ./testfixture$(TEXE) $(TOP)/test/full.test +# This is the common case. Run many tests but not those that take +# a really long time. +# test: testfixture$(TEXE) sqlite3$(TEXE) ./testfixture$(TEXE) $(TOP)/test/veryquick.test +# Run a test using valgrind. This can take a really long time +# because valgrind is so much slower than a native machine. +# valgrindtest: testfixture$(TEXE) sqlite3$(TEXE) valgrind -v ./testfixture$(TEXE) $(TOP)/test/permutations.test valgrind +# A very fast test that checks basic sanity. The name comes from +# the 60s-era electronics testing: "Turn it on and see if smoke +# comes out." +# +smoketest: testfixture$(TEXT) sqlite3$(TEXT) + ./testfixture$(TEXT) $(TOP)/test/main.test + sqlite3_analyzer.c: sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl echo "#define TCLSH 2" > $@ cat sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c >> $@ diff --git a/manifest b/manifest index 643c4b0538..132f600c79 100644 --- a/manifest +++ b/manifest @@ -1,7 +1,7 @@ -C In\sreleasetest.tcl,\salways\suse\s--disable-shared\stogether\swith\n--disable-amalgamation\sbecause\smingw\sgenerates\sa\sbinary\sthat\scrashes\sand\ncannot\sbe\sdebugged\susing\sgdb\sif\syou\sdon't. -D 2015-01-07T19:38:49.154 +C In\sreleasetest.tcl:\sadd\soptions\s--veryquick\sand\spass-through\scompiler\noptimization\ssettings\s(ex:\s-O0).\s\sCollect\sthe\sSQLite\sversion\snumber\sfrom\nthe\smain.test\soutput\sand\sshow\sit\sduring\sthe\ssummary\sreport\sat\sthe\send. +D 2015-01-08T01:05:42.481 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in 3a2b5f8356e11591b2a7b23ce444654424591d06 +F Makefile.in f1c9525dccb991ad3095a7f8778b4ae869851130 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 @@ -699,7 +699,7 @@ F test/lock6.test ad5b387a3a8096afd3c68a55b9535056431b0cf5 F test/lock7.test 49f1eaff1cdc491cc5dee3669f3c671d9f172431 F test/lock_common.tcl 0c270b121d40959fa2f3add382200c27045b3d95 F test/lookaside.test 93f07bac140c5bb1d49f3892d2684decafdc7af2 -F test/main.test 39c4bb8a157f57298ed1659d6df89d9f35aaf2c8 +F test/main.test 6aa6c7a5468f5b16868e74ce1160b4947c58d83b F test/make-where7.tcl 05c16b5d4f5d6512881dfec560cb793915932ef9 F test/malloc.test 96939d2d1a6f39667bbebe5bc27c6525f2ab614e F test/malloc3.test e3b32c724b5a124b57cb0ed177f675249ad0c66a @@ -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 ed0bbb989509c727ef485986a239f13a431ff01f +F test/releasetest.tcl 29111a0fd97b4b92a5f40c25c0102d94167ae57f 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 889864b58af1e51fb148af2d6a5cef4950f373f4 -R 26902a8eca2abb38182891a95ae86cbf +P 19982439418fbd36c91853cf9e09a66606f293fc +R e120388d83e06da397d9a5be14f3a4df U drh -Z e594c5678dcb940c76bf74543898ae24 +Z 2b3b1e8376da1c06b0cff1703883fdf5 diff --git a/manifest.uuid b/manifest.uuid index 0a8eace1f4..a69406b825 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -19982439418fbd36c91853cf9e09a66606f293fc \ No newline at end of file +e7e7bc1d9a5c19571e7d87ad345b98c27a826fbd \ No newline at end of file diff --git a/test/main.test b/test/main.test index 5bbc52b845..62c0f708ae 100644 --- a/test/main.test +++ b/test/main.test @@ -514,5 +514,11 @@ if {$::tcl_platform(platform)=="unix" } {1 {no such vfs: async}} } } + +# Print the version number so that it can be picked up by releasetest.tcl. +# +puts [db one {SELECT 'VERSION: ' || + sqlite_version() || ' ' || + sqlite_source_id();}] finish_test diff --git a/test/releasetest.tcl b/test/releasetest.tcl index ec1e6b2889..7c93479dc9 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -13,6 +13,7 @@ optional) are: --platform PLATFORM (see below) --config CONFIGNAME (Run only CONFIGNAME) --quick (Run "veryquick.test" only) + --veryquick (Run "make smoketest" only) --buildonly (Just build testfixture - do not run) --dryrun (Print what would have happened) --info (Show diagnostic info) @@ -31,7 +32,7 @@ of the SQLite source tree. array set ::Configs { "Default" { -O2 - --disable-amalgamation --disable-shared + --disable-amalgamation } "Ftrapv" { -O2 -ftrapv @@ -257,6 +258,15 @@ proc count_tests_and_errors {logfile rcVar errmsgVar} { set errmsg $all } } + if {[regexp {^VERSION: 3\.\d+.\d+} $line]} { + set v [string range $line 9 end] + if {$::SQLITE_VERSION eq ""} { + set ::SQLITE_VERSION $v + } elseif {$::SQLITE_VERSION ne $v} { + set rc 1 + set errmsg "version conflict: {$::SQLITE_VERSION} vs. {$v}" + } + } } close $fd if {!$seen} { @@ -408,6 +418,9 @@ proc process_options {argv} { -quick { set ::QUICK 1 } + -veryquick { + set ::QUICK 2 + } -config { incr i @@ -447,6 +460,7 @@ proc process_options {argv} { } -g - -D* - + -O* - -enable-* - -disable-* - *=* { @@ -484,7 +498,10 @@ proc process_options {argv} { puts -nonewline "Flags:" if {$::DRYRUN} {puts -nonewline " --dryrun"} if {$::BUILDONLY} {puts -nonewline " --buildonly"} - if {$::QUICK} {puts -nonewline " --quick"} + switch -- $::QUICK { + 1 {puts -nonewline " --quick"} + 2 {puts -nonewline " --veryquick"} + } puts "" } @@ -501,10 +518,16 @@ proc main {argv} { set ::NTEST 0 set ::NTESTCASE 0 set ::NERRCASE 0 + set ::SQLITE_VERSION {} set STARTTIME [clock seconds] foreach {zConfig target} $::CONFIGLIST { - if {$::QUICK} {set target test} - if {$::BUILDONLY} {set target testfixture} + if {$target ne "checksymbols"} { + switch -- $::QUICK { + 1 {set target test} + 2 {set target smoketest} + } + if {$::BUILDONLY} {set target testfixture} + } set config_options [concat $::Configs($zConfig) $::EXTRACONFIG] incr NTEST @@ -513,7 +536,8 @@ proc main {argv} { # If the configuration included the SQLITE_DEBUG option, then remove # it and run veryquick.test. If it did not include the SQLITE_DEBUG option # add it and run veryquick.test. - if {$target!="checksymbols" && $target!="valgrindtest" && !$::BUILDONLY} { + if {$target!="checksymbols" && $target!="valgrindtest" + && !$::BUILDONLY && $::QUICK<2} { set debug_idx [lsearch -glob $config_options -DSQLITE_DEBUG*] set xtarget $target regsub -all {fulltest[a-z]*} $xtarget test xtarget @@ -536,7 +560,10 @@ proc main {argv} { set sec [expr {$elapsetime%60}] set etime [format (%02d:%02d:%02d) $hr $min $sec] puts [string repeat * 79] - puts "$::NERRCASE failures of $::NTESTCASE tests run in $etime" + puts "$::NERRCASE failures out of $::NTESTCASE tests in $etime" + if {$::SQLITE_VERSION ne ""} { + puts "SQLite $::SQLITE_VERSION" + } } main $argv From edb31cd191404b4b488abaa7f57d7372eeb3b4ca Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 8 Jan 2015 02:15:11 +0000 Subject: [PATCH 31/69] In releasetest.tcl: (1) Add the Failure-Detection platform. (2) Re-add the --disable-shared argument on Default that was mistakenly removed by the previous commit. (3) Remove the -ftrapv tests, as we read that -ftrapv does not work in GCC. FossilOrigin-Name: 1f2fb77781a93427a2348f821b66dba7310c49b8 --- manifest | 18 +++++++------- manifest.uuid | 2 +- src/test1.c | 56 ++++++++++++++++++++++++++++++++++++++++++ test/main.test | 14 +++++++++++ test/permutations.test | 8 ++++++ test/releasetest.tcl | 18 ++++++++------ 6 files changed, 99 insertions(+), 17 deletions(-) diff --git a/manifest b/manifest index 132f600c79..45138d6c8f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C In\sreleasetest.tcl:\sadd\soptions\s--veryquick\sand\spass-through\scompiler\noptimization\ssettings\s(ex:\s-O0).\s\sCollect\sthe\sSQLite\sversion\snumber\sfrom\nthe\smain.test\soutput\sand\sshow\sit\sduring\sthe\ssummary\sreport\sat\sthe\send. -D 2015-01-08T01:05:42.481 +C In\sreleasetest.tcl:\n(1)\sAdd\sthe\sFailure-Detection\splatform.\n(2)\sRe-add\sthe\s--disable-shared\sargument\son\sDefault\sthat\swas\smistakenly\n\s\s\s\sremoved\sby\sthe\sprevious\scommit.\n(3)\sRemove\sthe\s-ftrapv\stests,\sas\swe\sread\sthat\s-ftrapv\sdoes\snot\swork\sin\sGCC. +D 2015-01-08T02:15:11.082 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in f1c9525dccb991ad3095a7f8778b4ae869851130 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -238,7 +238,7 @@ F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c 81712116e826b0089bb221b018929536b2b5406f F src/table.c e7a09215315a978057fb42c640f890160dbcc45e F src/tclsqlite.c c6a21c64da1490e14d53cdc2062d1e2e57942622 -F src/test1.c 041c4edf2f9c49a329add297e26ee86a83852f51 +F src/test1.c 71f67f0c9f98de15026203bcdb7436268465a866 F src/test2.c 98049e51a17dc62606a99a9eb95ee477f9996712 F src/test3.c 1c0e5d6f080b8e33c1ce8b3078e7013fdbcd560c F src/test4.c 9b32d22f5f150abe23c1830e2057c4037c45b3df @@ -699,7 +699,7 @@ F test/lock6.test ad5b387a3a8096afd3c68a55b9535056431b0cf5 F test/lock7.test 49f1eaff1cdc491cc5dee3669f3c671d9f172431 F test/lock_common.tcl 0c270b121d40959fa2f3add382200c27045b3d95 F test/lookaside.test 93f07bac140c5bb1d49f3892d2684decafdc7af2 -F test/main.test 6aa6c7a5468f5b16868e74ce1160b4947c58d83b +F test/main.test 16131264ea0c2b93b95201f0c92958e85f2ba11a F test/make-where7.tcl 05c16b5d4f5d6512881dfec560cb793915932ef9 F test/malloc.test 96939d2d1a6f39667bbebe5bc27c6525f2ab614e F test/malloc3.test e3b32c724b5a124b57cb0ed177f675249ad0c66a @@ -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 3a58611f8b703d385015bbe1710c722ff900f2ee +F test/permutations.test fa2b4e56d1427dd3763053d78ce2f132376bb695 F test/pragma.test aa16dedfe01c02c8895169012f7dfde9c163f0d5 F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13 F test/pragma3.test 6f849ccffeee7e496d2f2b5e74152306c0b8757c @@ -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 29111a0fd97b4b92a5f40c25c0102d94167ae57f +F test/releasetest.tcl 1e68ec50478dce13b374904668fb7e09409371fb 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 19982439418fbd36c91853cf9e09a66606f293fc -R e120388d83e06da397d9a5be14f3a4df +P e7e7bc1d9a5c19571e7d87ad345b98c27a826fbd +R c0ba3022e15ea8eeed124c3c8db015b7 U drh -Z 2b3b1e8376da1c06b0cff1703883fdf5 +Z 35451ec031f31c61639c4f2be05cb417 diff --git a/manifest.uuid b/manifest.uuid index a69406b825..47a6bf314b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e7e7bc1d9a5c19571e7d87ad345b98c27a826fbd \ No newline at end of file +1f2fb77781a93427a2348f821b66dba7310c49b8 \ No newline at end of file diff --git a/src/test1.c b/src/test1.c index 032e3f338c..9c0c572f7d 100644 --- a/src/test1.c +++ b/src/test1.c @@ -6604,6 +6604,60 @@ static int test_user_delete( } #endif /* SQLITE_USER_AUTHENTICATION */ +/* +** tclcmd: bad_behavior TYPE +** +** Do some things that should trigger a valgrind or -fsanitize=undefined +** warning. This is used to verify that errors and warnings output by those +** tools are detected by the test scripts. +** +** TYPE BEHAVIOR +** 1 Overflow a signed integer +** 2 Jump based on an uninitialized variable +** 3 Read after free +*/ +static int test_bad_behavior( + ClientData clientData, /* Pointer to an integer containing zero */ + Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ + int objc, /* Number of arguments */ + Tcl_Obj *CONST objv[] /* Command arguments */ +){ + int iType; + int xyz; + int i = *(int*)clientData; + int j; + int w[10]; + int *a; + if( objc!=2 ){ + Tcl_WrongNumArgs(interp, 1, objv, "TYPE"); + return TCL_ERROR; + } + if( Tcl_GetIntFromObj(interp, objv[1], &iType) ) return TCL_ERROR; + switch( iType ){ + case 1: { + xyz = 0x7fffff00 - i; + xyz += 0x100; + Tcl_SetObjResult(interp, Tcl_NewIntObj(xyz)); + break; + } + case 2: { + w[1] = 5; + if( w[i]>0 ) w[1]++; + Tcl_SetObjResult(interp, Tcl_NewIntObj(w[1])); + break; + } + case 3: { + a = malloc( sizeof(int)*10 ); + for(j=0; j<10; j++) a[j] = j; + free(a); + Tcl_SetObjResult(interp, Tcl_NewIntObj(a[i])); + break; + } + } + return TCL_OK; +} + + /* ** Register commands with the TCL interpreter. */ @@ -6620,6 +6674,7 @@ int Sqlitetest1_Init(Tcl_Interp *interp){ extern int sqlite3_max_blobsize; extern int sqlite3BtreeSharedCacheReport(void*, Tcl_Interp*,int,Tcl_Obj*CONST*); + static int iZero = 0; static struct { char *zName; Tcl_CmdProc *xProc; @@ -6672,6 +6727,7 @@ int Sqlitetest1_Init(Tcl_Interp *interp){ Tcl_ObjCmdProc *xProc; void *clientData; } aObjCmd[] = { + { "bad_behavior", test_bad_behavior, (void*)&iZero }, { "sqlite3_connection_pointer", get_sqlite_pointer, 0 }, { "sqlite3_bind_int", test_bind_int, 0 }, { "sqlite3_bind_zeroblob", test_bind_zeroblob, 0 }, diff --git a/test/main.test b/test/main.test index 62c0f708ae..3f35afe20c 100644 --- a/test/main.test +++ b/test/main.test @@ -520,5 +520,19 @@ if {$::tcl_platform(platform)=="unix" puts [db one {SELECT 'VERSION: ' || sqlite_version() || ' ' || sqlite_source_id();}] + +# Do deliberate failures if the TEST_FAILURE environment variable is set. +# This is done to verify that failure notifications are detected by the +# releasetest.tcl script, or possibly by other scripts involved in automatic +# testing. +# +if {[info exists ::env(TEST_FAILURE)]} { + set res 123 + if {$::env(TEST_FAILURE)==0} {set res 234} + do_test main-99.1 { + bad_behavior $::env(TEST_FAILURE) + set x 123 + } $res +} finish_test diff --git a/test/permutations.test b/test/permutations.test index 232e8f9704..6c7b563041 100644 --- a/test/permutations.test +++ b/test/permutations.test @@ -124,6 +124,14 @@ if {[info exists ::env(QUICKTEST_OMIT)]} { } } +# If the TEST_FAILURE environment variable is set, it means that we what to +# deliberately provoke test failures in order to test the test infrastructure. +# Only the main.test module is needed for this. +# +if {[info exists ::env(TEST_FAILURE)]} { + set allquicktests main.test +} + ############################################################################# # Start of tests # diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 7c93479dc9..3766dbd421 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -32,12 +32,7 @@ of the SQLite source tree. array set ::Configs { "Default" { -O2 - --disable-amalgamation - } - "Ftrapv" { - -O2 -ftrapv - -DSQLITE_MAX_ATTACHED=125 - -DSQLITE_TCL_DEFAULT_FULLMUTEX=1 + --disable-amalgamation --disable-shared } "Sanitize" { CC=clang -fsanitize=undefined @@ -88,6 +83,7 @@ array set ::Configs { -DSQLITE_ENABLE_MEMSYS3=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_ENABLE_STAT4 + -DSQLITE_MAX_ATTACHED=125 } "Device-One" { -O2 @@ -168,6 +164,9 @@ array set ::Configs { -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE } + Fail0 {-O0} + Fail2 {-O0} + Fail3 {-O0} } array set ::Platforms { @@ -181,7 +180,6 @@ array set ::Platforms { "Device-Two" test "No-lookaside" test "Devkit" test - "Ftrapv" test "Sanitize" {QUICKTEST_OMIT=func4.test,nan.test test} "Valgrind" valgrindtest "Default" "threadtest fulltest" @@ -205,6 +203,12 @@ array set ::Platforms { "Windows NT-intel" { "Default" "mptest fulltestonly" } + Failure-Detection { + Fail0 "TEST_FAILURE=0 test" + Sanitize "TEST_FAILURE=1 test" + Fail2 "TEST_FAILURE=2 valgrindtest" + Fail3 "TEST_FAILURE=3 valgrindtest" + } } From bc8b87a1bbf66e7d6357c6e656d80698014bc20c Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 8 Jan 2015 02:28:02 +0000 Subject: [PATCH 32/69] Fix the extension tags on the "smoketest" makefile target for Windows. FossilOrigin-Name: 826fd311e7e2849aefbd81724dcb4a5644cfa126 --- Makefile.in | 4 ++-- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile.in b/Makefile.in index 5b52e0fe2d..d654f96be9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -958,8 +958,8 @@ valgrindtest: testfixture$(TEXE) sqlite3$(TEXE) # the 60s-era electronics testing: "Turn it on and see if smoke # comes out." # -smoketest: testfixture$(TEXT) sqlite3$(TEXT) - ./testfixture$(TEXT) $(TOP)/test/main.test +smoketest: testfixture$(TEXE) + ./testfixture$(TEXE) $(TOP)/test/main.test sqlite3_analyzer.c: sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl echo "#define TCLSH 2" > $@ diff --git a/manifest b/manifest index 45138d6c8f..3134eea58b 100644 --- a/manifest +++ b/manifest @@ -1,7 +1,7 @@ -C In\sreleasetest.tcl:\n(1)\sAdd\sthe\sFailure-Detection\splatform.\n(2)\sRe-add\sthe\s--disable-shared\sargument\son\sDefault\sthat\swas\smistakenly\n\s\s\s\sremoved\sby\sthe\sprevious\scommit.\n(3)\sRemove\sthe\s-ftrapv\stests,\sas\swe\sread\sthat\s-ftrapv\sdoes\snot\swork\sin\sGCC. -D 2015-01-08T02:15:11.082 +C Fix\sthe\sextension\stags\son\sthe\s"smoketest"\smakefile\starget\sfor\sWindows. +D 2015-01-08T02:28:02.318 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in f1c9525dccb991ad3095a7f8778b4ae869851130 +F Makefile.in c93eb4b0258e78a7dacfddd328e52827be2c3773 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 @@ -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 e7e7bc1d9a5c19571e7d87ad345b98c27a826fbd -R c0ba3022e15ea8eeed124c3c8db015b7 +P 1f2fb77781a93427a2348f821b66dba7310c49b8 +R 8a1de20d0981a3624bba5e9b9b14f4fc U drh -Z 35451ec031f31c61639c4f2be05cb417 +Z 06dcf0afe5114ee85b427e54261705d7 diff --git a/manifest.uuid b/manifest.uuid index 47a6bf314b..c8083da5a3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1f2fb77781a93427a2348f821b66dba7310c49b8 \ No newline at end of file +826fd311e7e2849aefbd81724dcb4a5644cfa126 \ No newline at end of file From 32e1f27960f62d5f193e59ad9d213442cb5e3041 Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 8 Jan 2015 16:47:51 +0000 Subject: [PATCH 33/69] Try to fix up the "valgrindtest" target in Makefile.in so that it avoids misuse testing that can trigger false errors. FossilOrigin-Name: 50b5a8af843fff93452cd1c8f82152124a1d864a --- Makefile.in | 2 +- manifest | 16 ++++++++-------- manifest.uuid | 2 +- src/test1.c | 3 +++ test/oserror.test | 27 ++++++++++++++------------- 5 files changed, 27 insertions(+), 23 deletions(-) diff --git a/Makefile.in b/Makefile.in index d654f96be9..42caa69835 100644 --- a/Makefile.in +++ b/Makefile.in @@ -952,7 +952,7 @@ test: testfixture$(TEXE) sqlite3$(TEXE) # because valgrind is so much slower than a native machine. # valgrindtest: testfixture$(TEXE) sqlite3$(TEXE) - valgrind -v ./testfixture$(TEXE) $(TOP)/test/permutations.test valgrind + OMIT_MISUSE=1 valgrind -v ./testfixture$(TEXE) $(TOP)/test/permutations.test valgrind # A very fast test that checks basic sanity. The name comes from # the 60s-era electronics testing: "Turn it on and see if smoke diff --git a/manifest b/manifest index 3134eea58b..86064253cb 100644 --- a/manifest +++ b/manifest @@ -1,7 +1,7 @@ -C Fix\sthe\sextension\stags\son\sthe\s"smoketest"\smakefile\starget\sfor\sWindows. -D 2015-01-08T02:28:02.318 +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 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in c93eb4b0258e78a7dacfddd328e52827be2c3773 +F Makefile.in b40b4c2a3a187c41ee657d3f0e0e0dfe8fd860b5 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 @@ -238,7 +238,7 @@ F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c 81712116e826b0089bb221b018929536b2b5406f F src/table.c e7a09215315a978057fb42c640f890160dbcc45e F src/tclsqlite.c c6a21c64da1490e14d53cdc2062d1e2e57942622 -F src/test1.c 71f67f0c9f98de15026203bcdb7436268465a866 +F src/test1.c 460d39e7abbcd0c61c9788c06e0d925f4d1e6a22 F src/test2.c 98049e51a17dc62606a99a9eb95ee477f9996712 F src/test3.c 1c0e5d6f080b8e33c1ce8b3078e7013fdbcd560c F src/test4.c 9b32d22f5f150abe23c1830e2057c4037c45b3df @@ -768,7 +768,7 @@ F test/orderby4.test 4d39bfbaaa3ae64d026ca2ff166353d2edca4ba4 F test/orderby5.test 8f08a54836d21fb7c70245360751aedd1c2286fb F test/orderby6.test 8b38138ab0972588240b3fca0985d2e400432859 F test/orderby7.test 3d1383d52ade5b9eb3a173b3147fdd296f0202da -F test/oserror.test 50417780d0e0d7cd23cf12a8277bb44024765df3 +F test/oserror.test 14fec2796c2b6fe431c7823750e8a18a761176d7 F test/ovfl.test 4f7ca651cba5c059a12d8c67dddd49bec5747799 F test/pager1.test 1acbdb14c5952a72dd43129cabdbf69aaa3ed1fa F test/pager2.test 67b8f40ae98112bcdba1f2b2d03ea83266418c71 @@ -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 1f2fb77781a93427a2348f821b66dba7310c49b8 -R 8a1de20d0981a3624bba5e9b9b14f4fc +P 826fd311e7e2849aefbd81724dcb4a5644cfa126 +R 3faebdda7f25c90fe0938a6de3f393ba U drh -Z 06dcf0afe5114ee85b427e54261705d7 +Z 770e2b1cc0fe0d2202d8e9974f70c6d8 diff --git a/manifest.uuid b/manifest.uuid index c8083da5a3..52c980db7c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -826fd311e7e2849aefbd81724dcb4a5644cfa126 \ No newline at end of file +50b5a8af843fff93452cd1c8f82152124a1d864a \ No newline at end of file diff --git a/src/test1.c b/src/test1.c index 9c0c572f7d..8cbce70731 100644 --- a/src/test1.c +++ b/src/test1.c @@ -261,6 +261,8 @@ static int test_io_trace( ** ** Returns true if the program was compiled using clang with the ** -fsanitize=address switch on the command line. False otherwise. +** +** Also return true if the OMIT_MISUSE environment variable exists. */ static int clang_sanitize_address( void *NotUsed, @@ -274,6 +276,7 @@ static int clang_sanitize_address( res = 1; # endif #endif + if( res==0 && getenv("OMIT_MISUSE")!=0 ) res = 1; Tcl_SetObjResult(interp, Tcl_NewIntObj(res)); return TCL_OK; } diff --git a/test/oserror.test b/test/oserror.test index 40d2966bcc..1bfa37cd6c 100644 --- a/test/oserror.test +++ b/test/oserror.test @@ -51,19 +51,20 @@ proc do_re_test {tn script expression} { # a call to getcwd() may fail if there are no free file descriptors. So # an error may be reported for either open() or getcwd() here. # -puts "Possible valgrind error about invalid file descriptor follows:" -do_test 1.1.1 { - set ::log [list] - list [catch { - for {set i 0} {$i < 2000} {incr i} { sqlite3 dbh_$i test.db -readonly 1 } - } msg] $msg -} {1 {unable to open database file}} -do_test 1.1.2 { - catch { for {set i 0} {$i < 2000} {incr i} { dbh_$i close } } -} {1} -do_re_test 1.1.3 { - lindex $::log 0 -} {^os_unix.c:\d+: \(\d+\) (open|getcwd)\(.*test.db\) - } +if {![clang_sanitize_address]} { + do_test 1.1.1 { + set ::log [list] + list [catch { + for {set i 0} {$i < 2000} {incr i} { sqlite3 dbh_$i test.db -readonly 1 } + } msg] $msg + } {1 {unable to open database file}} + do_test 1.1.2 { + catch { for {set i 0} {$i < 2000} {incr i} { dbh_$i close } } + } {1} + do_re_test 1.1.3 { + lindex $::log 0 + } {^os_unix.c:\d+: \(\d+\) (open|getcwd)\(.*test.db\) - } +} # Test a failure in open() due to the path being a directory. From 64134662c03b2053813d0d40a0f17cc37bd8a9f2 Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 8 Jan 2015 22:08:57 +0000 Subject: [PATCH 34/69] 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 35/69] 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 36/69] 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 37/69] 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 38/69] 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 39/69] 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 40/69] 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 41/69] 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 42/69] 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 43/69] 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 44/69] 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 45/69] 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 46/69] 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 47/69] 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 48/69] 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 49/69] 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 50/69] 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 51/69] 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 52/69] 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 53/69] 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 54/69] 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 55/69] 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 56/69] 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 57/69] 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 58/69] 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 From dedc5ea0ba34d8beca9de9a8879bf26de3bb791b Mon Sep 17 00:00:00 2001 From: mistachkin Date: Fri, 16 Jan 2015 19:35:45 +0000 Subject: [PATCH 59/69] Fix harmless compiler warning. FossilOrigin-Name: cab46fb737ed3fc29dc8517f07bcfc72936df2b8 --- manifest | 20 ++++++++++---------- manifest.uuid | 2 +- src/os_win.c | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/manifest b/manifest index 2d35ff8ff1..7eb0c4f96f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Version\s3.8.8 -D 2015-01-16T12:08:06.393 +C Fix\sharmless\scompiler\swarning. +D 2015-01-16T19:35:45.500 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5407a688f4d77a05c18a8142be8ae5a2829dd610 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -215,7 +215,7 @@ F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04 F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa F src/os_unix.c aefeaf915aaef9f81aa2645e0d5d06fa1bd83beb -F src/os_win.c 91d3d08e33ec0258d180d4c8255492f47d15e007 +F src/os_win.c a5ac9e249ed0ca33de6de27898a08d313effc40c F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21 F src/pager.c 4120a49ecd37697e28f5ed807f470b9c0b88410c F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77 @@ -1236,10 +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 8f45217cbafef2297cdcec3fd69f4371dfb83922 -R 933466cd8ec4e35d692da3aefe1a6703 -T +bgcolor * #d0c0ff -T +sym-release * -T +sym-version-3.8.8 * -U drh -Z bb546801ed90d1803572e32e58b772a4 +P 7d68a42face3ab14ed88407d4331872f5b243fdf +R 09c0fda2a74fde3bf50886f176d10583 +T *branch * msvcWarn +T *sym-msvcWarn * +T -sym-trunk * +U mistachkin +Z 6366b530ace06a071790ce7afb643d4f diff --git a/manifest.uuid b/manifest.uuid index b043ddc196..9de0be4b58 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -7d68a42face3ab14ed88407d4331872f5b243fdf \ No newline at end of file +cab46fb737ed3fc29dc8517f07bcfc72936df2b8 \ No newline at end of file diff --git a/src/os_win.c b/src/os_win.c index e2f9aecac6..c938a4d7dd 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -3814,16 +3814,16 @@ static int winShmMap( void volatile **pp /* OUT: Mapped memory */ ){ winFile *pDbFd = (winFile*)fd; - winShm *p = pDbFd->pShm; + winShm *pShm = pDbFd->pShm; winShmNode *pShmNode; int rc = SQLITE_OK; - if( !p ){ + if( !pShm ){ rc = winOpenSharedMemory(pDbFd); if( rc!=SQLITE_OK ) return rc; - p = pDbFd->pShm; + pShm = pDbFd->pShm; } - pShmNode = p->pShmNode; + pShmNode = pShm->pShmNode; sqlite3_mutex_enter(pShmNode->mutex); assert( szRegion==pShmNode->szRegion || pShmNode->nRegion==0 ); From 5d907be5c9c2eb195f747a3112edf5aab4e42c98 Mon Sep 17 00:00:00 2001 From: drh Date: Sun, 18 Jan 2015 01:50:54 +0000 Subject: [PATCH 60/69] Set the command-line shell stdin to binary mode on windows. FossilOrigin-Name: 80541e8b94b713e8f9e588ae047ffc5ae804ef1c --- manifest | 13 ++++++------- manifest.uuid | 2 +- src/shell.c | 3 +++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index ba96eedc79..d122701d5e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sharmless\scompiler\swarning\sthe\sVFS\sfor\sWindows. -D 2015-01-17T15:26:28.724 +C Set\sthe\scommand-line\sshell\sstdin\sto\sbinary\smode\son\swindows. +D 2015-01-18T01:50:54.333 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5407a688f4d77a05c18a8142be8ae5a2829dd610 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -230,7 +230,7 @@ F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/select.c e4c38c75e36f28aed80a69a725d888751bfd53df -F src/shell.c 5b8e786a7c8eec87fa3f2ea615b337d2d99e284c +F src/shell.c 96c40c85467552025d81505310efcf3679303d3a F src/sqlite.h.in 9dfc99d6533d36d6a549c4f3f01cacc8be956ada F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d @@ -1236,8 +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 7d68a42face3ab14ed88407d4331872f5b243fdf cab46fb737ed3fc29dc8517f07bcfc72936df2b8 -R 09c0fda2a74fde3bf50886f176d10583 -T +closed cab46fb737ed3fc29dc8517f07bcfc72936df2b8 +P ceac571f53bdbc02616b21a4404cb1250030dea8 +R af1132932e63d89318ed108ce444bb3a U drh -Z 7ac57dd8af4bfddd779870b304f0eb12 +Z 8c65f5a7bb0fabe2bc52b8a9296117bf diff --git a/manifest.uuid b/manifest.uuid index 55cebb6800..2997f19ca0 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ceac571f53bdbc02616b21a4404cb1250030dea8 \ No newline at end of file +80541e8b94b713e8f9e588ae047ffc5ae804ef1c \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index 9c0481c0dd..9e23734ae7 100644 --- a/src/shell.c +++ b/src/shell.c @@ -4175,6 +4175,9 @@ int main(int argc, char **argv){ sqlite3_sourceid(), SQLITE_SOURCE_ID); exit(1); } +#endif +#if defined(WIN32) || defined(_WIN32) + _setmode(0, _O_BINARY); #endif Argv0 = argv[0]; main_init(&data); From 047d4538e3f6f35c9369f27cde2982baf3ca59c6 Mon Sep 17 00:00:00 2001 From: drh Date: Sun, 18 Jan 2015 20:30:23 +0000 Subject: [PATCH 61/69] Set binary mode for output on Windows when writing a quoted string that might contain newline characters. FossilOrigin-Name: 7096e6c06d9a3e48d3f0d134f5f3275dde796be2 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/shell.c | 36 +++++++++++++++++++++++++----------- 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/manifest b/manifest index d122701d5e..12bc387dc3 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Set\sthe\scommand-line\sshell\sstdin\sto\sbinary\smode\son\swindows. -D 2015-01-18T01:50:54.333 +C Set\sbinary\smode\sfor\soutput\son\sWindows\swhen\swriting\sa\squoted\sstring\sthat\nmight\scontain\snewline\scharacters. +D 2015-01-18T20:30:23.778 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5407a688f4d77a05c18a8142be8ae5a2829dd610 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -230,7 +230,7 @@ F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/select.c e4c38c75e36f28aed80a69a725d888751bfd53df -F src/shell.c 96c40c85467552025d81505310efcf3679303d3a +F src/shell.c 4958f393be95eaf223dd51f7eb799f6c5e800060 F src/sqlite.h.in 9dfc99d6533d36d6a549c4f3f01cacc8be956ada F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d @@ -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 ceac571f53bdbc02616b21a4404cb1250030dea8 -R af1132932e63d89318ed108ce444bb3a +P 80541e8b94b713e8f9e588ae047ffc5ae804ef1c +R 8c7ae3a28cebe6c4cd8f1efeb860b8e0 U drh -Z 8c65f5a7bb0fabe2bc52b8a9296117bf +Z d712af0bd91c24c0e42eda8fb9513bd5 diff --git a/manifest.uuid b/manifest.uuid index 2997f19ca0..d19793c1f5 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -80541e8b94b713e8f9e588ae047ffc5ae804ef1c \ No newline at end of file +7096e6c06d9a3e48d3f0d134f5f3275dde796be2 \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index 9e23734ae7..5643e4f242 100644 --- a/src/shell.c +++ b/src/shell.c @@ -106,6 +106,26 @@ extern int pclose(FILE*); #define IsDigit(X) isdigit((unsigned char)X) #define ToLower(X) (char)tolower((unsigned char)X) +/* On Windows, we normally run with output mode of TEXT so that \n characters +** are automatically translated into \r\n. However, this behavior needs +** to be disabled in some cases (ex: when generating CSV output and when +** rendering quoted strings that contain \n characters). The following +** routines take care of that. +*/ +#if defined(_WIN32) || defined(WIN32) +static setBinaryMode(FILE *out){ + fflush(out); + _setmode(_fileno(out), _O_BINARY); +} +static setTextMode(FILE *out){ + fflush(out); + _setmode(_fileno(out), _O_TEXT); +} +#else +# define setBinaryMode(X) +# define setTextMode(X) +#endif + /* True if the timer is enabled */ static int enableTimer = 0; @@ -584,6 +604,7 @@ static void output_hex_blob(FILE *out, const void *pBlob, int nBlob){ static void output_quoted_string(FILE *out, const char *z){ int i; int nSingle = 0; + setBinaryMode(out); for(i=0; z[i]; i++){ if( z[i]=='\'' ) nSingle++; } @@ -606,6 +627,7 @@ static void output_quoted_string(FILE *out, const char *z){ } fprintf(out,"'"); } + setTextMode(out); } /* @@ -908,10 +930,7 @@ static int shell_callback( break; } case MODE_Csv: { -#if defined(WIN32) || defined(_WIN32) - fflush(p->out); - _setmode(_fileno(p->out), _O_BINARY); -#endif + setBinaryMode(p->out); if( p->cnt++==0 && p->showHeader ){ for(i=0; iout, "%s", p->rowSeparator); } -#if defined(WIN32) || defined(_WIN32) - fflush(p->out); - _setmode(_fileno(p->out), _O_TEXT); -#endif + setTextMode(p->out); break; } case MODE_Insert: { @@ -4176,9 +4192,7 @@ int main(int argc, char **argv){ exit(1); } #endif -#if defined(WIN32) || defined(_WIN32) - _setmode(0, _O_BINARY); -#endif + setBinaryMode(stdin); Argv0 = argv[0]; main_init(&data); stdin_is_interactive = isatty(0); From 65545b5993ed670e111105860ccc73862bbeff30 Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 19 Jan 2015 00:35:53 +0000 Subject: [PATCH 62/69] Eliminate all use of sprintf(), strcpy() and strcat() from test logic because OpenBSD hates those functions. FossilOrigin-Name: 10321910990195878c0af1e94b34ae0cdc0cb31b --- ext/misc/amatch.c | 28 +++++++++++++++++++++++----- manifest | 30 +++++++++++++++--------------- manifest.uuid | 2 +- src/tclsqlite.c | 6 +++--- src/test1.c | 41 ++++++++++++++++++++--------------------- src/test3.c | 15 ++++++++++----- src/test4.c | 2 +- src/test7.c | 2 +- src/test8.c | 4 ++-- src/test_sqllog.c | 6 ++++-- src/test_thread.c | 2 +- src/test_vfs.c | 5 +++-- 12 files changed, 84 insertions(+), 59 deletions(-) diff --git a/ext/misc/amatch.c b/ext/misc/amatch.c index 98c01431ba..d08ef57aad 100644 --- a/ext/misc/amatch.c +++ b/ext/misc/amatch.c @@ -998,6 +998,23 @@ static void amatchWriteCost(amatch_word *pWord){ pWord->zCost[8] = 0; } +/* Circumvent compiler warnings about the use of strcpy() by supplying +** our own implementation. +*/ +#if defined(__OpenBSD__) +static void amatchStrcpy(char *dest, const char *src){ + while( (*(dest++) = *(src++))!=0 ){} +} +static void amatchStrcat(char *dest, const char *src){ + while( *dest ) dest++; + amatchStrcpy(dest, src); +} +#else +# define amatchStrcpy strcpy +# define amatchStrcat strcat +#endif + + /* ** Add a new amatch_word object to the queue. ** @@ -1073,7 +1090,7 @@ static void amatchAddWord( assert( pOther==0 ); (void)pOther; pWord->sWord.zKey = pWord->zWord; pWord->sWord.pWord = pWord; - strcpy(pWord->zWord, pCur->zBuf); + amatchStrcpy(pWord->zWord, pCur->zBuf); pOther = amatchAvlInsert(&pCur->pWord, &pWord->sWord); assert( pOther==0 ); (void)pOther; #ifdef AMATCH_TRACE_1 @@ -1083,6 +1100,7 @@ static void amatchAddWord( #endif } + /* ** Advance a cursor to its next row of output */ @@ -1148,7 +1166,7 @@ static int amatchNext(sqlite3_vtab_cursor *cur){ zBuf = sqlite3_realloc(zBuf, nBuf); if( zBuf==0 ) return SQLITE_NOMEM; } - strcpy(zBuf, pWord->zWord+2); + amatchStrcpy(zBuf, pWord->zWord+2); zNext[0] = 0; zNextIn[0] = pCur->zInput[pWord->nMatch]; if( zNextIn[0] ){ @@ -1163,7 +1181,7 @@ static int amatchNext(sqlite3_vtab_cursor *cur){ if( zNextIn[0] && zNextIn[0]!='*' ){ sqlite3_reset(p->pVCheck); - strcat(zBuf, zNextIn); + amatchStrcat(zBuf, zNextIn); sqlite3_bind_text(p->pVCheck, 1, zBuf, nWord+nNextIn, SQLITE_STATIC); rc = sqlite3_step(p->pVCheck); if( rc==SQLITE_ROW ){ @@ -1176,13 +1194,13 @@ static int amatchNext(sqlite3_vtab_cursor *cur){ } while( 1 ){ - strcpy(zBuf+nWord, zNext); + amatchStrcpy(zBuf+nWord, zNext); sqlite3_reset(p->pVCheck); sqlite3_bind_text(p->pVCheck, 1, zBuf, -1, SQLITE_TRANSIENT); rc = sqlite3_step(p->pVCheck); if( rc!=SQLITE_ROW ) break; zW = (const char*)sqlite3_column_text(p->pVCheck, 0); - strcpy(zBuf+nWord, zNext); + amatchStrcpy(zBuf+nWord, zNext); if( strncmp(zW, zBuf, nWord)!=0 ) break; if( (zNextIn[0]=='*' && zNextIn[1]==0) || (zNextIn[0]==0 && zW[nWord]==0) diff --git a/manifest b/manifest index 12bc387dc3..976365ad63 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Set\sbinary\smode\sfor\soutput\son\sWindows\swhen\swriting\sa\squoted\sstring\sthat\nmight\scontain\snewline\scharacters. -D 2015-01-18T20:30:23.778 +C Eliminate\sall\suse\sof\ssprintf(),\sstrcpy()\sand\sstrcat()\sfrom\stest\slogic\sbecause\nOpenBSD\shates\sthose\sfunctions. +D 2015-01-19T00:35:53.426 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5407a688f4d77a05c18a8142be8ae5a2829dd610 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 17ba78dc9b33601a40d2a7bc54c748b6f3eb7176 +F ext/misc/amatch.c 27b9b601fb1453084e18a3432ea0240d7af8decb F ext/misc/closure.c 636024302cde41b2bf0c542f81c40c624cfb7012 F ext/misc/compress.c 76e45655f4046e756064ab10c62e18f2eb846b9f F ext/misc/eval.c f971962e92ebb8b0a4e6b62949463ee454d88fa2 @@ -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 0bbb44543175ef2033d39780a233f98bf354eff9 -F src/test1.c 093d8b5b54b829dcfebae3181d4406edcc935d90 +F src/tclsqlite.c b8014393a96a9781bb635c8b1f52fc9b77a2bfcf +F src/test1.c 00a74fbc6604e1bcd240726a9ff8d0cc123374e7 F src/test2.c 577961fe48961b2f2e5c8b56ee50c3f459d3359d -F src/test3.c 1c0e5d6f080b8e33c1ce8b3078e7013fdbcd560c -F src/test4.c 9b32d22f5f150abe23c1830e2057c4037c45b3df +F src/test3.c 64d2afdd68feac1bb5e2ffb8226c8c639f798622 +F src/test4.c d168f83cc78d02e8d35567bb5630e40dcd85ac1e F src/test5.c 5a34feec76d9b3a86aab30fd4f6cc9c48cbab4c1 F src/test6.c 41cacf3b0dd180823919bf9e1fbab287c9266723 -F src/test7.c 72b732baa5642f795655ba1126ea032af46ecfd2 -F src/test8.c df8dd4c99c1dd2225cb2a6f334299cddc5dcf1f1 +F src/test7.c 9c89a4f1ed6bb13af0ed805b8d782bd83fcd57e3 +F src/test8.c 610e3d523018ca63b08081795e76794a2121ec38 F src/test9.c bea1e8cf52aa93695487badedd6e1886c321ea60 F src/test_async.c 21e11293a2f72080eda70e1124e9102044531cd8 F src/test_autoext.c dea8a01a7153b9adc97bd26161e4226329546e12 @@ -276,13 +276,13 @@ F src/test_quota.h 2a8ad1952d1d2ca9af0ce0465e56e6c023b5e15d F src/test_rtree.c fdd8d29ca5165c7857987a2ba263fac5c69e231f F src/test_schema.c 2bdba21b82f601da69793e1f1d11bf481a79b091 F src/test_server.c a2615049954cbb9cfb4a62e18e2f0616e4dc38fe -F src/test_sqllog.c c1c1bbedbcaf82b93d83e4f9dd990e62476a680e +F src/test_sqllog.c b690c12933f50ff46491e0d56a251f84ae16e914 F src/test_stat.c 9898687a6c2beca733b0dd6fe19163d987826d31 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 8ee7be45fe773a150b4015ef957da960179ee43a +F src/test_thread.c af391ec03d23486dffbcc250b7e58e073f172af9 +F src/test_vfs.c 5a14c63da9579ba148138c1fb233100f2eb58ebb 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 80541e8b94b713e8f9e588ae047ffc5ae804ef1c -R 8c7ae3a28cebe6c4cd8f1efeb860b8e0 +P 7096e6c06d9a3e48d3f0d134f5f3275dde796be2 +R 7d263eb98fc5c91928b9a60626248b0a U drh -Z d712af0bd91c24c0e42eda8fb9513bd5 +Z 962c42be5c17a76b63845109393eb3c7 diff --git a/manifest.uuid b/manifest.uuid index d19793c1f5..fbfc967ad3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -7096e6c06d9a3e48d3f0d134f5f3275dde796be2 \ No newline at end of file +10321910990195878c0af1e94b34ae0cdc0cb31b \ No newline at end of file diff --git a/src/tclsqlite.c b/src/tclsqlite.c index a912e8aba4..b1d4dc413c 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -661,9 +661,9 @@ static int DbWalHandler( #if defined(SQLITE_TEST) && defined(SQLITE_ENABLE_UNLOCK_NOTIFY) static void setTestUnlockNotifyVars(Tcl_Interp *interp, int iArg, int nArg){ char zBuf[64]; - sprintf(zBuf, "%d", iArg); + sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", iArg); Tcl_SetVar(interp, "sqlite_unlock_notify_arg", zBuf, TCL_GLOBAL_ONLY); - sprintf(zBuf, "%d", nArg); + sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", nArg); Tcl_SetVar(interp, "sqlite_unlock_notify_argcount", zBuf, TCL_GLOBAL_ONLY); } #else @@ -3429,7 +3429,7 @@ static void MD5DigestToBase10x8(unsigned char digest[16], char zDigest[50]){ for(i=j=0; i<16; i+=2){ x = digest[i]*256 + digest[i+1]; if( i>0 ) zDigest[j++] = '-'; - sprintf(&zDigest[j], "%05u", x); + sqlite3_snprintf(16-j, &zDigest[j], "%05u", x); j += 5; } zDigest[j] = 0; diff --git a/src/test1.c b/src/test1.c index 8f21660c27..d86ec1e84d 100644 --- a/src/test1.c +++ b/src/test1.c @@ -94,10 +94,7 @@ static int get_sqlite_pointer( return TCL_ERROR; } p = (struct SqliteDb*)cmdInfo.objClientData; - sprintf(zBuf, "%p", p->db); - if( strncmp(zBuf,"0x",2) ){ - sprintf(zBuf, "0x%p", p->db); - } + sqlite3_snprintf(sizeof(zBuf), zBuf, "%p", p->db); Tcl_AppendResult(interp, zBuf, 0); return TCL_OK; } @@ -145,7 +142,8 @@ int sqlite3TestErrCode(Tcl_Interp *interp, sqlite3 *db, int rc){ && sqlite3_errcode(db)!=rc ){ char zBuf[200]; int r2 = sqlite3_errcode(db); - sprintf(zBuf, "error code %s (%d) does not match sqlite3_errcode %s (%d)", + sqlite3_snprintf(sizeof(zBuf), zBuf, + "error code %s (%d) does not match sqlite3_errcode %s (%d)", t1ErrorName(rc), rc, t1ErrorName(r2), r2); Tcl_ResetResult(interp); Tcl_AppendResult(interp, zBuf, 0); @@ -310,7 +308,7 @@ static int test_exec_printf( zSql = sqlite3_mprintf(argv[2], argv[3]); rc = sqlite3_exec(db, zSql, exec_printf_cb, &str, &zErr); sqlite3_free(zSql); - sprintf(zBuf, "%d", rc); + sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", rc); Tcl_AppendElement(interp, zBuf); Tcl_AppendElement(interp, rc==SQLITE_OK ? Tcl_DStringValue(&str) : zErr); Tcl_DStringFree(&str); @@ -357,7 +355,7 @@ static int test_exec_hex( zSql[i] = 0; Tcl_DStringInit(&str); rc = sqlite3_exec(db, zSql, exec_printf_cb, &str, &zErr); - sprintf(zBuf, "%d", rc); + sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", rc); Tcl_AppendElement(interp, zBuf); Tcl_AppendElement(interp, rc==SQLITE_OK ? Tcl_DStringValue(&str) : zErr); Tcl_DStringFree(&str); @@ -442,7 +440,7 @@ static int test_exec( zSql[j] = 0; rc = sqlite3_exec(db, zSql, exec_printf_cb, &str, &zErr); sqlite3_free(zSql); - sprintf(zBuf, "%d", rc); + sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", rc); Tcl_AppendElement(interp, zBuf); Tcl_AppendElement(interp, rc==SQLITE_OK ? Tcl_DStringValue(&str) : zErr); Tcl_DStringFree(&str); @@ -591,13 +589,13 @@ static int test_get_table_printf( resCount = (nRow+1)*nCol; } sqlite3_free(zSql); - sprintf(zBuf, "%d", rc); + sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", rc); Tcl_AppendElement(interp, zBuf); if( rc==SQLITE_OK ){ if( argc==4 ){ - sprintf(zBuf, "%d", nRow); + sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", nRow); Tcl_AppendElement(interp, zBuf); - sprintf(zBuf, "%d", nCol); + sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", nCol); Tcl_AppendElement(interp, zBuf); } for(i=0; i9 || n1<1 ){ - sprintf(zErr, "putVarint returned %d - should be between 1 and 9", n1); + sqlite3_snprintf(sizeof(zErr), zErr, + "putVarint returned %d - should be between 1 and 9", n1); Tcl_AppendResult(interp, zErr, 0); return TCL_ERROR; } n2 = getVarint(zBuf, &out); if( n1!=n2 ){ - sprintf(zErr, "putVarint returned %d and getVarint returned %d", n1, n2); + sqlite3_snprintf(sizeof(zErr), zErr, + "putVarint returned %d and getVarint returned %d", n1, n2); Tcl_AppendResult(interp, zErr, 0); return TCL_ERROR; } if( in!=out ){ - sprintf(zErr, "Wrote 0x%016llx and got back 0x%016llx", in, out); + sqlite3_snprintf(sizeof(zErr), zErr, + "Wrote 0x%016llx and got back 0x%016llx", in, out); Tcl_AppendResult(interp, zErr, 0); return TCL_ERROR; } @@ -465,13 +468,15 @@ static int btree_varint_test( n2 = getVarint32(zBuf, out32); out = out32; if( n1!=n2 ){ - sprintf(zErr, "putVarint returned %d and GetVarint32 returned %d", + sqlite3_snprintf(sizeof(zErr), zErr, + "putVarint returned %d and GetVarint32 returned %d", n1, n2); Tcl_AppendResult(interp, zErr, 0); return TCL_ERROR; } if( in!=out ){ - sprintf(zErr, "Wrote 0x%016llx and got back 0x%016llx from GetVarint32", + sqlite3_snprintf(sizeof(zErr), zErr, + "Wrote 0x%016llx and got back 0x%016llx from GetVarint32", in, out); Tcl_AppendResult(interp, zErr, 0); return TCL_ERROR; diff --git a/src/test4.c b/src/test4.c index a6375c7cc4..d689030303 100644 --- a/src/test4.c +++ b/src/test4.c @@ -270,7 +270,7 @@ static int tcl_thread_argc( return TCL_ERROR; } thread_wait(&threadset[i]); - sprintf(zBuf, "%d", threadset[i].argc); + sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", threadset[i].argc); Tcl_AppendResult(interp, zBuf, 0); return TCL_OK; } diff --git a/src/test7.c b/src/test7.c index 93bf1e4898..6ba3631b41 100644 --- a/src/test7.c +++ b/src/test7.c @@ -315,7 +315,7 @@ static int tcl_client_argc( return TCL_ERROR; } client_wait(&threadset[i]); - sprintf(zBuf, "%d", threadset[i].argc); + sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", threadset[i].argc); Tcl_AppendResult(interp, zBuf, 0); return TCL_OK; } diff --git a/src/test8.c b/src/test8.c index f37a28ced6..2107710a99 100644 --- a/src/test8.c +++ b/src/test8.c @@ -206,8 +206,8 @@ static int getColumnNames( zSpace = (char *)(&aCol[nCol]); for(ii=0; ii=(sizeof(sqllogglobal.zPrefix)) ) return; - sprintf(sqllogglobal.zPrefix, "%s/sqllog_%d", zVar, getProcessId()); - sprintf(sqllogglobal.zIdx, "%s.idx", sqllogglobal.zPrefix); + sqlite3_snprintf(sizeof(sqllogglobal.zPrefix), sqllogglobal.zPrefix, + "%s/sqllog_%d", zVar, getProcessId()); + sqlite3_snprintf(sizeof(sqllogglobal.zIdx), sqllogglobal.zIdx, + "%s.idx", sqllogglobal.zPrefix); if( getenv(ENVIRONMENT_VARIABLE2_NAME) ){ sqllogglobal.bReuse = atoi(getenv(ENVIRONMENT_VARIABLE2_NAME)); } diff --git a/src/test_thread.c b/src/test_thread.c index 2f9363b750..a4d96e1942 100644 --- a/src/test_thread.c +++ b/src/test_thread.c @@ -608,7 +608,7 @@ static int blocking_prepare_v2_proc( } if( rc!=SQLITE_OK ){ assert( pStmt==0 ); - sprintf(zBuf, "%s ", (char *)sqlite3ErrName(rc)); + sqlite3_snprintf(sizeof(zBuf), zBuf, "%s ", (char *)sqlite3ErrName(rc)); Tcl_AppendResult(interp, zBuf, sqlite3_errmsg(db), 0); return TCL_ERROR; } diff --git a/src/test_vfs.c b/src/test_vfs.c index 37081af784..561addfcc5 100644 --- a/src/test_vfs.c +++ b/src/test_vfs.c @@ -823,11 +823,12 @@ static int tvfsShmOpen(sqlite3_file *pFile){ if( 0==strcmp(pFd->zFilename, pBuffer->zFile) ) break; } if( !pBuffer ){ - int nByte = sizeof(TestvfsBuffer) + (int)strlen(pFd->zFilename) + 1; + int szName = (int)strlen(pFd->zFilename); + int nByte = sizeof(TestvfsBuffer) + szName + 1; pBuffer = (TestvfsBuffer *)ckalloc(nByte); memset(pBuffer, 0, nByte); pBuffer->zFile = (char *)&pBuffer[1]; - strcpy(pBuffer->zFile, pFd->zFilename); + memcpy(pBuffer->zFile, pFd->zFilename, szName+1); pBuffer->pNext = p->pBuffer; p->pBuffer = pBuffer; } From e4bb23a1a7f38eae02ba49c58854b674c37a8622 Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 19 Jan 2015 15:05:54 +0000 Subject: [PATCH 63/69] Enhance the command-line shell with the ability to set the SQLITE_TESTCTRL_NEVER_CORRUPT flag using: ".testctrl never_corrupt 1". FossilOrigin-Name: 824328f9833d01fc155a9d0265ef41d338cf1ffb --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/shell.c | 4 +++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 976365ad63..136cb71f94 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Eliminate\sall\suse\sof\ssprintf(),\sstrcpy()\sand\sstrcat()\sfrom\stest\slogic\sbecause\nOpenBSD\shates\sthose\sfunctions. -D 2015-01-19T00:35:53.426 +C Enhance\sthe\scommand-line\sshell\swith\sthe\sability\sto\sset\sthe\nSQLITE_TESTCTRL_NEVER_CORRUPT\sflag\susing:\s".testctrl\snever_corrupt\s1". +D 2015-01-19T15:05:54.471 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5407a688f4d77a05c18a8142be8ae5a2829dd610 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -230,7 +230,7 @@ F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/select.c e4c38c75e36f28aed80a69a725d888751bfd53df -F src/shell.c 4958f393be95eaf223dd51f7eb799f6c5e800060 +F src/shell.c d2d3b46701e44369dd314bd6817541c60e2c39ea F src/sqlite.h.in 9dfc99d6533d36d6a549c4f3f01cacc8be956ada F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d @@ -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 7096e6c06d9a3e48d3f0d134f5f3275dde796be2 -R 7d263eb98fc5c91928b9a60626248b0a +P 10321910990195878c0af1e94b34ae0cdc0cb31b +R 1842536563f5d094d57991d4a5161858 U drh -Z 962c42be5c17a76b63845109393eb3c7 +Z b40ce48cd42cd2dd2358d0667c50be5c diff --git a/manifest.uuid b/manifest.uuid index fbfc967ad3..a042232dda 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -10321910990195878c0af1e94b34ae0cdc0cb31b \ No newline at end of file +824328f9833d01fc155a9d0265ef41d338cf1ffb \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index 5643e4f242..1d9c80798c 100644 --- a/src/shell.c +++ b/src/shell.c @@ -3535,6 +3535,7 @@ static int do_meta_command(char *zLine, ShellState *p){ { "iskeyword", SQLITE_TESTCTRL_ISKEYWORD }, { "scratchmalloc", SQLITE_TESTCTRL_SCRATCHMALLOC }, { "byteorder", SQLITE_TESTCTRL_BYTEORDER }, + { "never_corrupt", SQLITE_TESTCTRL_NEVER_CORRUPT }, }; int testctrl = -1; int rc = 0; @@ -3601,7 +3602,8 @@ static int do_meta_command(char *zLine, ShellState *p){ /* sqlite3_test_control(int, int) */ case SQLITE_TESTCTRL_ASSERT: - case SQLITE_TESTCTRL_ALWAYS: + case SQLITE_TESTCTRL_ALWAYS: + case SQLITE_TESTCTRL_NEVER_CORRUPT: if( nArg==3 ){ int opt = booleanValue(azArg[2]); rc = sqlite3_test_control(testctrl, opt); From e1bb802c5460325d958bb7e61a2d9399496ef9a2 Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 19 Jan 2015 19:48:52 +0000 Subject: [PATCH 64/69] An alternative way of implementing the assert() that verifies the relative values of KeyInfo.nField+KeyInfo.nXField and the number of columns in a record. This version of the assert() only fires when the high-speed comparison routines are used - which is to say it only fires when the constraint actually matters. FossilOrigin-Name: bf744b4908b096f301565f6a4ea8d56667c1d76a --- manifest | 15 +++++++++------ manifest.uuid | 2 +- src/vdbeaux.c | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 7 deletions(-) diff --git a/manifest b/manifest index 136cb71f94..5e36253afb 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Enhance\sthe\scommand-line\sshell\swith\sthe\sability\sto\sset\sthe\nSQLITE_TESTCTRL_NEVER_CORRUPT\sflag\susing:\s".testctrl\snever_corrupt\s1". -D 2015-01-19T15:05:54.471 +C An\salternative\sway\sof\simplementing\sthe\sassert()\sthat\sverifies\sthe\srelative\nvalues\sof\sKeyInfo.nField+KeyInfo.nXField\sand\sthe\snumber\sof\scolumns\sin\sa\srecord.\nThis\sversion\sof\sthe\sassert()\sonly\sfires\swhen\sthe\shigh-speed\scomparison\nroutines\sare\sused\s-\swhich\sis\sto\ssay\sit\sonly\sfires\swhen\sthe\sconstraint\nactually\smatters. +D 2015-01-19T19:48:52.667 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5407a688f4d77a05c18a8142be8ae5a2829dd610 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -296,7 +296,7 @@ F src/vdbe.c ddfc977981cd6324668aa6b114045eb1c677421a F src/vdbe.h 6fc69d9c5e146302c56e163cb4b31d1ee64a18c3 F src/vdbeInt.h 9bb69ff2447c34b6ccc58b34ec35b615f86ead78 F src/vdbeapi.c 4bc511a46b9839392ae0e90844a71dc96d9dbd71 -F src/vdbeaux.c 07ef87c6d4b5abdf13ff33babb10205702fdab0a +F src/vdbeaux.c d22d71f5928f0170061b6509b72832d307fb581e F src/vdbeblob.c 4af4bfb71f6df7778397b4a0ebc1879793276778 F src/vdbemem.c 31d8eabb0cd78bfeab4e5124c7363c3e9e54db9f F src/vdbesort.c 6d64c5448b64851b99931ede980addc3af70d5e2 @@ -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 10321910990195878c0af1e94b34ae0cdc0cb31b -R 1842536563f5d094d57991d4a5161858 +P 824328f9833d01fc155a9d0265ef41d338cf1ffb +R 62f359e43ad9aa835c85ab2bfc9c70b0 +T *branch * tkt-f97c4637 +T *sym-tkt-f97c4637 * +T -sym-trunk * U drh -Z b40ce48cd42cd2dd2358d0667c50be5c +Z e1e735a41c0bcd1d69846f2fcc6f5b85 diff --git a/manifest.uuid b/manifest.uuid index a042232dda..eecb747ee6 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -824328f9833d01fc155a9d0265ef41d338cf1ffb \ No newline at end of file +bf744b4908b096f301565f6a4ea8d56667c1d76a \ No newline at end of file diff --git a/src/vdbeaux.c b/src/vdbeaux.c index 03c229c994..b3f8278eb1 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -3349,6 +3349,39 @@ debugCompareEnd: } #endif +#if SQLITE_DEBUG +/* +** Count the number of fields (a.k.a. columns) in the record given by +** pKey,nKey. The verify that this count is less than or equal to the +** limit given by pKeyInfo->nField + pKeyInfo->nXField. +** +** If this constraint is not satisfied, it means that the high-speed +** vdbeRecordCompareInt() and vdbeRecordCompareString() routines will +** not work correctly. If this assert() ever fires, it probably means +** that the KeyInfo.nField or KeyInfo.nXField values were computed +** incorrectly. +*/ +static void vdbeAssertFieldCountWithinLimits( + int nKey, const void *pKey, /* The record to verify */ + const KeyInfo *pKeyInfo /* Compare size with this KeyInfo */ +){ + int nField = 0; + u32 szHdr; + u32 idx; + u32 notUsed; + const unsigned char *aKey = (const unsigned char*)pKey; + + if( CORRUPT_DB ) return; + idx = getVarint32(aKey, szHdr); + assert( szHdr<=nKey ); + while( idxnField+pKeyInfo->nXField ); +} +#endif + /* ** Both *pMem1 and *pMem2 contain string values. Compare the two values ** using the collation sequence pColl. As usual, return a negative , zero @@ -3760,6 +3793,7 @@ static int vdbeRecordCompareInt( i64 v = pPKey2->aMem[0].u.i; i64 lhs; + vdbeAssertFieldCountWithinLimits(nKey1, pKey1, pPKey2->pKeyInfo); assert( (*(u8*)pKey1)<=0x3F || CORRUPT_DB ); switch( serial_type ){ case 1: { /* 1-byte signed integer */ @@ -3847,6 +3881,7 @@ static int vdbeRecordCompareString( int serial_type; int res; + vdbeAssertFieldCountWithinLimits(nKey1, pKey1, pPKey2->pKeyInfo); getVarint32(&aKey1[1], serial_type); if( serial_type<12 ){ res = pPKey2->r1; /* (pKey1/nKey1) is a number or a null */ From 89ea0d379a44c19f7ca9263705aeed5e81ffba2c Mon Sep 17 00:00:00 2001 From: mistachkin Date: Mon, 19 Jan 2015 20:05:53 +0000 Subject: [PATCH 65/69] Fix compilation on Cygwin when SQLITE_MAX_WORKER_THREADS is greater than zero. FossilOrigin-Name: 2037442c582e51d85967bc911ea4a412eb4da573 --- manifest | 16 ++++++++-------- manifest.uuid | 2 +- src/os_win.h | 11 +++++++++++ src/threads.c | 4 ++-- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index 136cb71f94..cabfaf3916 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Enhance\sthe\scommand-line\sshell\swith\sthe\sability\sto\sset\sthe\nSQLITE_TESTCTRL_NEVER_CORRUPT\sflag\susing:\s".testctrl\snever_corrupt\s1". -D 2015-01-19T15:05:54.471 +C Fix\scompilation\son\sCygwin\swhen\sSQLITE_MAX_WORKER_THREADS\sis\sgreater\sthan\szero. +D 2015-01-19T20:05:53.508 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5407a688f4d77a05c18a8142be8ae5a2829dd610 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -216,7 +216,7 @@ F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04 F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa F src/os_unix.c aefeaf915aaef9f81aa2645e0d5d06fa1bd83beb F src/os_win.c a5ac9e249ed0ca33de6de27898a08d313effc40c -F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21 +F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca F src/pager.c 4120a49ecd37697e28f5ed807f470b9c0b88410c F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77 F src/parse.y c5d0d964f9ac023e8154cad512e54b0b6058e086 @@ -285,7 +285,7 @@ F src/test_thread.c af391ec03d23486dffbcc250b7e58e073f172af9 F src/test_vfs.c 5a14c63da9579ba148138c1fb233100f2eb58ebb F src/test_vfstrace.c bab9594adc976cbe696ff3970728830b4c5ed698 F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9 -F src/threads.c 2fb3ea4d70d5acf68b539c2489b4adace61cc01b +F src/threads.c 6bbcc9fe50c917864d48287b4792d46d6e873481 F src/tokenize.c e00458c9938072b0ea711c850b8dcf4ddcb5fe18 F src/trigger.c 25571661fdeae8c7f975ff40ffec205520a3f92f F src/update.c 3c4ecc282accf12d39edb8d524cf089645e55a13 @@ -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 10321910990195878c0af1e94b34ae0cdc0cb31b -R 1842536563f5d094d57991d4a5161858 -U drh -Z b40ce48cd42cd2dd2358d0667c50be5c +P 824328f9833d01fc155a9d0265ef41d338cf1ffb +R 46d0fc0085c932a30f59bac1bd145cf7 +U mistachkin +Z 998ddd7b1750b28ed4b199120a25244e diff --git a/manifest.uuid b/manifest.uuid index a042232dda..5c080e945f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -824328f9833d01fc155a9d0265ef41d338cf1ffb \ No newline at end of file +2037442c582e51d85967bc911ea4a412eb4da573 \ No newline at end of file diff --git a/src/os_win.h b/src/os_win.h index 5174ac7781..17d6a2bef4 100644 --- a/src/os_win.h +++ b/src/os_win.h @@ -74,4 +74,15 @@ # define SQLITE_WIN32_VOLATILE volatile #endif +/* +** For some Windows sub-platforms, the _beginthreadex() / _endthreadex() +** functions are not available (e.g. those not using MSVC, Cygwin, etc). +*/ +#if SQLITE_OS_WIN && !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && \ + SQLITE_THREADSAFE>0 && !defined(__CYGWIN__) +# define SQLITE_OS_WIN_THREADS 1 +#else +# define SQLITE_OS_WIN_THREADS 0 +#endif + #endif /* _OS_WIN_H_ */ diff --git a/src/threads.c b/src/threads.c index 16f52498c3..4ce6122274 100644 --- a/src/threads.c +++ b/src/threads.c @@ -101,7 +101,7 @@ int sqlite3ThreadJoin(SQLiteThread *p, void **ppOut){ /********************************* Win32 Threads ****************************/ -#if SQLITE_OS_WIN && !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && SQLITE_THREADSAFE>0 +#if SQLITE_OS_WIN_THREADS #define SQLITE_THREADS_IMPLEMENTED 1 /* Prevent the single-thread code below */ #include @@ -194,7 +194,7 @@ int sqlite3ThreadJoin(SQLiteThread *p, void **ppOut){ return (rc==WAIT_OBJECT_0) ? SQLITE_OK : SQLITE_ERROR; } -#endif /* SQLITE_OS_WIN && !SQLITE_OS_WINCE && !SQLITE_OS_WINRT */ +#endif /* SQLITE_OS_WIN_THREADS */ /******************************** End Win32 Threads *************************/ From 1af3c64d03c4f899e8f112639e3f5f4fe81a70ef Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 19 Jan 2015 20:57:19 +0000 Subject: [PATCH 66/69] Fix the assert() of the previous check-in so that it works even when compiled without SQLITE_DEBUG. FossilOrigin-Name: 38868f845e1ad4d61354ab1ad39dd19e3e07c7fd --- manifest | 15 ++++++--------- manifest.uuid | 2 +- src/vdbeaux.c | 2 ++ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index 5e36253afb..95a9ce8219 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C An\salternative\sway\sof\simplementing\sthe\sassert()\sthat\sverifies\sthe\srelative\nvalues\sof\sKeyInfo.nField+KeyInfo.nXField\sand\sthe\snumber\sof\scolumns\sin\sa\srecord.\nThis\sversion\sof\sthe\sassert()\sonly\sfires\swhen\sthe\shigh-speed\scomparison\nroutines\sare\sused\s-\swhich\sis\sto\ssay\sit\sonly\sfires\swhen\sthe\sconstraint\nactually\smatters. -D 2015-01-19T19:48:52.667 +C Fix\sthe\sassert()\sof\sthe\sprevious\scheck-in\sso\sthat\sit\sworks\seven\swhen\ncompiled\swithout\sSQLITE_DEBUG. +D 2015-01-19T20:57:19.823 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5407a688f4d77a05c18a8142be8ae5a2829dd610 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -296,7 +296,7 @@ F src/vdbe.c ddfc977981cd6324668aa6b114045eb1c677421a F src/vdbe.h 6fc69d9c5e146302c56e163cb4b31d1ee64a18c3 F src/vdbeInt.h 9bb69ff2447c34b6ccc58b34ec35b615f86ead78 F src/vdbeapi.c 4bc511a46b9839392ae0e90844a71dc96d9dbd71 -F src/vdbeaux.c d22d71f5928f0170061b6509b72832d307fb581e +F src/vdbeaux.c f06d38c71d7f533348c09869d69fd1b647042a5b F src/vdbeblob.c 4af4bfb71f6df7778397b4a0ebc1879793276778 F src/vdbemem.c 31d8eabb0cd78bfeab4e5124c7363c3e9e54db9f F src/vdbesort.c 6d64c5448b64851b99931ede980addc3af70d5e2 @@ -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 824328f9833d01fc155a9d0265ef41d338cf1ffb -R 62f359e43ad9aa835c85ab2bfc9c70b0 -T *branch * tkt-f97c4637 -T *sym-tkt-f97c4637 * -T -sym-trunk * +P bf744b4908b096f301565f6a4ea8d56667c1d76a +R 41daf6b428d707d4f33647380c4cfa49 U drh -Z e1e735a41c0bcd1d69846f2fcc6f5b85 +Z 452da4f6a59c3f1fc4c567af0e6571ad diff --git a/manifest.uuid b/manifest.uuid index eecb747ee6..453f2b2bad 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -bf744b4908b096f301565f6a4ea8d56667c1d76a \ No newline at end of file +38868f845e1ad4d61354ab1ad39dd19e3e07c7fd \ No newline at end of file diff --git a/src/vdbeaux.c b/src/vdbeaux.c index b3f8278eb1..e07aacbcac 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -3380,6 +3380,8 @@ static void vdbeAssertFieldCountWithinLimits( } assert( nField <= pKeyInfo->nField+pKeyInfo->nXField ); } +#else +# define vdbeAssertFieldCountWithinLimits(A,B,C) #endif /* From 3f39bcf5bc9fa27fd51c0649bbed4d3f8418c808 Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 19 Jan 2015 20:59:34 +0000 Subject: [PATCH 67/69] Make sure that the KeyInfo.nXField value of ephermeral tables used for ORDER BY and GROUP BY is set correctly, so that the correct comparison function can be choosen by sqlite3VdbeFindCompare(). FossilOrigin-Name: c16bae5e699b851f4ca8414c5dfa5370b18f69f0 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/select.c | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index 95a9ce8219..c67989eac9 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\sassert()\sof\sthe\sprevious\scheck-in\sso\sthat\sit\sworks\seven\swhen\ncompiled\swithout\sSQLITE_DEBUG. -D 2015-01-19T20:57:19.823 +C Make\ssure\sthat\sthe\sKeyInfo.nXField\svalue\sof\sephermeral\stables\sused\sfor\nORDER\sBY\sand\sGROUP\sBY\sis\sset\scorrectly,\sso\sthat\sthe\scorrect\scomparison\nfunction\scan\sbe\schoosen\sby\ssqlite3VdbeFindCompare(). +D 2015-01-19T20:59:34.124 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5407a688f4d77a05c18a8142be8ae5a2829dd610 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -229,7 +229,7 @@ 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/select.c bc02e8b084891af5a3b428faa9cf367aff887d1a F src/shell.c d2d3b46701e44369dd314bd6817541c60e2c39ea F src/sqlite.h.in 9dfc99d6533d36d6a549c4f3f01cacc8be956ada F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad @@ -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 bf744b4908b096f301565f6a4ea8d56667c1d76a -R 41daf6b428d707d4f33647380c4cfa49 +P 38868f845e1ad4d61354ab1ad39dd19e3e07c7fd +R 13f159f0ffd29d3a96e72fa52e241602 U drh -Z 452da4f6a59c3f1fc4c567af0e6571ad +Z 00bba407ebbd95d365912cac0942941c diff --git a/manifest.uuid b/manifest.uuid index 453f2b2bad..7543094f94 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -38868f845e1ad4d61354ab1ad39dd19e3e07c7fd \ No newline at end of file +c16bae5e699b851f4ca8414c5dfa5370b18f69f0 \ No newline at end of file diff --git a/src/select.c b/src/select.c index 78b1caea8d..4037326467 100644 --- a/src/select.c +++ b/src/select.c @@ -1054,7 +1054,7 @@ static KeyInfo *keyInfoFromExprList( int i; nExpr = pList->nExpr; - pInfo = sqlite3KeyInfoAlloc(db, nExpr+nExtra-iStart, 1); + pInfo = sqlite3KeyInfoAlloc(db, nExpr-iStart, nExtra+1); if( pInfo ){ assert( sqlite3KeyInfoIsWriteable(pInfo) ); for(i=iStart, pItem=pList->a+iStart; inExpr); sSort.iECursor = pParse->nTab++; sSort.addrSortIndex = sqlite3VdbeAddOp4(v, OP_OpenEphemeral, @@ -5098,7 +5098,7 @@ int sqlite3Select( ** will be converted into a Noop. */ sAggInfo.sortingIdx = pParse->nTab++; - pKeyInfo = keyInfoFromExprList(pParse, pGroupBy, 0, 0); + pKeyInfo = keyInfoFromExprList(pParse, pGroupBy, 0, sAggInfo.nColumn); addrSortingIdx = sqlite3VdbeAddOp4(v, OP_SorterOpen, sAggInfo.sortingIdx, sAggInfo.nSortingColumn, 0, (char*)pKeyInfo, P4_KEYINFO); From 59b1b58b667ca8f89034ec57e77711ba00ad1d06 Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 19 Jan 2015 21:10:53 +0000 Subject: [PATCH 68/69] There are asserts in place now that will prevent a recurrence of ticket [f97c4637102a3ae7]. Nevertheless, it is good to add some test cases as well. FossilOrigin-Name: e02959b9a0e1bacdd3939548d4434c042aacc2e6 --- manifest | 11 ++++++----- manifest.uuid | 2 +- test/orderby8.test | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 test/orderby8.test diff --git a/manifest b/manifest index c67989eac9..88e87b25f8 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Make\ssure\sthat\sthe\sKeyInfo.nXField\svalue\sof\sephermeral\stables\sused\sfor\nORDER\sBY\sand\sGROUP\sBY\sis\sset\scorrectly,\sso\sthat\sthe\scorrect\scomparison\nfunction\scan\sbe\schoosen\sby\ssqlite3VdbeFindCompare(). -D 2015-01-19T20:59:34.124 +C There\sare\sasserts\sin\splace\snow\sthat\swill\sprevent\sa\srecurrence\sof\nticket\s[f97c4637102a3ae7].\s\sNevertheless,\sit\sis\sgood\sto\sadd\ssome\ntest\scases\sas\swell. +D 2015-01-19T21:10:53.444 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5407a688f4d77a05c18a8142be8ae5a2829dd610 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -769,6 +769,7 @@ F test/orderby4.test 4d39bfbaaa3ae64d026ca2ff166353d2edca4ba4 F test/orderby5.test 8f08a54836d21fb7c70245360751aedd1c2286fb F test/orderby6.test 8b38138ab0972588240b3fca0985d2e400432859 F test/orderby7.test 3d1383d52ade5b9eb3a173b3147fdd296f0202da +F test/orderby8.test 23ef1a5d72bd3adcc2f65561c654295d1b8047bd F test/oserror.test 14fec2796c2b6fe431c7823750e8a18a761176d7 F test/ovfl.test 4f7ca651cba5c059a12d8c67dddd49bec5747799 F test/pager1.test 1acbdb14c5952a72dd43129cabdbf69aaa3ed1fa @@ -1236,7 +1237,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 38868f845e1ad4d61354ab1ad39dd19e3e07c7fd -R 13f159f0ffd29d3a96e72fa52e241602 +P c16bae5e699b851f4ca8414c5dfa5370b18f69f0 +R e27a2655369428e59f07848a6b54ddd6 U drh -Z 00bba407ebbd95d365912cac0942941c +Z e964ea280030c93ae7b89ddabdb22c13 diff --git a/manifest.uuid b/manifest.uuid index 7543094f94..7c623bd1a8 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c16bae5e699b851f4ca8414c5dfa5370b18f69f0 \ No newline at end of file +e02959b9a0e1bacdd3939548d4434c042aacc2e6 \ No newline at end of file diff --git a/test/orderby8.test b/test/orderby8.test new file mode 100644 index 0000000000..53da971b12 --- /dev/null +++ b/test/orderby8.test @@ -0,0 +1,41 @@ +# 2015-01-19 +# +# 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 implements regression tests for SQLite library. The +# focus of this file is testing ORDER BY and LIMIT on tables with +# many columns. +# +# These tests verify that ticket [f97c4637102a3ae72b7911167e1d4da12ce60722] +# from 2015-01-19 has been fixed. +# + +set testdir [file dirname $argv0] +source $testdir/tester.tcl +set ::testprefix orderby8 + +do_test 1.0 { + db eval { + CREATE TABLE t1(x); + INSERT INTO t1(x) VALUES(1),(5),(9),(7),(3),(2),(4),(6),(8); + } + set ::result_set "x" +} {x} +for {set i 1} {$i<200} {incr i} { + append ::result_set ", x+$i" + do_test 1.$i { + set res {} + db eval "SELECT $::result_set FROM t1 ORDER BY x LIMIT -1" { + lappend res $x + } + set res + } {1 2 3 4 5 6 7 8 9} +} + +finish_test From fe201effbe35d38fdd198be93b23abe7583b2aa9 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 20 Jan 2015 03:04:29 +0000 Subject: [PATCH 69/69] Fix another instance of an incorrect value for KeyInfo.nXField on a sorting index. Ticket [f97c4637102a3ae72b79]. FossilOrigin-Name: 0077f64510f9b9ce90032df2696cb242d097ab84 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/select.c | 4 +++- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 5ab9b699da..045fe9bb3a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Ensure\sthat\sthe\sKeyInfo.nXField\svalue\sfor\sephemeral\stables\sused\sto\simplement\nORDER\sBY\sor\sGROUP\sBY\sclauses\sis\sset\scorrectly,\sso\sthat\sthe\nsqlite3VdbeFindCompare()\sroutine\scan\schoose\sthe\scorrect\scomparison\sfunction.\nAdd\sassert()\sstatements\sto\sthe\shigh-speed\scomparison\sfunctions\sto\sdetect\ncases\swhere\sthey\sare\sinappropriately\schosen.\nFix\sfor\sticket\s[f97c4637102a3ae72b7911]. -D 2015-01-19T21:36:05.317 +C Fix\sanother\sinstance\sof\san\sincorrect\svalue\sfor\sKeyInfo.nXField\son\sa\nsorting\sindex.\s\sTicket\s[f97c4637102a3ae72b79]. +D 2015-01-20T03:04:29.620 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5407a688f4d77a05c18a8142be8ae5a2829dd610 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -229,7 +229,7 @@ F src/printf.c ea82bcb1b83273b4c67177c233c1f78c81fc42f9 F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e -F src/select.c bc02e8b084891af5a3b428faa9cf367aff887d1a +F src/select.c a4e8fda24c8eab2682a058bdda0d5d68cfe3919c F src/shell.c d2d3b46701e44369dd314bd6817541c60e2c39ea F src/sqlite.h.in 9dfc99d6533d36d6a549c4f3f01cacc8be956ada F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad @@ -1237,8 +1237,8 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 2037442c582e51d85967bc911ea4a412eb4da573 e02959b9a0e1bacdd3939548d4434c042aacc2e6 -R 5021170f2a6880b445a702735148b9c6 -T +closed e02959b9a0e1bacdd3939548d4434c042aacc2e6 +P f7201bb0cdc9e1425c68599b32434de2231dca36 +Q +dc711db44ec424a7850231a39088229c23238f1b +R 62321acc2f9c598a0f3d605f6dbddb80 U drh -Z b76cf3617d76194e2b83c38054737fb3 +Z 8cb1f44c22f57ba114489669ef914874 diff --git a/manifest.uuid b/manifest.uuid index 06d89b2c82..eb64824593 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f7201bb0cdc9e1425c68599b32434de2231dca36 \ No newline at end of file +0077f64510f9b9ce90032df2696cb242d097ab84 \ No newline at end of file diff --git a/src/select.c b/src/select.c index 4037326467..39a0550f2a 100644 --- a/src/select.c +++ b/src/select.c @@ -543,7 +543,9 @@ static void pushOntoSorter( pKI = pOp->p4.pKeyInfo; memset(pKI->aSortOrder, 0, pKI->nField); /* Makes OP_Jump below testable */ sqlite3VdbeChangeP4(v, -1, (char*)pKI, P4_KEYINFO); - pOp->p4.pKeyInfo = keyInfoFromExprList(pParse, pSort->pOrderBy, nOBSat, 1); + testcase( pKI->nXField>2 ); + pOp->p4.pKeyInfo = keyInfoFromExprList(pParse, pSort->pOrderBy, nOBSat, + pKI->nXField-1); addrJmp = sqlite3VdbeCurrentAddr(v); sqlite3VdbeAddOp3(v, OP_Jump, addrJmp+1, 0, addrJmp+1); VdbeCoverage(v); pSort->labelBkOut = sqlite3VdbeMakeLabel(v);
"); - 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,"