diff --git a/Makefile.msc b/Makefile.msc index a7f8ee5527..995d8cd260 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -272,6 +272,17 @@ TCC = $(TCC) -I$(TOP)\ext\session RCC = $(RCC) -I$(TOP)\ext\session !ENDIF +# The mksqlite3c.tcl script accepts some options on the command +# line. When compiling with debugging enabled, some of these +# options are necessary in order to allow debugging symbols to +# work correctly with Visual Studio when using the amalgamation. +# +!IF $(DEBUG)>0 +MKSQLITE3C_ARGS = --linemacros +!ELSE +MKSQLITE3C_ARGS = +!ENDIF + # Define -DNDEBUG to compile without debugging (i.e., for production usage) # Omitting the define will cause extra debugging code to be inserted and # includes extra comments when "EXPLAIN stmt" is used. @@ -935,7 +946,7 @@ mptester.exe: $(TOP)\mptest\mptest.c libsqlite3.lib $(LIBRESOBJS) sqlite3.h echo > .target_source sqlite3.c: .target_source $(TOP)\tool\mksqlite3c.tcl - $(TCLSH_CMD) $(TOP)\tool\mksqlite3c.tcl + $(TCLSH_CMD) $(TOP)\tool\mksqlite3c.tcl $(MKSQLITE3C_ARGS) copy tsrc\shell.c . copy tsrc\sqlite3ext.h . copy $(TOP)\ext\session\sqlite3session.h . @@ -1357,17 +1368,17 @@ sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS) $(LTLINK) -DBUILD_sqlite -DTCLSH=2 -I$(TCLINCDIR) sqlite3_analyzer.c \ /link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS) -showdb.exe: $(TOP)\tool\showdb.c sqlite3.c - $(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o $@ \ - $(TOP)\tool\showdb.c sqlite3.c +showdb.exe: $(TOP)\tool\showdb.c $(SQLITE3C) + $(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \ + $(TOP)\tool\showdb.c $(SQLITE3C) -wordcount.exe: $(TOP)\test\wordcount.c sqlite3.c - $(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o $@ \ - $(TOP)\test\wordcount.c sqlite3.c +wordcount.exe: $(TOP)\test\wordcount.c $(SQLITE3C) + $(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \ + $(TOP)\test\wordcount.c $(SQLITE3C) -speedtest1.exe: $(TOP)\test\speedtest1.c sqlite3.c - $(LTLINK) -DSQLITE_OMIT_LOAD_EXTENSION -o $@ \ - $(TOP)\test\speedtest1.c sqlite3.c +speedtest1.exe: $(TOP)\test\speedtest1.c $(SQLITE3C) + $(LTLINK) -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \ + $(TOP)\test\speedtest1.c $(SQLITE3C) clean: del /Q *.lo *.ilk *.lib *.obj *.pdb sqlite3.exe libsqlite3.lib diff --git a/autoconf/tea/doc/sqlite3.n b/autoconf/tea/doc/sqlite3.n index cee765f94c..13913e5583 100644 --- a/autoconf/tea/doc/sqlite3.n +++ b/autoconf/tea/doc/sqlite3.n @@ -11,5 +11,5 @@ SQLite3 is a self-contains, zero-configuration, transactional SQL database engine. This extension provides an easy to use interface for accessing SQLite database files from Tcl. .PP -For full documentation see http://www.sqlite.org/ and -in particular http://www.sqlite.org/tclsqlite.html. +For full documentation see \fIhttp://www.sqlite.org/\fR and +in particular \fIhttp://www.sqlite.org/tclsqlite.html\fR. diff --git a/manifest b/manifest index 7ecac84a19..ac14cbf2d0 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Merge\slatest\sfixes\sfrom\sthe\strunk. -D 2014-01-29T14:21:31.405 +C Sync\swith\sversion\s3.8.3. +D 2014-02-03T13:58:42.546 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in e4ee6d36cdf6136aee0158675a3b24dd3bf31a5a F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 -F Makefile.msc 043280f9ca15befa7236484a6c1448d9271abd73 +F Makefile.msc 71dd5335d266351598e51f2d694396db2a2e219f F Makefile.vxworks db21ed42a01d5740e656b16f92cb5d8d5e5dd315 F README cd04a36fbc7ea56932a4052d7d0b7f09f27c33d6 F VERSION 8ed548d87d0a27fd7d7620476f9e25f9fa742d73 @@ -27,7 +27,7 @@ F autoconf/tea/Makefile.in 5c3b0bdfb66c20d55ebff59d1718864461570ca9 F autoconf/tea/README 3e9a3c060f29a44344ab50aec506f4db903fb873 F autoconf/tea/aclocal.m4 52c47aac44ce0ddb1f918b6993e8beb8eee88f43 F autoconf/tea/configure.in e0466b881b53f31f5a4a69e7a91ad130902fb359 -F autoconf/tea/doc/sqlite3.n e268faa1691c33663d3a7faf9fa30673d14bd879 +F autoconf/tea/doc/sqlite3.n e1fe45d4f5286ee3d0ccc877aca2a0def488e9bb F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523 F autoconf/tea/pkgIndex.tcl.in 3ef61715cf1c7bdcff56947ffadb26bc991ca39d F autoconf/tea/tclconfig/install-sh b087e5c4b92820c60bffb74acc1d9c2d40d80b8f @@ -171,7 +171,7 @@ F mptest/mptest.c 499a74af4be293b7c1c7c3d40f332b67227dd739 F mptest/multiwrite01.test 499ad0310da8dff8e8f98d2e272fc2a8aa741b2e F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b -F sqlite3.1 6be1ad09113570e1fc8dcaff84c9b0b337db5ffc +F sqlite3.1 3d8b83c91651f53472ca17599dae3457b8b89494 F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a F src/alter.c 2af0330bb1b601af7a7789bf7229675fd772a083 F src/analyze.c 581d5c18ce89c6f45d4dca65914d0de5b4dad41f @@ -458,7 +458,7 @@ F test/e_fts3.test 5c02288842e4f941896fd44afdef564dd5fc1459 F test/e_insert.test 1e44f84d2abe44d66e4fbf198be4b20e3cc724a0 F test/e_reindex.test 396b7b4f0a66863b4e95116a67d93b227193e589 F test/e_resolve.test dcce9308fb13b934ce29591105d031d3e14fbba6 -F test/e_select.test 51c062a9bda16e0ae1bbeed50806bedbd040b282 +F test/e_select.test 52692ff3849541e828ad4661fe3773a9b8711763 F test/e_select2.test aceb80ab927d46fba5ce7586ebabf23e2bb0604f F test/e_update.test 312cb8f5ccfe41515a6bb092f8ea562a9bd54d52 F test/e_uri.test a2c92d80093a7efdcfbb11093651cbea87097b6b @@ -751,7 +751,7 @@ F test/pagesize.test 1dd51367e752e742f58e861e65ed7390603827a0 F test/pcache.test b09104b03160aca0d968d99e8cd2c5b1921a993d F test/pcache2.test a83efe2dec0d392f814bfc998def1d1833942025 F test/percentile.test b98fc868d71eb5619d42a1702e9ab91718cbed54 -F test/permutations.test 79927c8175c4dc889f30486388490dae229b3b11 +F test/permutations.test b7b8b410e3d22e616ff473e588078da6a377c082 F test/pragma.test e882183ecd21d064cec5c7aaea174fbd36293429 F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13 F test/printf.test ec9870c4dce8686a37818e0bf1aba6e6a1863552 @@ -1167,7 +1167,7 @@ F tool/vdbe-compress.tcl 0cf56e9263a152b84da86e75a5c0cdcdb7a47891 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff -P 7b5f3773867ed0e4ed17bd473ba972d500035318 5bb29b82109224a2ad02920658fabd8fb0f27b3f -R 432574c0dd840817debf508c99b1ccfe -U dan -Z 2459ddf115f614b7a3ba484263d1245a +P 6b6dcd4cc75317628072abac7c58b41361cc72b4 e816dd924619db5f766de6df74ea2194f3e3b538 +R 346d101c294d20bde7ae1f470938d788 +U drh +Z 539f6826e36788b480b45411fb5563b3 diff --git a/manifest.uuid b/manifest.uuid index d587a3dc0e..3dc9abc5ee 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6b6dcd4cc75317628072abac7c58b41361cc72b4 \ No newline at end of file +a704b65b9476d60c88b5bc82f2743faa2bce5ac2 \ No newline at end of file diff --git a/sqlite3.1 b/sqlite3.1 index 785995bf60..02df7f44c7 100644 --- a/sqlite3.1 +++ b/sqlite3.1 @@ -2,7 +2,7 @@ .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) -.TH SQLITE3 1 "Mon Apr 15 23:49:17 2002" +.TH SQLITE3 1 "Mon Jan 31 11:14:00 2014" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -49,7 +49,7 @@ a table named "memos" and insert a couple of records into that table: $ .B sqlite3 mydata.db .br -SQLite version 3.1.3 +SQLite version 3.8.3 .br Enter ".help" for instructions .br @@ -108,15 +108,24 @@ sqlite> .B .help .nf .cc | +.backup ?DB? FILE Backup DB (default "main") to FILE +.bail ON|OFF Stop after hitting an error. Default OFF .databases List names and files of attached databases .dump ?TABLE? ... Dump the database in an SQL text format + If TABLE specified, only dump tables matching + LIKE pattern TABLE. .echo ON|OFF Turn command echo on or off .exit Exit this program -.explain ON|OFF Turn output mode suitable for EXPLAIN on or off. +.explain ?ON|OFF? Turn output mode suitable for EXPLAIN on or off. + With no args, it turns EXPLAIN on. .header(s) ON|OFF Turn display of headers on or off .help Show this message .import FILE TABLE Import data from FILE into TABLE -.indices TABLE Show names of all indices on TABLE +.indices ?TABLE? Show names of all indices + If TABLE specified, only show indices for tables + matching LIKE pattern TABLE. +.load FILE ?ENTRY? Load an extension library +.log FILE|off Turn logging on or off. FILE can be stderr/stdout .mode MODE ?TABLE? Set output mode where MODE is one of: csv Comma-separated values column Left-aligned columns. (See .width) @@ -126,46 +135,76 @@ sqlite> list Values delimited by .separator string tabs Tab-separated values tcl TCL list elements -.nullvalue STRING Print STRING in place of NULL values +.nullvalue STRING Use STRING in place of NULL values +.open ?FILENAME? Close existing database and reopen FILENAME .output FILENAME Send output to FILENAME .output stdout Send output to the screen +.print STRING... Print literal STRING .prompt MAIN CONTINUE Replace the standard prompts .quit Exit this program .read FILENAME Execute SQL in FILENAME +.restore ?DB? FILE Restore content of DB (default "main") from FILE .schema ?TABLE? Show the CREATE statements + If TABLE specified, only show tables matching + LIKE pattern TABLE. .separator STRING Change separator used by output mode and .import .show Show the current values for various settings -.tables ?PATTERN? List names of tables matching a LIKE pattern +.stats ON|OFF Turn stats on or off +.tables ?TABLE? List names of tables + If TABLE specified, only list tables matching + LIKE pattern TABLE. .timeout MS Try opening locked tables for MS milliseconds -.width NUM NUM ... Set column widths for "column" mode +.trace FILE|off Output each SQL statement as it is run +.vfsname ?AUX? Print the name of the VFS stack +.width NUM1 NUM2 ... Set column widths for "column" mode +.timer ON|OFF Turn the CPU timer measurement on or off sqlite> |cc . .sp .fi - .SH OPTIONS .B sqlite3 has the following options: .TP -.BI \-init\ file -Read and execute commands from -.I file -, which can contain a mix of SQL statements and meta-commands. +.B \-bail +Stop after hitting an error. .TP -.B \-echo -Print commands before execution. -.TP -.B \-[no]header -Turn headers on or off. +.B \-batch +Force batch I/O. .TP .B \-column Query results will be displayed in a table like form, using whitespace characters to separate the columns and align the output. .TP +.BI \-cmd\ command +run +.I command +before reading stdin +.TP +.B \-csv +Set output mode to CSV (comma separated values). +.TP +.B \-echo +Print commands before execution. +.TP +.BI \-init\ file +Read and execute commands from +.I file +, which can contain a mix of SQL statements and meta-commands. +.TP +.B \-[no]header +Turn headers on or off. +.TP +.B \-help +Show help on options and exit. +.TP .B \-html Query results will be output as simple HTML tables. .TP +.B \-interactive +Force interactive I/O. +.TP .B \-line Query results will be displayed with one value per line, rows separated by a blank line. Designed to be easily parsed by @@ -175,18 +214,28 @@ scripts or other programs Query results will be displayed with the separator (|, by default) character between each field value. The default. .TP -.BI \-separator\ separator -Set output field separator. Default is '|'. +.BI \-mmap\ N +Set default mmap size to +.I N +\. .TP .BI \-nullvalue\ string Set string used to represent NULL values. Default is '' (empty string). .TP +.BI \-separator\ separator +Set output field separator. Default is '|'. +.TP +.B \-stats +Print memory stats before each finalize. +.TP .B \-version Show SQLite version. .TP -.B \-help -Show help on options and exit. +.BI \-vfs\ name +Use +.I name +as the default VFS. .SH INIT FILE @@ -222,8 +271,9 @@ o All other command line options are processed. .SH SEE ALSO http://www.sqlite.org/ .br -The sqlite-doc package +The sqlite3-doc package. .SH AUTHOR This manual page was originally written by Andreas Rottmann , for the Debian GNU/Linux system (but may be used -by others). It was subsequently revised by Bill Bumgarner . +by others). It was subsequently revised by Bill Bumgarner and +further updated by Laszlo Boszormenyi . diff --git a/test/e_select.test b/test/e_select.test index 58b8987ba6..89d61b53bc 100644 --- a/test/e_select.test +++ b/test/e_select.test @@ -464,10 +464,10 @@ do_join_test e_select-1.4.2.1 { ] # TODO: Come back and add a few more like the above. -# EVIDENCE-OF: R-20659-43267 In other words, if the left-hand dataset -# consists of Nlhs rows of Mlhs columns, and the right-hand dataset of -# Nrhs rows of Mrhs columns, then the cartesian product is a dataset of -# Nlhs.Nrhs rows, each containing Mlhs+Mrhs columns. +# EVIDENCE-OF: R-18439-38548 In other words, if the left-hand dataset +# consists of Nleft rows of Mleft columns, and the right-hand dataset of +# Nright rows of Mright columns, then the cartesian product is a dataset +# of Nleft×Nright rows, each containing Mleft+Mright columns. # # x1, x2 (Nlhs=3, Nrhs=2) (Mlhs=2, Mrhs=3) do_join_test e_select-1.4.3.1 { @@ -732,10 +732,10 @@ do_execsql_test e_select-3.0 { INSERT INTO x2 VALUES(7, 'mistrusted', 'standardized'); } {} -# EVIDENCE-OF: R-06999-14330 If a WHERE clause is specified, the WHERE +# EVIDENCE-OF: R-60775-64916 If a WHERE clause is specified, the WHERE # expression is evaluated for each row in the input data as a boolean -# expression. All rows for which the WHERE clause expression evaluates -# to false are excluded from the dataset before continuing. +# expression. Only rows for which the WHERE clause expression evaluates +# to true are included from the dataset before continuing. # do_execsql_test e_select-3.1.1 { SELECT k FROM x1 WHERE x } {3} do_execsql_test e_select-3.1.2 { SELECT k FROM x1 WHERE y } {3 5 6} @@ -813,8 +813,8 @@ do_select_tests e_select-4.1 { } } -# EVIDENCE-OF: R-61869-22578 It is an error to use a "*" or "alias.*" -# expression in any context other than than a result expression list. +# EVIDENCE-OF: R-38023-18396 It is an error to use a "*" or "alias.*" +# expression in any context other than a result expression list. # # EVIDENCE-OF: R-44324-41166 It is also an error to use a "*" or # "alias.*" expression in a simple SELECT query that does not have a @@ -1007,12 +1007,12 @@ do_execsql_test e_select-4.9.0 { INSERT INTO b3 VALUES('dEF', 'dEF'); } {} -# EVIDENCE-OF: R-57754-57109 If the SELECT statement is an aggregate +# EVIDENCE-OF: R-07284-35990 If the SELECT statement is an aggregate # query with a GROUP BY clause, then each of the expressions specified # as part of the GROUP BY clause is evaluated for each row of the # dataset. Each row is then assigned to a "group" based on the results; # rows for which the results of evaluating the GROUP BY expressions are -# the same are assigned to the same group. +# the same get assigned to the same group. # # These tests also show that the following is not untrue: # @@ -1371,8 +1371,9 @@ foreach {tn select op1 op2} { do_catchsql_test e_select-7.2.$tn $select [list 1 $err] } -# EVIDENCE-OF: R-22874-32655 ORDER BY and LIMIT clauses may only occur -# at the end of the entire compound SELECT. +# EVIDENCE-OF: R-45440-25633 ORDER BY and LIMIT clauses may only occur +# at the end of the entire compound SELECT, and then only if the final +# element of the compound is not a VALUES clause. # foreach {tn select} { 1 "SELECT * FROM j1 UNION ALL SELECT * FROM j2,j3 ORDER BY a" @@ -1384,6 +1385,7 @@ foreach {tn select} { 7 "SELECT * FROM j1 UNION SELECT * FROM j2,j3 ORDER BY a" 8 "SELECT count(*) FROM j1 UNION SELECT max(e) FROM j2 ORDER BY 1" + 8b "VALUES('8b') UNION SELECT max(e) FROM j2 ORDER BY 1" 9 "SELECT count(*), * FROM j1 UNION SELECT *,* FROM j2 ORDER BY 1,2,3" 10 "SELECT * FROM j1 UNION SELECT * FROM j2,j3 LIMIT 10" 11 "SELECT * FROM j1 UNION SELECT * FROM j2,j3 LIMIT 10 OFFSET 5" @@ -1405,6 +1407,14 @@ foreach {tn select} { } { do_test e_select-7.3.$tn { catch {execsql $select} msg } 0 } +foreach {tn select} { + 50 "SELECT * FROM j1 ORDER BY 1 UNION ALL SELECT * FROM j2,j3" + 51 "SELECT * FROM j1 LIMIT 1 UNION ALL SELECT * FROM j2,j3" + 52 "SELECT count(*) FROM j1 UNION ALL VALUES(11) ORDER BY 1" + 53 "SELECT count(*) FROM j1 UNION ALL VALUES(11) LIMIT 1" +} { + do_test e_select-7.3.$tn { catch {execsql $select} msg } 1 +} # EVIDENCE-OF: R-08531-36543 A compound SELECT created using UNION ALL # operator returns all the rows from the SELECT to the left of the UNION diff --git a/test/permutations.test b/test/permutations.test index c88e69fe3d..f7b955f5c5 100644 --- a/test/permutations.test +++ b/test/permutations.test @@ -645,7 +645,7 @@ test_suite "inmemory_journal" -description { ioerr.test ioerr2.test ioerr3.test ioerr4.test ioerr5.test vacuum3.test incrblob_err.test diskfull.test backup_ioerr.test e_fts3.test fts3cov.test fts3malloc.test fts3rnd.test - fts3snippet.test + fts3snippet.test mmapfault.test # Exclude test scripts that use tcl IO to access journal files or count # the number of fsync() calls.