Merge the 3.8.5 release candidate changes into the sessions branch.

FossilOrigin-Name: 09e75d82d02f900e58eceaaa010a42fc7044c89f
This commit is contained in:
drh 2014-06-03 20:09:48 +00:00
commit 83f951ee95
16 changed files with 247 additions and 37 deletions

View File

@ -1,5 +1,5 @@
C Merge\strunk\schanges\sinto\sthe\ssessions\sbranch.
D 2014-05-29T20:29:13.254
C Merge\sthe\s3.8.5\srelease\scandidate\schanges\sinto\sthe\ssessions\sbranch.
D 2014-06-03T20:09:48.914
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in faf03dca4bd103f3e98b317aeba930dea49cfaa1
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -220,7 +220,7 @@ F src/os.h 60d419395e32a8029fa380a80a3da2e9030f635e
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa
F src/os_unix.c ae4b5240af4619d711301d7992396e182585269f
F src/os_win.c 648f842876e25391b7c454c8e49f7db1fd981d65
F src/os_win.c 8dbf6c11780fe2eb96c1f289e664d0c7b2911d37
F src/os_win.h 057344a6720b4c8405d9bd98f58cb37a6ee46c25
F src/pager.c f6bb1fa6cdf2062f2d8aec3e64db302bca519ab8
F src/pager.h ffd5607f7b3e4590b415b007a4382f693334d428
@ -230,13 +230,13 @@ F src/pcache.h a5e4f5d9f5d592051d91212c5949517971ae6222
F src/pcache1.c 102e6f5a2fbc646154463eb856d1fd716867b64c
F src/pragma.c 810ef31ccfaa233201dcf100637a9777cc24e897
F src/prepare.c 677521ab7132615a8a26107a1d1c3132f44ae337
F src/printf.c e5a0005f8b3de21f85da6a709d2fbee76775bf4b
F src/printf.c af06f66927919730f03479fed6ae9854f73419f4
F src/random.c d10c1f85b6709ca97278428fd5db5bbb9c74eece
F src/resolve.c 273d5f47c4e2c05b2d3d2bffeda939551ab59e66
F src/rowset.c a9c9aae3234b44a6d7c6f5a3cadf90dce1e627be
F src/select.c 7df17ec5506c2427576d412bee0e6ea740e12563
F src/shell.c 33f6c0bc0e32eae099f7c2b79cfa7515b4b4702c
F src/sqlite.h.in 78ac857a20a16d03b343320973b7da1736ff8fe9
F src/select.c 6762c62e11b504aa014edceab8886495165e3a77
F src/shell.c 98ce7f52445aa0c2eac3d4553a4cdcbb6402a670
F src/sqlite.h.in a585e10c0d181b0f102df93477cfd3ab2b98b2e5
F src/sqlite3.rc 11094cc6a157a028b301a9f06b3d03089ea37c3e
F src/sqlite3ext.h 886f5a34de171002ad46fae8c36a7d8051c190fc
F src/sqliteInt.h b9260ccf4c1ca2e26bc0789597c0a132aad4961b
@ -244,7 +244,7 @@ F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d
F src/status.c 7ac05a5c7017d0b9f0b4bcd701228b784f987158
F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
F src/tclsqlite.c 7ada527ce7916adcabad7997c10f09680aac7c9b
F src/test1.c 899bddeb0c7fb2b8062de6f03af4a4e4f48f9df5
F src/test1.c 4edf8810c86d77ae7ac6d56d563965a9beeea2ce
F src/test2.c 98049e51a17dc62606a99a9eb95ee477f9996712
F src/test3.c 1c0e5d6f080b8e33c1ce8b3078e7013fdbcd560c
F src/test4.c 9b32d22f5f150abe23c1830e2057c4037c45b3df
@ -308,8 +308,8 @@ F src/vtab.c 21b932841e51ebd7d075e2d0ad1415dce8d2d5fd
F src/wal.c 76e7fc6de229bea8b30bb2539110f03a494dc3a8
F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
F src/walker.c 11edb74d587bc87b33ca96a5173e3ec1b8389e45
F src/where.c b3be5eb4193b6327c4a02fe91411df503fe770e8
F src/whereInt.h 6804c2e5010378568c2bb1350477537755296a46
F src/where.c a7d59dd5d5bf6d6ab905fb549567a0a11376de25
F src/whereInt.h 929c1349b5355fd44f22cee5c14d72b3329c58a6
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
F test/aggnested.test 45c0201e28045ad38a530b5a144b73cd4aa2cfd6
@ -423,7 +423,7 @@ F test/corruptF.test be9fde98e4c93648f1ba52b74e5318edc8f59fe4
F test/corruptG.test 1ab3bf97ee7bdba70e0ff3ba2320657df55d1804
F test/corruptH.test 88ed71a086e13591c917aac6de32750e7c7281cb
F test/corruptI.test b3e4203d420490fc3d3062711597bc1dea06a789
F test/cost.test 04842adec34311d70c3f3c5fd698b22be54138fd
F test/cost.test 19d314526616ce4473eb4e4e450fcb94499ce318
F test/count.test 42a251178e32f617eda33f76236a7f79825a50b5
F test/coveridxscan.test cdb47d01acc4a634a34fd25abe85189e0d0f1e62
F test/crash.test fb9dc4a02dcba30d4aa5c2c226f98b220b2b959f
@ -458,7 +458,7 @@ F test/e_dropview.test 0c9f7f60989164a70a67a9d9c26d1083bc808306
F test/e_expr.test 5c71d183fbf519a4769fd2e2124afdc70b5b1f42
F test/e_fkey.test a1783fe1f759e1990e6a11adfcf0702dac4d0707
F test/e_fts3.test 5c02288842e4f941896fd44afdef564dd5fc1459
F test/e_insert.test 1e44f84d2abe44d66e4fbf198be4b20e3cc724a0
F test/e_insert.test 7b2fa9cd1456f83474d6c5d27db3abaeb8be2023
F test/e_reindex.test 396b7b4f0a66863b4e95116a67d93b227193e589
F test/e_resolve.test dcce9308fb13b934ce29591105d031d3e14fbba6
F test/e_select.test 52692ff3849541e828ad4661fe3773a9b8711763
@ -740,7 +740,7 @@ F test/notnull.test f8fcf58669ddba79274daa2770d61dfad8274f62
F test/null.test a8b09b8ed87852742343b33441a9240022108993
F test/numcast.test 5d126f7f581432e86a90d1e35cac625164aec4a1
F test/openv2.test 0d3040974bf402e19b7df4b783e447289d7ab394
F test/orderby1.test 9b524aff9147288da43a6d7ddfdcff47fa2303c6
F test/orderby1.test 12426f99518cde45f34215ca6a0ebc0e9bc5c77a
F test/orderby2.test bc11009f7cd99d96b1b11e57b199b00633eb5b04
F test/orderby3.test 8619d06a3debdcd80a27c0fdea5c40b468854b99
F test/orderby4.test 4d39bfbaaa3ae64d026ca2ff166353d2edca4ba4
@ -760,7 +760,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 f3617ac9b55f63c031c13f5fa9e57116fc597165
F test/permutations.test bf568516e21758f2961a4612f29dc422d3ab75c1
F test/pragma.test adb21a90875bc54a880fa939c4d7c46598905aa0
F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13
F test/printf.test ec9870c4dce8686a37818e0bf1aba6e6a1863552
@ -1125,7 +1125,7 @@ F test/whereI.test 1d89199697919d4930be05a71e7fe620f114e622
F test/wherelimit.test 5e9fd41e79bb2b2d588ed999d641d9c965619b31
F test/wild001.test bca33f499866f04c24510d74baf1e578d4e44b1c
F test/win32heap.test ea19770974795cff26e11575e12d422dbd16893c
F test/win32lock.test 7a6bd73a5dcdee39b5bb93e92395e1773a194361
F test/win32lock.test 71642fa56e9b06e5cfffe6bad67cb8c1eb2c555a
F test/win32longpath.test 169c75a3b2e43481f4a62122510210c67b08f26d
F test/with1.test 268081a6b14817a262ced4d0ee34d4d2a1dd2068
F test/with2.test ee227a663586aa09771cafd4fa269c5217eaf775
@ -1152,7 +1152,7 @@ F tool/lemon.c 07aba6270d5a5016ba8107b09e431eea4ecdc123
F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc
F tool/logest.c eef612f8adf4d0993dafed0416064cf50d5d33c6
F tool/mkautoconfamal.sh f8d8dbf7d62f409ebed5134998bf5b51d7266383
F tool/mkkeywordhash.c c9e05e4a7bcab8fab9f583d5b321fb72f565ad97
F tool/mkkeywordhash.c dfff09dbbfaf950e89af294f48f902181b144670
F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e
F tool/mkpragmatab.tcl 78a77b2c554d534c6f2dc903130186ed15715460
F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
@ -1188,7 +1188,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 a769c7e03e6d4163986d49652687de34d15906a0 8f916ed1e185ac728e00624d90e1d7bd2dda4469
R 3370b40cbcc7803475544bb7516ae78d
P 9f18e78f039ffa89a8806810ad385bdc51bc88ed 6d81805298ea882f5fee99504d5a95f1a762a90b
R 1b537fdde3fe5617547753819824a8f7
U drh
Z cb38c4d301930323a7c7581f1a945fe2
Z 60e68d7eb2611275d6e02a10bd056454

