Compare commits

..

13 Commits

Author SHA1 Message Date
mistachkin f344a5e70e Stop using the TCL_LIBS configuration variable when linking with Tcl. Remove superfluous 'rm' command.
FossilOrigin-Name: e1feab9834fe829d43ae895cc575ad269a36668c
2012-12-06 00:16:51 +00:00
dan e825831ee4 Disable a couple of tests in where.test when running the "no_optimization" permutation.
FossilOrigin-Name: 5e961e37c5357776bcb44c473cb5ee4b59561f07
2012-12-05 19:04:32 +00:00
dan 97305a7ccb Modify a query in test/thread001.test to ensure that results are returned in the order expected by the test.
FossilOrigin-Name: 51cbddd51d02bcd954be411ecc83556c049a2680
2012-12-05 16:44:13 +00:00
dan 9ccaefb172 Fixes to a test case in shared_err.test. The fix is to prevent sqlite3_prepare() from being called when the test intends to test the response of sqlite3_step() to an OOM condition.
FossilOrigin-Name: 40c143955ebe75f8e73119f9103f36a3c8ac4514
2012-12-05 14:37:55 +00:00
drh 7f5febc729 Make sure memory is freed using a routine that is compatible with the
routine used to allocate the memory.  The SQLITE_MEMDEBUG compile-time
option enforces this.

FossilOrigin-Name: 9f6c68856b694373b7ffb124abd996e519ba5921
2012-12-05 14:31:13 +00:00
dan 44c4fcb9d8 Since errors are ignored anyway, use sqlite3OsFileControlHint() instead of OsFileControl() to invoke the SQLITE_FCNTL_BUSY_HANDLER file-control.
FossilOrigin-Name: bdceca2738eb3e8acc44d0384cf2a3a969ee8170
2012-12-05 11:30:28 +00:00
dan 3de0f18476 If the atomic-write property is enabled, a transaction may be committed in journal_mode=DELETE mode without ever actually creating a journal file on disk. In this case, do not attempt to unlink() the journal file when committing the transaction.
FossilOrigin-Name: 11aa47b0a837858b644c304638e1cbbf482de2f0
2012-12-05 10:01:35 +00:00
dan 8411b25c59 Update a couple of test scripts so that they work in auto-vacuum mode.
FossilOrigin-Name: 04ab2dc6914e4d6fe2682eba08fc1cd1148a44a1
2012-12-05 09:12:58 +00:00
drh 68c804b9ab Fix a harmless compiler warning.
FossilOrigin-Name: 12693deba9b8a47ad02ca4e32d5fba6006b0401c
2012-12-04 11:03:11 +00:00
dan ec6b07b27b Add a test to ensure that the fix in [b0c1ba655d] has worked.
FossilOrigin-Name: 41806de5c88e924e306ca737192755c011517426
2012-12-04 05:24:21 +00:00
drh d483dfa4b4 Improvements to the 'tcl' shell output mode. Escape doublequotes,
set separator to space when mode is set, and skip separator after final 
column.

