1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Update the sessions branch with all the latest changes from trunk.

FossilOrigin-Name: 0f347fbfc7d8821f56f1ae0d1a9472a375631e65
This commit is contained in:
drh
2012-05-04 23:31:14 +00:00
28 changed files with 2390 additions and 268 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -1,5 +1,5 @@
C Merge\sthe\slatest\strunk\schanges\sinto\sthe\ssessions\sbranch. C Update\sthe\ssessions\sbranch\swith\sall\sthe\slatest\schanges\sfrom\strunk.
D 2012-04-19T20:00:31.443 D 2012-05-04T23:31:14.883
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 2f37e468503dbe79d35c9f6dffcf3fae1ae9ec20 F Makefile.in 2f37e468503dbe79d35c9f6dffcf3fae1ae9ec20
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -9,17 +9,9 @@ F README cd04a36fbc7ea56932a4052d7d0b7f09f27c33d6
F VERSION f9313d88cb77df8617059a88eb382291321ef6bc F VERSION f9313d88cb77df8617059a88eb382291321ef6bc
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50 F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
F addopcodes.awk 17dc593f791f874d2c23a0f9360850ded0286531 F addopcodes.awk 17dc593f791f874d2c23a0f9360850ded0286531
F art/2005osaward.gif 0d1851b2a7c1c9d0ccce545f3e14bca42d7fd248
F art/SQLite.eps 9b43cc99cfd2be687d386faea6862ea68d6a72b2
F art/SQLite.gif 1bbb94484963f1382e27e1c5e86dd0c1061eba2b
F art/SQLiteLogo3.tiff b9e6bf022ae939bc986cddb8ab99583ca1b02cb3
F art/SQLite_big.gif 2b8e4603b91ba2a2c7062a82ff570d945034bb30
F art/nocopy.gif 716aa07d4bb7250d4e75756073bf8ef9f56bec8f
F art/powered_by_sqlite.gif 7fbcd7d3675391fd3d21672c14c05f5999eb60d1
F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2
F art/src_logo.gif 9341ef09f0e53cd44c0c9b6fc3c16f7f3d6c2ad9
F config.guess 226d9a188c6196f3033ffc651cbc9dcee1a42977 F config.guess 226d9a188c6196f3033ffc651cbc9dcee1a42977
F config.h.in 0921066a13130082764ab4ab6456f7b5bebe56de F config.h.in 0921066a13130082764ab4ab6456f7b5bebe56de
F config.sub 9ebe4c3b3dab6431ece34f16828b594fb420da55 F config.sub 9ebe4c3b3dab6431ece34f16828b594fb420da55
@ -181,7 +173,7 @@ F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
F src/os_os2.c 4a75888ba3dfc820ad5e8177025972d74d7f2440 F src/os_os2.c 4a75888ba3dfc820ad5e8177025972d74d7f2440
F src/os_unix.c 424d46e0edab969293c2223f09923b2178171f47 F src/os_unix.c 424d46e0edab969293c2223f09923b2178171f47
F src/os_win.c 5e9e933a412ab35de2a6506b3c6a8295b31b309e F src/os_win.c 5e9e933a412ab35de2a6506b3c6a8295b31b309e
F src/pager.c 85988507fa20acc60defb834722eddf4633e4aeb F src/pager.c bb5635dde0b152797836d1c72275284724bb563c
F src/pager.h ef1eaf8593e78f73885c1dfac27ad83bee23bdc5 F src/pager.h ef1eaf8593e78f73885c1dfac27ad83bee23bdc5
F src/parse.y eb054bb40a5bf90d3422a01ed0e5df229461727a F src/parse.y eb054bb40a5bf90d3422a01ed0e5df229461727a
F src/pcache.c f8043b433a57aba85384a531e3937a804432a346 F src/pcache.c f8043b433a57aba85384a531e3937a804432a346
@ -191,10 +183,10 @@ F src/pragma.c e708b3bb5704605816f617e0b1d63a5488060715
F src/prepare.c ec4989f7f480544bdc4192fe663470d2a2d7d61e F src/prepare.c ec4989f7f480544bdc4192fe663470d2a2d7d61e
F src/printf.c 7ffb4ebb8b341f67e049695ba031da717b3d2699 F src/printf.c 7ffb4ebb8b341f67e049695ba031da717b3d2699
F src/random.c cd4a67b3953b88019f8cd4ccd81394a8ddfaba50 F src/random.c cd4a67b3953b88019f8cd4ccd81394a8ddfaba50
F src/resolve.c 969ec2bc52db1b068054ecf5ddc74f244102a71d F src/resolve.c 748e75299faff345f34f0e5bd02a2bac8aa69fcd
F src/rowset.c f6a49f3e9579428024662f6e2931832511f831a1 F src/rowset.c f6a49f3e9579428024662f6e2931832511f831a1
F src/select.c d7b9018b7dd2e821183d69477ab55c39b8272335 F src/select.c d7b9018b7dd2e821183d69477ab55c39b8272335
F src/shell.c 11185a9a4574f363bd4268a2780d37480ae00040 F src/shell.c 04399b2f9942bd02ed5ffee3b84bcdb39c52a1e6
F src/sqlite.h.in ad55acc42422c461719f3adaee434836ab00677b F src/sqlite.h.in ad55acc42422c461719f3adaee434836ab00677b
F src/sqlite3ext.h 6904f4aadf976f95241311fbffb00823075d9477 F src/sqlite3ext.h 6904f4aadf976f95241311fbffb00823075d9477
F src/sqliteInt.h 572c5e6aca50256bdbc34919ece5f660dabf25cc F src/sqliteInt.h 572c5e6aca50256bdbc34919ece5f660dabf25cc
@ -238,6 +230,7 @@ F src/test_quota.h ee5da2ae7f84d1c8e0e0e2ab33f01d69f10259b5
F src/test_rtree.c aba603c949766c4193f1068b91c787f57274e0d9 F src/test_rtree.c aba603c949766c4193f1068b91c787f57274e0d9
F src/test_schema.c 8c06ef9ddb240c7a0fcd31bc221a6a2aade58bf0 F src/test_schema.c 8c06ef9ddb240c7a0fcd31bc221a6a2aade58bf0
F src/test_server.c 2f99eb2837dfa06a4aacf24af24c6affdf66a84f F src/test_server.c 2f99eb2837dfa06a4aacf24af24c6affdf66a84f
F src/test_spellfix.c 495535f3eb57acdc384572da570e869bb1834bf4
F src/test_stat.c d7035cfcc0ff1f93c000b621f36524318e004e11 F src/test_stat.c d7035cfcc0ff1f93c000b621f36524318e004e11
F src/test_superlock.c 2b97936ca127d13962c3605dbc9a4ef269c424cd F src/test_superlock.c 2b97936ca127d13962c3605dbc9a4ef269c424cd
F src/test_syscall.c a992d8c80ea91fbf21fb2dd570db40e77dd7e6ae F src/test_syscall.c a992d8c80ea91fbf21fb2dd570db40e77dd7e6ae
@ -262,11 +255,11 @@ F src/vdbeblob.c 11248c6362389569764682eb0f59ce910f3cc381
F src/vdbemem.c cb55e84b8e2c15704968ee05f0fae25883299b74 F src/vdbemem.c cb55e84b8e2c15704968ee05f0fae25883299b74
F src/vdbesort.c b25814d385895544ebc8118245c8311ded7f81c9 F src/vdbesort.c b25814d385895544ebc8118245c8311ded7f81c9
F src/vdbetrace.c d6e50e04e1ec498150e519058f617d91b8f5c843 F src/vdbetrace.c d6e50e04e1ec498150e519058f617d91b8f5c843
F src/vtab.c ab90fb600a3f5e4b7c48d22a4cdb2d6b23239847 F src/vtab.c ae657b1c22cff43863458e768a44f915c07bc0e4
F src/wal.c 7bb3ad807afc7973406c805d5157ec7a2f65e146 F src/wal.c 7bb3ad807afc7973406c805d5157ec7a2f65e146
F src/wal.h 29c197540b19044e6cd73487017e5e47a1d3dac6 F src/wal.h 29c197540b19044e6cd73487017e5e47a1d3dac6
F src/walker.c 3112bb3afe1d85dc52317cb1d752055e9a781f8f F src/walker.c 3112bb3afe1d85dc52317cb1d752055e9a781f8f
F src/where.c 2112422a404dcca5d47f6630bdf180bccd36c62b F src/where.c 8e9f01cd1604aa21cfa8e0258b7101e05082fa98
F test/8_3_names.test 631ea964a3edb091cf73c3b540f6bcfdb36ce823 F test/8_3_names.test 631ea964a3edb091cf73c3b540f6bcfdb36ce823
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
F test/alias.test 4529fbc152f190268a15f9384a5651bbbabc9d87 F test/alias.test 4529fbc152f190268a15f9384a5651bbbabc9d87
@ -388,7 +381,7 @@ F test/descidx1.test 533dcbda614b0463b0ea029527fd27e5a9ab2d66
F test/descidx2.test 9f1a0c83fd57f8667c82310ca21b30a350888b5d F test/descidx2.test 9f1a0c83fd57f8667c82310ca21b30a350888b5d
F test/descidx3.test fe720e8b37d59f4cef808b0bf4e1b391c2e56b6f F test/descidx3.test fe720e8b37d59f4cef808b0bf4e1b391c2e56b6f
F test/diskfull.test 106391384780753ea6896b7b4f005d10e9866b6e F test/diskfull.test 106391384780753ea6896b7b4f005d10e9866b6e
F test/distinct.test 8c6d12ba53ee8351a5b2d47628acdfad1fc97743 F test/distinct.test da36612d05b9ed17e0425d4bfd7ab978d28a7e46
F test/distinctagg.test 1a6ef9c87a58669438fc771450d7a72577417376 F test/distinctagg.test 1a6ef9c87a58669438fc771450d7a72577417376
F test/e_createtable.test 48598b15e8fe6554d301e7b65a10c9851f177e84 F test/e_createtable.test 48598b15e8fe6554d301e7b65a10c9851f177e84
F test/e_delete.test 89aa84d3d1bd284a0689ede04bce10226a5aeaa5 F test/e_delete.test 89aa84d3d1bd284a0689ede04bce10226a5aeaa5
@ -555,7 +548,7 @@ F test/insert5.test 394f96728d1258f406fe5f5aeb0aaf29487c39a6
F test/intarray.test 066b7d7ac38d25bf96f87f1b017bfc687551cdd4 F test/intarray.test 066b7d7ac38d25bf96f87f1b017bfc687551cdd4
F test/interrupt.test 42e7cf98646fd9cb4a3b131a93ed3c50b9e149f1 F test/interrupt.test 42e7cf98646fd9cb4a3b131a93ed3c50b9e149f1
F test/intpkey.test 537669fd535f62632ca64828e435b9e54e8d677f F test/intpkey.test 537669fd535f62632ca64828e435b9e54e8d677f
F test/io.test b278aa8fa609ed0dcc825df31b2d9f526c5a52bd F test/io.test 36d251507d72e92b965fb2f0801c2f0b56335bcf
F test/ioerr.test 40bb2cfcab63fb6aa7424cd97812a84bc16b5fb8 F test/ioerr.test 40bb2cfcab63fb6aa7424cd97812a84bc16b5fb8
F test/ioerr2.test 9d71166f8466eda510f1af6137bdabaa82b5408d F test/ioerr2.test 9d71166f8466eda510f1af6137bdabaa82b5408d
F test/ioerr3.test d3cec5e1a11ad6d27527d0d38573fbff14c71bdd F test/ioerr3.test d3cec5e1a11ad6d27527d0d38573fbff14c71bdd
@ -695,7 +688,7 @@ F test/select5.test e758b8ef94f69b111df4cb819008856655dcd535
F test/select6.test cc25a8650cf9a4d4f74e586c45a75f9836516b18 F test/select6.test cc25a8650cf9a4d4f74e586c45a75f9836516b18
F test/select7.test dad6f00f0d49728a879d6eb6451d4752db0b0abe F test/select7.test dad6f00f0d49728a879d6eb6451d4752db0b0abe
F test/select8.test 391de11bdd52339c30580dabbbbe97e3e9a3c79d F test/select8.test 391de11bdd52339c30580dabbbbe97e3e9a3c79d
F test/select9.test 74c0fb2c6eecb0219cbed0cbe3df136f8fbf9343 F test/select9.test c0ca3cd87a8ebb04de2cb1402c77df55d911a0ea
F test/selectA.test 06d1032fa9009314c95394f2ca2e60d9f7ae8532 F test/selectA.test 06d1032fa9009314c95394f2ca2e60d9f7ae8532
F test/selectB.test 954e4e49cf1f896d61794e440669e03a27ceea25 F test/selectB.test 954e4e49cf1f896d61794e440669e03a27ceea25
F test/selectC.test 871fb55d884d3de5943c4057ebd22c2459e71977 F test/selectC.test 871fb55d884d3de5943c4057ebd22c2459e71977
@ -709,6 +702,11 @@ F test/shared6.test 866bb4982c45ce216c61ded5e8fde4e7e2f3ffa9
F test/shared7.test 960760bc8d03e1419e70dea69cf41db62853616e F test/shared7.test 960760bc8d03e1419e70dea69cf41db62853616e
F test/shared_err.test 91e26ec4f3fbe07951967955585137e2f18993de F test/shared_err.test 91e26ec4f3fbe07951967955585137e2f18993de
F test/sharedlock.test ffa0a3c4ac192145b310f1254f8afca4d553eabf F test/sharedlock.test ffa0a3c4ac192145b310f1254f8afca4d553eabf
F test/shell1.test 7dcd612b0018ddad783647d984fffa76791ffd3d w tool/shell1.test
F test/shell2.test 037d6ad16e873354195d30bb2dc4b5321788154a w tool/shell2.test
F test/shell3.test 9196c42772d575685e722c92b4b39053c6ebba59 w tool/shell3.test
F test/shell4.test aa4eef8118b412d1a01477a53426ece169ea86a9 w tool/shell4.test
F test/shell5.test fa2188bbb13fe2d183fd04a5f7b512650c35ef5d w tool/shell5.test
F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3 F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3
F test/shrink.test 8c70f62b6e8eb4d54533de6d65bd06b1b9a17868 F test/shrink.test 8c70f62b6e8eb4d54533de6d65bd06b1b9a17868
F test/sidedelete.test f0ad71abe6233e3b153100f3b8d679b19a488329 F test/sidedelete.test f0ad71abe6233e3b153100f3b8d679b19a488329
@ -740,7 +738,7 @@ F test/tclsqlite.test 2f2aa887763af30641f5561bdc26c5d3fbc73a88
F test/tempdb.test 19d0f66e2e3eeffd68661a11c83ba5e6ace9128c F test/tempdb.test 19d0f66e2e3eeffd68661a11c83ba5e6ace9128c
F test/temptable.test 51edd31c65ed1560dd600b1796e8325df96318e2 F test/temptable.test 51edd31c65ed1560dd600b1796e8325df96318e2
F test/temptrigger.test 26670ed7a39cf2296a7f0a9e0a1d7bdb7abe936d F test/temptrigger.test 26670ed7a39cf2296a7f0a9e0a1d7bdb7abe936d
F test/tester.tcl a3e41436033f39f7009de8bc4cb0de09d63f500a F test/tester.tcl e9e495e68f7c5e0e17561acdfcb59ca6679ff019
F test/thread001.test 7cc2ce08f9cde95964736d11e91f9ab610f82f91 F test/thread001.test 7cc2ce08f9cde95964736d11e91f9ab610f82f91
F test/thread002.test e630504f8a06c00bf8bbe68528774dd96aeb2e58 F test/thread002.test e630504f8a06c00bf8bbe68528774dd96aeb2e58
F test/thread003.test ee4c9efc3b86a6a2767516a37bd64251272560a7 F test/thread003.test ee4c9efc3b86a6a2767516a37bd64251272560a7
@ -754,10 +752,12 @@ F test/threadtest2.c ace893054fa134af3fc8d6e7cfecddb8e3acefb9
F test/threadtest3.c 0ed13e09690f6204d7455fac3b0e8ece490f6eef F test/threadtest3.c 0ed13e09690f6204d7455fac3b0e8ece490f6eef
F test/tkt-02a8e81d44.test 6c80d9c7514e2a42d4918bf87bf6bc54f379110c F test/tkt-02a8e81d44.test 6c80d9c7514e2a42d4918bf87bf6bc54f379110c
F test/tkt-26ff0c2d1e.test 888324e751512972c6e0d1a09df740d8f5aaf660 F test/tkt-26ff0c2d1e.test 888324e751512972c6e0d1a09df740d8f5aaf660
F test/tkt-2a5629202f.test 1ab32e084e9fc3d36be6dee2617530846a0eb0b6
F test/tkt-2d1a5c67d.test b028a811049eb472cb2d3a43fc8ce4f6894eebda F test/tkt-2d1a5c67d.test b028a811049eb472cb2d3a43fc8ce4f6894eebda
F test/tkt-2ea2425d34.test 1cf13e6f75d149b3209a0cb32927a82d3d79fb28 F test/tkt-2ea2425d34.test 1cf13e6f75d149b3209a0cb32927a82d3d79fb28
F test/tkt-31338dca7e.test 1f714c14b6682c5db715e0bda347926a3456f7a9 F test/tkt-31338dca7e.test 1f714c14b6682c5db715e0bda347926a3456f7a9
F test/tkt-313723c356.test c47f8a9330523e6f35698bf4489bcb29609b53ac F test/tkt-313723c356.test c47f8a9330523e6f35698bf4489bcb29609b53ac
F test/tkt-385a5b56b9.test 8eb87c4bbcc3fd4f33d73719de7e9d64973fa196
F test/tkt-38cb5df375.test f3cc8671f1eb604d4ae9cf886ed4366bec656678 F test/tkt-38cb5df375.test f3cc8671f1eb604d4ae9cf886ed4366bec656678
F test/tkt-3998683a16.test 6d1d04d551ed1704eb3396ca87bb9ccc8c5c1eb7 F test/tkt-3998683a16.test 6d1d04d551ed1704eb3396ca87bb9ccc8c5c1eb7
F test/tkt-3a77c9714e.test 32bb28afa8c63fc76e972e996193139b63551ed9 F test/tkt-3a77c9714e.test 32bb28afa8c63fc76e972e996193139b63551ed9
@ -952,7 +952,7 @@ F test/walro.test e6bb27762c9f22601cbb8bff6e0acfd124e74b63
F test/walshared.test 6dda2293880c300baf5d791c307f653094585761 F test/walshared.test 6dda2293880c300baf5d791c307f653094585761
F test/walslow.test e7be6d9888f83aa5d3d3c7c08aa9b5c28b93609a F test/walslow.test e7be6d9888f83aa5d3d3c7c08aa9b5c28b93609a
F test/walthread.test a2ed5270eb695284d4ad27d252517bdc3317ee2a F test/walthread.test a2ed5270eb695284d4ad27d252517bdc3317ee2a
F test/where.test de337a3fe0a459ec7c93db16a519657a90552330 F test/where.test 4c9f69987ed2aa0173fa930f2b41ab9879478cd8
F test/where2.test 43d4becaf5a5df854e6c21d624a1cb84c6904554 F test/where2.test 43d4becaf5a5df854e6c21d624a1cb84c6904554
F test/where3.test 667e75642102c97a00bf9b23d3cb267db321d006 F test/where3.test 667e75642102c97a00bf9b23d3cb267db321d006
F test/where4.test e9b9e2f2f98f00379e6031db6a6fca29bae782a2 F test/where4.test e9b9e2f2f98f00379e6031db6a6fca29bae782a2
@ -990,11 +990,6 @@ F tool/omittest.tcl 72a49b8a9a8b0bf213a438180307a0df836d4380
F tool/opcodeDoc.awk b3a2a3d5d3075b8bd90b7afe24283efdd586659c F tool/opcodeDoc.awk b3a2a3d5d3075b8bd90b7afe24283efdd586659c
F tool/restore_jrnl.tcl 6957a34f8f1f0f8285e07536225ec3b292a9024a F tool/restore_jrnl.tcl 6957a34f8f1f0f8285e07536225ec3b292a9024a
F tool/rollback-test.c 9fc98427d1e23e84429d7e6d07d9094fbdec65a5 F tool/rollback-test.c 9fc98427d1e23e84429d7e6d07d9094fbdec65a5
F tool/shell1.test 20dfe7099cf2afe37aecd69afb7678d14f7a0abf
F tool/shell2.test 5dc76b8005b465f420fed8241621da7513060ff3
F tool/shell3.test 4fad469e8003938426355afdf34155f08c587836
F tool/shell4.test 35f9c3d452b4e76d5013c63e1fd07478a62f14ce
F tool/shell5.test 0e987fb8d40638bb5c90163cb58cbe3e07dbed56
F tool/showdb.c 2e28d8e499b016485672e9a7ac65dacc0d28ff69 F tool/showdb.c 2e28d8e499b016485672e9a7ac65dacc0d28ff69
F tool/showjournal.c b62cecaab86a4053d944c276bb5232e4d17ece02 F tool/showjournal.c b62cecaab86a4053d944c276bb5232e4d17ece02
F tool/showwal.c f09e5a80a293919290ec85a6a37c85a5ddcf37d9 F tool/showwal.c f09e5a80a293919290ec85a6a37c85a5ddcf37d9
@ -1013,7 +1008,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
F tool/warnings-clang.sh a8a0a3babda96dfb1ff51adda3cbbf3dfb7266c2 F tool/warnings-clang.sh a8a0a3babda96dfb1ff51adda3cbbf3dfb7266c2
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
P 87a0eab5d98fff93aa2147c04c4af27be42fb365 3281972eaa46cb57fd9f0387063f47430dc0a3b4 P 2b7a91e61794ce9ffe210bad584454e52c79924e bfa61e781cb442be641486e7e55a1518e888d830
R 9636c18c52011b532bece9e648b40abc R bed2e7cce64395c916783d9e3080c791
U drh U drh
Z 8c2c5ae91a3dd05ffa0247cd525ea466 Z 95959a45df2928e15269c2ba6866d087