View File

@ -1 +1 @@
9f18e78f039ffa89a8806810ad385bdc51bc88ed
09e75d82d02f900e58eceaaa010a42fc7044c89f

View File

@ -2924,8 +2924,16 @@ static int winLock(sqlite3_file *id, int locktype){
** If you are using this code as a model for alternative VFSes, do not
** copy this retry logic. It is a hack intended for Windows only.
*/
lastErrno = osGetLastError();
OSTRACE(("LOCK-PENDING-FAIL file=%p, count=%d, result=%d\n",
pFile->h, cnt, res));
if( lastErrno==ERROR_INVALID_HANDLE ){
pFile->lastErrno = lastErrno;
rc = SQLITE_IOERR_LOCK;
OSTRACE(("LOCK-FAIL file=%p, count=%d, rc=%s\n",
pFile->h, cnt, sqlite3ErrName(rc)));
return rc;
}
if( cnt ) sqlite3_win32_sleep(1);
}
gotPendingLock = res;
@ -3169,6 +3177,17 @@ static int winFileControl(sqlite3_file *id, int op, void *pArg){
OSTRACE(("FCNTL file=%p, rc=SQLITE_OK\n", pFile->h));
return SQLITE_OK;
}
#ifdef SQLITE_TEST
case SQLITE_FCNTL_WIN32_SET_HANDLE: {
LPHANDLE phFile = (LPHANDLE)pArg;
HANDLE hOldFile = pFile->h;
pFile->h = *phFile;
*phFile = hOldFile;
OSTRACE(("FCNTL oldFile=%p, newFile=%p, rc=SQLITE_OK\n",
hOldFile, pFile->h));
return SQLITE_OK;
}
#endif
case SQLITE_FCNTL_TEMPFILENAME: {
char *zTFile = 0;
int rc = winGetTempname(pFile->pVfs, &zTFile);

View File

@ -756,6 +756,7 @@ static int sqlite3StrAccumEnlarge(StrAccum *p, int N){
zNew = sqlite3_realloc(zOld, p->nAlloc);
}
if( zNew ){
assert( p->zText!=0 || p->nChar==0 );
if( zOld==0 && p->nChar>0 ) memcpy(zNew, p->zText, p->nChar);
p->zText = zNew;
}else{

View File

@ -1226,9 +1226,6 @@ static void generateSortTail(
}
if( pSort->regReturn ) sqlite3VdbeAddOp1(v, OP_Return, pSort->regReturn);
sqlite3VdbeResolveLabel(v, addrBreak);
if( eDest==SRT_Output || eDest==SRT_Coroutine ){
sqlite3VdbeAddOp2(v, OP_Close, pseudoTab, 0);
}
}
/*

View File

@ -2425,8 +2425,8 @@ static int do_meta_command(char *zLine, struct callback_data *p){
}else
if( c=='i' && strncmp(azArg[0], "import", n)==0 ){
char *zTable = azArg[2]; /* Insert data into this table */
char *zFile = azArg[1]; /* Name of file to extra content from */
char *zTable; /* Insert data into this table */
char *zFile; /* Name of file to extra content from */
sqlite3_stmt *pStmt = NULL; /* A statement */
int nCol; /* Number of columns in the table */
int nByte; /* Number of bytes in an SQL string */
@ -2441,6 +2441,8 @@ static int do_meta_command(char *zLine, struct callback_data *p){
fprintf(stderr, "Usage: .import FILE TABLE\n");
goto meta_command_exit;
}
zFile = azArg[1];
zTable = azArg[2];
seenInterrupt = 0;
memset(&sCsv, 0, sizeof(sCsv));
open_db(p, 0);
@ -2998,7 +3000,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
zCmd = sqlite3_mprintf(strchr(azArg[i],' ')==0?"%z %s":"%z \"%s\"",
zCmd, azArg[i]);
}
system(zCmd);
(void)system(zCmd);
sqlite3_free(zCmd);
}else