FossilOrigin-Name: 487ba753139c256b911f16aee9586144faea846f
2012-12-04 00:59:05 +00:00
drh 7b6be6f7bf Fix an uninitialized variable detected by valgrind.
FossilOrigin-Name: ffd1e51490286abfaea68fd4b4b4cb967d87b04b
2012-12-04 00:53:08 +00:00
mistachkin a359b5eea4 Fix an out-of-order function declaration when compiled with MEMDEBUG.
FossilOrigin-Name: 6d31557837fef2c8fad6f009ac6dd97dd4af0a54
2012-12-04 00:37:58 +00:00
19 changed files with 104 additions and 47 deletions
+1 -2
View File
@@ -45,7 +45,7 @@ TCC += @TCL_INCLUDE_SPEC@
# The library that programs using TCL must link against.
#
LIBTCL = @TCL_LIB_SPEC@ @TCL_LIBS@
LIBTCL = @TCL_LIB_SPEC@
# Compiler options needed for programs that use the readline() library.
#
@@ -935,7 +935,6 @@ clean:
rm -rf .libs .deps
rm -f lemon$(BEXE) lempar.c parse.* sqlite*.tar.gz
rm -f mkkeywordhash$(BEXE) keywordhash.h
rm -f $(PUBLISH)
rm -f *.da *.bb *.bbg gmon.out
rm -rf quota2a quota2b quota2c
rm -rf tsrc .target_source
Vendored
-1
View File
@@ -879,7 +879,6 @@ TARGET_EXEEXT
TCL_VERSION
TCL_BIN_DIR
TCL_SRC_DIR
TCL_LIBS
TCL_INCLUDE_SPEC
TCL_LIB_FILE
TCL_LIB_FLAG
-1
View File
@@ -501,7 +501,6 @@ if test "${use_tcl}" = "yes" ; then
AC_SUBST(TCL_VERSION)
AC_SUBST(TCL_BIN_DIR)
AC_SUBST(TCL_SRC_DIR)
AC_SUBST(TCL_LIBS)
AC_SUBST(TCL_INCLUDE_SPEC)
AC_SUBST(TCL_LIB_FILE)
+1 -1
View File
@@ -5253,7 +5253,7 @@ int sqlite3Fts3UpdateMethod(
int rc = SQLITE_OK; /* Return Code */
int isRemove = 0; /* True for an UPDATE or DELETE */
u32 *aSzIns = 0; /* Sizes of inserted documents */
u32 *aSzDel; /* Sizes of deleted documents */
u32 *aSzDel = 0; /* Sizes of deleted documents */
int nChng = 0; /* Net change in number of documents */
int bInsertDone = 0;
+24 -24
View File
@@ -1,7 +1,7 @@
C Improvements\sto\sthe\s'tcl'\sshell\soutput\smode.\s\sEscape\sdouble\squotes,\sset\sseparator\sto\sspace\swhen\smode\sis\sset,\sand\sskip\sseparator\safter\sfinal\scolumn.
D 2012-12-04T00:23:43.067
C Stop\susing\sthe\sTCL_LIBS\sconfiguration\svariable\swhen\slinking\swith\sTcl.\s\sRemove\ssuperfluous\s'rm'\scommand.
D 2012-12-06T00:16:51.996
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 82c41c0ed4cc94dd3cc7d498575b84c57c2c2384
F Makefile.in 690d441a758cbffd13e814dc2724a721a6ebd400
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F Makefile.msc 911b8188f5d67801035a113e063c3023a617525d
F Makefile.vxworks b18ad88e9a8c6a001f5cf4a389116a4f1a7ab45f
@@ -15,8 +15,8 @@ F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2
F config.guess 226d9a188c6196f3033ffc651cbc9dcee1a42977
F config.h.in 0921066a13130082764ab4ab6456f7b5bebe56de
F config.sub 9ebe4c3b3dab6431ece34f16828b594fb420da55
F configure 4907207e1627a394e8892cce8dcc8068fbe5f7cd x
F configure.ac 6e909664785b8184db2179013cd9d574f96ca3a3
F configure 252992f6588107ebd5d17c956d90cf7484580c6f x
F configure.ac 81c43d151d0b0e406be056394cc9ff4cb3fd0444
F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
F doc/lemon.html 334dbf6621b8fb8790297ec1abf3cfa4621709d1
F doc/pager-invariants.txt 27fed9a70ddad2088750c4a2b493b63853da2710
@@ -72,7 +72,7 @@ F ext/fts3/fts3_tokenizer.h 66dec98e365854b6cd2d54f1a96bb6d428fc5a68
F ext/fts3/fts3_tokenizer1.c 5c98225a53705e5ee34824087478cf477bdb7004
F ext/fts3/fts3_unicode.c 49e36e6ba59f79e6bd6a8bfe434570fe48d20559
F ext/fts3/fts3_unicode2.c a863f05f758af36777dffc2facc898bc73fec896
F ext/fts3/fts3_write.c a432433a706bd065e8bb0f8b3b33ce7cf9d7f21d
F ext/fts3/fts3_write.c c2166f7148a4ad8bcdad99a99d647b1091744e6b
F ext/fts3/fts3speed.tcl b54caf6a18d38174f1a6e84219950d85e98bb1e9
F ext/fts3/mkfts3amal.tcl 252ecb7fe6467854f2aa237bf2c390b74e71f100
F ext/fts3/tool/fts3view.c 6cfc5b67a5f0e09c0d698f9fd012c784bfaa9197
@@ -116,7 +116,7 @@ F sqlite3.1 6be1ad09113570e1fc8dcaff84c9b0b337db5ffc
F sqlite3.pc.in ae6f59a76e862f5c561eb32a380228a02afc3cad
F src/alter.c f8db986c03eb0bfb221523fc9bbb9d0b70de3168
F src/analyze.c 7553068d21e32a57fc33ab6b2393fc8c1ba41410
F src/attach.c 34c15ecd686e58f08e5bb1389e28a0b65c2c83db
F src/attach.c ea5247f240e2c08afd608e9beb380814b86655e1
F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34
F src/backup.c cab40f2c1fe79d6eb93d3b4086c78c41ad2fa5d0
F src/bitvec.c 26675fe8e431dc555e6f2d0e11e651d172234aa1
@@ -133,13 +133,13 @@ F src/delete.c 9b8d308979114991e5dc7cee958316e07186941d
F src/expr.c 3b25a95f3d309403940ba4a3212f197b8b6251d5
F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
F src/fkey.c c82a04e7a92bb728f9ab972b76590403283be2af
F src/func.c 1755cafdb8f2a291681f1ea55e0215518ebd6e52
F src/func.c 8147799b048065a1590805be464d05b4913e652c
F src/global.c e59ecd2c553ad0d4bfbc84ca71231336f8993a7a
F src/hash.c ac3470bbf1ca4ae4e306a8ecb0fdf1731810ffe4
F src/hash.h 2894c932d84d9f892d4b4023a75e501f83050970
F src/hwtime.h d32741c8f4df852c7d959236615444e2b1063b08
F src/insert.c d7ed04b1fab887d6d26cf5e36753f5d6d1246290
F src/journal.c 552839e54d1bf76fb8f7abe51868b66acacf6a0e
F src/journal.c eb7b9f5e783266521bcd9b2b93d419a219411f71
F src/legacy.c a199d7683d60cef73089e892409113e69c23a99f
F src/lempar.c cdf0a000315332fc9b50b62f3b5e22e080a0952b
F src/loadext.c f20382fbaeec832438a1ba7797bee3d3c8a6d51d
@@ -162,7 +162,7 @@ F src/os.h 027491c77d2404c0a678bb3fb06286f331eb9b57
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
F src/os_unix.c b75d9b0876ad3fde151843ad389b4c3dd727c662
F src/os_win.c 6e55b48f793d0c0d0e086d3f1482a0882530eeeb
F src/pager.c ed53fe75a269c1d67645fe079ea0f3f0ce6492d5
F src/pager.c 4092c907222cfd451c74fe6bd2fd64b342f7190f
F src/pager.h 1109a06578ec5574dc2c74cf8d9f69daf36fe3e0
F src/parse.y f29df90bd3adc64b33114ab1de9fb7768fcf2099
F src/pcache.c f8043b433a57aba85384a531e3937a804432a346
@@ -179,7 +179,7 @@ F src/shell.c e392dd1ccbb77cc1d75a8367a89b473c24bea019
F src/sqlite.h.in 4e71a210f383b6d060bd3fdf81d850f0f8c4eca3
F src/sqlite3.rc fea433eb0a59f4c9393c8e6d76a6e2596b1fe0c0
F src/sqlite3ext.h 6904f4aadf976f95241311fbffb00823075d9477
F src/sqliteInt.h 68f23dcfc3fb6559c07b327ab6d8d2e63e4bb69e
F src/sqliteInt.h 72ab83e698a42d509a0d1cf16a66ec2dae51a756
F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d
F src/status.c bedc37ec1a6bb9399944024d63f4c769971955a9
F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
@@ -208,7 +208,7 @@ F src/test_intarray.c 07ddcebe4097d400ffca362770f1d883c112387a
F src/test_intarray.h b999bb18d090b8d9d9c49d36ec37ef8f341fe169
F src/test_journal.c f5c0a05b7b3d5930db769b5ee6c3766dc2221a64
F src/test_loadext.c df586c27176e3c2cb2e099c78da67bf14379a56e
F src/test_malloc.c 01cd65ae7ae93de9fbf8214d1ee6b4eba4850700
F src/test_malloc.c 6982a357a6a6c24f281b91c89303a5c31075c392
F src/test_multiplex.c ac0fbc1748e5b86a41a1d7a84654fae0d53a881d
F src/test_multiplex.h 9b63b95f07acedee425fdfe49a47197c9bf5f9d8
F src/test_mutex.c a6bd7b9cf6e19d989e31392b06ac8d189f0d573e
@@ -241,7 +241,7 @@ F src/vdbe.c 5b49cb1f852e4604a4fb6c47e087ddab28af193f
F src/vdbe.h b52887278cb173e66188da84dfab216bea61119d
F src/vdbeInt.h 79abf9b31be406d35ca77d6999cb2d42aaf91e78
F src/vdbeapi.c 4c2418161cf45392ba76a7ca92f9a5f06b96f89c
F src/vdbeaux.c 2d1b3ee65860b1ea97ad9f20a02338b26caf2367
F src/vdbeaux.c f68a124380954985d797fa7d91fe483e2e894aca
F src/vdbeblob.c 32f2a4899d67f69634ea4dd93e3f651936d732cb
F src/vdbemem.c cb55e84b8e2c15704968ee05f0fae25883299b74
F src/vdbesort.c c61ca318681c0e7267da8be3abfca8469652a7e9
@@ -290,7 +290,7 @@ F test/avtrans.test 0252654f4295ddda3b2cce0e894812259e655a85
F test/backcompat.test ecd841f3a3bfb81518721879cc56a760670e3198
F test/backup.test c9cdd23a495864b9edf75a9fa66f5cb7e10fcf62
F test/backup2.test 34986ef926ea522911a51dfdb2f8e99b7b75ebcf
F test/backup4.test 3c3639d28f3cdb4a123694a0a7c5fa7bfe304e2a
F test/backup4.test 4d90389daeb781fe718816a4fc836ad1b06791d8
F test/backup_ioerr.test 40d208bc9224b666ee3ed423f49bc9062a36a9d0
F test/backup_malloc.test 7162d604ec2b4683c4b3799a48657fb8b5e2d450
F test/badutf.test d5360fc31f643d37a973ab0d8b4fb85799c3169f
@@ -706,7 +706,7 @@ F test/shared6.test 866bb4982c45ce216c61ded5e8fde4e7e2f3ffa9
F test/shared7.test 960760bc8d03e1419e70dea69cf41db62853616e
F test/shared8.test b27befbefbe7f4517f1d6b7ff8f64a41ec74165d
F test/shared9.test 614a3ca431adc73c857632deb4eff75bcaee40ec
F test/shared_err.test 91e26ec4f3fbe07951967955585137e2f18993de
F test/shared_err.test 0079c05c97d88cfa03989b7c20a8b266983087aa
F test/sharedlock.test ffa0a3c4ac192145b310f1254f8afca4d553eabf
F test/shell1.test b7896eb84028f3bc8300caf1fc796a73728aad0b
F test/shell2.test 037d6ad16e873354195d30bb2dc4b5321788154a
@@ -746,7 +746,7 @@ F test/tempdb.test 19d0f66e2e3eeffd68661a11c83ba5e6ace9128c
F test/temptable.test 51edd31c65ed1560dd600b1796e8325df96318e2
F test/temptrigger.test 26670ed7a39cf2296a7f0a9e0a1d7bdb7abe936d
F test/tester.tcl 2f383e811010b05a83c0f00fc168cae1dd63a6d9
F test/thread001.test 7cc2ce08f9cde95964736d11e91f9ab610f82f91
F test/thread001.test 9f22fd3525a307ff42a326b6bc7b0465be1745a5
F test/thread002.test e630504f8a06c00bf8bbe68528774dd96aeb2e58
F test/thread003.test ee4c9efc3b86a6a2767516a37bd64251272560a7
F test/thread004.test f51dfc3936184aaf73ee85f315224baad272a87f
@@ -918,7 +918,7 @@ F test/vacuum4.test d3f8ecff345f166911568f397d2432c16d2867d9
F test/varint.test ab7b110089a08b9926ed7390e7e97bdefeb74102
F test/veryquick.test 7701bb609fe8bf6535514e8b849a309e8f00573b
F test/view.test b182a67ec43f490b156b5a710827a341be83dd17
F test/vtab1.test 10fb9e656fe4b318cd82ff1616a340acc01aac4b
F test/vtab1.test 36c9935e4be3b6350b31b6b697561b6fc3ab349a
F test/vtab2.test 7bcffc050da5c68f4f312e49e443063e2d391c0d
F test/vtab3.test baad99fd27217f5d6db10660522e0b7192446de1
F test/vtab4.test 942f8b8280b3ea8a41dae20e7822d065ca1cb275
@@ -944,7 +944,7 @@ F test/wal5.test f58ed4b8b542f71c7441da12fbd769d99b362437
F test/wal6.test 2e3bc767d9c2ce35c47106148d43fcbd072a93b3
F test/wal7.test 2ae8f427d240099cc4b2dfef63cff44e2a68a1bd
F test/wal8.test b3ee739fe8f7586aaebdc2367f477ebcf3e3b034
F test/wal9.test 48c40803faf6849515c81213697e9f3376835981
F test/wal9.test 378e76a9ad09cd9bee06c172ad3547b0129a6750
F test/wal_common.tcl a98f17fba96206122eff624db0ab13ec377be4fe
F test/walbak.test b9f68e39646375c2b877be906babcc15d38b4877
F test/walbig.test f437473a16cfb314867c6b5d1dbcd519e73e3434
@@ -961,7 +961,7 @@ F test/walro.test a31deb621033442a76c3a61e44929250d06f81b1
F test/walshared.test 6dda2293880c300baf5d791c307f653094585761
F test/walslow.test e7be6d9888f83aa5d3d3c7c08aa9b5c28b93609a
F test/walthread.test de8dbaf6d9e41481c460ba31ca61e163d7348f8e
F test/where.test 41b65069a227a61238c1387b050f029480ca5677
F test/where.test 9714e6f292d70c22e78e1cecb3d896457186b9b7
F test/where2.test 43d4becaf5a5df854e6c21d624a1cb84c6904554
F test/where3.test 667e75642102c97a00bf9b23d3cb267db321d006
F test/where4.test e9b9e2f2f98f00379e6031db6a6fca29bae782a2
@@ -1025,10 +1025,10 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
P 7d5fc1a339cf4f3597ab6a5f3e7101884d2d7673
R 38c0a4b163ba004b3c0d2e19a002293a
T *branch * tclMode
T *sym-tclMode *
P 5e961e37c5357776bcb44c473cb5ee4b59561f07
R c93349168a8ba9f9a5a912129488c71b
T *branch * noTclLibs
T *sym-noTclLibs *
T -sym-trunk *
U mistachkin
Z 962a729a6a99e4b42add9e81143f97fc
Z c1e70093e440f3f1851be714ee963068
+1 -1
View File
@@ -1 +1 @@
41fd9dd29034b2269e4b7f2626350124d37b5303
e1feab9834fe829d43ae895cc575ad269a36668c
+1 -1
View File
@@ -471,7 +471,7 @@ int sqlite3FixSrcList(
pFix->zType, pFix->pName, pItem->zDatabase);
return 1;
}
sqlite3_free(pItem->zDatabase);
sqlite3DbFree(pFix->pParse->db, pItem->zDatabase);
pItem->zDatabase = 0;
pItem->pSchema = pFix->pSchema;
#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_TRIGGER)
+1
View File
@@ -192,6 +192,7 @@ static void instrFunc(
int N = 1;
int isText;
UNUSED_PARAMETER(argc);
typeHaystack = sqlite3_value_type(argv[0]);
typeNeedle = sqlite3_value_type(argv[1]);
if( typeHaystack==SQLITE_NULL || typeNeedle==SQLITE_NULL ) return;
+10
View File
@@ -228,6 +228,16 @@ int sqlite3JournalCreate(sqlite3_file *p){
return createFile((JournalFile *)p);
}
/*
** The file-handle passed as the only argument is guaranteed to be an open
** file. It may or may not be of class JournalFile. If the file is a
** JournalFile, and the underlying file on disk has not yet been opened,
** return 0. Otherwise, return 1.
*/
int sqlite3JournalExists(sqlite3_file *p){
return (p->pMethods!=&JournalFileMethods || ((JournalFile *)p)->pReal!=0);
}
/*
** Return the number of bytes required to store a JournalFile that uses vfs
** pVfs to create the underlying on-disk files.
+3 -2
View File
@@ -1941,12 +1941,13 @@ static int pager_end_transaction(Pager *pPager, int hasMaster){
** file should be closed and deleted. If this connection writes to
** the database file, it will do so using an in-memory journal.
*/
int bDelete = (!pPager->tempFile && sqlite3JournalExists(pPager->jfd));
assert( pPager->journalMode==PAGER_JOURNALMODE_DELETE
|| pPager->journalMode==PAGER_JOURNALMODE_MEMORY
|| pPager->journalMode==PAGER_JOURNALMODE_WAL
);
sqlite3OsClose(pPager->jfd);
if( !pPager->tempFile ){
if( bDelete ){
rc = sqlite3OsDelete(pPager->pVfs, pPager->zJournal, 0);
}
}
@@ -3485,7 +3486,7 @@ void sqlite3PagerSetBusyhandler(
void **ap = (void **)&pPager->xBusyHandler;
assert( ((int(*)(void *))(ap[0]))==xBusyHandler );
assert( ap[1]==pBusyHandlerArg );
sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_BUSYHANDLER, (void *)ap);
sqlite3OsFileControlHint(pPager->fd, SQLITE_FCNTL_BUSYHANDLER, (void *)ap);
}
}
+2
View File
@@ -3253,8 +3253,10 @@ int sqlite3FindInIndex(Parse *, Expr *, int*);
int sqlite3JournalOpen(sqlite3_vfs *, const char *, sqlite3_file *, int, int);
int sqlite3JournalSize(sqlite3_vfs *);
int sqlite3JournalCreate(sqlite3_file *);
int sqlite3JournalExists(sqlite3_file *p);
#else
#define sqlite3JournalSize(pVfs) ((pVfs)->szOsFile)
#define sqlite3JournalExists(p) 1
#endif
void sqlite3MemJournalOpen(sqlite3_file *);
+1 -1
View File
@@ -720,8 +720,8 @@ static int test_memdebug_settitle(
#ifdef SQLITE_MEMDEBUG
{
const char *zTitle;
zTitle = Tcl_GetString(objv[1]);
extern int sqlite3MemdebugSettitle(const char*);
zTitle = Tcl_GetString(objv[1]);
sqlite3MemdebugSettitle(zTitle);
}
#endif
+1 -1
View File
@@ -2482,7 +2482,7 @@ void sqlite3VdbeClearObject(sqlite3 *db, Vdbe *p){
sqlite3DbFree(db, p->zSql);
sqlite3DbFree(db, p->pFree);
#if defined(SQLITE_ENABLE_TREE_EXPLAIN)
sqlite3DbFree(db, p->zExplain);
sqlite3_free(p->zExplain);
sqlite3DbFree(db, p->pExplain);
#endif
}
+2 -4
View File
@@ -63,8 +63,7 @@ do_execsql_test 2.1 {
CREATE TABLE t1(a, b);
CREATE INDEX i1 ON t1(a, b);
}
do_test 2.2 { file size test.db } 3072
do_test 2.2 { file size test.db } [expr $AUTOVACUUM ? 4096 : 3072]
do_test 2.3 {
sqlite3 db1 test.db2
@@ -90,8 +89,7 @@ do_execsql_test 3.1 {
CREATE TABLE t1(a, b);
CREATE INDEX i1 ON t1(a, b);
}
do_test 3.2 { file size test.db } 12288
do_test 3.2 { file size test.db } [expr $AUTOVACUUM ? 16384 : 12288]
do_test 3.3 {
sqlite3 db1 test.db2
+3 -2
View File
@@ -401,6 +401,8 @@ do_malloc_test shared_err-8 -tclprep {
execsql {INSERT INTO t1 VALUES($a, $b)} db2
}
execsql {COMMIT} db2
execsql BEGIN
execsql ROLLBACK
set ::DB2 [sqlite3_connection_pointer db2]
set ::STMT [sqlite3_prepare $::DB2 "SELECT a FROM t1 ORDER BY a" -1 DUMMY]
sqlite3_step $::STMT ;# Cursor points at 0000000000
@@ -409,8 +411,7 @@ do_malloc_test shared_err-8 -tclprep {
execsql {
BEGIN;
INSERT INTO t1 VALUES(6, NULL);
ROLLBACK;
}
ROLLBACK}
} -cleanup {
# UPDATE: As of [5668], if the rollback fails SQLITE_CORRUPT is returned.
# So these tests have been updated to expect SQLITE_CORRUPT and its
+2 -2
View File
@@ -87,7 +87,7 @@ foreach {tn same_db shared_cache} [list \
do_test t1 {
execsql {
SELECT
(SELECT md5sum(a, b) FROM ab WHERE a < (SELECT max(a) FROM ab)) ==
(SELECT md5sum(a, b) FROM ab WHERE +a < (SELECT max(a) FROM ab)) ==
(SELECT b FROM ab WHERE a = (SELECT max(a) FROM ab))
}
} {1}
@@ -131,7 +131,7 @@ foreach {tn same_db shared_cache} [list \
do_test thread001.$tn.6 {
execsql {
SELECT
(SELECT md5sum(a, b) FROM ab WHERE a < (SELECT max(a) FROM ab)) ==
(SELECT md5sum(a, b) FROM ab WHERE +a < (SELECT max(a) FROM ab)) ==
(SELECT b FROM ab WHERE a = (SELECT max(a) FROM ab))
}
} {1}
+40
View File
@@ -1293,4 +1293,44 @@ do_test 19.3 {
db2 close
} {}
#-------------------------------------------------------------------------
# Test that the bug fixed by [b0c1ba655d69] really is fixed.
#
do_execsql_test 20.1 {
CREATE TABLE t7 (a, b);
CREATE TABLE t8 (c, d);
CREATE INDEX i2 ON t7(a);
CREATE INDEX i3 ON t7(b);
CREATE INDEX i4 ON t8(c);
CREATE INDEX i5 ON t8(d);
CREATE VIRTUAL TABLE t7v USING echo(t7);
CREATE VIRTUAL TABLE t8v USING echo(t8);
}
do_test 20.2 {
for {set i 0} {$i < 1000} {incr i} {
db eval {INSERT INTO t7 VALUES($i, $i)}
db eval {INSERT INTO t8 VALUES($i, $i)}
}
} {}
do_execsql_test 20.3 {
SELECT a, b FROM (
SELECT a, b FROM t7 WHERE a=11 OR b=12
UNION ALL
SELECT c, d FROM t8 WHERE c=5 OR d=6
)
ORDER BY 1, 2;
} {5 5 6 6 11 11 12 12}
do_execsql_test 20.4 {
SELECT a, b FROM (
SELECT a, b FROM t7v WHERE a=11 OR b=12
UNION ALL
SELECT c, d FROM t8v WHERE c=5 OR d=6
)
ORDER BY 1, 2;
} {5 5 6 6 11 11 12 12}
finish_test
+9 -4
View File
@@ -60,11 +60,16 @@ do_execsql_test 1.2 {
# Check file sizes are as expected. The real requirement here is that
# the *shm file is now more than one chunk (>32KiB).
#
# The sizes of various files are slightly different in normal and
# auto-vacuum mode.
do_test 1.3 { file size test.db } {1024}
do_test 1.4 { file size test.db-wal } {15421352}
do_test 1.5 { expr {[file size test.db-shm]>32768} } {1}
do_execsql_test 1.6 { PRAGMA wal_checkpoint } {0 14715 14715}
do_test 1.4 { expr {[file size test.db-wal]>(1500*1024)} } {1}
do_test 1.5 { expr {[file size test.db-shm]>32768} } {1}
do_test 1.6 {
foreach {a b c} [db eval {PRAGMA wal_checkpoint}] break
list [expr {$a==0}] [expr {$b>14500}] [expr {$c>14500}] [expr {$b==$c}]
} {1 1 1 1}
# At this point connection [db2] has mapped the first 32KB of the *shm file
# only. Because the entire WAL file has been checkpointed, it is not
+2
View File
@@ -1079,6 +1079,7 @@ do_test where-13.12 {
# When optimizing out ORDER BY clauses, make sure that trailing terms
# of the ORDER BY clause do not reference other tables in a join.
#
if {[permutation] != "no_optimization"} {
do_test where-14.1 {
execsql {
CREATE TABLE t8(a INTEGER PRIMARY KEY, b TEXT UNIQUE);
@@ -1156,6 +1157,7 @@ do_test where-14.12 {
SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.b, y.a||x.b DESC
}
} {4/4 4/1 1/4 1/1 sort}
} ;# {permutation != "no_optimization"}
# Ticket #2445.
#