View File

@ -1 +1 @@
2b7a91e61794ce9ffe210bad584454e52c79924e 0f347fbfc7d8821f56f1ae0d1a9472a375631e65

View File

@ -3003,7 +3003,7 @@ static int pagerWalFrames(
PgHdr *p; PgHdr *p;
PgHdr **ppNext = &pList; PgHdr **ppNext = &pList;
nList = 0; nList = 0;
for(p=pList; (*ppNext = p); p=p->pDirty){ for(p=pList; (*ppNext = p)!=0; p=p->pDirty){
if( p->pgno<=nTruncate ){ if( p->pgno<=nTruncate ){
ppNext = &p->pDirty; ppNext = &p->pDirty;
nList++; nList++;

View File

@ -883,7 +883,7 @@ static int resolveOrderGroupBy(
ExprList *pOrderBy, /* An ORDER BY or GROUP BY clause to resolve */ ExprList *pOrderBy, /* An ORDER BY or GROUP BY clause to resolve */
const char *zType /* Either "ORDER" or "GROUP", as appropriate */ const char *zType /* Either "ORDER" or "GROUP", as appropriate */
){ ){
int i; /* Loop counter */ int i, j; /* Loop counters */
int iCol; /* Column number */ int iCol; /* Column number */
struct ExprList_item *pItem; /* A term of the ORDER BY clause */ struct ExprList_item *pItem; /* A term of the ORDER BY clause */
Parse *pParse; /* Parsing context */ Parse *pParse; /* Parsing context */
@ -920,6 +920,11 @@ static int resolveOrderGroupBy(
if( sqlite3ResolveExprNames(pNC, pE) ){ if( sqlite3ResolveExprNames(pNC, pE) ){
return 1; return 1;
} }
for(j=0; j<pSelect->pEList->nExpr; j++){
if( sqlite3ExprCompare(pE, pSelect->pEList->a[j].pExpr)==0 ){
pItem->iOrderByCol = j+1;
}
}
} }
return sqlite3ResolveOrderGroupBy(pParse, pSelect, pOrderBy, zType); return sqlite3ResolveOrderGroupBy(pParse, pSelect, pOrderBy, zType);
} }

View File

@ -499,7 +499,7 @@ static void output_hex_blob(FILE *out, const void *pBlob, int nBlob){
int i; int i;
char *zBlob = (char *)pBlob; char *zBlob = (char *)pBlob;
fprintf(out,"X'"); fprintf(out,"X'");
for(i=0; i<nBlob; i++){ fprintf(out,"%02x",zBlob[i]); } for(i=0; i<nBlob; i++){ fprintf(out,"%02x",zBlob[i]&0xff); }
fprintf(out,"'"); fprintf(out,"'");
} }
@ -2248,46 +2248,71 @@ static int do_meta_command(char *zLine, struct callback_data *p){
}else }else
if( c=='t' && n>1 && strncmp(azArg[0], "tables", n)==0 && nArg<3 ){ if( c=='t' && n>1 && strncmp(azArg[0], "tables", n)==0 && nArg<3 ){
sqlite3_stmt *pStmt;
char **azResult; char **azResult;
int nRow; int nRow, nAlloc;
char *zErrMsg; char *zSql = 0;
int ii;
open_db(p); open_db(p);
if( nArg==1 ){ rc = sqlite3_prepare_v2(p->db, "PRAGMA database_list", -1, &pStmt, 0);
rc = sqlite3_get_table(p->db, if( rc ) return rc;
"SELECT name FROM sqlite_master " zSql = sqlite3_mprintf(
"WHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%' " "SELECT name FROM sqlite_master"
"UNION ALL " " WHERE type IN ('table','view')"
"SELECT name FROM sqlite_temp_master " " AND name NOT LIKE 'sqlite_%%'"
"WHERE type IN ('table','view') " " AND name LIKE ?1");
"ORDER BY 1", while( sqlite3_step(pStmt)==SQLITE_ROW ){
&azResult, &nRow, 0, &zErrMsg const char *zDbName = (const char*)sqlite3_column_text(pStmt, 1);
); if( zDbName==0 || strcmp(zDbName,"main")==0 ) continue;
}else{ if( strcmp(zDbName,"temp")==0 ){
zShellStatic = azArg[1]; zSql = sqlite3_mprintf(
rc = sqlite3_get_table(p->db, "%z UNION ALL "
"SELECT name FROM sqlite_master " "SELECT 'temp.' || name FROM sqlite_temp_master"
"WHERE type IN ('table','view') AND name LIKE shellstatic() " " WHERE type IN ('table','view')"
"UNION ALL " " AND name NOT LIKE 'sqlite_%%'"
"SELECT name FROM sqlite_temp_master " " AND name LIKE ?1", zSql);
"WHERE type IN ('table','view') AND name LIKE shellstatic() " }else{
"ORDER BY 1", zSql = sqlite3_mprintf(
&azResult, &nRow, 0, &zErrMsg "%z UNION ALL "
); "SELECT '%q.' || name FROM \"%w\".sqlite_master"
zShellStatic = 0; " WHERE type IN ('table','view')"
" AND name NOT LIKE 'sqlite_%%'"
" AND name LIKE ?1", zSql, zDbName, zDbName);
}
} }
if( zErrMsg ){ sqlite3_finalize(pStmt);
fprintf(stderr,"Error: %s\n", zErrMsg); zSql = sqlite3_mprintf("%z ORDER BY 1", zSql);
sqlite3_free(zErrMsg); rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
rc = 1; sqlite3_free(zSql);
}else if( rc != SQLITE_OK ){ if( rc ) return rc;
fprintf(stderr,"Error: querying sqlite_master and sqlite_temp_master\n"); nRow = nAlloc = 0;
rc = 1; azResult = 0;
if( nArg>1 ){
sqlite3_bind_text(pStmt, 1, azArg[1], -1, SQLITE_TRANSIENT);
}else{ }else{
sqlite3_bind_text(pStmt, 1, "%", -1, SQLITE_STATIC);
}
while( sqlite3_step(pStmt)==SQLITE_ROW ){
if( nRow>=nAlloc ){
char **azNew;
int n = nAlloc*2 + 10;
azNew = sqlite3_realloc(azResult, sizeof(azResult[0])*n);
if( azNew==0 ){
fprintf(stderr, "Error: out of memory\n");
break;
}
nAlloc = n;
azResult = azNew;
}
azResult[nRow] = sqlite3_mprintf("%s", sqlite3_column_text(pStmt, 0));
if( azResult[nRow] ) nRow++;
}
sqlite3_finalize(pStmt);
if( nRow>0 ){
int len, maxlen = 0; int len, maxlen = 0;
int i, j; int i, j;
int nPrintCol, nPrintRow; int nPrintCol, nPrintRow;
for(i=1; i<=nRow; i++){ for(i=0; i<nRow; i++){
if( azResult[i]==0 ) continue;
len = strlen30(azResult[i]); len = strlen30(azResult[i]);
if( len>maxlen ) maxlen = len; if( len>maxlen ) maxlen = len;
} }
@ -2295,14 +2320,15 @@ static int do_meta_command(char *zLine, struct callback_data *p){
if( nPrintCol<1 ) nPrintCol = 1; if( nPrintCol<1 ) nPrintCol = 1;
nPrintRow = (nRow + nPrintCol - 1)/nPrintCol; nPrintRow = (nRow + nPrintCol - 1)/nPrintCol;
for(i=0; i<nPrintRow; i++){ for(i=0; i<nPrintRow; i++){
for(j=i+1; j<=nRow; j+=nPrintRow){ for(j=i; j<nRow; j+=nPrintRow){
char *zSp = j<=nPrintRow ? "" : " "; char *zSp = j<nPrintRow ? "" : " ";
printf("%s%-*s", zSp, maxlen, azResult[j] ? azResult[j] : ""); printf("%s%-*s", zSp, maxlen, azResult[j] ? azResult[j] : "");
} }
printf("\n"); printf("\n");
} }
} }
sqlite3_free_table(azResult); for(ii=0; ii<nRow; ii++) sqlite3_free(azResult[ii]);
sqlite3_free(azResult);
}else }else
if( c=='t' && n>=8 && strncmp(azArg[0], "testctrl", n)==0 && nArg>=2 ){ if( c=='t' && n>=8 && strncmp(azArg[0], "testctrl", n)==0 && nArg>=2 ){
@ -2437,6 +2463,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
}else }else
if( c=='t' && strncmp(azArg[0], "trace", n)==0 && nArg>1 ){ if( c=='t' && strncmp(azArg[0], "trace", n)==0 && nArg>1 ){
open_db(p);
output_file_close(p->traceOut); output_file_close(p->traceOut);
p->traceOut = output_file_open(azArg[1]); p->traceOut = output_file_open(azArg[1]);
#ifndef SQLITE_OMIT_TRACE #ifndef SQLITE_OMIT_TRACE
@ -2572,7 +2599,9 @@ static int process_input(struct callback_data *p, FILE *in){
free(zLine); free(zLine);
zLine = one_input_line(zSql, in); zLine = one_input_line(zSql, in);
if( zLine==0 ){ if( zLine==0 ){
break; /* We have reached EOF */ /* End of input */
if( stdin_is_interactive ) printf("\n");
break;
} }
if( seenInterrupt ){ if( seenInterrupt ){
if( in!=0 ) break; if( in!=0 ) break;

1951
src/test_spellfix.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -447,7 +447,7 @@ static int vtabCallConstructor(
int (*xConstruct)(sqlite3*,void*,int,const char*const*,sqlite3_vtab**,char**), int (*xConstruct)(sqlite3*,void*,int,const char*const*,sqlite3_vtab**,char**),
char **pzErr char **pzErr
){ ){
VtabCtx sCtx; VtabCtx sCtx, *pPriorCtx;
VTable *pVTable; VTable *pVTable;
int rc; int rc;
const char *const*azArg = (const char *const*)pTab->azModuleArg; const char *const*azArg = (const char *const*)pTab->azModuleArg;
@ -472,9 +472,10 @@ static int vtabCallConstructor(
assert( xConstruct ); assert( xConstruct );
sCtx.pTab = pTab; sCtx.pTab = pTab;
sCtx.pVTable = pVTable; sCtx.pVTable = pVTable;
pPriorCtx = db->pVtabCtx;
db->pVtabCtx = &sCtx; db->pVtabCtx = &sCtx;
rc = xConstruct(db, pMod->pAux, nArg, azArg, &pVTable->pVtab, &zErr); rc = xConstruct(db, pMod->pAux, nArg, azArg, &pVTable->pVtab, &zErr);
db->pVtabCtx = 0; db->pVtabCtx = pPriorCtx;
if( rc==SQLITE_NOMEM ) db->mallocFailed = 1; if( rc==SQLITE_NOMEM ) db->mallocFailed = 1;
if( SQLITE_OK!=rc ){ if( SQLITE_OK!=rc ){

View File

@ -1562,15 +1562,19 @@ static int isDistinctRedundant(
** list, or else the WHERE clause contains a term of the form "col=X", ** list, or else the WHERE clause contains a term of the form "col=X",
** where X is a constant value. The collation sequences of the ** where X is a constant value. The collation sequences of the
** comparison and select-list expressions must match those of the index. ** comparison and select-list expressions must match those of the index.
**
** 3. All of those index columns for which the WHERE clause does not
** contain a "col=X" term are subject to a NOT NULL constraint.
*/ */
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
if( pIdx->onError==OE_None ) continue; if( pIdx->onError==OE_None ) continue;
for(i=0; i<pIdx->nColumn; i++){ for(i=0; i<pIdx->nColumn; i++){
int iCol = pIdx->aiColumn[i]; int iCol = pIdx->aiColumn[i];
if( 0==findTerm(pWC, iBase, iCol, ~(Bitmask)0, WO_EQ, pIdx) if( 0==findTerm(pWC, iBase, iCol, ~(Bitmask)0, WO_EQ, pIdx) ){
&& 0>findIndexCol(pParse, pDistinct, iBase, pIdx, i) int iIdxCol = findIndexCol(pParse, pDistinct, iBase, pIdx, i);
){ if( iIdxCol<0 || pTab->aCol[pIdx->aiColumn[i]].notNull==0 ){
break; break;
}
} }
} }
if( i==pIdx->nColumn ){ if( i==pIdx->nColumn ){
@ -1718,14 +1722,26 @@ static int isSortingIndex(
} }
if( pIdx->onError!=OE_None && i==pIdx->nColumn if( pIdx->onError!=OE_None && i==pIdx->nColumn
&& (wsFlags & WHERE_COLUMN_NULL)==0 && (wsFlags & WHERE_COLUMN_NULL)==0
&& !referencesOtherTables(pOrderBy, pMaskSet, j, base) ){ && !referencesOtherTables(pOrderBy, pMaskSet, j, base)
/* All terms of this index match some prefix of the ORDER BY clause ){
** and the index is UNIQUE and no terms on the tail of the ORDER BY Column *aCol = pIdx->pTable->aCol;
** clause reference other tables in a join. If this is all true then int i;
** the order by clause is superfluous. Not that if the matching
** condition is IS NULL then the result is not necessarily unique /* All terms of this index match some prefix of the ORDER BY clause,
** even on a UNIQUE index, so disallow those cases. */ ** the index is UNIQUE, and no terms on the tail of the ORDER BY
return 1; ** refer to other tables in a join. So, assuming that the index entries
** visited contain no NULL values, then this index delivers rows in
** the required order.
**
** It is not possible for any of the first nEqCol index fields to be
** NULL (since the corresponding "=" operator in the WHERE clause would
** not be true). So if all remaining index columns have NOT NULL
** constaints attached to them, we can be confident that the visited
** index entries are free of NULLs. */
for(i=nEqCol; i<pIdx->nColumn; i++){
if( aCol[pIdx->aiColumn[i]].notNull==0 ) break;
}
return (i==pIdx->nColumn);
} }
return 0; return 0;
} }

View File

@ -77,20 +77,27 @@ do_execsql_test 1.0 {
CREATE TABLE t2(x INTEGER PRIMARY KEY, y); CREATE TABLE t2(x INTEGER PRIMARY KEY, y);
CREATE TABLE t3(c1 PRIMARY KEY, c2); CREATE TABLE t3(c1 PRIMARY KEY NOT NULL, c2 NOT NULL);
CREATE INDEX i3 ON t3(c2); CREATE INDEX i3 ON t3(c2);
CREATE TABLE t4(a, b NOT NULL, c NOT NULL, d NOT NULL);
CREATE UNIQUE INDEX t4i1 ON t4(b, c);
CREATE UNIQUE INDEX t4i2 ON t4(d COLLATE nocase);
} }
foreach {tn noop sql} { foreach {tn noop sql} {
1 1 "SELECT DISTINCT b, c FROM t1" 1.1 0 "SELECT DISTINCT b, c FROM t1"
2 1 "SELECT DISTINCT c FROM t1 WHERE b = ?" 1.2 1 "SELECT DISTINCT b, c FROM t4"
2.1 0 "SELECT DISTINCT c FROM t1 WHERE b = ?"
2.2 1 "SELECT DISTINCT c FROM t4 WHERE b = ?"
3 1 "SELECT DISTINCT rowid FROM t1" 3 1 "SELECT DISTINCT rowid FROM t1"
4 1 "SELECT DISTINCT rowid, a FROM t1" 4 1 "SELECT DISTINCT rowid, a FROM t1"
5 1 "SELECT DISTINCT x FROM t2" 5 1 "SELECT DISTINCT x FROM t2"
6 1 "SELECT DISTINCT * FROM t2" 6 1 "SELECT DISTINCT * FROM t2"
7 1 "SELECT DISTINCT * FROM (SELECT * FROM t2)" 7 1 "SELECT DISTINCT * FROM (SELECT * FROM t2)"
8 1 "SELECT DISTINCT * FROM t1" 8.1 0 "SELECT DISTINCT * FROM t1"
8.2 1 "SELECT DISTINCT * FROM t4"
8 0 "SELECT DISTINCT a, b FROM t1" 8 0 "SELECT DISTINCT a, b FROM t1"
@ -98,11 +105,16 @@ foreach {tn noop sql} {
10 0 "SELECT DISTINCT c FROM t1" 10 0 "SELECT DISTINCT c FROM t1"
11 0 "SELECT DISTINCT b FROM t1" 11 0 "SELECT DISTINCT b FROM t1"
12 0 "SELECT DISTINCT a, d FROM t1" 12.1 0 "SELECT DISTINCT a, d FROM t1"
13 0 "SELECT DISTINCT a, b, c COLLATE nocase FROM t1" 12.2 0 "SELECT DISTINCT a, d FROM t4"
14 1 "SELECT DISTINCT a, d COLLATE nocase FROM t1" 13.1 0 "SELECT DISTINCT a, b, c COLLATE nocase FROM t1"
15 0 "SELECT DISTINCT a, d COLLATE binary FROM t1" 13.2 0 "SELECT DISTINCT a, b, c COLLATE nocase FROM t4"
16 1 "SELECT DISTINCT a, b, c COLLATE binary FROM t1" 14.1 0 "SELECT DISTINCT a, d COLLATE nocase FROM t1"
14.2 1 "SELECT DISTINCT a, d COLLATE nocase FROM t4"
15 0 "SELECT DISTINCT a, d COLLATE binary FROM t1"
16.1 0 "SELECT DISTINCT a, b, c COLLATE binary FROM t1"
16.2 1 "SELECT DISTINCT a, b, c COLLATE binary FROM t4"
16 0 "SELECT DISTINCT t1.rowid FROM t1, t2" 16 0 "SELECT DISTINCT t1.rowid FROM t1, t2"
17 0 { /* Technically, it would be possible to detect that DISTINCT 17 0 { /* Technically, it would be possible to detect that DISTINCT
@ -120,7 +132,8 @@ foreach {tn noop sql} {
24 0 "SELECT DISTINCT rowid/2 FROM t1" 24 0 "SELECT DISTINCT rowid/2 FROM t1"
25 1 "SELECT DISTINCT rowid/2, rowid FROM t1" 25 1 "SELECT DISTINCT rowid/2, rowid FROM t1"
26 1 "SELECT DISTINCT rowid/2, b FROM t1 WHERE c = ?" 26.1 0 "SELECT DISTINCT rowid/2, b FROM t1 WHERE c = ?"
26.2 1 "SELECT DISTINCT rowid/2, b FROM t4 WHERE c = ?"
} { } {
if {$noop} { if {$noop} {
do_distinct_noop_test 1.$tn $sql do_distinct_noop_test 1.$tn $sql

View File

@ -146,11 +146,15 @@ do_test io-2.2 {
# written because page 1 - the change-counter page - is written using # written because page 1 - the change-counter page - is written using
# an out-of-band method that bypasses the write counter. # an out-of-band method that bypasses the write counter.
# #
# UPDATE: As of [05f98d4eec] (adding SQLITE_DBSTATUS_CACHE_WRITE), the
# second write is also counted. So this now reports two writes and a
# single fsync.
#
sqlite3_simulate_device -char atomic sqlite3_simulate_device -char atomic
do_test io-2.3 { do_test io-2.3 {
execsql { INSERT INTO abc VALUES(3, 4) } execsql { INSERT INTO abc VALUES(3, 4) }
list [nWrite db] [nSync] list [nWrite db] [nSync]
} {1 1} } {2 1}
# Test that the journal file is not created and the change-counter is # Test that the journal file is not created and the change-counter is
# updated when the atomic-write optimization is used. # updated when the atomic-write optimization is used.

View File

@ -415,5 +415,40 @@ do_test select9-4.X {
} }
} {} } {}
# Testing to make sure that queries involving a view of a compound select
# are planned efficiently. This detects a problem reported on the mailing
# list on 2012-04-26. See
#
# http://www.mail-archive.com/sqlite-users%40sqlite.org/msg69746.html
#
# For additional information.
#
do_test select9-5.1 {
db eval {
CREATE TABLE t51(x, y);
CREATE TABLE t52(x, y);
CREATE VIEW v5 as
SELECT x, y FROM t51
UNION ALL
SELECT x, y FROM t52;
CREATE INDEX t51x ON t51(x);
CREATE INDEX t52x ON t52(x);
EXPLAIN QUERY PLAN
SELECT * FROM v5 WHERE x='12345' ORDER BY y;
}
} {~/SCAN TABLE/} ;# Uses indices with "*"
do_test select9-5.2 {
db eval {
EXPLAIN QUERY PLAN
SELECT x, y FROM v5 WHERE x='12345' ORDER BY y;
}
} {~/SCAN TABLE/} ;# Uses indices with "x, y"
do_test select9-5.3 {
db eval {
EXPLAIN QUERY PLAN
SELECT x, y FROM v5 WHERE +x='12345' ORDER BY y;
}
} {/SCAN TABLE/} ;# Full table scan if the "+x" prevents index usage.
finish_test finish_test

View File

@ -11,7 +11,6 @@
# #
# The focus of this file is testing the CLI shell tool. # The focus of this file is testing the CLI shell tool.
# #
# $Id: shell1.test,v 1.7 2009/07/17 16:54:48 shaneh Exp $
# #
# Test plan: # Test plan:
@ -20,44 +19,19 @@
# shell1-2.*: Basic "dot" command token parsing. # shell1-2.*: Basic "dot" command token parsing.
# shell1-3.*: Basic test that "dot" command can be called. # shell1-3.*: Basic test that "dot" command can be called.
# #
set testdir [file dirname $argv0]
package require sqlite3 source $testdir/tester.tcl
if {$tcl_platform(platform)=="windows"} {
set CLI "./sqlite3" set CLI "sqlite3.exe"
} else {
proc do_test {name cmd expected} { set CLI "./sqlite3"
puts -nonewline "$name ..."
set res [uplevel $cmd]
if {$res eq $expected} {
puts Ok
} else {
puts Error
puts " Got: $res"
puts " Expected: $expected"
exit
}
} }
if {![file executable $CLI]} {
proc execsql {sql} { finish_test
uplevel [list db eval $sql] return
} }
db close
proc catchsql {sql} { forcedelete test.db test.db-journal test.db-wal
set rc [catch {uplevel [list db eval $sql]} msg]
list $rc $msg
}
proc catchcmd {db {cmd ""}} {
global CLI
set out [open cmds.txt w]
puts $out $cmd
close $out
set line "exec $CLI $db < cmds.txt"
set rc [catch { eval $line } msg]
list $rc $msg
}
file delete -force test.db test.db.journal
sqlite3 db test.db sqlite3 db test.db
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
@ -717,4 +691,33 @@ do_test shell1-3-28.1 {
".log stdout\nSELECT coalesce(sqlite_log(123,'hello'),'456');" ".log stdout\nSELECT coalesce(sqlite_log(123,'hello'),'456');"
} "0 {(123) hello\n456}" } "0 {(123) hello\n456}"
puts "CLI tests completed successfully" # Test the output of the ".dump" command
#
do_test shell1-4.1 {
db eval {
CREATE TABLE t1(x);
INSERT INTO t1 VALUES(null), (1), (2.25), ('hello'), (x'807f');
}
catchcmd test.db {.dump}
} {0 {PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE t1(x);
INSERT INTO "t1" VALUES(NULL);
INSERT INTO "t1" VALUES(1);
INSERT INTO "t1" VALUES(2.25);
INSERT INTO "t1" VALUES('hello');
INSERT INTO "t1" VALUES(X'807F');
COMMIT;}}
# Test the output of ".mode insert"
#
do_test shell1-4.2 {
catchcmd test.db ".mode insert t1\nselect * from t1;"
} {0 {INSERT INTO t1 VALUES(NULL);
INSERT INTO t1 VALUES(1);
INSERT INTO t1 VALUES(2.25);
INSERT INTO t1 VALUES('hello');
INSERT INTO t1 VALUES(X'807f');}}
finish_test

View File

@ -18,44 +18,19 @@
# #
# shell2-1.*: Misc. test of various tickets and reported errors. # shell2-1.*: Misc. test of various tickets and reported errors.
# #
set testdir [file dirname $argv0]
package require sqlite3 source $testdir/tester.tcl
if {$tcl_platform(platform)=="windows"} {
set CLI "./sqlite3" set CLI "sqlite3.exe"
} else {
proc do_test {name cmd expected} { set CLI "./sqlite3"
puts -nonewline "$name ..."
set res [uplevel $cmd]
if {$res eq $expected} {
puts Ok
} else {
puts Error
puts " Got: $res"
puts " Expected: $expected"
exit
}
} }
if {![file executable $CLI]} {
proc execsql {sql} { finish_test
uplevel [list db eval $sql] return
} }
db close
proc catchsql {sql} { forcedelete test.db test.db-journal test.db-wal
set rc [catch {uplevel [list db eval $sql]} msg]
list $rc $msg
}
proc catchcmd {db {cmd ""}} {
global CLI
set out [open cmds.txt w]
puts $out $cmd
close $out
set line "exec $CLI $db < cmds.txt"
set rc [catch { eval $line } msg]
list $rc $msg
}
file delete -force test.db test.db.journal
sqlite3 db test.db sqlite3 db test.db
@ -219,4 +194,4 @@ b
1 1
2}} 2}}
puts "CLI tests completed successfully" finish_test

View File

@ -19,47 +19,21 @@
# shell3-1.*: Basic tests for running SQL statments from command line. # shell3-1.*: Basic tests for running SQL statments from command line.
# shell3-2.*: Basic tests for running SQL file from command line. # shell3-2.*: Basic tests for running SQL file from command line.
# #
set testdir [file dirname $argv0]
package require sqlite3 source $testdir/tester.tcl
if {$tcl_platform(platform)=="windows"} {
set CLI "./sqlite3" set CLI "sqlite3.exe"
} else {
proc do_test {name cmd expected} { set CLI "./sqlite3"
puts -nonewline "$name ..."
set res [uplevel $cmd]
if {$res eq $expected} {
puts Ok
} else {
puts Error
puts " Got: $res"
puts " Expected: $expected"
exit
}
} }
if {![file executable $CLI]} {
proc execsql {sql} { finish_test
uplevel [list db eval $sql] return
} }
db close
proc catchsql {sql} { forcedelete test.db test.db-journal test.db-wal
set rc [catch {uplevel [list db eval $sql]} msg]
list $rc $msg
}
proc catchcmd {db {cmd ""}} {
global CLI
set out [open cmds.txt w]
puts $out $cmd
close $out
set line "exec $CLI $db < cmds.txt"
set rc [catch { eval $line } msg]
list $rc $msg
}
file delete -force test.db test.db.journal
sqlite3 db test.db sqlite3 db test.db
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# shell3-1.*: Basic tests for running SQL statments from command line. # shell3-1.*: Basic tests for running SQL statments from command line.
# #
@ -120,5 +94,4 @@ do_test shell3-2.7 {
catchcmd "foo.db" "CREATE TABLE" catchcmd "foo.db" "CREATE TABLE"
} {1 {Error: incomplete SQL: CREATE TABLE}} } {1 {Error: incomplete SQL: CREATE TABLE}}
finish_test
puts "CLI tests completed successfully"

View File

@ -19,33 +19,20 @@
# #
# shell4-1.*: Basic tests specific to the "stats" command. # shell4-1.*: Basic tests specific to the "stats" command.
# #
set testdir [file dirname $argv0]
set CLI "./sqlite3" source $testdir/tester.tcl
if {$tcl_platform(platform)=="windows"} {
proc do_test {name cmd expected} { set CLI "sqlite3.exe"
puts -nonewline "$name ..." } else {
set res [uplevel $cmd] set CLI "./sqlite3"
if {$res eq $expected} {
puts Ok
} else {
puts Error
puts " Got: $res"
puts " Expected: $expected"
exit
}
} }
if {![file executable $CLI]} {
proc catchcmd {db {cmd ""}} { finish_test
global CLI return
set out [open cmds.txt w]
puts $out $cmd
close $out
set line "exec $CLI $db < cmds.txt"
set rc [catch { eval $line } msg]
list $rc $msg
} }
db close
file delete -force test.db test.db.journal forcedelete test.db test.db-journal test.db-wal
sqlite3 db test.db
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# Test cases shell4-1.*: Tests specific to the "stats" command. # Test cases shell4-1.*: Tests specific to the "stats" command.
@ -126,4 +113,4 @@ SELECT 1;
[regexp {Autoindex Inserts} $res] [regexp {Autoindex Inserts} $res]
} {1 1 1} } {1 1 1}
puts "CLI tests completed successfully" finish_test

View File

@ -19,33 +19,20 @@
# #
# shell5-1.*: Basic tests specific to the ".import" command. # shell5-1.*: Basic tests specific to the ".import" command.
# #
set testdir [file dirname $argv0]
set CLI "./sqlite3" source $testdir/tester.tcl
if {$tcl_platform(platform)=="windows"} {
proc do_test {name cmd expected} { set CLI "sqlite3.exe"
puts -nonewline "$name ..." } else {
set res [uplevel $cmd] set CLI "./sqlite3"
if {$res eq $expected} {
puts Ok
} else {
puts Error
puts " Got: $res"
puts " Expected: $expected"
exit
}
} }
if {![file executable $CLI]} {
proc catchcmd {db {cmd ""}} { finish_test
global CLI return
set out [open cmds.txt w]
puts $out $cmd
close $out
set line "exec $CLI $db < cmds.txt"
set rc [catch { eval $line } msg]
list $rc $msg
} }
db close
file delete -force test.db test.db.journal forcedelete test.db test.db-journal test.db-wal
sqlite3 db test.db
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# Test cases shell5-1.*: Basic handling of the .import and .separator commands. # Test cases shell5-1.*: Basic handling of the .import and .separator commands.
@ -239,5 +226,4 @@ do_test shell5-1.7.1 {
SELECT COUNT(*) FROM t3;}] SELECT COUNT(*) FROM t3;}]
} [list 0 $rows] } [list 0 $rows]
finish_test
puts "CLI tests completed successfully"

View File

@ -474,7 +474,6 @@ proc incr_ntest {} {
# Invoke the do_test procedure to run a single test # Invoke the do_test procedure to run a single test
# #
proc do_test {name cmd expected} { proc do_test {name cmd expected} {
global argv cmdlinearg global argv cmdlinearg
fix_testname name fix_testname name
@ -505,11 +504,24 @@ proc do_test {name cmd expected} {
if {[catch {uplevel #0 "$cmd;\n"} result]} { if {[catch {uplevel #0 "$cmd;\n"} result]} {
puts "\nError: $result" puts "\nError: $result"
fail_test $name fail_test $name
} elseif {[string compare $result $expected]} {
puts "\nExpected: \[$expected\]\n Got: \[$result\]"
fail_test $name
} else { } else {
puts " Ok" if {[regexp {^~?/.*/$} $expected]} {
if {[string index $expected 0]=="~"} {
set re [string range $expected 2 end-1]
set ok [expr {![regexp $re $result]}]
} else {
set re [string range $expected 1 end-1]
set ok [regexp $re $result]
}
} else {
set ok [expr {[string compare $result $expected]==0}]
}
if {!$ok} {
puts "\nExpected: \[$expected\]\n Got: \[$result\]"
fail_test $name
} else {
puts " Ok"
}
} }
} else { } else {
puts " Omitted" puts " Omitted"
@ -518,6 +530,16 @@ proc do_test {name cmd expected} {
flush stdout flush stdout
} }
proc catchcmd {db {cmd ""}} {
global CLI
set out [open cmds.txt w]
puts $out $cmd
close $out
set line "exec $CLI $db < cmds.txt"
set rc [catch { eval $line } msg]
list $rc $msg
}
proc filepath_normalize {p} { proc filepath_normalize {p} {
# test cases should be written to assume "unix"-like file paths # test cases should be written to assume "unix"-like file paths
if {$::tcl_platform(platform)!="unix"} { if {$::tcl_platform(platform)!="unix"} {

71
test/tkt-2a5629202f.test Normal file
View File

@ -0,0 +1,71 @@
# 2012 April 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.
#
#***********************************************************************
# The tests in this file were used while developing the SQLite 4 code.
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix tkt-2a5629202f
# This procedure executes the SQL. Then it checks to see if the OP_Sort
# opcode was executed. If an OP_Sort did occur, then "sort" is appended
# to the result. If no OP_Sort happened, then "nosort" is appended.
#
# This procedure is used to check to make sure sorting is or is not
# occurring as expected.
#
proc cksort {sql} {
set data [execsql $sql]
if {[db status sort]} {set x sort} {set x nosort}
lappend data $x
return $data
}
do_execsql_test 1.1 {
CREATE TABLE t8(b TEXT, c TEXT);
INSERT INTO t8 VALUES('a', 'one');
INSERT INTO t8 VALUES('b', 'two');
INSERT INTO t8 VALUES(NULL, 'three');
INSERT INTO t8 VALUES(NULL, 'four');
}
do_execsql_test 1.2 {
SELECT coalesce(b, 'null') || '/' || c FROM t8 x ORDER BY x.b, x.c
} {null/four null/three a/one b/two}
do_execsql_test 1.3 {
CREATE UNIQUE INDEX i1 ON t8(b);
SELECT coalesce(b, 'null') || '/' || c FROM t8 x ORDER BY x.b, x.c
} {null/four null/three a/one b/two}
#-------------------------------------------------------------------------
#
do_execsql_test 2.1 {
CREATE TABLE t2(a, b NOT NULL, c);
CREATE UNIQUE INDEX t2ab ON t2(a, b);
CREATE UNIQUE INDEX t2ba ON t2(b, a);
}
do_test 2.2 {
cksort { SELECT * FROM t2 WHERE a = 10 ORDER BY a, b, c }
} {nosort}
do_test 2.3 {
cksort { SELECT * FROM t2 WHERE b = 10 ORDER BY a, b, c }
} {sort}
do_test 2.4 {
cksort { SELECT * FROM t2 WHERE a IS NULL ORDER BY a, b, c }
} {sort}
finish_test

54
test/tkt-385a5b56b9.test Normal file
View File

@ -0,0 +1,54 @@
# 2012 April 02
#
# 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.
#
#***********************************************************************
# The tests in this file were used while developing the SQLite 4 code.
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix tkt-385a5b56b9
do_execsql_test 1.0 {
CREATE TABLE t1(x, y);
INSERT INTO t1 VALUES(1, NULL);
INSERT INTO t1 VALUES(2, NULL);
INSERT INTO t1 VALUES(1, NULL);
}
do_execsql_test 1.1 { SELECT DISTINCT x, y FROM t1 } {1 {} 2 {}}
do_execsql_test 1.2 { CREATE UNIQUE INDEX i1 ON t1(x, y) }
do_execsql_test 1.3 { SELECT DISTINCT x, y FROM t1 } {1 {} 2 {}}
#-------------------------------------------------------------------------
do_execsql_test 2.0 {
CREATE TABLE t2(x, y NOT NULL);
CREATE UNIQUE INDEX t2x ON t2(x);
CREATE UNIQUE INDEX t2y ON t2(y);
}
do_eqp_test 2.1 { SELECT DISTINCT x FROM t2 } {
0 0 0 {SCAN TABLE t2 USING COVERING INDEX t2x (~1000000 rows)}
}
do_eqp_test 2.2 { SELECT DISTINCT y FROM t2 } {
0 0 0 {SCAN TABLE t2 (~1000000 rows)}
}
do_eqp_test 2.3 { SELECT DISTINCT x, y FROM t2 WHERE y=10 } {
0 0 0 {SEARCH TABLE t2 USING INDEX t2y (y=?) (~1 rows)}
}
do_eqp_test 2.4 { SELECT DISTINCT x, y FROM t2 WHERE x=10 } {
0 0 0 {SEARCH TABLE t2 USING INDEX t2x (x=?) (~1 rows)}
}
finish_test

View File

@ -1105,15 +1105,17 @@ do_test where-14.4 {
} }
} {1/1 1/4 4/1 4/4 nosort} } {1/1 1/4 4/1 4/4 nosort}
do_test where-14.5 { do_test where-14.5 {
# This test case changed from "nosort" to "sort". See ticket 2a5629202f.
cksort { cksort {
SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.b, x.a||x.b SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.b, x.a||x.b
} }
} {4/1 4/4 1/1 1/4 nosort} } {4/1 4/4 1/1 1/4 sort}
do_test where-14.6 { do_test where-14.6 {
# This test case changed from "nosort" to "sort". See ticket 2a5629202f.
cksort { cksort {
SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.b, x.a||x.b DESC SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.b, x.a||x.b DESC
} }
} {4/1 4/4 1/1 1/4 nosort} } {4/1 4/4 1/1 1/4 sort}
do_test where-14.7 { do_test where-14.7 {
cksort { cksort {
SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.b, y.a||y.b SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.b, y.a||y.b