View File

@ -942,6 +942,12 @@ struct sqlite3_io_methods {
** on whether or not the file has been renamed, moved, or deleted since it
** was first opened.
**
** <li>[[SQLITE_FCNTL_WIN32_SET_HANDLE]]
** The [SQLITE_FCNTL_WIN32_SET_HANDLE] opcode is used for debugging. This
** opcode causes the xFileControl method to swap the file handle with the one
** pointed to by the pArg argument. This capability is used during testing
** and only needs to be supported when SQLITE_TEST is defined.
**
** </ul>
*/
#define SQLITE_FCNTL_LOCKSTATE 1
@ -965,6 +971,7 @@ struct sqlite3_io_methods {
#define SQLITE_FCNTL_HAS_MOVED 20
#define SQLITE_FCNTL_SYNC 21
#define SQLITE_FCNTL_COMMIT_PHASETWO 22
#define SQLITE_FCNTL_WIN32_SET_HANDLE 23
/*
** CAPI3REF: Mutex Handle

View File

@ -117,6 +117,16 @@ int getDbPointer(Tcl_Interp *interp, const char *zA, sqlite3 **ppDb){
return TCL_OK;
}
#if SQLITE_OS_WIN
/*
** Decode a Win32 HANDLE object.
*/
int getWin32Handle(Tcl_Interp *interp, const char *zA, LPHANDLE phFile){
*phFile = (HANDLE)sqlite3TestTextToPtr(zA);
return TCL_OK;
}
#endif
extern const char *sqlite3ErrName(int);
#define t1ErrorName sqlite3ErrName
@ -5210,6 +5220,7 @@ static int file_control_lockproxy_test(
return TCL_OK;
}
#if SQLITE_OS_WIN
/*
** tclcmd: file_control_win32_av_retry DB NRETRY DELAY
**
@ -5243,6 +5254,42 @@ static int file_control_win32_av_retry(
return TCL_OK;
}
/*
** tclcmd: file_control_win32_set_handle DB HANDLE
**
** This TCL command runs the sqlite3_file_control interface with
** the SQLITE_FCNTL_WIN32_SET_HANDLE opcode.
*/
static int file_control_win32_set_handle(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
Tcl_Obj *CONST objv[] /* Command arguments */
){
sqlite3 *db;
int rc;
HANDLE hFile = NULL;
char z[100];
if( objc!=3 ){
Tcl_AppendResult(interp, "wrong # args: should be \"",
Tcl_GetStringFromObj(objv[0], 0), " DB HANDLE", 0);
return TCL_ERROR;
}
if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ){
return TCL_ERROR;
}
if( getWin32Handle(interp, Tcl_GetString(objv[2]), &hFile) ){
return TCL_ERROR;
}
rc = sqlite3_file_control(db, NULL, SQLITE_FCNTL_WIN32_SET_HANDLE,
(void*)&hFile);
sqlite3_snprintf(sizeof(z), z, "%d %p", rc, (void*)hFile);
Tcl_AppendResult(interp, z, (char*)0);
return TCL_OK;
}
#endif
/*
** tclcmd: file_control_persist_wal DB PERSIST-FLAG
**
@ -6472,7 +6519,10 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
{ "file_control_lockproxy_test", file_control_lockproxy_test, 0 },
{ "file_control_chunksize_test", file_control_chunksize_test, 0 },
{ "file_control_sizehint_test", file_control_sizehint_test, 0 },
#if SQLITE_OS_WIN
{ "file_control_win32_av_retry", file_control_win32_av_retry, 0 },
{ "file_control_win32_set_handle", file_control_win32_set_handle, 0 },
#endif
{ "file_control_persist_wal", file_control_persist_wal, 0 },
{ "file_control_powersafe_overwrite",file_control_powersafe_overwrite,0},
{ "file_control_vfsname", file_control_vfsname, 0 },

View File

@ -4286,7 +4286,6 @@ static int whereLoopAddBtreeIndex(
testcase( eOp & WO_IN );
pNew->nOut += pTerm->truthProb;
pNew->nOut -= nIn;
pNew->wsFlags |= WHERE_LIKELIHOOD;
}else{
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
tRowcnt nOut = 0;
@ -4295,7 +4294,6 @@ static int whereLoopAddBtreeIndex(
&& pNew->u.btree.nEq<=pProbe->nSampleCol
&& OptimizationEnabled(db, SQLITE_Stat3)
&& ((eOp & WO_IN)==0 || !ExprHasProperty(pTerm->pExpr, EP_xIsSelect))
&& (pNew->wsFlags & WHERE_LIKELIHOOD)==0
){
Expr *pExpr = pTerm->pExpr;
if( (eOp & (WO_EQ|WO_ISNULL))!=0 ){
@ -5297,7 +5295,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
/* TUNING: For simple queries, only the best path is tracked.
** For 2-way joins, the 5 best paths are followed.
** For joins of 3 or more tables, track the 10 best paths */
mxChoice = (nLoop==1) ? 1 : (nLoop==2 ? 5 : 10);
mxChoice = (nLoop<=1) ? 1 : (nLoop==2 ? 5 : 10);
assert( nLoop<=pWInfo->pTabList->nSrc );
WHERETRACE(0x002, ("---- begin solver\n"));
@ -5327,7 +5325,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
aFrom[0].isOrdered = 0;
nOrderBy = 0;
}else{
aFrom[0].isOrdered = -1;
aFrom[0].isOrdered = nLoop>0 ? -1 : 1;
nOrderBy = pWInfo->pOrderBy->nExpr;
}

