-C Bring\stest\scoverage\sup\sto\s99%.\s(CVS\s5522)
-D 2008-08-01T20:10:08
+C Additional\scoverage\stesting.\s\sFix\sa\ssegfault\sfollowing\sOOM\sin\nsqltie3_load_extension().\s(CVS\s5523)
+D 2008-08-02T03:50:39
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in bbb62eecc851379aef5a48a1bf8787eb13e6ec06
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/btree.c 0be00cb6a5cd130127a06eb5f661cb5e4a9d0259
F src/btree.h 03256ed7ee42b5ecacbe887070b0f8249e7d069d
F src/btreeInt.h ab18c7b4980314e9e4b402e5dcde09f3c2545576
-F src/build.c 77d5518a64c0a905024bee80f6df2e794f4f5d43
+F src/build.c 05be60b1edc70bb8b354778facfb0ad5137c679a
F src/callback.c c9f75a4c403f166af3761df47d78a806587d63af
F src/complete.c cb14e06dbe79dee031031f0d9e686ff306afe07c
F src/date.c 52a54811218a76da6235420f532ece841159a96d
F src/hwtime.h 4a1d45f4cae1f402ea19686acf24acf4f0cb53cb
F src/insert.c 89cd9af52a5ea6fb7d0cfc9c3b935d6406c360c4
F src/journal.c cffd2cd214e58c0e99c3ff632b3bee6c7cbb260e
-F src/legacy.c 3635cc6a5889918086b3501de8287cbbecb55917
-F src/loadext.c 9ab55455f59dce0ae6388952216a1505ce7f9d13
+F src/legacy.c aac57bd984e666059011ea01ec4383892a253be3
+F src/loadext.c eb1fe4f44d7c8ff53fc0c6a4388ab79fbd34cd64
F src/main.c 730c6f40379e2258718ee2e591a4ae091d4e26c6
F src/malloc.c f0ad28008351cac2337ef502a3fdc8ffd3e5d9a9
F src/md5.c 008216bbb5d34c6fbab5357aa68575ad8a31516a
F src/os_os2.c 676ed273b17bd260f905df81375c9f9950d85517
F src/os_unix.c fe0dbc35bcd3de49e46b132abfc0f45d6dd6a864
F src/os_win.c aefe9ee26430678a19a058a874e4e2bd91398142
-F src/pager.c 6ad4d2b9b62a40f9ee898111d4519fec2e7c4796
+F src/pager.c b6a366f2343e7f127d7e70dbe76cd664336143cd
F src/pager.h 588c1ac195228b2da45c4e5f7ab6c2fd253d1751
F src/parse.y d962e544d9953289db23c1d4cc2dab514c7136fa
F src/pragma.c 6e207b4f69901089758c02c02e0bf86ed12a4d8f
-F src/prepare.c d2d53aec81517f8666450aa5fd1a041a3b72320e
+F src/prepare.c d9f420808f7d2802258f0bf64103271311e2d87f
F src/printf.c 2e984b2507291a7e16d89dc9bb60582904f6247d
F src/random.c 5c754319d38abdd6acd74601ee0105504adc508a
-F src/select.c 95fb28783ef1342be8c6ee278c539309e29c010e
+F src/select.c 23106fd9a9618a832abaf5dc906c79dc21755edc
F src/shell.c 4b835fe734304ac22a3385868cd3790c1e4f7aa1
F src/sqlite.h.in 30af3a002a0b672aaae8f4a5deb0a2e9a4b699af
F src/sqlite3ext.h 1e3887c9bd3ae66cb599e922824b04cd0d0f2c3e
-F src/sqliteInt.h 80fa4a46024dee8cb6c66a6f04a716c253d98165
+F src/sqliteInt.h 4c3a19206bacfab8650f2616bc0004c1dea7fbf3
F src/sqliteLimit.h f435e728c6b620ef7312814d660a81f9356eb5c8
F src/status.c 8ad1f215934c5f5afb91df86e44dccff7ef3c1d0
F src/table.c 22744786199c9195720c15a7a42cb97b2e2728d8
F src/test_btree.c 7170e0c922ed3979f2d38f4a3f84728e5740dfc3
F src/test_config.c 224f699a34d45eb8ac5c22a7ad6cdbb8edf0ba28
F src/test_devsym.c 6012cb8e3acf812513511025a4fa5d626e0ba19b
-F src/test_func.c 94c4424ed9869ecf2e2132662a04581bbec016f6
+F src/test_func.c df7ddd5abfc5c8d6cd3e36ae9ecb0c276b0e9039
F src/test_hexio.c 2f1122aa3f012fa0142ee3c36ce5c902a70cd12f
-F src/test_loadext.c df8ab3a6481ddebbdf0d28ebac5d9e0790f7860f
+F src/test_loadext.c 97dc8800e46a46ed002c2968572656f37e9c0dd9
F src/test_malloc.c 3919ed155da54a1ee1e06282a69fb8a035b2749f
F src/test_md5.c 28209a4e2068711b5443c33104fe41f21d160071
F src/test_mutex.c d3422d9f60cc1330249d102e74b333f0d24a0cb6
F src/vacuum.c ef342828002debc97514617af3424aea8ef8522c
F src/vdbe.c a548d1dd6c5d99b2bd38e522aba2fa401340c99c
F src/vdbe.h 647fcf33a551ba10a974162c56846cb9aef2276b
-F src/vdbeInt.h ab27f964458fd070c6660f80694ab85d56d5f4c5
-F src/vdbeapi.c 6a769ea6708f75b1e55268ec1c7bcf8e96fc7628
-F src/vdbeaux.c 81a433ce73b79df605cc9709af430362e771ecdc
+F src/vdbeInt.h 6f04c2bf65a0d5c2bb8318b226278a35d1f7a8f5
+F src/vdbeapi.c 803f365b77a22c1b2680a0dee9202bc75c02bf4a
+F src/vdbeaux.c 21126e0d319e19125f5e42fceafb17eafe58721c
F src/vdbeblob.c f93110888ddc246215e9ba1f831d3d375bfd8355
F src/vdbefifo.c 20fda2a7c4c0bcee1b90eb7e545fefcdbf2e1de7
F src/vdbemem.c c37b2a266a49eaf0c0f5080157f9f1a908fdaac3
-F src/vtab.c 914db4c9435c61a522e3cdaf103dac163d38aa30
+F src/vtab.c 9c1bbb54d8b29a3412bff4eee32e9be309d85727
F src/where.c a800184a2d023b15d6f2758b7a6c7ab011258fee
F tclinstaller.tcl 4356d9d94d2b5ed5e68f9f0c80c4df3048dd7617
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
F test/auth.test 9eb4b6b99eee54c95711c74c4b9694acf4d850ed
F test/auth2.test ee3ba272e2b975e913afc9b041ee75706e190005
F test/autoinc.test 42af2c407c4e37d0626f9cda57ed381e94522c9d
-F test/autovacuum.test 4339e66003b9cf813dd667a83aed2dee27c4c36d
+F test/autovacuum.test e3428031ad7a14f16a7d515cd2a0480854e66b21
F test/autovacuum_ioerr2.test 598b0663074d3673a9c1bc9a16e80971313bafe6
F test/avtrans.test 1e901d8102706b63534dbd2bdd4d8f16c4082650
F test/badutf.test d5360fc31f643d37a973ab0d8b4fb85799c3169f
F test/laststmtchanges.test 18ead86c8a87ade949a1d5658f6dc4bb111d1b02
F test/like.test 2a3ddbd5d91503f914eabae67a47c4196fe33a58
F test/like2.test 3b2ee13149ba4a8a60b59756f4e5d345573852da
-F test/limit.test ca61a9fc520f54470edb3a771167fe4b68abc247
-F test/loadext.test 5f4354b3eb22584563a51ff74329f06e48dfae33
+F test/limit.test 2db7b3b34fb925b8e847d583d2eb67531d0ce67e
+F test/loadext.test f79e5460c4664916a93ba6e7c762886153e2014b
F test/loadext2.test 0bcaeb4d81cd5b6e883fdfea3c1bdbe1f173cbca
F test/lock.test 6825aea0b5885578b1b63a3b178803842c4ee9f1
F test/lock2.test 018b846f6f3b3b695fad07e317b7988442b556f4
F test/mallocF.test 2d5c590ebc2fc7f0dcebdf5aa8498b9aed69107e
F test/mallocG.test 4584d0d8ddb8009f16ca0c8bab1fa37f6358efa2
F test/mallocH.test 79b65aed612c9b3ed2dcdaa727c85895fd1bfbdb
+F test/mallocI.test 6e24fe6444bd2999ccc81f984977b44c0d6e5591
F test/malloc_common.tcl 753eb1ff3481f6cddb65cff33b9ef9f72c5ccdf7
F test/manydb.test 8de36b8d33aab5ef295b11d9e95310aeded31af8
F test/memdb.test a67bda4ff90a38f2b19f6c7f95aa7289e051d893
F test/misc4.test 91e8ed25c092c2bb4e0bb01864631e2930f8d7de
F test/misc5.test 6a5c1e3217a95b0db05ff9a0f1ecb5ce9043ffef
F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91
-F test/misc7.test 9aef880e037722f6a8549dfec4013080489ee822
+F test/misc7.test fd424ff93a83bb6a31463eb043c588777d8215a8
F test/misuse.test 30b3a458e5a70c31e74c291937b6c82204c59f33
F test/mutex1.test 7f5e21fd11fe22de079e5dcd394ee4f6c257e68e
F test/mutex2.test 56f282f436596e9febdc6e0db2c507432b6724bb
F test/select2.test 272a3d3e35b1d3a0760168ababf555e656357fc4
F test/select3.test 2ce595f8fb8e2ac10071d3b4e424cadd4634a054
F test/select4.test 0618c9377013840194b7901e6224d841cd3e7193
-F test/select5.test 5ad14ea338aada2e6394ba98fa9aa40e3e50aec0
+F test/select5.test 1bddfe92ae0b00ca53dc2735d5d23ce6b9723c26
F test/select6.test 1131113eb6ae398069a8bc2173eb6c9a2d8ff1cd
F test/select7.test 7906735805cfbee4dddc0bed4c14e68d7f5f9c5f
F test/select8.test 391de11bdd52339c30580dabbbbe97e3e9a3c79d
F test/utf16align.test 7360e84472095518c56746f76b1f9d4dce99fb4d
F test/vacuum.test 0bc75ee74ab9c69322d6563aa2287375697e630b
F test/vacuum2.test d3b9691541fe6ed5c711f547a1c7d70e9760ac6f
-F test/vacuum3.test 75dee6ffd1baa60308dcad93f2c689126500dcff
+F test/vacuum3.test 306b65554980d8d4a3b6eeb7b3ccd11c65ebb540
F test/varint.test ab7b110089a08b9926ed7390e7e97bdefeb74102
F test/veryquick.test e265401afefa994cdf2fe4b6f286b1e87c2f9b9d
F test/view.test 5799906511d6c77cfe3516d3d1189224350ef732
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P b65f493c7519e8a5ee632a395b57d45269741dda
-R 569ccbda0a2f36d2174f959575a5f332
+P 2cd6bae80984126023bcf479e5f3db5eaa5c4134
+R cea4eb266e996617279acd70a132ce2a
U drh
-Z f6ba4601378d31882289341741f7ff01
+Z 7dbeb8531e58c51f99b7f023b4b1da67
-2cd6bae80984126023bcf479e5f3db5eaa5c4134
\ No newline at end of file
+f1e44eb323f05495cbae25113aebcc50d16b40df
\ No newline at end of file
** COMMIT
** ROLLBACK
**
-** $Id: build.c,v 1.491 2008/07/28 19:34:53 drh Exp $
+** $Id: build.c,v 1.492 2008/08/02 03:50:39 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
if( db->mallocFailed ) return;
if( pParse->nested ) return;
if( pParse->nErr ) return;
- if( !pParse->pVdbe ){
- if( pParse->rc==SQLITE_OK && pParse->nErr ){
- pParse->rc = SQLITE_ERROR;
- return;
- }
- }
/* Begin by generating some termination code at the end of the
** vdbe program
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
-** $Id: legacy.c,v 1.28 2008/07/28 19:34:53 drh Exp $
+** $Id: legacy.c,v 1.29 2008/08/02 03:50:39 drh Exp $
*/
#include "sqliteInt.h"
}
for(i=0; i<nCol; i++){
azCols[i] = (char *)sqlite3_column_name(pStmt, i);
- if( !azCols[i] ){
- db->mallocFailed = 1;
- goto exec_out;
- }
+ /* sqlite3VdbeSetColName() installs column names as UTF8
+ ** strings so there is no way for sqlite3_column_name() to fail. */
+ assert( azCols[i]!=0 );
}
nCallback++;
}
** This file contains code used to dynamically load extensions into
** the SQLite library.
**
-** $Id: loadext.c,v 1.52 2008/07/28 19:34:53 drh Exp $
+** $Id: loadext.c,v 1.53 2008/08/02 03:50:39 drh Exp $
*/
#ifndef SQLITE_CORE
}
/* Append the new shared library handle to the db->aExtension array. */
- db->nExtension++;
- aHandle = sqlite3DbMallocZero(db, sizeof(handle)*db->nExtension);
+ aHandle = sqlite3DbMallocZero(db, sizeof(handle)*(db->nExtension+1));
if( aHandle==0 ){
return SQLITE_NOMEM;
}
if( db->nExtension>0 ){
- memcpy(aHandle, db->aExtension, sizeof(handle)*(db->nExtension-1));
+ memcpy(aHandle, db->aExtension, sizeof(handle)*db->nExtension);
}
sqlite3DbFree(db, db->aExtension);
db->aExtension = aHandle;
- db->aExtension[db->nExtension-1] = handle;
+ db->aExtension[db->nExtension++] = handle;
return SQLITE_OK;
}
int sqlite3_load_extension(
** file simultaneously, or one process from reading the database while
** another is writing.
**
-** @(#) $Id: pager.c,v 1.468 2008/08/01 10:50:23 danielk1977 Exp $
+** @(#) $Id: pager.c,v 1.469 2008/08/02 03:50:39 drh Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
u32 change_counter;
int rc = SQLITE_OK;
+#ifndef SQLITE_ENABLE_ATOMIC_WRITE
+ assert( isDirect==0 ); /* isDirect is only true for atomic writes */
+#endif
if( !pPager->changeCountDone ){
/* Open page 1 of the file for writing. */
rc = sqlite3PagerGet(pPager, 1, &pPgHdr);
change_counter++;
put32bits(((char*)PGHDR_TO_DATA(pPgHdr))+24, change_counter);
+#ifdef SQLITE_ENABLE_ATOMIC_WRITE
if( isDirect && pPager->fd->pMethods ){
const void *zBuf = PGHDR_TO_DATA(pPgHdr);
rc = sqlite3OsWrite(pPager->fd, zBuf, pPager->pageSize, 0);
}
+#endif
/* Release the page reference. */
sqlite3PagerUnref(pPgHdr);
** interface, and routines that contribute to loading the database schema
** from disk.
**
-** $Id: prepare.c,v 1.90 2008/07/28 19:34:53 drh Exp $
+** $Id: prepare.c,v 1.91 2008/08/02 03:50:39 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
rc = sqlite3BtreeCursor(pDb->pBt, MASTER_ROOT, 0, 0, curMain);
if( rc!=SQLITE_OK && rc!=SQLITE_EMPTY ){
sqlite3SetString(pzErrMsg, db, "%s", sqlite3ErrStr(rc));
- goto leave_error_out;
+ goto initone_error_out;
}
/* Get the database meta information.
*/
if( rc==SQLITE_OK ){
int i;
- for(i=0; rc==SQLITE_OK && i<sizeof(meta)/sizeof(meta[0]); i++){
+ for(i=0; i<sizeof(meta)/sizeof(meta[0]); i++){
rc = sqlite3BtreeGetMeta(pDb->pBt, i+1, (u32 *)&meta[i]);
- }
- if( rc ){
- sqlite3SetString(pzErrMsg, db, "%s", sqlite3ErrStr(rc));
- goto leave_error_out;
+ if( rc ){
+ sqlite3SetString(pzErrMsg, db, "%s", sqlite3ErrStr(rc));
+ goto initone_error_out;
+ }
}
}else{
memset(meta, 0, sizeof(meta));
sqlite3SetString(pzErrMsg, db, "attached databases must use the same"
" text encoding as main database");
rc = SQLITE_ERROR;
- goto leave_error_out;
+ goto initone_error_out;
}
}
}else{
if( pDb->pSchema->file_format>SQLITE_MAX_FILE_FORMAT ){
sqlite3SetString(pzErrMsg, db, "unsupported file format");
rc = SQLITE_ERROR;
- goto leave_error_out;
+ goto initone_error_out;
}
/* Ticket #2804: When we open a database in the newer file format,
** curMain and calling sqlite3BtreeEnter(). For an error that occurs
** before that point, jump to error_out.
*/
-leave_error_out:
+initone_error_out:
sqlite3BtreeCloseCursor(curMain);
sqlite3_free(curMain);
sqlite3BtreeLeave(pDb->pBt);
** This file contains C code routines that are called by the parser
** to handle SELECT statements in SQLite.
**
-** $Id: select.c,v 1.461 2008/08/01 18:47:02 drh Exp $
+** $Id: select.c,v 1.462 2008/08/02 03:50:39 drh Exp $
*/
#include "sqliteInt.h"
/* Make sure there is no ORDER BY or LIMIT clause on prior SELECTs. Only
** the last (right-most) SELECT in the series may have an ORDER BY or LIMIT.
*/
- if( p==0 || p->pPrior==0 ){
- rc = 1;
- goto multi_select_end;
- }
+ assert( p && p->pPrior ); /* Calling function guarantees this much */
db = pParse->db;
pPrior = p->pPrior;
assert( pPrior->pRightmost!=pPrior );
goto multi_select_end;
}
- /* Make sure we have a valid query engine. If not, create a new one.
- */
v = sqlite3GetVdbe(pParse);
- if( v==0 ){
- rc = 1;
- goto multi_select_end;
- }
+ assert( v!=0 ); /* The VDBE already created by calling function */
/* Create the destination temporary table if necessary
*/
struct AggInfo_col *pCol = &sAggInfo.aCol[i];
if( pCol->iSorterColumn>=j ){
int r1 = j + regBase;
- int r2 = sqlite3ExprCodeGetColumn(pParse,
+#ifndef NDEBUG
+ int r2 =
+#endif
+ sqlite3ExprCodeGetColumn(pParse,
pCol->pTab, pCol->iColumn, pCol->iTable, r1, 0);
- if( r1!=r2 ){
- sqlite3VdbeAddOp2(v, OP_SCopy, r2, r1);
- }
j++;
+
+ /* sAggInfo.aCol[] only contains one entry per column. So
+ ** The reference to pCol->iColumn,pCol->iTable must have been
+ ** the first reference to that column. Hence,
+ ** sqliteExprCodeGetColumn is guaranteed to put the result in
+ ** the column requested.
+ */
+ assert( r1==r2 );
}
}
regRecord = sqlite3GetTempReg(pParse);
*************************************************************************
** Internal interface definitions for SQLite.
**
-** @(#) $Id: sqliteInt.h,v 1.749 2008/08/01 17:37:41 danielk1977 Exp $
+** @(#) $Id: sqliteInt.h,v 1.750 2008/08/02 03:50:39 drh Exp $
*/
#ifndef _SQLITEINT_H_
#define _SQLITEINT_H_
# define sqlite3VtabSync(X,Y) (Y)
# define sqlite3VtabRollback(X)
# define sqlite3VtabCommit(X)
-# define sqlite3VtabTransferError(A,B,C)
#else
void sqlite3VtabClear(Table*);
int sqlite3VtabSync(sqlite3 *db, char **);
int sqlite3VtabRollback(sqlite3 *db);
int sqlite3VtabCommit(sqlite3 *db);
- void sqlite3VtabTransferError(sqlite3 *db, int, sqlite3_vtab*);
#endif
void sqlite3VtabMakeWritable(Parse*,Table*);
void sqlite3VtabLock(sqlite3_vtab*);
** Code for testing all sorts of SQLite interfaces. This code
** implements new SQL functions used by the test scripts.
**
-** $Id: test_func.c,v 1.9 2008/07/31 01:47:11 shane Exp $
+** $Id: test_func.c,v 1.10 2008/08/02 03:50:39 drh Exp $
*/
#include "sqlite3.h"
#include "tcl.h"
int objc,
Tcl_Obj *CONST objv[]
){
- sqlite3_auto_extension((void*)registerTestFunctions);
+ int rc = sqlite3_auto_extension((void*)registerTestFunctions);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
return TCL_OK;
}
*************************************************************************
** Test extension for testing the sqlite3_load_extension() function.
**
-** $Id: test_loadext.c,v 1.2 2008/06/19 15:44:00 drh Exp $
+** $Id: test_loadext.c,v 1.3 2008/08/02 03:50:39 drh Exp $
*/
#include <string.h>
#include "sqlite3ext.h"
char **pzErrMsg,
const sqlite3_api_routines *pApi
){
+ int nErr = 0;
SQLITE_EXTENSION_INIT2(pApi);
- sqlite3_create_function(db, "half", 1, SQLITE_ANY, 0, halfFunc, 0, 0);
- sqlite3_create_function(db, "sqlite3_status", 1, SQLITE_ANY, 0,
+ nErr |= sqlite3_create_function(db, "half", 1, SQLITE_ANY, 0, halfFunc, 0, 0);
+ nErr |= sqlite3_create_function(db, "sqlite3_status", 1, SQLITE_ANY, 0,
statusFunc, 0, 0);
- sqlite3_create_function(db, "sqlite3_status", 2, SQLITE_ANY, 0,
+ nErr |= sqlite3_create_function(db, "sqlite3_status", 2, SQLITE_ANY, 0,
statusFunc, 0, 0);
- return 0;
+ return nErr ? SQLITE_ERROR : SQLITE_OK;
}
/*
** 6000 lines long) it was split up into several smaller files and
** this header information was factored out.
**
-** $Id: vdbeInt.h,v 1.152 2008/07/30 13:14:55 drh Exp $
+** $Id: vdbeInt.h,v 1.153 2008/08/02 03:50:39 drh Exp $
*/
#ifndef _VDBEINT_H_
#define _VDBEINT_H_
Mem *pResultSet; /* Pointer to an array of results */
u8 explain; /* True if EXPLAIN present on SQL command */
u8 changeCntOn; /* True to update the change-counter */
- u8 aborted; /* True if ROLLBACK in another VM causes an abort */
u8 expired; /* True if the VM needs to be recompiled */
u8 minWriteFileFormat; /* Minimum file format for writable database files */
u8 inVtabMethod; /* See comments above */
** This file contains code use to implement APIs that are part of the
** VDBE.
**
-** $Id: vdbeapi.c,v 1.137 2008/08/01 20:10:08 drh Exp $
+** $Id: vdbeapi.c,v 1.138 2008/08/02 03:50:39 drh Exp $
*/
#include "sqliteInt.h"
#include "vdbeInt.h"
db = p->db;
assert( !db->mallocFailed );
- if( p->aborted ){
- return SQLITE_ABORT;
- }
if( p->pc<=0 && p->expired ){
if( p->rc==SQLITE_OK ){
p->rc = SQLITE_SCHEMA;
** to version 2.8.7, all this code was combined into the vdbe.c source file.
** But that file was getting too big so this subroutines were split out.
**
-** $Id: vdbeaux.c,v 1.404 2008/08/01 20:10:08 drh Exp $
+** $Id: vdbeaux.c,v 1.405 2008/08/02 03:50:39 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
}
#endif
p->magic = VDBE_MAGIC_INIT;
- p->aborted = 0;
return p->rc & db->errMask;
}
*************************************************************************
** This file contains code used to help implement virtual tables.
**
-** $Id: vtab.c,v 1.73 2008/08/01 17:37:41 danielk1977 Exp $
+** $Id: vtab.c,v 1.74 2008/08/02 03:50:39 drh Exp $
*/
#ifndef SQLITE_OMIT_VIRTUALTABLE
#include "sqliteInt.h"
}
rc = pMod->xFindFunction(pVtab, nArg, zLowerName, &xFunc, &pArg);
sqlite3DbFree(db, zLowerName);
- sqlite3VtabTransferError(db, rc, pVtab);
+ if( pVtab->zErrMsg ){
+ sqlite3Error(db, rc, "%s", pVtab->zErrMsg);
+ sqlite3DbFree(db, pVtab->zErrMsg);
+ pVtab->zErrMsg = 0;
+ }
}
if( rc==0 ){
return pDef;
}
}
-/*
-** Transfer a virtual table error into the database connection.
-*/
-void sqlite3VtabTransferError(sqlite3 *db, int rc, sqlite3_vtab *pVtab){
- if( pVtab->zErrMsg ){
- sqlite3Error(db, rc, "%s", pVtab->zErrMsg);
- sqlite3DbFree(db, pVtab->zErrMsg);
- pVtab->zErrMsg = 0;
- }
-}
-
#endif /* SQLITE_OMIT_VIRTUALTABLE */
# This file implements regression tests for SQLite library. The
# focus of this file is testing the SELECT statement.
#
-# $Id: autovacuum.test,v 1.26 2007/04/07 15:03:17 danielk1977 Exp $
+# $Id: autovacuum.test,v 1.27 2008/08/02 03:50:39 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
expr {[file size test.db] / 1024}
} {286}
+#------------------------------------------------------------------------
+# Additional tests.
+#
+# Try to determine the autovacuum setting for a database that is locked.
+#
+do_test autovacuum-8.1 {
+ db close
+ sqlite3 db test.db
+ sqlite3 db2 test.db
+ db eval {PRAGMA auto_vacuum}
+} {1}
+do_test autovacuum-8.2 {
+ db eval {BEGIN EXCLUSIVE}
+ catchsql {PRAGMA auto_vacuum} db2
+} {1 {database is locked}}
+catch {db2 close}
+catch {db eval {COMMIT}}
+
+
finish_test
# focus of this file is testing the LIMIT ... OFFSET ... clause
# of SELECT statements.
#
-# $Id: limit.test,v 1.31 2008/01/16 18:20:42 danielk1977 Exp $
+# $Id: limit.test,v 1.32 2008/08/02 03:50:39 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
} {}
} ;# ifcapable subquery
+# Test error processing.
+#
+do_test limit-12.1 {
+ catchsql {
+ SELECT * FROM t1 LIMIT replace(1)
+ }
+} {1 {wrong number of arguments to function replace()}}
+do_test limit-12.2 {
+ catchsql {
+ SELECT * FROM t1 LIMIT 5 OFFSET replace(1)
+ }
+} {1 {wrong number of arguments to function replace()}}
+do_test limit-12.3 {
+ catchsql {
+ SELECT * FROM t1 LIMIT x
+ }
+} {1 {no such column: x}}
+do_test limit-12.4 {
+ catchsql {
+ SELECT * FROM t1 LIMIT 1 OFFSET x
+ }
+} {1 {no such column: x}}
+
+
finish_test
# This file implements regression tests for SQLite library. The
# focus of this script is extension loading.
#
-# $Id: loadext.test,v 1.13 2008/06/30 15:09:29 danielk1977 Exp $
+# $Id: loadext.test,v 1.14 2008/08/02 03:50:39 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
}
} {1 {not authorized}}
+source $testdir/malloc_common.tcl
+# Malloc failure in sqlite3_auto_extension and sqlite3_load_extension
+#
+do_malloc_test loadext-5 -tclprep {
+ sqlite3_reset_auto_extension
+} -tclbody {
+ if {[autoinstall_test_functions]==7} {error "out of memory"}
+}
+do_malloc_test loadext-6 -tclbody {
+ db enable_load_extension 1
+ sqlite3_load_extension db $::testextension testloadext_init
+}
+autoinstall_test_functions
+
finish_test
--- /dev/null
+# 2008 August 01
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+# This test script checks malloc failures in various obscure operations.
+#
+# $Id: mallocI.test,v 1.1 2008/08/02 03:50:39 drh Exp $
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+source $testdir/malloc_common.tcl
+
+# Malloc failures in a view.
+#
+do_malloc_test mallocI-1 -sqlprep {
+ CREATE TABLE t1(a,b,c,d);
+ CREATE VIEW v1 AS SELECT a*b, c*d FROM t1 ORDER BY b-d;
+} -sqlbody {
+ SELECT * FROM v1
+}
+
+# Malloc failure while trying to service a pragma on a TEMP database.
+#
+do_malloc_test mallocI-2 -sqlbody {
+ PRAGMA temp.page_size
+}
+
+# Malloc failure while creating a table from a SELECT statement.
+#
+do_malloc_test mallocI-3 -sqlprep {
+ CREATE TABLE t1(a,b,c);
+} -sqlbody {
+ CREATE TABLE t2 AS SELECT b,c FROM t1;
+}
+
+finish_test
#***********************************************************************
# This file implements regression tests for SQLite library.
#
-# $Id: misc7.test,v 1.22 2008/08/01 15:06:30 drh Exp $
+# $Id: misc7.test,v 1.23 2008/08/02 03:50:40 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
sqlite3 db test.db
ifcapable explain {
- do_test misc7-14 {
+ do_test misc7-14.1 {
execsql {
CREATE TABLE abc(a PRIMARY KEY, b, c);
}
EXPLAIN QUERY PLAN SELECT * FROM abc AS t2 WHERE rowid = 1;
}
} {0 0 {TABLE abc AS t2 USING PRIMARY KEY}}
- do_test misc7-15 {
+ do_test misc7-14.2 {
execsql {
EXPLAIN QUERY PLAN SELECT * FROM abc AS t2 WHERE a = 1;
}
} {0 0 {TABLE abc AS t2 WITH INDEX sqlite_autoindex_abc_1}}
+ do_test misc7-14.3 {
+ execsql {
+ EXPLAIN QUERY PLAN SELECT * FROM abc AS t2 ORDER BY a;
+ }
+ } {0 0 {TABLE abc AS t2 WITH INDEX sqlite_autoindex_abc_1 ORDER BY}}
}
db close
# focus of this file is testing aggregate functions and the
# GROUP BY and HAVING clauses of SELECT statements.
#
-# $Id: select5.test,v 1.17 2008/01/16 18:20:42 danielk1977 Exp $
+# $Id: select5.test,v 1.18 2008/08/02 03:50:40 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
# Some tests for queries with a GROUP BY clause but no aggregate functions.
#
-# Note: The query in test case 5-5.5 are not legal SQL. So if the
+# Note: The query in test cases 5.1 through 5.5 are not legal SQL. So if the
# implementation changes in the future and it returns different results,
# this is not such a big deal.
#
}
} {1 4 6 4}
+# Test rendering of columns for the GROUP BY clause.
+#
+do_test select5-5.11 {
+breakpoint
+ execsql {
+ SELECT max(c), b*a, b, a FROM t2 GROUP BY b*a, b, a
+ }
+} {3 2 2 1 5 4 4 1 7 24 4 6}
+
# NULL compare equal to each other for the purposes of processing
# the GROUP BY clause.
#
# focus of this file is changing the database page size using a
# VACUUM statement.
#
-# $Id: vacuum3.test,v 1.6 2008/07/12 14:52:21 drh Exp $
+# $Id: vacuum3.test,v 1.7 2008/08/02 03:50:40 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
PRAGMA page_size = 512;
VACUUM;
}
+ do_malloc_test vacuum3-malloc-2 -sqlprep {
+ PRAGMA encoding=UTF16;
+ CREATE TABLE t1(a, b, c);
+ INSERT INTO t1 VALUES(1, 2, 3);
+ CREATE TABLE t2(x,y,z);
+ INSERT INTO t2 SELECT * FROM t1;
+ } -sqlbody {
+ VACUUM;
+ }
}
finish_test