View File

@ -458,4 +458,3 @@ struct WhereInfo {
#define WHERE_AUTO_INDEX 0x00004000 /* Uses an ephemeral index */
#define WHERE_SKIPSCAN 0x00008000 /* Uses the skip-scan algorithm */
#define WHERE_UNQ_WANTED 0x00010000 /* WHERE_ONEROW would have been helpful*/
#define WHERE_LIKELIHOOD 0x00020000 /* A likelihood() is affecting nOut */

View File

@ -244,6 +244,47 @@ foreach {tn nTerm nRow} {
}
#-------------------------------------------------------------------------
#
ifcapable stat4 {
do_execsql_test 10.1 {
CREATE TABLE t6(a, b, c);
CREATE INDEX t6i1 ON t6(a, b);
CREATE INDEX t6i2 ON t6(c);
}
do_test 10.2 {
for {set i 0} {$i < 16} {incr i} {
execsql { INSERT INTO t6 VALUES($i%4, 'xyz', $i%8) }
}
execsql ANALYZE
} {}
do_eqp_test 10.3 {
SELECT rowid FROM t6 WHERE a=0 AND c=0
} {
0 0 0 {SEARCH TABLE t6 USING INDEX t6i2 (c=?)}
}
do_eqp_test 10.4 {
SELECT rowid FROM t6 WHERE a=0 AND b='xyz' AND c=0
} {
0 0 0 {SEARCH TABLE t6 USING INDEX t6i2 (c=?)}
}
do_eqp_test 10.5 {
SELECT rowid FROM t6 WHERE likelihood(a=0, 0.1) AND c=0
} {
0 0 0 {SEARCH TABLE t6 USING INDEX t6i1 (a=?)}
}
do_eqp_test 10.6 {
SELECT rowid FROM t6 WHERE likelihood(a=0, 0.1) AND b='xyz' AND c=0
} {
0 0 0 {SEARCH TABLE t6 USING INDEX t6i1 (a=? AND b=?)}
}
}
finish_test

View File

@ -174,9 +174,9 @@ do_insert_tests e_insert-1.2 -error {
4 "INSERT INTO a2 VALUES(1,2,3,4,5)" {a2 3 5}
}
# EVIDENCE-OF: R-34231-22576 In this case the result of evaluating the
# left-most expression in each term of the VALUES list is inserted into
# the left-most column of the each new row, and forth for each
# EVIDENCE-OF: R-29730-42609 In this case the result of evaluating the
# left-most expression from each term of the VALUES list is inserted
# into the left-most column of each new row, and so forth for each
# subsequent expression.
#
delete_all_data

View File

@ -452,6 +452,34 @@ do_test 4.0 {
}
} {1 13 1 14 1 15 1 16}
# No sorting of queries that omit the FROM clause.
#
do_execsql_test 5.0 {
EXPLAIN QUERY PLAN SELECT 5 ORDER BY 1
} {}
do_execsql_test 5.1 {
EXPLAIN QUERY PLAN SELECT 5 UNION ALL SELECT 3 ORDER BY 1
} {~/B-TREE/}
do_execsql_test 5.2 {
SELECT 5 UNION ALL SELECT 3 ORDER BY 1
} {3 5}
# The following test (originally derived from a single test within fuzz.test)
# verifies that a PseudoTable cursor is not closed prematurely in a deeply
# nested query. This test caused a segfault on 3.8.5 beta.
#
do_execsql_test 6.0 {
CREATE TABLE abc(a, b, c);
INSERT INTO abc VALUES(1, 2, 3);
INSERT INTO abc VALUES(4, 5, 6);
INSERT INTO abc VALUES(7, 8, 9);
SELECT (
SELECT 'hardware' FROM (
SELECT 'software' ORDER BY 'firmware' ASC, 'sportswear' DESC
) GROUP BY 1 HAVING length(b)
)
FROM abc;
} {hardware hardware hardware}
finish_test

View File

@ -161,6 +161,28 @@ test_suite "valgrind" -prefix "" -description {
unset -nocomplain ::G(valgrind)
}
test_suite "valgrind-nolookaside" -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
] -initialize {
set ::G(valgrind) 1
catch {db close}
sqlite3_shutdown
sqlite3_config_lookaside 0 0
sqlite3_initialize
autoinstall_test_functions
} -shutdown {
catch {db close}
sqlite3_shutdown
sqlite3_config_lookaside 100 500
sqlite3_initialize
autoinstall_test_functions
unset -nocomplain ::G(valgrind)
}
test_suite "quick" -prefix "" -description {
Quick test suite. Runs in around 10 minutes on a workstation.
} -files [

View File

@ -24,7 +24,7 @@ db close
sqlite3_shutdown
test_sqlite3_log xLog
proc xLog {error_code msg} {
lappend ::log $msg
lappend ::log $msg
}
sqlite3 db test.db
db eval {PRAGMA mmap_size=0}
@ -128,7 +128,53 @@ while {1} {
file_control_win32_av_retry db 10 25
sqlite3_test_control_pending_byte $old_pending_byte
db close
forcedelete test.db
sqlite3 db test.db
sqlite3 db2 test.db
do_test win32lock-3.0 {
db eval {
CREATE TABLE t1(x);
INSERT INTO t1 VALUES(1);
INSERT INTO t1 VALUES(2);
INSERT INTO t1 VALUES(3);
}
} {}
do_test win32lock-3.1 {
db eval {
BEGIN EXCLUSIVE;
INSERT INTO t1 VALUES(4);
}
} {}
do_test win32lock-3.2 {
catchsql {
BEGIN EXCLUSIVE;
INSERT INTO t1 VALUES(5);
COMMIT;
} db2
} {1 {database is locked}}
do_test win32lock-3.3 {
db eval {
COMMIT;
}
} {}
do_test win32lock-3.4 {
set handle [lindex [file_control_win32_set_handle db 0] end]
list [catchsql {
BEGIN EXCLUSIVE;
INSERT INTO t1 VALUES(6);
COMMIT;
}] [file_control_win32_set_handle db $handle] [sqlite3_extended_errcode db]
} {{1 {disk I/O error}} {0 0} SQLITE_IOERR_LOCK}
db2 close
db close
sqlite3_shutdown
test_sqlite3_log
test_sqlite3_log
sqlite3_initialize
finish_test

View File

@ -370,7 +370,7 @@ int main(int argc, char **argv){
Keyword *p = &aKeywordTable[i];
p->len = (int)strlen(p->zName);
assert( p->len<sizeof(p->zOrigName) );
strcpy(p->zOrigName, p->zName);
memcpy(p->zOrigName, p->zName, p->len+1);
totalLen += p->len;
p->hash = (UpperToLower[(int)p->zName[0]]*4) ^
(UpperToLower[(int)p->zName[p->len-1]]*3) ^ p->len;