summaryrefslogtreecommitdiff
path: root/lang/sql/adapter/sqlite-patches
diff options
context:
space:
mode:
Diffstat (limited to 'lang/sql/adapter/sqlite-patches')
-rw-r--r--lang/sql/adapter/sqlite-patches/01_sqlite_excl_test.patch87
-rw-r--r--lang/sql/adapter/sqlite-patches/02_sqlite_test.patch332
-rw-r--r--lang/sql/adapter/sqlite-patches/03_editline.patch126
-rw-r--r--lang/sql/adapter/sqlite-patches/04_build_config.patch8
-rw-r--r--lang/sql/adapter/sqlite-patches/05_shell_config.patch4
-rw-r--r--lang/sql/adapter/sqlite-patches/07_shell_prompt.patch10
-rw-r--r--lang/sql/adapter/sqlite-patches/08_errno_header.patch16
-rw-r--r--lang/sql/adapter/sqlite-patches/09_comment_tests.patch70
-rw-r--r--lang/sql/adapter/sqlite-patches/10_compile_options.patch2
-rw-r--r--lang/sql/adapter/sqlite-patches/11_android_shell.patch6
-rw-r--r--lang/sql/adapter/sqlite-patches/12_e_fts3_test.patch2
-rw-r--r--lang/sql/adapter/sqlite-patches/13_malloc_test.patch12
-rw-r--r--lang/sql/adapter/sqlite-patches/14_custom_pragma.patch41
-rw-r--r--lang/sql/adapter/sqlite-patches/15_bdb_stat.patch18
-rw-r--r--lang/sql/adapter/sqlite-patches/16_bdb_deadlock.patch28
-rw-r--r--lang/sql/adapter/sqlite-patches/17_encryption.patch26
-rw-r--r--lang/sql/adapter/sqlite-patches/18_vacuum_test.patch6
-rw-r--r--lang/sql/adapter/sqlite-patches/19_backup_test.patch147
-rw-r--r--lang/sql/adapter/sqlite-patches/22_unique_key.patch79
-rw-r--r--lang/sql/adapter/sqlite-patches/23_sequence_functions.patch76
-rw-r--r--lang/sql/adapter/sqlite-patches/24_exclusive_error_handling.patch52
-rw-r--r--lang/sql/adapter/sqlite-patches/25_tester.patch269
-rw-r--r--lang/sql/adapter/sqlite-patches/26_solaris_build.patch4
-rw-r--r--lang/sql/adapter/sqlite-patches/27_sqlthread.patch97
-rw-r--r--lang/sql/adapter/sqlite-patches/28_wal_pragma.patch21
-rw-r--r--lang/sql/adapter/sqlite-patches/29_manydb_test.patch2
-rw-r--r--lang/sql/adapter/sqlite-patches/30_handle_cache.patch35
-rw-r--r--lang/sql/adapter/sqlite-patches/31_eqp_test.patch18
-rw-r--r--lang/sql/adapter/sqlite-patches/32_permutations_test.patch63
-rw-r--r--lang/sql/adapter/sqlite-patches/33_vdbe_assert.patch27
30 files changed, 651 insertions, 1033 deletions
diff --git a/lang/sql/adapter/sqlite-patches/01_sqlite_excl_test.patch b/lang/sql/adapter/sqlite-patches/01_sqlite_excl_test.patch
deleted file mode 100644
index 8e69044e..00000000
--- a/lang/sql/adapter/sqlite-patches/01_sqlite_excl_test.patch
+++ /dev/null
@@ -1,87 +0,0 @@
---- test/tester.tcl
-+++ test/tester.tcl
-@@ -266,16 +266,21 @@
- proc set_test_counter {counter args} {
- if {[llength $args]} {
- set ::TC($counter) [lindex $args 0]
- }
- set ::TC($counter)
- }
- }
-
-+# Pull in the list of test cases that are excluded and ignored when running
-+# with Berkeley DB.
-+#
-+source $testdir/../../../../test/sql/bdb_excl.test
-+
- # Record the fact that a sequence of tests were omitted.
- #
- proc omit_test {name reason} {
- set omitList [set_test_counter omit_list]
- lappend omitList [list $name $reason]
- set_test_counter omit_list $omitList
- }
-
-@@ -300,22 +305,29 @@
- set_test_counter count [expr [set_test_counter count] + 1]
- }
-
-
- # Invoke the do_test procedure to run a single test
- #
- proc do_test {name cmd expected} {
-
-- global argv cmdlinearg
-+ global argv cmdlinearg IGNORE_CASES EXCLUDE_CASES
-
- fix_testname name
-
- sqlite3_memdebug_settitle $name
-
-+ foreach pattern $EXCLUDE_CASES {
-+ if {[string match $pattern $name]} {
-+ puts "$name... Skipping"
-+ flush stdout
-+ return
-+ }
-+ }
- # if {[llength $argv]==0} {
- # set go 1
- # } else {
- # set go 0
- # foreach pattern $argv {
- # if {[string match $pattern $name]} {
- # set go 1
- # break
-@@ -329,18 +341,29 @@
-
- incr_ntest
- puts -nonewline $name...
- flush stdout
- if {[catch {uplevel #0 "$cmd;\n"} result]} {
- puts "\nError: $result"
- fail_test $name
- } elseif {[string compare $result $expected]} {
-- puts "\nExpected: \[$expected\]\n Got: \[$result\]"
-- fail_test $name
-+ set ignore 0
-+ foreach pattern $IGNORE_CASES {
-+ if {[string match $pattern $name]} {
-+ set ignore 1
-+ break
-+ }
-+ }
-+ if {$ignore} {
-+ puts " Ignored"
-+ } else {
-+ puts "\nExpected: \[$expected\]\n Got: \[$result\]"
-+ fail_test $name
-+ }
- } else {
- puts " Ok"
- }
- flush stdout
- }
-
- proc fix_testname {varname} {
- upvar $varname testname
diff --git a/lang/sql/adapter/sqlite-patches/02_sqlite_test.patch b/lang/sql/adapter/sqlite-patches/02_sqlite_test.patch
index fb6eabcb..7b431308 100644
--- a/lang/sql/adapter/sqlite-patches/02_sqlite_test.patch
+++ b/lang/sql/adapter/sqlite-patches/02_sqlite_test.patch
@@ -1,44 +1,15 @@
---- src/tclsqlite.c
-+++ src/tclsqlite.c
-@@ -761,7 +761,7 @@
- case SQLITE_INTEGER: {
- sqlite_int64 v = sqlite3_value_int64(pIn);
- if( v>=-2147483647 && v<=2147483647 ){
-- pVal = Tcl_NewIntObj(v);
-+ pVal = Tcl_NewIntObj((int)v);
- }else{
- pVal = Tcl_NewWideIntObj(v);
- }
-@@ -1441,7 +1441,7 @@
- case SQLITE_INTEGER: {
- sqlite_int64 v = sqlite3_column_int64(pStmt, iCol);
- if( v>=-2147483647 && v<=2147483647 ){
-- return Tcl_NewIntObj(v);
-+ return Tcl_NewIntObj((int)v);
- }else{
- return Tcl_NewWideIntObj(v);
- }
--- src/test1.c
+++ src/test1.c
-@@ -3207,7 +3207,7 @@
- char *value;
- int rc;
-
-- void (*xDel)() = (objc==6?SQLITE_STATIC:SQLITE_TRANSIENT);
-+ void (*xDel)(void*) = (objc==6?SQLITE_STATIC:SQLITE_TRANSIENT);
- Tcl_Obj *oStmt = objv[objc-4];
- Tcl_Obj *oN = objv[objc-3];
- Tcl_Obj *oString = objv[objc-2];
-@@ -3555,7 +3555,7 @@
+@@ -3626,7 +3626,7 @@
if( bytes>=0 ){
- bytes = bytes - (zTail-zSql);
+ bytes = bytes - (int)(zTail-zSql);
}
-- if( strlen(zTail)<bytes ){
-+ if(bytes>-1 && strlen(zTail)<(unsigned int)bytes ){
- bytes = strlen(zTail);
+- if( (int)strlen(zTail)<bytes ){
++ if(bytes>-1 && (int)strlen(zTail)<(unsigned int)bytes ){
+ bytes = (int)strlen(zTail);
}
Tcl_ObjSetVar2(interp, objv[4], 0, Tcl_NewStringObj(zTail, bytes), 0);
-@@ -5389,8 +5389,6 @@
+@@ -6297,8 +6297,6 @@
extern int sqlite3_hostid_num;
#endif
extern int sqlite3_max_blobsize;
@@ -47,7 +18,7 @@
static struct {
char *zName;
Tcl_CmdProc *xProc;
-@@ -5554,7 +5552,6 @@
+@@ -6486,7 +6486,6 @@
{ "tcl_variable_type", tcl_variable_type, 0 },
#ifndef SQLITE_OMIT_SHARED_CACHE
{ "sqlite3_enable_shared_cache", test_enable_shared, 0 },
@@ -57,20 +28,18 @@
#ifdef SQLITE_ENABLE_COLUMN_METADATA
--- src/test2.c
+++ src/test2.c
-@@ -19,6 +19,7 @@
- #include <string.h>
- #include <ctype.h>
+@@ -21,475 +21,14 @@
+
+ extern const char *sqlite3ErrName(int);
+#ifndef SQLITE_OMIT_DISKIO
++
/*
- ** Interpret an SQLite error number
- */
-@@ -53,470 +54,6 @@
** Page size and reserved size used for testing.
*/
static int test_pagesize = 1024;
--
--/*
+
+ /*
-** Dummy page reinitializer
-*/
-static void pager_test_reiniter(DbPage *pNotUsed){
@@ -103,7 +72,7 @@
- SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_MAIN_DB,
- pager_test_reiniter);
- if( rc!=SQLITE_OK ){
-- Tcl_AppendResult(interp, errorName(rc), 0);
+- Tcl_AppendResult(interp, sqlite3ErrName(rc), 0);
- return TCL_ERROR;
- }
- sqlite3PagerSetCachesize(pPager, nPage);
@@ -135,7 +104,7 @@
- pPager = sqlite3TestTextToPtr(argv[1]);
- rc = sqlite3PagerClose(pPager);
- if( rc!=SQLITE_OK ){
-- Tcl_AppendResult(interp, errorName(rc), 0);
+- Tcl_AppendResult(interp, sqlite3ErrName(rc), 0);
- return TCL_ERROR;
- }
- return TCL_OK;
@@ -162,7 +131,7 @@
- pPager = sqlite3TestTextToPtr(argv[1]);
- rc = sqlite3PagerRollback(pPager);
- if( rc!=SQLITE_OK ){
-- Tcl_AppendResult(interp, errorName(rc), 0);
+- Tcl_AppendResult(interp, sqlite3ErrName(rc), 0);
- return TCL_ERROR;
- }
- return TCL_OK;
@@ -189,12 +158,12 @@
- pPager = sqlite3TestTextToPtr(argv[1]);
- rc = sqlite3PagerCommitPhaseOne(pPager, 0, 0);
- if( rc!=SQLITE_OK ){
-- Tcl_AppendResult(interp, errorName(rc), 0);
+- Tcl_AppendResult(interp, sqlite3ErrName(rc), 0);
- return TCL_ERROR;
- }
- rc = sqlite3PagerCommitPhaseTwo(pPager);
- if( rc!=SQLITE_OK ){
-- Tcl_AppendResult(interp, errorName(rc), 0);
+- Tcl_AppendResult(interp, sqlite3ErrName(rc), 0);
- return TCL_ERROR;
- }
- return TCL_OK;
@@ -221,7 +190,7 @@
- pPager = sqlite3TestTextToPtr(argv[1]);
- rc = sqlite3PagerOpenSavepoint(pPager, 1);
- if( rc!=SQLITE_OK ){
-- Tcl_AppendResult(interp, errorName(rc), 0);
+- Tcl_AppendResult(interp, sqlite3ErrName(rc), 0);
- return TCL_ERROR;
- }
- return TCL_OK;
@@ -249,7 +218,7 @@
- rc = sqlite3PagerSavepoint(pPager, SAVEPOINT_ROLLBACK, 0);
- sqlite3PagerSavepoint(pPager, SAVEPOINT_RELEASE, 0);
- if( rc!=SQLITE_OK ){
-- Tcl_AppendResult(interp, errorName(rc), 0);
+- Tcl_AppendResult(interp, sqlite3ErrName(rc), 0);
- return TCL_ERROR;
- }
- return TCL_OK;
@@ -276,7 +245,7 @@
- pPager = sqlite3TestTextToPtr(argv[1]);
- rc = sqlite3PagerSavepoint(pPager, SAVEPOINT_RELEASE, 0);
- if( rc!=SQLITE_OK ){
-- Tcl_AppendResult(interp, errorName(rc), 0);
+- Tcl_AppendResult(interp, sqlite3ErrName(rc), 0);
- return TCL_ERROR;
- }
- return TCL_OK;
@@ -369,7 +338,7 @@
- rc = sqlite3PagerGet(pPager, pgno, &pPage);
- }
- if( rc!=SQLITE_OK ){
-- Tcl_AppendResult(interp, errorName(rc), 0);
+- Tcl_AppendResult(interp, sqlite3ErrName(rc), 0);
- return TCL_ERROR;
- }
- sqlite3_snprintf(sizeof(zBuf),zBuf,"%p",pPage);
@@ -523,7 +492,7 @@
- pPage = (DbPage *)sqlite3TestTextToPtr(argv[1]);
- rc = sqlite3PagerWrite(pPage);
- if( rc!=SQLITE_OK ){
-- Tcl_AppendResult(interp, errorName(rc), 0);
+- Tcl_AppendResult(interp, sqlite3ErrName(rc), 0);
- return TCL_ERROR;
- }
- pData = sqlite3PagerGetData(pPage);
@@ -533,10 +502,11 @@
-}
-
-#ifndef SQLITE_OMIT_DISKIO
- /*
- ** Usage: fake_big_file N FILENAME
- **
-@@ -544,6 +77,12 @@
+-/*
+ ** Usage: fake_big_file N FILENAME
+ **
+ ** Write a few bytes at the N megabyte point of FILENAME. This will
+@@ -518,6 +57,12 @@
}
if( Tcl_GetInt(interp, argv[1], &n) ) return TCL_ERROR;
@@ -547,9 +517,9 @@
+ return TCL_ERROR;
+
pVfs = sqlite3_vfs_find(0);
- rc = sqlite3OsOpenMalloc(pVfs, argv[2], &fd,
- (SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE|SQLITE_OPEN_MAIN_DB), 0
-@@ -564,31 +103,6 @@
+ nFile = (int)strlen(argv[2]);
+ zFile = sqlite3_malloc( nFile+2 );
+@@ -545,31 +90,6 @@
}
#endif
@@ -581,7 +551,7 @@
/*
** sqlite3BitvecBuiltinTest SIZE PROGRAM
**
-@@ -623,58 +137,49 @@
+@@ -604,58 +124,49 @@
return TCL_OK;
}
@@ -681,10 +651,10 @@
+ return TCL_OK;
+}
+
+ extern const char *sqlite3ErrName(int);
+
/*
- ** Interpret an SQLite error number
- */
-@@ -355,36 +364,6 @@
+@@ -339,36 +348,6 @@
}
/*
@@ -721,7 +691,7 @@
** Usage: btree_payload_size ID
**
** Return the number of bytes of payload
-@@ -396,8 +375,7 @@
+@@ -380,8 +359,7 @@
const char **argv /* Text of each argument */
){
BtCursor *pCur;
@@ -731,7 +701,7 @@
char zBuf[50];
if( argc!=2 ){
-@@ -410,103 +388,13 @@
+@@ -394,103 +372,13 @@
/* The cursor may be in "require-seek" state. If this is the case, the
** call to BtreeDataSize() will fix it. */
@@ -784,7 +754,7 @@
- if( Tcl_GetInt(interp, argv[4], (int*)&incr) ) return TCL_ERROR;
- in = start;
- in *= mult;
-- for(i=0; i<count; i++){
+- for(i=0; i<(int)count; i++){
- char zErr[200];
- n1 = putVarint(zBuf, in);
- if( n1>9 || n1<1 ){
@@ -837,7 +807,7 @@
** usage: btree_from_db DB-HANDLE
**
** This command returns the btree handle for the main database associated
-@@ -551,67 +439,6 @@
+@@ -535,67 +423,6 @@
}
/*
@@ -905,89 +875,24 @@
** Register commands with the TCL interpreter.
*/
int Sqlitetest3_Init(Tcl_Interp *interp){
-@@ -622,17 +449,17 @@
- { "btree_open", (Tcl_CmdProc*)btree_open },
- { "btree_close", (Tcl_CmdProc*)btree_close },
- { "btree_begin_transaction", (Tcl_CmdProc*)btree_begin_transaction },
-- { "btree_pager_stats", (Tcl_CmdProc*)btree_pager_stats },
-+ { "btree_pager_stats", (Tcl_CmdProc*)btree_pager_stats },
+@@ -610,13 +437,13 @@
{ "btree_cursor", (Tcl_CmdProc*)btree_cursor },
{ "btree_close_cursor", (Tcl_CmdProc*)btree_close_cursor },
{ "btree_next", (Tcl_CmdProc*)btree_next },
- { "btree_eof", (Tcl_CmdProc*)btree_eof },
-- { "btree_payload_size", (Tcl_CmdProc*)btree_payload_size },
-+ { "btree_eof", (Tcl_CmdProc*)t3_tcl_function_stub },
-+ { "btree_payload_size", (Tcl_CmdProc*)btree_payload_size },
++ { "btree_eof", (Tcl_CmdProc*)t3_tcl_function_stub },
+ { "btree_payload_size", (Tcl_CmdProc*)btree_payload_size },
{ "btree_first", (Tcl_CmdProc*)btree_first },
- { "btree_varint_test", (Tcl_CmdProc*)btree_varint_test },
-- { "btree_from_db", (Tcl_CmdProc*)btree_from_db },
++ { "btree_varint_test", (Tcl_CmdProc*)t3_tcl_function_stub },
+ { "btree_from_db", (Tcl_CmdProc*)btree_from_db },
- { "btree_ismemdb", (Tcl_CmdProc*)btree_ismemdb },
- { "btree_set_cache_size", (Tcl_CmdProc*)btree_set_cache_size }
-+ { "btree_varint_test", (Tcl_CmdProc*)t3_tcl_function_stub },
-+ { "btree_from_db", (Tcl_CmdProc*)btree_from_db },
-+ { "btree_ismemdb", (Tcl_CmdProc*)t3_tcl_function_stub },
-+ { "btree_set_cache_size", (Tcl_CmdProc*)t3_tcl_function_stub }
++ { "btree_ismemdb", (Tcl_CmdProc*)t3_tcl_function_stub },
++ { "btree_set_cache_size", (Tcl_CmdProc*)t3_tcl_function_stub }
};
int i;
---- src/test6.c
-+++ src/test6.c
-@@ -177,7 +177,7 @@
- iSkip = 512;
- }
- if( (iAmt-iSkip)>0 ){
-- rc = sqlite3OsWrite(p->pRealFile, &z[iSkip], iAmt-iSkip, iOff+iSkip);
-+ rc = sqlite3OsWrite(p->pRealFile, &z[iSkip], (int)iAmt-iSkip, iOff+iSkip);
- }
- return rc;
- }
-@@ -306,8 +306,8 @@
- }
- case 3: { /* Trash sectors */
- u8 *zGarbage;
-- int iFirst = (pWrite->iOffset/g.iSectorSize);
-- int iLast = (pWrite->iOffset+pWrite->nBuf-1)/g.iSectorSize;
-+ int iFirst = ((int)pWrite->iOffset/g.iSectorSize);
-+ int iLast = ((int)pWrite->iOffset+pWrite->nBuf-1)/g.iSectorSize;
-
- assert(pWrite->zBuf);
-
-@@ -430,7 +430,7 @@
- ){
- CrashFile *pCrash = (CrashFile *)pFile;
- if( iAmt+iOfst>pCrash->iSize ){
-- pCrash->iSize = iAmt+iOfst;
-+ pCrash->iSize = iAmt+(int)iOfst;
- }
- while( pCrash->iSize>pCrash->nData ){
- u8 *zNew;
-@@ -454,7 +454,7 @@
- CrashFile *pCrash = (CrashFile *)pFile;
- assert(size>=0);
- if( pCrash->iSize>size ){
-- pCrash->iSize = size;
-+ pCrash->iSize = (int)size;
- }
- return writeListAppend(pFile, size, 0, 0);
- }
-@@ -612,7 +612,7 @@
- ** never contains valid data anyhow. So avoid doing such a read here.
- */
- const int isDb = (flags&SQLITE_OPEN_MAIN_DB);
-- i64 iChunk = pWrapper->iSize;
-+ int iChunk = pWrapper->iSize;
- if( iChunk>PENDING_BYTE && isDb ){
- iChunk = PENDING_BYTE;
- }
-@@ -620,7 +620,7 @@
- rc = sqlite3OsRead(pReal, pWrapper->zData, iChunk, 0);
- if( SQLITE_OK==rc && pWrapper->iSize>(PENDING_BYTE+512) && isDb ){
- i64 iOff = PENDING_BYTE+512;
-- iChunk = pWrapper->iSize - iOff;
-+ iChunk = pWrapper->iSize - (int)iOff;
- rc = sqlite3OsRead(pReal, &pWrapper->zData[iOff], iChunk, iOff);
- }
- }else{
--- src/test_btree.c
+++ src/test_btree.c
@@ -13,50 +13,3 @@
@@ -1014,7 +919,7 @@
- BtShared *pBt;
- Tcl_Obj *pRet = Tcl_NewObj();
- for(pBt=GLOBAL(BtShared*,sqlite3SharedCacheList); pBt; pBt=pBt->pNext){
-- const char *zFile = sqlite3PagerFilename(pBt->pPager);
+- const char *zFile = sqlite3PagerFilename(pBt->pPager, 1);
- Tcl_ListObjAppendElement(interp, pRet, Tcl_NewStringObj(zFile, -1));
- Tcl_ListObjAppendElement(interp, pRet, Tcl_NewIntObj(pBt->nRef));
- }
@@ -1041,155 +946,14 @@
- }
-#endif
-}
---- src/test_journal.c
-+++ src/test_journal.c
-@@ -136,7 +136,7 @@
- */
- static int jtClose(sqlite3_file*);
- static int jtRead(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
--static int jtWrite(sqlite3_file*,const void*,int iAmt, sqlite3_int64 iOfst);
-+static int jtWrite(sqlite3_file*,const void*, int iAmt, sqlite3_int64 iOfst);
- static int jtTruncate(sqlite3_file*, sqlite3_int64 size);
- static int jtSync(sqlite3_file*, int flags);
- static int jtFileSize(sqlite3_file*, sqlite3_int64 *pSize);
-@@ -405,7 +405,7 @@
-
- /* Calculate and store a checksum for each page in the database file. */
- if( rc==SQLITE_OK ){
-- int ii;
-+ unsigned int ii;
- for(ii=0; rc==SQLITE_OK && ii<pMain->nPage; ii++){
- i64 iOff = (i64)(pMain->nPagesize) * (i64)ii;
- if( iOff==PENDING_BYTE ) continue;
-@@ -467,7 +467,7 @@
- continue;
- }
- }
-- nRec = (iSize-iOff) / (pMain->nPagesize+8);
-+ nRec = (u32)((iSize-iOff) / (pMain->nPagesize+8));
- }
-
- /* Read all the records that follow the journal-header just read. */
-@@ -539,7 +539,7 @@
- }
-
- if( p->flags&SQLITE_OPEN_MAIN_DB && p->pWritable ){
-- if( iAmt<p->nPagesize
-+ if( (u32)iAmt<p->nPagesize
- && p->nPagesize%iAmt==0
- && iOfst>=(PENDING_BYTE+512)
- && iOfst+iAmt<=PENDING_BYTE+p->nPagesize
-@@ -550,7 +550,7 @@
- ** pending-byte page.
- */
- }else{
-- u32 pgno = iOfst/p->nPagesize + 1;
-+ u32 pgno = (u32)(iOfst/p->nPagesize + 1);
- assert( (iAmt==1||iAmt==p->nPagesize) && ((iOfst+iAmt)%p->nPagesize)==0 );
- assert( pgno<=p->nPage || p->nSync>0 );
- assert( pgno>p->nPage || sqlite3BitvecTest(p->pWritable, pgno) );
-@@ -579,7 +579,7 @@
- if( p->flags&SQLITE_OPEN_MAIN_DB && p->pWritable ){
- u32 pgno;
- u32 locking_page = (u32)(PENDING_BYTE/p->nPagesize+1);
-- for(pgno=size/p->nPagesize+1; pgno<=p->nPage; pgno++){
-+ for(pgno=(u32)(size/p->nPagesize+1); pgno<=p->nPage; pgno++){
- assert( pgno==locking_page || sqlite3BitvecTest(p->pWritable, pgno) );
- }
- }
--- src/test_malloc.c
+++ src/test_malloc.c
@@ -749,7 +749,7 @@
int isNew;
int aKey[MALLOC_LOG_KEYINTS];
-- int nKey = sizeof(int)*MALLOC_LOG_KEYINTS;
+- unsigned int nKey = sizeof(int)*MALLOC_LOG_KEYINTS;
+ unsigned int nKey = sizeof(int)*MALLOC_LOG_FRAMES;
memset(aKey, 0, nKey);
if( (sizeof(void*)*nFrame)<nKey ){
---- src/test_onefile.c
-+++ src/test_onefile.c
-@@ -288,7 +288,7 @@
- ){
- tmp_file *pTmp = (tmp_file *)pFile;
- if( (iAmt+iOfst)>pTmp->nAlloc ){
-- int nNew = 2*(iAmt+iOfst+pTmp->nAlloc);
-+ int nNew = 2*(iAmt+(int)iOfst+pTmp->nAlloc);
- char *zNew = sqlite3_realloc(pTmp->zAlloc, nNew);
- if( !zNew ){
- return SQLITE_NOMEM;
-@@ -297,7 +297,7 @@
- pTmp->nAlloc = nNew;
- }
- memcpy(&pTmp->zAlloc[iOfst], zBuf, iAmt);
-- pTmp->nSize = MAX(pTmp->nSize, iOfst+iAmt);
-+ pTmp->nSize = (int)MAX(pTmp->nSize, iOfst+iAmt);
- return SQLITE_OK;
- }
-
-@@ -306,7 +306,7 @@
- */
- static int tmpTruncate(sqlite3_file *pFile, sqlite_int64 size){
- tmp_file *pTmp = (tmp_file *)pFile;
-- pTmp->nSize = MIN(pTmp->nSize, size);
-+ pTmp->nSize = (int)MIN(pTmp->nSize, size);
- return SQLITE_OK;
- }
-
-@@ -418,7 +418,7 @@
- /* Journal file. */
- int iRem = iAmt;
- int iBuf = 0;
-- int ii = iOfst;
-+ int ii = (int)iOfst;
- while( iRem>0 && rc==SQLITE_OK ){
- int iRealOff = pReal->nBlob - BLOCKSIZE*((ii/BLOCKSIZE)+1) + ii%BLOCKSIZE;
- int iRealAmt = MIN(iRem, BLOCKSIZE - (iRealOff%BLOCKSIZE));
-@@ -453,14 +453,14 @@
- }else{
- rc = pF->pMethods->xWrite(pF, zBuf, iAmt, iOfst+BLOCKSIZE);
- if( rc==SQLITE_OK ){
-- pReal->nDatabase = MAX(pReal->nDatabase, iAmt+iOfst);
-+ pReal->nDatabase = (int)MAX(pReal->nDatabase, iAmt+iOfst);
- }
- }
- }else{
- /* Journal file. */
- int iRem = iAmt;
- int iBuf = 0;
-- int ii = iOfst;
-+ int ii = (int)iOfst;
- while( iRem>0 && rc==SQLITE_OK ){
- int iRealOff = pReal->nBlob - BLOCKSIZE*((ii/BLOCKSIZE)+1) + ii%BLOCKSIZE;
- int iRealAmt = MIN(iRem, BLOCKSIZE - (iRealOff%BLOCKSIZE));
-@@ -475,7 +475,7 @@
- }
- }
- if( rc==SQLITE_OK ){
-- pReal->nJournal = MAX(pReal->nJournal, iAmt+iOfst);
-+ pReal->nJournal = (int)MAX(pReal->nJournal, iAmt+iOfst);
- }
- }
-
-@@ -489,9 +489,9 @@
- fs_file *p = (fs_file *)pFile;
- fs_real_file *pReal = p->pReal;
- if( p->eType==DATABASE_FILE ){
-- pReal->nDatabase = MIN(pReal->nDatabase, size);
-+ pReal->nDatabase = (int)MIN(pReal->nDatabase, size);
- }else{
-- pReal->nJournal = MIN(pReal->nJournal, size);
-+ pReal->nJournal = (int)MIN(pReal->nJournal, size);
- }
- return SQLITE_OK;
- }
-@@ -641,7 +641,7 @@
- pReal->nBlob = BLOBSIZE;
- }else{
- unsigned char zS[4];
-- pReal->nBlob = size;
-+ pReal->nBlob = (int)size;
- rc = pRealFile->pMethods->xRead(pRealFile, zS, 4, 0);
- pReal->nDatabase = (zS[0]<<24)+(zS[1]<<16)+(zS[2]<<8)+zS[3];
- if( rc==SQLITE_OK ){
diff --git a/lang/sql/adapter/sqlite-patches/03_editline.patch b/lang/sql/adapter/sqlite-patches/03_editline.patch
index 170457ba..35ea4ca5 100644
--- a/lang/sql/adapter/sqlite-patches/03_editline.patch
+++ b/lang/sql/adapter/sqlite-patches/03_editline.patch
@@ -1,6 +1,6 @@
--- Makefile.in
+++ Makefile.in
-@@ -49,7 +49,7 @@ LIBTCL = @TCL_LIB_SPEC@ @TCL_LIBS@
+@@ -49,7 +49,7 @@
# Compiler options needed for programs that use the readline() library.
#
@@ -11,7 +11,7 @@
#
--- configure
+++ configure
-@@ -890,6 +890,7 @@ TCL_STUB_LIB_SPEC
+@@ -888,6 +888,7 @@
HAVE_TCL
TARGET_READLINE_LIBS
TARGET_READLINE_INC
@@ -19,107 +19,107 @@
TARGET_HAVE_READLINE
TARGET_DEBUG
USE_AMALGAMATION
-@@ -3734,13 +3735,13 @@ if test "${lt_cv_nm_interface+set}" = se
+@@ -3732,13 +3733,13 @@
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
-- (eval echo "\"\$as_me:3737: $ac_compile\"" >&5)
-+ (eval echo "\"\$as_me:3738: $ac_compile\"" >&5)
+- (eval echo "\"\$as_me:3735: $ac_compile\"" >&5)
++ (eval echo "\"\$as_me:3736: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
-- (eval echo "\"\$as_me:3740: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
-+ (eval echo "\"\$as_me:3741: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+- (eval echo "\"\$as_me:3738: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
++ (eval echo "\"\$as_me:3739: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
-- (eval echo "\"\$as_me:3743: output\"" >&5)
-+ (eval echo "\"\$as_me:3744: output\"" >&5)
+- (eval echo "\"\$as_me:3741: output\"" >&5)
++ (eval echo "\"\$as_me:3742: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
-@@ -4962,7 +4963,7 @@ ia64-*-hpux*)
+@@ -4960,7 +4961,7 @@
;;
*-*-irix6*)
# Find out which ABI we are using.
-- echo '#line 4965 "configure"' > conftest.$ac_ext
-+ echo '#line 4966 "configure"' > conftest.$ac_ext
+- echo '#line 4963 "configure"' > conftest.$ac_ext
++ echo '#line 4964 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
-@@ -6831,11 +6832,11 @@ else
+@@ -6829,11 +6830,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
-- (eval echo "\"\$as_me:6834: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:6835: $lt_compile\"" >&5)
+- (eval echo "\"\$as_me:6832: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:6833: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
-- echo "$as_me:6838: \$? = $ac_status" >&5
-+ echo "$as_me:6839: \$? = $ac_status" >&5
+- echo "$as_me:6836: \$? = $ac_status" >&5
++ echo "$as_me:6837: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-@@ -7170,11 +7171,11 @@ else
+@@ -7168,11 +7169,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
-- (eval echo "\"\$as_me:7173: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:7174: $lt_compile\"" >&5)
+- (eval echo "\"\$as_me:7171: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:7172: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
-- echo "$as_me:7177: \$? = $ac_status" >&5
-+ echo "$as_me:7178: \$? = $ac_status" >&5
+- echo "$as_me:7175: \$? = $ac_status" >&5
++ echo "$as_me:7176: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-@@ -7275,11 +7276,11 @@ else
+@@ -7273,11 +7274,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
-- (eval echo "\"\$as_me:7278: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:7279: $lt_compile\"" >&5)
+- (eval echo "\"\$as_me:7276: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:7277: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
-- echo "$as_me:7282: \$? = $ac_status" >&5
-+ echo "$as_me:7283: \$? = $ac_status" >&5
+- echo "$as_me:7280: \$? = $ac_status" >&5
++ echo "$as_me:7281: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
-@@ -7330,11 +7331,11 @@ else
+@@ -7328,11 +7329,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
-- (eval echo "\"\$as_me:7333: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:7334: $lt_compile\"" >&5)
+- (eval echo "\"\$as_me:7331: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:7332: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
-- echo "$as_me:7337: \$? = $ac_status" >&5
-+ echo "$as_me:7338: \$? = $ac_status" >&5
+- echo "$as_me:7335: \$? = $ac_status" >&5
++ echo "$as_me:7336: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
-@@ -10143,7 +10144,7 @@ else
+@@ -10141,7 +10142,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
--#line 10146 "configure"
-+#line 10147 "configure"
+-#line 10144 "configure"
++#line 10145 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
-@@ -10239,7 +10240,7 @@ else
+@@ -10237,7 +10238,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
--#line 10242 "configure"
-+#line 10243 "configure"
+-#line 10240 "configure"
++#line 10241 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
-@@ -12920,6 +12921,7 @@ fi
+@@ -12912,6 +12913,7 @@
#
TARGET_READLINE_LIBS=""
TARGET_READLINE_INC=""
@@ -127,7 +127,7 @@
TARGET_HAVE_READLINE=0
# Check whether --enable-readline was given.
if test "${enable_readline+set}" = set; then
-@@ -12930,6 +12932,7 @@ fi
+@@ -12922,6 +12924,7 @@
if test x"$with_readline" != xno; then
@@ -135,7 +135,7 @@
found="yes"
-@@ -12941,9 +12944,12 @@ else
+@@ -12933,9 +12936,12 @@
fi
if test "x$with_readline_lib" = xauto; then
@@ -151,7 +151,7 @@
$as_echo_n "checking for library containing tgetent... " >&6; }
if test "${ac_cv_search_tgetent+set}" = set; then
$as_echo_n "(cached) " >&6
-@@ -12971,7 +12977,7 @@ return tgetent ();
+@@ -12963,7 +12969,7 @@
return 0;
}
_ACEOF
@@ -160,7 +160,7 @@
if test -z "$ac_lib"; then
ac_res="none required"
else
-@@ -13032,13 +13038,14 @@ else
+@@ -13024,13 +13030,14 @@
term_LIBS=""
fi
@@ -179,7 +179,7 @@
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
-@@ -13082,12 +13089,12 @@ eval ac_try_echo="\"\$as_me:$LINENO: $ac
+@@ -13074,12 +13081,12 @@
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
@@ -194,7 +194,7 @@
fi
rm -rf conftest.dSYM
-@@ -13095,16 +13102,28 @@ rm -f core conftest.err conftest.$ac_obj
+@@ -13087,16 +13094,28 @@
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
@@ -229,7 +229,7 @@
else
TARGET_READLINE_LIBS="$with_readline_lib"
fi
-@@ -13118,18 +13137,21 @@ else
+@@ -13110,18 +13129,21 @@
fi
if test "x$with_readline_inc" = xauto; then
@@ -261,7 +261,7 @@
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
-@@ -13137,7 +13159,7 @@ cat confdefs.h >>conftest.$ac_ext
+@@ -13129,7 +13151,7 @@
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
@@ -270,7 +270,7 @@
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
-@@ -13170,15 +13192,15 @@ rm -f core conftest.err conftest.$ac_obj
+@@ -13162,15 +13184,15 @@
$as_echo "$ac_header_compiler" >&6; }
# Is the header present?
@@ -289,7 +289,7 @@
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
-@@ -13212,40 +13234,43 @@ rm -f conftest.err conftest.$ac_ext
+@@ -13204,40 +13226,43 @@
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
@@ -364,7 +364,7 @@
found="yes"
else
-@@ -13253,9 +13278,9 @@ else
+@@ -13245,9 +13270,9 @@
if test "$cross_compiling" != yes; then
for dir in /usr /usr/local /usr/local/readline /usr/contrib /mingw; do
for subdir in include include/readline; do
@@ -377,7 +377,7 @@
if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then
$as_echo_n "(cached) " >&6
else
-@@ -13263,7 +13288,7 @@ else
+@@ -13255,7 +13280,7 @@
{ { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
{ (exit 1); exit 1; }; }
@@ -386,7 +386,7 @@
eval "$as_ac_File=yes"
else
eval "$as_ac_File=no"
-@@ -13297,6 +13322,7 @@ fi
+@@ -13289,6 +13314,7 @@
if test x"$found" = xno; then
TARGET_READLINE_LIBS=""
TARGET_READLINE_INC=""
@@ -394,7 +394,7 @@
TARGET_HAVE_READLINE=0
else
TARGET_HAVE_READLINE=1
-@@ -13307,6 +13333,7 @@ fi
+@@ -13299,6 +13325,7 @@
@@ -404,7 +404,7 @@
# that use "fdatasync()" function.
--- configure.ac
+++ configure.ac
-@@ -524,6 +524,7 @@ AC_SUBST(HAVE_TCL)
+@@ -515,6 +515,7 @@
#
TARGET_READLINE_LIBS=""
TARGET_READLINE_INC=""
@@ -412,7 +412,7 @@
TARGET_HAVE_READLINE=0
AC_ARG_ENABLE([readline],
[AC_HELP_STRING([--disable-readline],[disable readline support [default=detect]])],
-@@ -531,6 +532,7 @@ AC_ARG_ENABLE([readline],
+@@ -522,6 +523,7 @@
[with_readline=auto])
if test x"$with_readline" != xno; then
@@ -420,7 +420,7 @@
found="yes"
AC_ARG_WITH([readline-lib],
-@@ -538,12 +540,24 @@ if test x"$with_readline" != xno; then
+@@ -529,12 +531,24 @@
[with_readline_lib=$withval],
[with_readline_lib="auto"])
if test "x$with_readline_lib" = xauto; then
@@ -451,7 +451,7 @@
else
TARGET_READLINE_LIBS="$with_readline_lib"
fi
-@@ -553,12 +567,12 @@ if test x"$with_readline" != xno; then
+@@ -544,12 +558,12 @@
[with_readline_inc=$withval],
[with_readline_inc="auto"])
if test "x$with_readline_inc" = xauto; then
@@ -466,7 +466,7 @@
if test "$found" = "yes"; then
TARGET_READLINE_INC="-I$dir/$subdir"
break
-@@ -575,6 +589,7 @@ if test x"$with_readline" != xno; then
+@@ -566,6 +580,7 @@
if test x"$found" = xno; then
TARGET_READLINE_LIBS=""
TARGET_READLINE_INC=""
@@ -474,7 +474,7 @@
TARGET_HAVE_READLINE=0
else
TARGET_HAVE_READLINE=1
-@@ -583,6 +598,7 @@ fi
+@@ -574,6 +589,7 @@
AC_SUBST(TARGET_READLINE_LIBS)
AC_SUBST(TARGET_READLINE_INC)
@@ -484,12 +484,12 @@
##########
--- src/shell.c
+++ src/shell.c
-@@ -38,14 +38,13 @@
- # include <unistd.h>
+@@ -45,14 +45,13 @@
+ # include <sys/types.h>
#endif
-#ifdef HAVE_EDITLINE
-+#if defined (HAVE_EDITLINE) && HAVE_EDITLINE==1
++#if defined(HAVE_EDITLINE) && HAVE_EDITLINE==1
# include <editline/editline.h>
-#endif
-#if defined(HAVE_READLINE) && HAVE_READLINE==1
@@ -499,6 +499,6 @@
#endif
-#if !defined(HAVE_EDITLINE) && (!defined(HAVE_READLINE) || HAVE_READLINE!=1)
+#if (!defined(HAVE_EDITLINE) || HAVE_EDITLINE!=1) && (!defined(HAVE_READLINE) || HAVE_READLINE!=1)
- # define readline(p) local_getline(p,stdin)
# define add_history(X)
# define read_history(X)
+ # define write_history(X)
diff --git a/lang/sql/adapter/sqlite-patches/04_build_config.patch b/lang/sql/adapter/sqlite-patches/04_build_config.patch
index 8bd00869..0ae553ee 100644
--- a/lang/sql/adapter/sqlite-patches/04_build_config.patch
+++ b/lang/sql/adapter/sqlite-patches/04_build_config.patch
@@ -1,4 +1,4 @@
---- /dev/null
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ build_config.h.in
@@ -0,0 +1,47 @@
+
@@ -50,7 +50,7 @@
+#endif
--- configure
+++ configure
-@@ -13548,7 +13548,7 @@ ac_config_headers="$ac_config_headers co
+@@ -13600,7 +13600,7 @@
# Generate the output files.
#
@@ -59,7 +59,7 @@
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
-@@ -14402,6 +14402,7 @@ do
+@@ -14454,6 +14454,7 @@
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"sqlite3.pc") CONFIG_FILES="$CONFIG_FILES sqlite3.pc" ;;
@@ -69,7 +69,7 @@
$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
--- configure.ac
+++ configure.ac
-@@ -714,4 +714,5 @@ AC_SUBST(BUILD_CFLAGS)
+@@ -690,4 +690,5 @@
AC_OUTPUT([
Makefile
sqlite3.pc
diff --git a/lang/sql/adapter/sqlite-patches/05_shell_config.patch b/lang/sql/adapter/sqlite-patches/05_shell_config.patch
index 415114fe..ae8aa49e 100644
--- a/lang/sql/adapter/sqlite-patches/05_shell_config.patch
+++ b/lang/sql/adapter/sqlite-patches/05_shell_config.patch
@@ -1,7 +1,7 @@
--- src/shell.c
+++ src/shell.c
-@@ -17,6 +17,14 @@
- #define _CRT_SECURE_NO_WARNINGS
+@@ -28,6 +28,14 @@
+ # define _LARGEFILE_SOURCE 1
#endif
+/*
diff --git a/lang/sql/adapter/sqlite-patches/07_shell_prompt.patch b/lang/sql/adapter/sqlite-patches/07_shell_prompt.patch
index 77bb25d0..a0d208d9 100644
--- a/lang/sql/adapter/sqlite-patches/07_shell_prompt.patch
+++ b/lang/sql/adapter/sqlite-patches/07_shell_prompt.patch
@@ -1,25 +1,25 @@
--- src/shell.c
+++ src/shell.c
-@@ -2529,7 +2529,7 @@
- memcpy(data->separator,"|", 2);
+@@ -2924,7 +2924,7 @@
data->showHeader = 0;
+ sqlite3_config(SQLITE_CONFIG_URI, 1);
sqlite3_config(SQLITE_CONFIG_LOG, shellLog, data);
- sqlite3_snprintf(sizeof(mainPrompt), mainPrompt,"sqlite> ");
+ sqlite3_snprintf(sizeof(mainPrompt), mainPrompt,"dbsql> ");
sqlite3_snprintf(sizeof(continuePrompt), continuePrompt," ...> ");
sqlite3_config(SQLITE_CONFIG_SINGLETHREAD);
}
-@@ -2730,11 +2730,12 @@
+@@ -3177,11 +3177,12 @@
char *zHome;
char *zHistory = 0;
int nHistory;
+ extern char *db_full_version(int *, int *, int *, int *, int *);
printf(
-- "SQLite version %s\n"
+- "SQLite version %s %.19s\n" /*extra-version-info*/
+ "%s\n"
"Enter \".help\" for instructions\n"
"Enter SQL statements terminated with a \";\"\n",
-- sqlite3_libversion()
+- sqlite3_libversion(), sqlite3_sourceid()
+ db_full_version(NULL, NULL, NULL, NULL, NULL)
);
zHome = find_home_dir();
diff --git a/lang/sql/adapter/sqlite-patches/08_errno_header.patch b/lang/sql/adapter/sqlite-patches/08_errno_header.patch
index 08fd0e45..595d5225 100644
--- a/lang/sql/adapter/sqlite-patches/08_errno_header.patch
+++ b/lang/sql/adapter/sqlite-patches/08_errno_header.patch
@@ -12,30 +12,30 @@
--- configure
+++ configure
-@@ -11993,7 +11993,8 @@ fi
+@@ -11991,7 +11991,8 @@
--for ac_header in sys/types.h stdlib.h stdint.h inttypes.h
+-for ac_header in sys/types.h stdlib.h stdint.h inttypes.h malloc.h
+
-+for ac_header in sys/types.h stdlib.h stdint.h inttypes.h errno.h
++for ac_header in sys/types.h stdlib.h stdint.h inttypes.h malloc.h errno.h
do
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
--- configure.ac
+++ configure.ac
-@@ -122,7 +122,7 @@ AC_CHECK_TYPES([int8_t, int16_t, int32_t
+@@ -122,7 +122,7 @@
#########
# Check for needed/wanted headers
--AC_CHECK_HEADERS([sys/types.h stdlib.h stdint.h inttypes.h])
-+AC_CHECK_HEADERS([sys/types.h stdlib.h stdint.h inttypes.h errno.h])
+-AC_CHECK_HEADERS([sys/types.h stdlib.h stdint.h inttypes.h malloc.h])
++AC_CHECK_HEADERS([sys/types.h stdlib.h stdint.h inttypes.h malloc.h errno.h])
#########
# Figure out whether or not we have these functions
--- src/sqliteInt.h
+++ src/sqliteInt.h
-@@ -75,6 +75,9 @@
+@@ -80,6 +80,9 @@
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
@@ -44,4 +44,4 @@
+#endif
/*
- ** The number of samples of an index that SQLite takes in order to
+ ** The following macros are used to cast pointers to integers and
diff --git a/lang/sql/adapter/sqlite-patches/09_comment_tests.patch b/lang/sql/adapter/sqlite-patches/09_comment_tests.patch
index bf55d5cf..2883fbba 100644
--- a/lang/sql/adapter/sqlite-patches/09_comment_tests.patch
+++ b/lang/sql/adapter/sqlite-patches/09_comment_tests.patch
@@ -12,22 +12,47 @@
if {0==[sqlite3 -has-codec]} {
do_test date-14.1 {
execsql {
-@@ -528,4 +533,5 @@
+@@ -528,6 +533,7 @@
} {1}
}
}
+}
- finish_test
+
+ # Verify that multiple calls to date functions with 'now' return the
+ # same answer.
+--- test/incrblob.test
++++ test/incrblob.test
+@@ -135,8 +135,8 @@
+ INSERT INTO blobs VALUES('one', $::str || randstr(500,500), 45);
+ COMMIT;
+ }
+- expr [file size test.db]/1024
+- } [expr 31 + $AutoVacuumMode]
++ } {}
++
+
+ ifcapable autovacuum {
+ do_test incrblob-2.$AutoVacuumMode.2 {
+--- test/manydb.test
++++ test/manydb.test
+@@ -67,6 +67,7 @@
+ for {set i 0} {$i<$N} {incr i} {
+ do_test manydb-1.$i {
+ sqlite3 db$i $dbname($i)
++ execsql { PRAGMA cache_size=20; } db$i
+ execsql {
+ CREATE TABLE t1(a,b);
+ BEGIN;
--- test/rollback.test
+++ test/rollback.test
@@ -88,8 +88,8 @@
BEGIN;
INSERT INTO t3 VALUES('hello world');
}
-- file copy -force test.db testA.db
-- file copy -force test.db-journal testA.db-journal
-+ #file copy -force test.db testA.db
-+ #file copy -force test.db-journal testA.db-journal
+- forcecopy test.db testA.db
+- forcecopy test.db-journal testA.db-journal
++ #forcecopy test.db testA.db
++ #forcecopy test.db-journal testA.db-journal
execsql {
COMMIT;
}
@@ -77,7 +102,7 @@
# Open a handle on testA.db and use it to query the database. At one
# point the first query would attempt a hot rollback, attempt to open
-@@ -127,6 +127,8 @@
+@@ -127,6 +130,8 @@
# be opened. This is incorrect, it should simply delete the journal
# file and proceed with the query.
#
@@ -86,37 +111,24 @@
do_test rollback-2.2 {
sqlite3 db2 testA.db
execsql {
-@@ -146,5 +148,6 @@
+@@ -146,5 +151,6 @@
db2 close
}
+}
finish_test
---- test/incrblob.test
-+++ test/incrblob.test
-@@ -134,8 +134,8 @@
- INSERT INTO blobs VALUES('one', $::str || randstr(500,500), 45);
- COMMIT;
- }
-- expr [file size test.db]/1024
-- } [expr 31 + $AutoVacuumMode]
-+ } {}
-+
-
- ifcapable autovacuum {
- do_test incrblob-2.$AutoVacuumMode.2 {
--- test/shared3.test
+++ test/shared3.test
-@@ -101,7 +101,7 @@
+@@ -102,7 +102,7 @@
db1 close
db2 close
-db3 close
+#db3 close
- sqlite3_enable_shared_cache $::enable_shared_cache
- finish_test
+ #-------------------------------------------------------------------------
+ # At one point this was causing a faulty assert to fail.
--- test/shared6.test
+++ test/shared6.test
@@ -42,8 +42,8 @@
@@ -130,13 +142,3 @@
do_test shared6-1.2.2 {
execsql { SELECT * FROM t1 } db1
} {}
---- test/manydb.test
-+++ test/manydb.test
-@@ -67,6 +67,7 @@
- for {set i 0} {$i<$N} {incr i} {
- do_test manydb-1.$i {
- sqlite3 db$i $dbname($i)
-+ execsql { PRAGMA cache_size=20; } db$i
- execsql {
- CREATE TABLE t1(a,b);
- BEGIN;
diff --git a/lang/sql/adapter/sqlite-patches/10_compile_options.patch b/lang/sql/adapter/sqlite-patches/10_compile_options.patch
index 4338b0e5..f4ddc58b 100644
--- a/lang/sql/adapter/sqlite-patches/10_compile_options.patch
+++ b/lang/sql/adapter/sqlite-patches/10_compile_options.patch
@@ -1,6 +1,6 @@
--- src/ctime.c
+++ src/ctime.c
-@@ -39,6 +39,9 @@ static const char * const azCompileOpt[]
+@@ -39,6 +39,9 @@
#ifdef SQLITE_4_BYTE_ALIGNED_MALLOC
"4_BYTE_ALIGNED_MALLOC",
#endif
diff --git a/lang/sql/adapter/sqlite-patches/11_android_shell.patch b/lang/sql/adapter/sqlite-patches/11_android_shell.patch
index e591c11c..278cc8cc 100644
--- a/lang/sql/adapter/sqlite-patches/11_android_shell.patch
+++ b/lang/sql/adapter/sqlite-patches/11_android_shell.patch
@@ -1,7 +1,7 @@
--- src/shell.c
+++ src/shell.c
-@@ -25,6 +25,12 @@
- #include "config.h"
+@@ -28,6 +28,12 @@
+ # define _LARGEFILE_SOURCE 1
#endif
+#ifdef ANDROID
@@ -13,7 +13,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
-@@ -1389,6 +1395,13 @@ static void open_db(struct callback_data
+@@ -1617,6 +1623,13 @@
sqlite3_create_function(db, "shellstatic", 0, SQLITE_UTF8, 0,
shellstaticFunc, 0, 0);
}
diff --git a/lang/sql/adapter/sqlite-patches/12_e_fts3_test.patch b/lang/sql/adapter/sqlite-patches/12_e_fts3_test.patch
index 30152d0f..50308e75 100644
--- a/lang/sql/adapter/sqlite-patches/12_e_fts3_test.patch
+++ b/lang/sql/adapter/sqlite-patches/12_e_fts3_test.patch
@@ -1,6 +1,6 @@
--- test/e_fts3.test
+++ test/e_fts3.test
-@@ -509,6 +509,7 @@ error_test 2.1.8 {
+@@ -509,6 +509,7 @@
# of the document examples above.
#
do_malloc_test e_fts3-3 -tclbody {
diff --git a/lang/sql/adapter/sqlite-patches/13_malloc_test.patch b/lang/sql/adapter/sqlite-patches/13_malloc_test.patch
index 1f8982ed..ecac5093 100644
--- a/lang/sql/adapter/sqlite-patches/13_malloc_test.patch
+++ b/lang/sql/adapter/sqlite-patches/13_malloc_test.patch
@@ -1,11 +1,6 @@
--- test/malloc.test
+++ test/malloc.test
-@@ -713,17 +713,17 @@
-
- # After committing a transaction in persistent-journal mode, if a journal
- # size limit is configured SQLite may attempt to truncate the journal file.
- # This test verifies the libraries response to a malloc() failure during
- # this operation.
+@@ -718,7 +718,7 @@
#
do_malloc_test 31 -sqlprep {
PRAGMA journal_mode = persist;
@@ -14,8 +9,3 @@
CREATE TABLE t1(a PRIMARY KEY, b);
} -sqlbody {
INSERT INTO t1 VALUES(1, 2);
- }
-
- # When written, this test provoked an obscure change-counter bug.
- #
- # If, when running in exclusive mode, a malloc() failure occurs
diff --git a/lang/sql/adapter/sqlite-patches/14_custom_pragma.patch b/lang/sql/adapter/sqlite-patches/14_custom_pragma.patch
index b10d312b..2166663a 100644
--- a/lang/sql/adapter/sqlite-patches/14_custom_pragma.patch
+++ b/lang/sql/adapter/sqlite-patches/14_custom_pragma.patch
@@ -7,9 +7,9 @@
- callback.lo complete.lo ctime.lo date.lo delete.lo \
+ callback.lo complete.lo ctime.lo date.lo db_pragma.lo delete.lo \
expr.lo fault.lo fkey.lo \
- fts3.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo fts3_porter.lo \
- fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo fts3_write.lo \
-@@ -207,6 +207,7 @@
+ fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
+ fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
+@@ -209,6 +209,7 @@
$(TOP)/src/complete.c \
$(TOP)/src/ctime.c \
$(TOP)/src/date.c \
@@ -17,7 +17,7 @@
$(TOP)/src/delete.c \
$(TOP)/src/expr.c \
$(TOP)/src/fault.c \
-@@ -573,6 +574,10 @@
+@@ -615,6 +616,10 @@
date.lo: $(TOP)/src/date.c $(HDR)
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/date.c
@@ -30,16 +30,7 @@
--- src/pragma.c
+++ src/pragma.c
-@@ -49,7 +49,7 @@
- /*
- ** Interpret the given string as a boolean value.
- */
--static u8 getBoolean(const char *z){
-+u8 getBoolean(const char *z){
- return getSafetyLevel(z)&1;
- }
-
-@@ -142,7 +142,7 @@
+@@ -601,7 +601,7 @@
/*
** Generate code to return a single integer value.
*/
@@ -48,7 +39,7 @@
Vdbe *v = sqlite3GetVdbe(pParse);
int mem = ++pParse->nMem;
i64 *pI64 = sqlite3DbMallocRaw(pParse->db, sizeof(value));
-@@ -283,6 +283,8 @@
+@@ -687,6 +687,8 @@
return azModeName[eMode];
}
@@ -57,19 +48,21 @@
/*
** Process a pragma statement.
**
-@@ -344,6 +346,9 @@
+@@ -783,6 +785,11 @@
goto pragma_out;
}
-
-+ if( bdbsqlPragma(pParse, zLeft, zRight, iDb)==0 ){
-+ /* Do nothing if this was a Berkeley DB specific pragma. */
-+ }else
- #ifndef SQLITE_OMIT_PAGER_PRAGMAS
- /*
- ** PRAGMA [database.]default_cache_size
+
++ if ( bdbsqlPragma(pParse, zLeft, zRight, iDb)==0 ) {
++ /* Do nothing if this was a Berkeley DB specific pragma. */
++ goto pragma_out;
++ }
++
+ /* Locate the pragma in the lookup table */
+ lwr = 0;
+ upr = ArraySize(aPragmaNames)-1;
--- tool/mksqlite3c.tcl
+++ tool/mksqlite3c.tcl
-@@ -250,6 +250,7 @@
+@@ -269,6 +269,7 @@
btmutex.c
btree.c
backup.c
diff --git a/lang/sql/adapter/sqlite-patches/15_bdb_stat.patch b/lang/sql/adapter/sqlite-patches/15_bdb_stat.patch
index f4533097..84a16105 100644
--- a/lang/sql/adapter/sqlite-patches/15_bdb_stat.patch
+++ b/lang/sql/adapter/sqlite-patches/15_bdb_stat.patch
@@ -8,10 +8,10 @@
- expr.lo fault.lo fkey.lo \
+ callback.lo complete.lo ctime.lo date.lo db_pragma.lo db_shell.lo \
+ delete.lo expr.lo fault.lo fkey.lo \
- fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo fts3_porter.lo \
- fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo fts3_write.lo \
- func.lo global.lo hash.lo \
-@@ -208,6 +208,7 @@ SRC = \
+ fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
+ fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
+ fts3_tokenize_vtab.lo \
+@@ -210,6 +210,7 @@
$(TOP)/src/ctime.c \
$(TOP)/src/date.c \
$(TOP)/../adapter/db_pragma.c \
@@ -19,7 +19,7 @@
$(TOP)/src/delete.c \
$(TOP)/src/expr.c \
$(TOP)/src/fault.c \
-@@ -583,6 +584,10 @@ db_pragma.lo: $(TOP)/../adapter/db_pragm
+@@ -620,6 +621,10 @@
$(TOP)/../adapter/btreeInt.h
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/../adapter/db_pragma.c
@@ -32,7 +32,7 @@
--- src/shell.c
+++ src/shell.c
-@@ -1368,6 +1368,17 @@ static char zHelp[] =
+@@ -1600,6 +1600,17 @@
" LIKE pattern TABLE.\n"
".separator STRING Change separator used by output mode and .import\n"
".show Show the current values for various settings\n"
@@ -50,7 +50,7 @@
".stats ON|OFF Turn stats on or off\n"
".tables ?TABLE? List names of tables\n"
" If TABLE specified, only list tables matching\n"
-@@ -2128,6 +2137,27 @@ static int do_meta_command(char *zLine,
+@@ -2685,6 +2696,27 @@
}
fprintf(p->out,"\n");
}else
@@ -60,7 +60,7 @@
+ extern int bdbSqlEnvStatPrint(sqlite3 *db, FILE *);
+ extern int bdbSqlRepSumStatPrint(sqlite3 *db, FILE *);
+
-+ open_db(p);
++ open_db(p, 0);
+
+ if (nArg == 1 || nArg == 2 && strcmp(azArg[1], ":env:") == 0)
+ rc = bdbSqlEnvStatPrint(p->db, p->out);
@@ -80,7 +80,7 @@
p->statsOn = booleanValue(azArg[1]);
--- tool/mksqlite3c.tcl
+++ tool/mksqlite3c.tcl
-@@ -251,6 +251,7 @@ foreach file {
+@@ -270,6 +270,7 @@
btree.c
backup.c
db_pragma.c
diff --git a/lang/sql/adapter/sqlite-patches/16_bdb_deadlock.patch b/lang/sql/adapter/sqlite-patches/16_bdb_deadlock.patch
index 21f57b1c..52771eb2 100644
--- a/lang/sql/adapter/sqlite-patches/16_bdb_deadlock.patch
+++ b/lang/sql/adapter/sqlite-patches/16_bdb_deadlock.patch
@@ -1,6 +1,6 @@
--- src/vdbe.c
+++ src/vdbe.c
-@@ -1112,7 +1112,10 @@ case OP_ResultRow: {
+@@ -1215,7 +1215,10 @@
** The statement transaction is never a top-level transaction. Hence
** the RELEASE call below can never fail.
*/
@@ -12,22 +12,16 @@
rc = sqlite3VdbeCloseStatement(p, SAVEPOINT_RELEASE);
if( NEVER(rc!=SQLITE_OK) ){
break;
-@@ -2786,9 +2781,12 @@ case OP_Transaction: {
+@@ -3001,7 +3004,7 @@
goto abort_due_to_error;
}
- if( pOp->p2 && p->usesStmtJournal
-+ /*if( pOp->p2 && p->usesStmtJournal
- && (db->autoCommit==0 || db->activeVdbeCnt>1)
-- ){
-+ ){*/
-+ /* In Berkeley DB create a statement transaction for every update
-+ * statement. BDB */
-+ if ( pOp->p2 && (db->autoCommit==0 || db->activeVdbeCnt>1)) {
++ if( pOp->p2 && (!db->aVTrans || p->usesStmtJournal)
+ && (db->autoCommit==0 || db->nVdbeRead>1)
+ ){
assert( sqlite3BtreeIsInTrans(pBt) );
- if( p->iStatement==0 ){
- assert( db->nStatement>=0 && db->nSavepoint>=0 );
-@@ -5907,6 +5913,14 @@ vdbe_error_halt:
+@@ -6273,6 +6276,14 @@
testcase( sqlite3GlobalConfig.xLog!=0 );
sqlite3_log(rc, "statement aborts at %d: [%s] %s",
pc, p->zSql, p->zErrMsg);
@@ -44,7 +38,7 @@
rc = SQLITE_ERROR;
--- src/vdbeblob.c
+++ src/vdbeblob.c
-@@ -155,6 +155,7 @@ int sqlite3_blob_open(
+@@ -156,6 +156,7 @@
Table *pTab;
Parse *pParse = 0;
Incrblob *pBlob = 0;
@@ -52,7 +46,7 @@
flags = !!flags; /* flags = (flags ? 1 : 0); */
*ppBlob = 0;
-@@ -254,7 +255,7 @@ int sqlite3_blob_open(
+@@ -259,7 +260,7 @@
assert( pBlob->pStmt || db->mallocFailed );
if( pBlob->pStmt ){
Vdbe *v = (Vdbe *)pBlob->pStmt;
@@ -61,9 +55,9 @@
sqlite3VdbeAddOpList(v, sizeof(openBlob)/sizeof(VdbeOpList), openBlob);
-@@ -298,6 +299,10 @@ int sqlite3_blob_open(
- if( !db->mallocFailed ){
- sqlite3VdbeMakeReady(v, 1, 1, 1, 0, 0, 0);
+@@ -307,6 +308,10 @@
+ pParse->nTab = 1;
+ sqlite3VdbeMakeReady(v, pParse);
}
+ /* This will prevent the statement transaction from being committed,
+ * which would invalidate the incrblob cursor. BDB */
diff --git a/lang/sql/adapter/sqlite-patches/17_encryption.patch b/lang/sql/adapter/sqlite-patches/17_encryption.patch
index edf097f3..7f9404dc 100644
--- a/lang/sql/adapter/sqlite-patches/17_encryption.patch
+++ b/lang/sql/adapter/sqlite-patches/17_encryption.patch
@@ -8,10 +8,10 @@
- delete.lo expr.lo fault.lo fkey.lo \
+ callback.lo complete.lo ctime.lo date.lo db_encrypt.lo db_pragma.lo \
+ db_shell.lo delete.lo expr.lo fault.lo fkey.lo \
- fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo fts3_porter.lo \
- fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo fts3_write.lo \
- func.lo global.lo hash.lo \
-@@ -207,6 +208,7 @@
+ fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
+ fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
+ fts3_tokenize_vtab.lo \
+@@ -209,6 +209,7 @@
$(TOP)/src/complete.c \
$(TOP)/src/ctime.c \
$(TOP)/src/date.c \
@@ -19,7 +19,7 @@
$(TOP)/../adapter/db_pragma.c \
$(TOP)/../adapter/db_shell.c \
$(TOP)/src/delete.c \
-@@ -580,6 +581,10 @@
+@@ -617,6 +618,10 @@
date.lo: $(TOP)/src/date.c $(HDR)
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/date.c
@@ -32,17 +32,7 @@
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/../adapter/db_pragma.c
--- src/tclsqlite.c
+++ src/tclsqlite.c
-@@ -2864,6 +2864,9 @@
- const char *zFile;
- const char *zVfs = 0;
- int flags;
-+#ifdef SQLITE_HAS_CODEC
-+ int rc;
-+#endif
- Tcl_DString translatedFilename;
-
- /* In normal use, each TCL interpreter runs in a single thread. So
-@@ -2968,7 +2971,13 @@
+@@ -3036,7 +3036,13 @@
}
#ifdef SQLITE_HAS_CODEC
if( p->db ){
@@ -59,7 +49,7 @@
if( p->db==0 ){
--- test/vtab1.test
+++ test/vtab1.test
-@@ -849,8 +849,12 @@
+@@ -879,8 +879,12 @@
ifcapable attach {
do_test vtab1.8-1 {
set echo_module ""
@@ -75,7 +65,7 @@
set echo_module
--- tool/mksqlite3c.tcl
+++ tool/mksqlite3c.tcl
-@@ -250,6 +250,7 @@
+@@ -269,6 +269,7 @@
btmutex.c
btree.c
backup.c
diff --git a/lang/sql/adapter/sqlite-patches/18_vacuum_test.patch b/lang/sql/adapter/sqlite-patches/18_vacuum_test.patch
index d276e41e..a035b72c 100644
--- a/lang/sql/adapter/sqlite-patches/18_vacuum_test.patch
+++ b/lang/sql/adapter/sqlite-patches/18_vacuum_test.patch
@@ -17,9 +17,9 @@
+# DBSQL does not do "db2 close" here because incrvacuum-12.2 is excluded
+# so db2 is not opended.
db close
- file delete -force test.db test.db-journal
+ forcedelete test.db test.db-journal
sqlite3 db test.db ; set ::DB [sqlite3_connection_pointer db]
-@@ -736,8 +737,8 @@
+@@ -736,8 +739,8 @@
catchsql {
PRAGMA incremental_vacuum(10);
} db3
@@ -31,7 +31,7 @@
do_test incrvacuum-15.1 {
--- test/vacuum4.test
+++ test/vacuum4.test
-@@ -65,3 +65,5 @@ do_test vacuum4-1.1 {
+@@ -65,3 +65,5 @@
VACUUM;
}
} {}
diff --git a/lang/sql/adapter/sqlite-patches/19_backup_test.patch b/lang/sql/adapter/sqlite-patches/19_backup_test.patch
index 7156d333..5bf83f3c 100644
--- a/lang/sql/adapter/sqlite-patches/19_backup_test.patch
+++ b/lang/sql/adapter/sqlite-patches/19_backup_test.patch
@@ -1,5 +1,14 @@
--- test/backup.test
+++ test/backup.test
+@@ -73,7 +73,7 @@
+ # Check that it is possible to create and finish backup operations.
+ #
+ do_test backup-1.3.1 {
+- delete_file test2.db
++ forcedelete test2.db
+ sqlite3 db2 test2.db
+ sqlite3_backup B db2 main db main
+ } {B}
@@ -164,12 +164,12 @@
set file_dest temp
}] {
@@ -9,10 +18,10 @@
foreach nPagePerStep {1 200} {
# Open the databases.
-- catch { file delete test.db }
-- catch { file delete test2.db }
-+ catch { file delete -force -- test.db }
-+ catch { file delete -force -- test2.db }
+- catch { delete_file test.db }
+- catch { delete_file test2.db }
++ catch { forcedelete test.db }
++ catch { forcedelete test2.db }
eval $zOpenScript
# Set to true if copying to an in-memory destination. Copying to an
@@ -35,11 +44,10 @@
CREATE TABLE ${file_dest}.t1(a, b);
CREATE INDEX ${file_dest}.i1 ON t1(a, b);
" $db_dest
-@@ -244,119 +245,6 @@
- # End of backup-2.* tests.
+@@ -245,120 +246,6 @@
#---------------------------------------------------------------------
--#---------------------------------------------------------------------
+ #---------------------------------------------------------------------
-# These tests, backup-3.*, ensure that nothing goes wrong if either
-# the source or destination database are large enough to include the
-# the locking-page (the page that contains the range of bytes that
@@ -74,8 +82,8 @@
-foreach nDestRow {10 100} {
-foreach nDestPgsz {512 1024 2048 4096} {
-
-- catch { file delete test.db }
-- catch { file delete test2.db }
+- catch { delete_file test.db }
+- catch { delete_file test2.db }
- sqlite3 db test.db
- sqlite3 db2 test2.db
-
@@ -122,8 +130,8 @@
-
-#--------------------------------------------------------------------
-do_test backup-3.$iTest.1 {
-- catch { file delete -force test.db }
-- catch { file delete -force test2.db }
+- catch { forcedelete test.db }
+- catch { forcedelete test2.db }
- sqlite3 db test.db
- set iTab 1
-
@@ -152,34 +160,27 @@
-# End of backup-3.* tests.
-#---------------------------------------------------------------------
-
-
- #---------------------------------------------------------------------
+-
+-#---------------------------------------------------------------------
# The following tests, backup-4.*, test various error conditions:
-@@ -439,7 +327,7 @@
- db2 close
-
- do_test backup-4.5.1 {
-- catch { file delete -force test.db }
-+ catch { file delete -force -- test.db }
- sqlite3 db test.db
- sqlite3 db2 :memory:
- execsql {
-@@ -492,11 +380,11 @@
+ #
+ # backup-4.1.*: Test invalid database names.
+@@ -492,11 +379,11 @@
#
set iTest 0
- file delete -force bak.db-wal
+ forcedelete bak.db-wal
-foreach {writer file} {db test.db db3 test.db db :memory:} {
+foreach {writer file} {db test.db db :memory:} {
incr iTest
-- catch { file delete bak.db }
-+ catch { file delete -force bak.db }
+- catch { delete_file bak.db }
++ catch { forcedelete bak.db }
sqlite3 db2 bak.db
-- catch { file delete $file }
-+ catch { file delete -force $file }
+- catch { delete_file $file }
++ catch { forcedelete $file }
sqlite3 db $file
sqlite3 db3 $file
-@@ -520,7 +408,7 @@
+@@ -520,7 +407,7 @@
} {SQLITE_OK}
do_test backup-5.$iTest.1.3 {
execsql { UPDATE t1 SET a = a + 1 } $writer
@@ -188,19 +189,19 @@
} {SQLITE_DONE}
do_test backup-5.$iTest.1.4 {
B finish
-@@ -597,9 +485,9 @@
+@@ -597,9 +484,9 @@
catch {db close}
catch {db2 close}
catch {db3 close}
-- catch { file delete bak.db }
-+ catch { file delete -force -- bak.db }
+- catch { delete_file bak.db }
++ catch { forcedelete bak.db }
sqlite3 db2 bak.db
-- catch { file delete $file }
-+ catch { file delete -force -- $file }
+- catch { delete_file $file }
++ catch { forcedelete $file }
sqlite3 db $file
sqlite3 db3 $file
do_test backup-5.$iTest.5.1 {
-@@ -631,7 +519,6 @@
+@@ -631,7 +518,6 @@
B finish
} {SQLITE_OK}
integrity_check backup-5.$iTest.5.5 db2
@@ -208,32 +209,15 @@
catch {db close}
catch {db2 close}
catch {db3 close}
-@@ -644,8 +531,8 @@
- # Test the sqlite3_backup_remaining() and backup_pagecount() APIs.
- #
- do_test backup-6.1 {
-- catch { file delete -force test.db }
-- catch { file delete -force test2.db }
-+ catch { file delete -force -- test.db }
-+ catch { file delete -force -- test2.db }
- sqlite3 db test.db
- sqlite3 db2 test2.db
- execsql {
-@@ -701,10 +588,11 @@
- # backup-7.3.*: Destination database is externally locked (return SQLITE_BUSY).
- #
- do_test backup-7.0 {
-- catch { file delete -force test.db }
-- catch { file delete -force test2.db }
-+ catch { file delete -force -- test.db }
-+ catch { file delete -force -- test2.db }
+@@ -705,6 +591,7 @@
+ catch { forcedelete test2.db }
sqlite3 db2 test2.db
sqlite3 db test.db
+ sqlite3 db3 test.db
execsql {
CREATE TABLE t1(a, b);
CREATE INDEX i1 ON t1(a, b);
-@@ -723,24 +611,12 @@
+@@ -723,24 +610,12 @@
sqlite3_backup B db2 main db main
B step 5
} {SQLITE_OK}
@@ -258,20 +242,13 @@
do_test backup-7.2.3 {
execsql { ROLLBACK }
B step 5000
-@@ -754,17 +630,17 @@
- do_test backup-7.3.1 {
- db2 close
- db3 close
-- file delete -force test2.db
-+ file delete -force -- test2.db
- sqlite3 db2 test2.db
+@@ -759,12 +634,12 @@
sqlite3 db3 test2.db
sqlite3_backup B db2 main db main
- execsql { BEGIN ; CREATE TABLE t2(a, b); } db3
--
+ execsql { BEGIN ; CREATE TABLE t2(a, b); COMMIT; } db3
-+
+
B step 5
} {SQLITE_BUSY}
do_test backup-7.3.2 {
@@ -280,7 +257,7 @@
B step 5000
} {SQLITE_DONE}
do_test backup-7.3.3 {
-@@ -773,7 +649,6 @@
+@@ -773,7 +648,6 @@
test_contents backup-7.3.4 db main db2 main
integrity_check backup-7.3.5 db2
catch { db2 close }
@@ -288,33 +265,10 @@
#-----------------------------------------------------------------------
# The following tests, backup-8.*, test attaching multiple backup
-@@ -783,8 +658,8 @@
- # These tests reuse the database "test.db" left over from backup-7.*.
- #
- do_test backup-8.1 {
-- catch { file delete -force test2.db }
-- catch { file delete -force test3.db }
-+ catch { file delete -force -- test2.db }
-+ catch { file delete -force -- test3.db }
- sqlite3 db2 test2.db
- sqlite3 db3 test3.db
-
-@@ -865,8 +740,8 @@
-
- ifcapable memorymanage {
- db close
-- file delete -force test.db
-- file delete -force bak.db
-+ file delete -force -- test.db
-+ file delete -force -- bak.db
-
- sqlite3 db test.db
- sqlite3 db2 test.db
-@@ -915,17 +790,24 @@
- # used as the source by a backup operation:
+@@ -916,16 +790,24 @@
#
# 10.1.*: If the db is in-memory, the backup is restarted.
--# 10.2.*: If the db is a file, the backup is not restarted.
+ # 10.2.*: If the db is a file, the backup is not restarted.
+# 10.2.*: If the db is a file, the backup is restarted.
+# 10.3.*: If the db is in-memory, and not updated, the backup is not
+# restarted
@@ -322,13 +276,12 @@
+# restarted
#
db close
--file delete -force test.db test.db-journal
+ forcedelete test.db test.db-journal
-foreach {tn file rc} {
- 1 test.db SQLITE_DONE
- 2 :memory: SQLITE_OK
-+file delete -force -- test.db test.db-journal
+foreach {tn file update rc} {
-+ 1 test.db 1 SQLITE_OK
++ 1 test.db 1 SQLITE_DONE
+ 2 :memory: 1 SQLITE_OK
+ 1 test.db 0 SQLITE_DONE
+ 2 :memory: 0 SQLITE_DONE
@@ -340,7 +293,7 @@
CREATE TABLE t1(a INTEGER PRIMARY KEY, b BLOB);
BEGIN;
INSERT INTO t1 VALUES(NULL, randomblob(200));
-@@ -942,21 +824,18 @@
+@@ -942,11 +824,6 @@
}
} {256}
@@ -350,10 +303,9 @@
- } {1}
-
do_test backup-10.$tn.3 {
-- file delete -force bak.db bak.db-journal
-+ file delete -force -- bak.db bak.db-journal
+ forcedelete bak.db bak.db-journal
sqlite3 db2 bak.db
- sqlite3_backup B db2 main db main
+@@ -954,9 +831,11 @@
B step 50
} {SQLITE_OK}
@@ -368,4 +320,3 @@
do_test backup-10.$tn.5 {
B step 50
-
diff --git a/lang/sql/adapter/sqlite-patches/22_unique_key.patch b/lang/sql/adapter/sqlite-patches/22_unique_key.patch
deleted file mode 100644
index 426246b1..00000000
--- a/lang/sql/adapter/sqlite-patches/22_unique_key.patch
+++ /dev/null
@@ -1,79 +0,0 @@
---- src/sqliteInt.h
-+++ src/sqliteInt.h
-@@ -1414,7 +1414,6 @@
- KeyInfo *pKeyInfo; /* Collation and sort-order information */
- u16 nField; /* Number of entries in apMem[] */
- u16 flags; /* Boolean settings. UNPACKED_... below */
-- i64 rowid; /* Used by UNPACKED_PREFIX_SEARCH */
- Mem *aMem; /* Values */
- };
-
-@@ -1426,7 +1425,6 @@
- #define UNPACKED_IGNORE_ROWID 0x0004 /* Ignore trailing rowid on key1 */
- #define UNPACKED_INCRKEY 0x0008 /* Make this key an epsilon larger */
- #define UNPACKED_PREFIX_MATCH 0x0010 /* A prefix match is considered OK */
--#define UNPACKED_PREFIX_SEARCH 0x0020 /* A prefix match is considered OK */
-
- /*
- ** Each SQL index is represented in memory by an
---- src/vdbe.c
-+++ src/vdbe.c
-@@ -3526,6 +3526,7 @@
- Mem *aMx;
- UnpackedRecord r; /* B-Tree index search key */
- i64 R; /* Rowid stored in register P3 */
-+ i64 rowid; /* Rowid found */
-
- pIn3 = &aMem[pOp->p3];
- aMx = &aMem[pOp->p4.i];
-@@ -3555,8 +3556,8 @@
- if( pCrsr!=0 ){
- /* Populate the index search key. */
- r.pKeyInfo = pCx->pKeyInfo;
-- r.nField = nField + 1;
-- r.flags = UNPACKED_PREFIX_SEARCH;
-+ r.nField = nField;
-+ r.flags = UNPACKED_PREFIX_MATCH;
- r.aMem = aMx;
- #ifdef SQLITE_DEBUG
- { int i; for(i=0; i<r.nField; i++) assert( memIsValid(&r.aMem[i]) ); }
-@@ -3570,10 +3571,14 @@
- ** to P2. Otherwise, copy the rowid of the conflicting record to
- ** register P3 and fall through to the next instruction. */
- rc = sqlite3BtreeMovetoUnpacked(pCrsr, &r, 0, 0, &pCx->seekResult);
-- if( (r.flags & UNPACKED_PREFIX_SEARCH) || r.rowid==R ){
-- pc = pOp->p2 - 1;
-- }else{
-- pIn3->u.i = r.rowid;
-+ if( rc != SQLITE_OK || pCx->seekResult != 0 ){
-+ pc = pOp->p2 - 1;
-+ }else{
-+ rc = sqlite3VdbeIdxRowid(db, pCrsr, &rowid);
-+ if (rc == SQLITE_OK && rowid == R)
-+ pc = pOp->p2 - 1;
-+ else
-+ pIn3->u.i = rowid;
- }
- }
- break;
---- src/vdbeaux.c
-+++ src/vdbeaux.c
-@@ -2916,18 +2916,6 @@
- rc = -rc;
- }
-
-- /* If the PREFIX_SEARCH flag is set and all fields except the final
-- ** rowid field were equal, then clear the PREFIX_SEARCH flag and set
-- ** pPKey2->rowid to the value of the rowid field in (pKey1, nKey1).
-- ** This is used by the OP_IsUnique opcode.
-- */
-- if( (pPKey2->flags & UNPACKED_PREFIX_SEARCH) && i==(pPKey2->nField-1) ){
-- assert( idx1==szHdr1 && rc );
-- assert( mem1.flags & MEM_Int );
-- pPKey2->flags &= ~UNPACKED_PREFIX_SEARCH;
-- pPKey2->rowid = mem1.u.i;
-- }
--
- return rc;
- }
- i++;
diff --git a/lang/sql/adapter/sqlite-patches/23_sequence_functions.patch b/lang/sql/adapter/sqlite-patches/23_sequence_functions.patch
index 71480c0e..2d3c6b81 100644
--- a/lang/sql/adapter/sqlite-patches/23_sequence_functions.patch
+++ b/lang/sql/adapter/sqlite-patches/23_sequence_functions.patch
@@ -1,30 +1,15 @@
--- Makefile.in
+++ Makefile.in
-@@ -159,17 +159,17 @@
-
- USE_AMALGAMATION = @USE_AMALGAMATION@
-
- # Object files for the SQLite library (non-amalgamation).
- #
+@@ -164,7 +164,7 @@
LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \
backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
callback.lo complete.lo ctime.lo date.lo db_encrypt.lo db_pragma.lo \
- db_shell.lo delete.lo expr.lo fault.lo fkey.lo \
+ db_sequence.lo db_shell.lo delete.lo expr.lo fault.lo fkey.lo \
- fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo fts3_porter.lo \
- fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo fts3_write.lo \
- func.lo global.lo hash.lo \
- icu.lo insert.lo journal.lo legacy.lo loadext.lo \
- main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
- memjournal.lo \
- mutex.lo mutex_noop.lo mutex_os2.lo mutex_unix.lo mutex_w32.lo \
- notify.lo opcodes.lo os.lo os_os2.lo os_unix.lo os_win.lo \
-@@ -204,16 +204,17 @@
- $(TOP)/../adapter/btreeInt.h \
- $(TOP)/src/build.c \
- $(TOP)/src/callback.c \
- $(TOP)/src/complete.c \
- $(TOP)/src/ctime.c \
+ fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
+ fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
+ fts3_tokenize_vtab.lo \
+@@ -211,6 +211,7 @@
$(TOP)/src/date.c \
$(TOP)/../adapter/db_encrypt.c \
$(TOP)/../adapter/db_pragma.c \
@@ -32,17 +17,7 @@
$(TOP)/../adapter/db_shell.c \
$(TOP)/src/delete.c \
$(TOP)/src/expr.c \
- $(TOP)/src/fault.c \
- $(TOP)/src/fkey.c \
- $(TOP)/src/func.c \
- $(TOP)/src/global.c \
- $(TOP)/src/hash.c \
-@@ -381,16 +382,17 @@
-
- # Source code to the library files needed by the test fixture
- #
- TESTSRC2 = \
- $(TOP)/src/attach.c \
+@@ -410,6 +411,7 @@
$(TOP)/../adapter/backup.c \
$(TOP)/src/bitvec.c \
$(TOP)/../adapter/btree.c \
@@ -50,17 +25,7 @@
$(TOP)/src/build.c \
$(TOP)/src/ctime.c \
$(TOP)/src/date.c \
- $(TOP)/src/expr.c \
- $(TOP)/src/func.c \
- $(TOP)/src/insert.c \
- $(TOP)/../adapter/wal.c \
- $(TOP)/src/mem5.c \
-@@ -579,16 +581,20 @@
- db_encrypt.lo: $(TOP)/../adapter/db_encrypt.c $(HDR) \
- $(TOP)/../adapter/btreeInt.h
- $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/../adapter/db_encrypt.c
-
- db_pragma.lo: $(TOP)/../adapter/db_pragma.c $(HDR) \
+@@ -626,6 +628,10 @@
$(TOP)/../adapter/btreeInt.h
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/../adapter/db_pragma.c
@@ -71,11 +36,6 @@
db_shell.lo: $(TOP)/../adapter/db_shell.c $(HDR) \
$(TOP)/../adapter/btreeInt.h
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/../adapter/db_shell.c
-
- delete.lo: $(TOP)/src/delete.c $(HDR)
- $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/delete.c
-
- expr.lo: $(TOP)/src/expr.c $(HDR)
--- src/main.c
+++ src/main.c
@@ -55,6 +55,8 @@
@@ -87,10 +47,10 @@
#if !defined(SQLITE_OMIT_TRACE) && defined(SQLITE_ENABLE_IOTRACE)
/*
** If the following function pointer is not NULL and if
-@@ -1854,6 +1856,13 @@
+@@ -2532,6 +2534,13 @@
db->pDfltColl = sqlite3FindCollSeq(db, SQLITE_UTF8, "BINARY", 0);
assert( db->pDfltColl!=0 );
-
+
+ /*
+ ** Berkley DB customization!
+ ** Register any Berkeley DB specific extension functions.
@@ -99,25 +59,15 @@
+ /* End Berkeley DB customization. */
+
/* Also add a UTF-8 case-insensitive collation sequence. */
- createCollation(db, "NOCASE", SQLITE_UTF8, SQLITE_COLL_NOCASE, 0,
- nocaseCollatingFunc, 0);
+ createCollation(db, "NOCASE", SQLITE_UTF8, 0, nocaseCollatingFunc, 0);
+
--- tool/mksqlite3c.tcl
+++ tool/mksqlite3c.tcl
-@@ -247,16 +247,17 @@
- pager.c
- wal.c
-
- btmutex.c
- btree.c
+@@ -271,6 +271,7 @@
backup.c
db_encrypt.c
db_pragma.c
+ db_sequence.c
db_shell.c
-
+
vdbemem.c
- vdbeaux.c
- vdbeapi.c
- vdbetrace.c
- vdbe.c
- vdbeblob.c
diff --git a/lang/sql/adapter/sqlite-patches/24_exclusive_error_handling.patch b/lang/sql/adapter/sqlite-patches/24_exclusive_error_handling.patch
index edaaaa4b..1d66bc0b 100644
--- a/lang/sql/adapter/sqlite-patches/24_exclusive_error_handling.patch
+++ b/lang/sql/adapter/sqlite-patches/24_exclusive_error_handling.patch
@@ -1,11 +1,6 @@
--- src/prepare.c
+++ src/prepare.c
-@@ -242,16 +242,20 @@
- ** meta[8] unused
- ** meta[9] unused
- **
- ** Note: The #defined SQLITE_UTF* symbols in sqliteInt.h correspond to
- ** the possible values of meta[4].
+@@ -249,6 +249,10 @@
*/
for(i=0; i<ArraySize(meta); i++){
sqlite3BtreeGetMeta(pDb->pBt, i+1, (u32 *)&meta[i]);
@@ -16,41 +11,21 @@
}
pDb->pSchema->schema_cookie = meta[BTREE_SCHEMA_VERSION-1];
- /* If opening a non-empty database, check the text encoding. For the
- ** main database, set sqlite3.enc to the encoding of the main database.
- ** For an attached db, it is an error if the encoding is not the same
- ** as sqlite3.enc.
- */
-@@ -466,17 +470,20 @@
- openedTransaction = 1;
- }
-
- /* Read the schema cookie from the database. If it does not match the
- ** value stored as part of the in-memory schema representation,
+@@ -480,7 +484,10 @@
** set Parse.rc to SQLITE_SCHEMA. */
sqlite3BtreeGetMeta(pBt, BTREE_SCHEMA_VERSION, (u32 *)&cookie);
assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
+- if( cookie!=db->aDb[iDb].pSchema->schema_cookie ){
+ if( pParse->rc == SQLITE_OK && db->errCode == SQLITE_BUSY )
+ pParse->rc = db->errCode;
+ if( pParse->rc != SQLITE_BUSY &&
+ cookie!=db->aDb[iDb].pSchema->schema_cookie ){
-- if( cookie!=db->aDb[iDb].pSchema->schema_cookie ){
- sqlite3ResetInternalSchema(db, iDb);
+ sqlite3ResetOneSchema(db, iDb);
pParse->rc = SQLITE_SCHEMA;
}
-
- /* Close the transaction, if one was opened. */
- if( openedTransaction ){
- sqlite3BtreeCommit(pBt);
- }
--- src/vdbe.c
+++ src/vdbe.c
-@@ -2858,16 +2858,18 @@
- iDb = pOp->p1;
- iCookie = pOp->p3;
- assert( pOp->p3<SQLITE_N_BTREE_META );
- assert( iDb>=0 && iDb<db->nDb );
- assert( db->aDb[iDb].pBt!=0 );
+@@ -3055,6 +3055,8 @@
assert( (p->btreeMask & (((yDbMask)1)<<iDb))!=0 );
sqlite3BtreeGetMeta(db->aDb[iDb].pBt, iCookie, (u32 *)&iMeta);
@@ -59,17 +34,7 @@
pOut->u.i = iMeta;
break;
}
-
- /* Opcode: SetCookie P1 P2 P3 * *
- **
- ** Write the content of register P3 (interpreted as an integer)
- ** into cookie number P2 of database P1. P2==1 is the schema version.
-@@ -2930,16 +2932,20 @@
- Btree *pBt;
-
- assert( pOp->p1>=0 && pOp->p1<db->nDb );
- assert( (p->btreeMask & (((yDbMask)1)<<pOp->p1))!=0 );
- assert( sqlite3SchemaMutexHeld(db, pOp->p1, 0) );
+@@ -3129,6 +3131,10 @@
pBt = db->aDb[pOp->p1].pBt;
if( pBt ){
sqlite3BtreeGetMeta(pBt, BTREE_SCHEMA_VERSION, (u32 *)&iMeta);
@@ -80,8 +45,3 @@
iGen = db->aDb[pOp->p1].pSchema->iGeneration;
}else{
iGen = iMeta = 0;
- }
- if( iMeta!=pOp->p2 || iGen!=pOp->p3 ){
- sqlite3DbFree(db, p->zErrMsg);
- p->zErrMsg = sqlite3DbStrDup(db, "database schema has changed");
- /* If the schema-cookie from the database file matches the cookie
diff --git a/lang/sql/adapter/sqlite-patches/25_tester.patch b/lang/sql/adapter/sqlite-patches/25_tester.patch
index fe4a9e04..73308e98 100644
--- a/lang/sql/adapter/sqlite-patches/25_tester.patch
+++ b/lang/sql/adapter/sqlite-patches/25_tester.patch
@@ -1,43 +1,244 @@
--- test/tester.tcl
+++ test/tester.tcl
-@@ -1441,6 +1441,7 @@
- set f [string range $f2 3 end]
- file copy -force $f2 $f
+@@ -138,7 +138,7 @@
+ # NOTE: Return the default number of retries for [file] operations. A
+ # value of zero or less here means "disabled".
+ #
+- return [expr {$::tcl_platform(platform) eq "windows" ? 50 : 0}]
++ return [expr {$::tcl_platform(platform) eq "windows" ? 10 : 0}]
}
-+ file delete test.db-journal/__db.register
+ return $::G(file-retries)
}
- proc db_restore_and_reopen {{dbfile test.db}} {
- catch { db close }
-@@ -1449,7 +1450,7 @@
+@@ -500,6 +500,9 @@
+ forcedelete test.db-journal
+ forcedelete test.db-wal
+ sqlite3 db ./test.db
++ if {[ array names ::env BDB_BLOB_SETTING ] != "" } {
++ db eval "pragma large_record_opt=$::env(BDB_BLOB_SETTING)"
++ }
+ set ::DB [sqlite3_connection_pointer db]
+ if {[info exists ::SETUP_SQL]} {
+ db eval $::SETUP_SQL
+@@ -534,6 +537,11 @@
+ }
}
- proc db_delete_and_reopen {{file test.db}} {
- catch { db close }
-- foreach f [glob -nocomplain test.db*] { file delete -force $f }
-+ foreach f [glob -nocomplain test.db*] { forcedelete $f }
- sqlite3 db $file
+
++# Pull in the list of test cases that are excluded and ignored when running
++# with Berkeley DB.
++#
++source $testdir/../../../../test/sql/bdb_excl.test
++
+ # Record the fact that a sequence of tests were omitted.
+ #
+ proc omit_test {name reason {append 1}} {
+@@ -581,12 +589,20 @@
+ # Invoke the do_test procedure to run a single test
+ #
+ proc do_test {name cmd expected} {
+- global argv cmdlinearg
++ global argv cmdlinearg IGNORE_CASES EXCLUDE_CASES
+
+ fix_testname name
+
+ sqlite3_memdebug_settitle $name
+
++ foreach pattern $EXCLUDE_CASES {
++ if {[string match $pattern $name]} {
++ puts "$name... Skipping"
++ flush stdout
++ return
++ }
++ }
++
+ # if {[llength $argv]==0} {
+ # set go 1
+ # } else {
+@@ -650,11 +666,19 @@
+ set ok [expr {[string compare $result $expected]==0}]
+ }
+ if {!$ok} {
+- # if {![info exists ::testprefix] || $::testprefix eq ""} {
+- # error "no test prefix"
+- # }
+- puts "\nExpected: \[$expected\]\n Got: \[$result\]"
+- fail_test $name
++ set ignore 0
++ foreach pattern $IGNORE_CASES {
++ if {[string match $pattern $name]} {
++ set ignore 1
++ break
++ }
++ }
++ if {$ignore} {
++ puts " Ignored"
++ } else {
++ puts "\nExpected: \[$expected\]\n Got: \[$result\]"
++ fail_test $name
++ }
+ } else {
+ puts " Ok"
+ }
+@@ -1224,12 +1248,6 @@
+ return $ret
+ }
+
+-# Returns non-zero if the capabilities are present; zero otherwise.
+-#
+-proc capable {expr} {
+- set e [fix_ifcapable_expr $expr]; return [expr ($e)]
+-}
+-
+ # Evaluate a boolean expression of capabilities. If true, execute the
+ # code. Omit the code if false.
+ #
+@@ -1340,25 +1358,6 @@
+ lappend r $msg
}
---- test/permutations.test
-+++ test/permutations.test
-@@ -171,4 +171,9 @@
+-proc run_ioerr_prep {} {
+- set ::sqlite_io_error_pending 0
+- catch {db close}
+- catch {db2 close}
+- catch {forcedelete test.db}
+- catch {forcedelete test.db-journal}
+- catch {forcedelete test2.db}
+- catch {forcedelete test2.db-journal}
+- set ::DB [sqlite3 db test.db; sqlite3_connection_pointer db]
+- sqlite3_extended_result_codes $::DB $::ioerropts(-erc)
+- if {[info exists ::ioerropts(-tclprep)]} {
+- eval $::ioerropts(-tclprep)
+- }
+- if {[info exists ::ioerropts(-sqlprep)]} {
+- execsql $::ioerropts(-sqlprep)
+- }
+- expr 0
+-}
+-
+ # Usage: do_ioerr_test <test number> <options...>
+ #
+ # This proc is used to implement test cases that check that IO errors
+@@ -1392,25 +1392,9 @@
+ # a couple of obscure IO errors that do not return them.
+ set ::ioerropts(-erc) 0
+
+- # Create a single TCL script from the TCL and SQL specified
+- # as the body of the test.
+- set ::ioerrorbody {}
+- if {[info exists ::ioerropts(-tclbody)]} {
+- append ::ioerrorbody "$::ioerropts(-tclbody)\n"
+- }
+- if {[info exists ::ioerropts(-sqlbody)]} {
+- append ::ioerrorbody "db eval {$::ioerropts(-sqlbody)}"
+- }
+-
+- save_prng_state
+- if {$::ioerropts(-cksum)} {
+- run_ioerr_prep
+- eval $::ioerrorbody
+- set ::goodcksum [cksum]
+- }
+-
+ set ::go 1
+ #reset_prng_state
++ save_prng_state
+ for {set n $::ioerropts(-start)} {$::go} {incr n} {
+ set ::TN $n
+ incr ::ioerropts(-count) -1
+@@ -1427,12 +1410,27 @@
+ # Delete the files test.db and test2.db, then execute the TCL and
+ # SQL (in that order) to prepare for the test case.
+ do_test $testname.$n.1 {
+- run_ioerr_prep
++ set ::sqlite_io_error_pending 0
++ catch {db close}
++ catch {db2 close}
++ catch {forcedelete test.db}
++ catch {forcedelete test.db-journal}
++ catch {forcedelete test2.db}
++ catch {forcedelete test2.db-journal}
++ set ::DB [sqlite3 db test.db; sqlite3_connection_pointer db]
++ sqlite3_extended_result_codes $::DB $::ioerropts(-erc)
++ if {[info exists ::ioerropts(-tclprep)]} {
++ eval $::ioerropts(-tclprep)
++ }
++ if {[info exists ::ioerropts(-sqlprep)]} {
++ execsql $::ioerropts(-sqlprep)
++ }
++ expr 0
+ } {0}
+
+ # Read the 'checksum' of the database.
+ if {$::ioerropts(-cksum)} {
+- set ::checksum [cksum]
++ set checksum [cksum]
+ }
+
+ # Set the Nth IO error to fail.
+@@ -1440,10 +1438,20 @@
+ set ::sqlite_io_error_persist $::ioerropts(-persist)
+ set ::sqlite_io_error_pending $n
+ }] $n
++
++ # Create a single TCL script from the TCL and SQL specified
++ # as the body of the test.
++ set ::ioerrorbody {}
++ if {[info exists ::ioerropts(-tclbody)]} {
++ append ::ioerrorbody "$::ioerropts(-tclbody)\n"
++ }
++ if {[info exists ::ioerropts(-sqlbody)]} {
++ append ::ioerrorbody "db eval {$::ioerropts(-sqlbody)}"
++ }
+
+- # Execute the TCL script created for the body of this test. If
+- # at least N IO operations performed by SQLite as a result of
+- # the script, the Nth will fail.
++ # Execute the TCL Script created in the above block. If
++ # there are at least N IO operations performed by SQLite as
++ # a result of the script, the Nth will fail.
+ do_test $testname.$n.3 {
+ set ::sqlite_io_error_hit 0
+ set ::sqlite_io_error_hardhit 0
+@@ -1547,15 +1555,8 @@
+ catch {db close}
+ catch {db2 close}
+ set ::DB [sqlite3 db test.db; sqlite3_connection_pointer db]
+- set nowcksum [cksum]
+- set res [expr {$nowcksum==$::checksum || $nowcksum==$::goodcksum}]
+- if {$res==0} {
+- puts "now=$nowcksum"
+- puts "the=$::checksum"
+- puts "fwd=$::goodcksum"
+- }
+- set res
+- } 1
++ cksum
++ } $checksum
+ }
+
+ set ::sqlite_io_error_hardhit 0
+@@ -1747,6 +1748,7 @@
+ $db eval { SELECT * FROM sqlite_master }
+ do_test $testname [list $db eval "PRAGMA main.journal_mode"] {wal}
+ }
++ forcedelete test.db-journal/__db.register
}
-+# We exlcude below fts3 tests:
-+# fts3defer.test, fts3defer2.test
-+# -- Known difference of zeroblob between SQLite and BDBSQL. #19764
-+# fts3fault.test
-+# -- Known difference: DBSQL testfixture does't support sqlite_io_error tests.
- test_suite "fts3" -prefix "" -description {
- All FTS3 tests except fts3rnd.test.
-@@ -178,8 +183,8 @@
- fts3ak.test fts3al.test fts3am.test fts3an.test fts3ao.test
- fts3atoken.test fts3b.test fts3c.test fts3cov.test fts3d.test
-- fts3defer.test fts3defer2.test fts3e.test fts3expr.test fts3expr2.test
-+ fts3e.test fts3expr.test fts3expr2.test
- fts3near.test fts3query.test fts3shared.test fts3snippet.test
-
-- fts3fault.test fts3malloc.test fts3matchinfo.test
-+ fts3malloc.test fts3matchinfo.test
-
- fts3aux1.test fts3comp1.test
-
+ proc permutation {} {
+@@ -1884,6 +1886,7 @@
+ set f [string range $f2 3 end]
+ forcecopy $f2 $f
+ }
++ forcedelete test.db-journal/__db.register
+ }
+ proc db_restore_and_reopen {{dbfile test.db}} {
+ catch { db close }
+--- Makefile.in
++++ Makefile.in
+@@ -445,7 +445,6 @@
+ $(TOP)/ext/fts3/fts3.c \
+ $(TOP)/ext/fts3/fts3_aux.c \
+ $(TOP)/ext/fts3/fts3_expr.c \
+- $(TOP)/ext/fts3/fts3_term.c \
+ $(TOP)/ext/fts3/fts3_tokenizer.c \
+ $(TOP)/ext/fts3/fts3_write.c \
+ $(TOP)/ext/async/sqlite3async.c
diff --git a/lang/sql/adapter/sqlite-patches/26_solaris_build.patch b/lang/sql/adapter/sqlite-patches/26_solaris_build.patch
index b3a5ec8a..4b766c8d 100644
--- a/lang/sql/adapter/sqlite-patches/26_solaris_build.patch
+++ b/lang/sql/adapter/sqlite-patches/26_solaris_build.patch
@@ -1,7 +1,6 @@
--- src/test_demovfs.c
+++ src/test_demovfs.c
-@@ -119,8 +119,9@@
-
+@@ -118,6 +118,7 @@
#include <sqlite3.h>
#include <assert.h>
@@ -9,4 +8,3 @@
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
- #include <sys/file.h>
diff --git a/lang/sql/adapter/sqlite-patches/27_sqlthread.patch b/lang/sql/adapter/sqlite-patches/27_sqlthread.patch
deleted file mode 100644
index 5d6ef98d..00000000
--- a/lang/sql/adapter/sqlite-patches/27_sqlthread.patch
+++ /dev/null
@@ -1,97 +0,0 @@
---- src/test_thread.c
-+++ src/test_thread.c
-@@ -273,6 +273,9 @@
-
- const char *zFilename;
- sqlite3 *db;
-+ void *pKey = 0;
-+ int nKey = 0;
-+ char *zErrMsg;
- int rc;
- char zBuf[100];
- extern void Md5_Register(sqlite3*);
-@@ -281,7 +284,18 @@
- UNUSED_PARAMETER(objc);
-
- zFilename = Tcl_GetString(objv[2]);
-+ pKey = Tcl_GetByteArrayFromObj(objv[3], &nKey);
- rc = sqlite3_open(zFilename, &db);
-+#ifdef SQLITE_HAS_CODEC
-+ if(db){
-+ rc = sqlite3_key(db, pKey, nKey);
-+ if( rc ){
-+ zErrMsg = sqlite3_mprintf("%s", sqlite3ErrStr(rc));
-+ sqlite3_close(db);
-+ db = NULL;
-+ }
-+ }
-+#endif
- Md5_Register(db);
- sqlite3_busy_handler(db, xBusy, 0);
-
-@@ -330,7 +344,7 @@
- } aSub[] = {
- {"parent", sqlthread_parent, 1, "SCRIPT"},
- {"spawn", sqlthread_spawn, 2, "VARNAME SCRIPT"},
-- {"open", sqlthread_open, 1, "DBNAME"},
-+ {"open", sqlthread_open, 2, "DBNAME KEY"},
- {"id", sqlthread_id, 0, ""},
- {0, 0, 0}
- };
---- test/thread001.test
-+++ test/thread001.test
-@@ -77,7 +77,11 @@
- #sqlthread parent {puts STARTING..}
- set needToClose 0
- if {![info exists ::DB]} {
-- set ::DB [sqlthread open test.db]
-+ set key ""
-+ if {[sqlite -has-codec]} {
-+ set key "xyzzy"
-+ }
-+ set ::DB [sqlthread open test.db $key]
- #sqlthread parent "puts \"OPEN $::DB\""
- set needToClose 1
- }
-diff --git a/lang/sql/sqlite/test/thread003.test b/lang/sql/sqlite/test/thread003.test
---- test/thread003.test
-+++ test/thread003.test
-@@ -80,7 +80,11 @@
- foreach zFile {test.db test2.db} {
- set SCRIPT [format {
- set iEnd [expr {[clock_seconds] + %d}]
-- set ::DB [sqlthread open %s]
-+ set key ""
-+ if {[sqlite -has-codec]} {
-+ set key "xyzzy"
-+ }
-+ set ::DB [sqlthread open %s $key]
-
- # Set the cache size to 15 pages per cache. 30 available globally.
- execsql { PRAGMA cache_size = 15 }
-@@ -117,7 +121,11 @@
- set SCRIPT [format {
- set iStart [clock_seconds]
- set iEnd [expr {[clock_seconds] + %d}]
-- set ::DB [sqlthread open %s]
-+ set key ""
-+ if {[sqlite -has-codec]} {
-+ set key "xyzzy"
-+ }
-+ set ::DB [sqlthread open %s $key]
-
- # Set the cache size to 15 pages per cache. 30 available globally.
- execsql { PRAGMA cache_size = 15 }
-@@ -156,7 +164,11 @@
- do_test thread003.4 {
- thread_spawn finished(1) $thread_procs [format {
- set iEnd [expr {[clock_seconds] + %d}]
-- set ::DB [sqlthread open test.db]
-+ set key ""
-+ if {[sqlite -has-codec]} {
-+ set key "xyzzy"
-+ }
-+ set ::DB [sqlthread open test.db $key]
-
- # Set the cache size to 15 pages per cache. 30 available globally.
- execsql { PRAGMA cache_size = 15 }
diff --git a/lang/sql/adapter/sqlite-patches/28_wal_pragma.patch b/lang/sql/adapter/sqlite-patches/28_wal_pragma.patch
deleted file mode 100644
index 4c700a51..00000000
--- a/lang/sql/adapter/sqlite-patches/28_wal_pragma.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- src/vdbe.c
-+++ src/vdbe.c
-@@ -5323,17 +5323,17 @@
-
- #ifndef SQLITE_OMIT_WAL
- zFilename = sqlite3PagerFilename(pPager);
-
- /* Do not allow a transition to journal_mode=WAL for a database
- ** in temporary storage or if the VFS does not support shared memory
- */
- if( eNew==PAGER_JOURNALMODE_WAL
-- && (zFilename[0]==0 /* Temp file */
-+ && (zFilename==NULL || zFilename[0]==0 /* Temp file */
- || !sqlite3PagerWalSupported(pPager)) /* No shared-memory support */
- ){
- eNew = eOld;
- }
-
- if( (eNew!=eOld)
- && (eOld==PAGER_JOURNALMODE_WAL || eNew==PAGER_JOURNALMODE_WAL)
- ){
diff --git a/lang/sql/adapter/sqlite-patches/29_manydb_test.patch b/lang/sql/adapter/sqlite-patches/29_manydb_test.patch
index 603fbd5c..a58e1cf9 100644
--- a/lang/sql/adapter/sqlite-patches/29_manydb_test.patch
+++ b/lang/sql/adapter/sqlite-patches/29_manydb_test.patch
@@ -5,7 +5,7 @@
source $testdir/tester.tcl
-set N 300
-+set N 100
++set N 50
# if we're using proxy locks, we use 5 filedescriptors for a db
# that is open and in the middle of writing changes, normally
# sqlite uses 3 (proxy locking adds the conch and the local lock)
diff --git a/lang/sql/adapter/sqlite-patches/30_handle_cache.patch b/lang/sql/adapter/sqlite-patches/30_handle_cache.patch
index 36de9fc8..69f0b8da 100644
--- a/lang/sql/adapter/sqlite-patches/30_handle_cache.patch
+++ b/lang/sql/adapter/sqlite-patches/30_handle_cache.patch
@@ -1,48 +1,49 @@
--- src/btree.h
+++ src/btree.h
-@@ -94,6 +94,14 @@ int sqlite3BtreeCopyFile(Btree *, Btree
+@@ -121,6 +121,14 @@
+ int sqlite3BtreeNewDb(Btree *p);
- int sqlite3BtreeIncrVacuum(Btree *);
-
-+/*
-+ * BEGIN Berkeley DB specific btree APIs.
+ /*
++ * BEGIN Berkeley DB specific function forward declarations.
+ */
-+int sqlite3BtreeHandleCacheUpdate(Btree *p, int schema_changed);
++int sqlite3BtreeHandleCacheFixup(Btree *, int);
+/*
-+ * END Berkeley DB specific btree APIs.
++ * END Berkeley DB specific function forward declarations.
+ */
+
- /* The flags parameter to sqlite3BtreeCreateTable can be the bitwise OR
- ** of the flags shown below.
- **
++/*
+ ** The second parameter to sqlite3BtreeGetMeta or sqlite3BtreeUpdateMeta
+ ** should be one of the following values. The integer values are assigned
+ ** to constants so that the offset of the corresponding field in an
--- src/vdbe.c
+++ src/vdbe.c
-@@ -2929,11 +2929,13 @@ case OP_SetCookie: { /* in3 */
+@@ -3122,12 +3122,14 @@
case OP_VerifyCookie: {
int iMeta;
int iGen;
-+ int iSchemaChanged;
++ int iSchemaUpdated;
Btree *pBt;
assert( pOp->p1>=0 && pOp->p1<db->nDb );
assert( (p->btreeMask & (((yDbMask)1)<<pOp->p1))!=0 );
assert( sqlite3SchemaMutexHeld(db, pOp->p1, 0) );
-+ iSchemaChanged = 0;
+ assert( p->bIsReader );
++ iSchemaUpdated = 0;
pBt = db->aDb[pOp->p1].pBt;
if( pBt ){
sqlite3BtreeGetMeta(pBt, BTREE_SCHEMA_VERSION, (u32 *)&iMeta);
-@@ -2962,12 +2964,14 @@ case OP_VerifyCookie: {
+@@ -3156,12 +3158,14 @@
** a v-table method.
*/
if( db->aDb[pOp->p1].pSchema->schema_cookie!=iMeta ){
-+ iSchemaChanged = 1;
- sqlite3ResetInternalSchema(db, pOp->p1);
++ iSchemaUpdated = 1;
+ sqlite3ResetOneSchema(db, pOp->p1);
}
p->expired = 1;
rc = SQLITE_SCHEMA;
}
-+ sqlite3BtreeHandleCacheUpdate(pBt, iSchemaChanged);
++ sqlite3BtreeHandleCacheFixup(pBt, iSchemaUpdated);
break;
}
diff --git a/lang/sql/adapter/sqlite-patches/31_eqp_test.patch b/lang/sql/adapter/sqlite-patches/31_eqp_test.patch
new file mode 100644
index 00000000..b3f49810
--- /dev/null
+++ b/lang/sql/adapter/sqlite-patches/31_eqp_test.patch
@@ -0,0 +1,18 @@
+--- test/eqp.test
++++ test/eqp.test
+@@ -521,6 +521,7 @@
+ # documentation page eqp.html works. The C code is duplicated in test1.c
+ # and wrapped in Tcl command [print_explain_query_plan]
+ #
++db close
+ set boilerplate {
+ proc explain_query_plan {db sql} {
+ set stmt [sqlite3_prepare_v2 db $sql -1 DUMMY]
+@@ -556,6 +557,7 @@
+ 0 0 0 COMPOUND SUBQUERIES 1 AND 2 (EXCEPT)
+ }]
+
++sqlite3 db test.db
+ #-------------------------------------------------------------------------
+ # The following tests - eqp-7.* - test that queries that use the OP_Count
+ # optimization return something sensible with EQP.
diff --git a/lang/sql/adapter/sqlite-patches/32_permutations_test.patch b/lang/sql/adapter/sqlite-patches/32_permutations_test.patch
new file mode 100644
index 00000000..f3316172
--- /dev/null
+++ b/lang/sql/adapter/sqlite-patches/32_permutations_test.patch
@@ -0,0 +1,63 @@
+--- test/permutations.test
++++ test/permutations.test
+@@ -178,6 +178,11 @@
+ thread004.test thread005.test walthread.test
+ }
+
++# We exlcude below fts3 tests:
++# fts3defer.test, fts3defer2.test
++# -- Known difference of zeroblob between SQLite and BDBSQL. #19764
++# fts3fault.test
++# -- Known difference: DBSQL testfixture does't support sqlite_io_error tests.
+ test_suite "fts3" -prefix "" -description {
+ All FTS3 tests except fts3rnd.test.
+ } -files {
+@@ -185,14 +190,14 @@
+ fts3af.test fts3ag.test fts3ah.test fts3ai.test fts3aj.test
+ fts3ak.test fts3al.test fts3am.test fts3an.test fts3ao.test
+ fts3atoken.test fts3b.test fts3c.test fts3cov.test fts3d.test
+- fts3defer.test fts3defer2.test fts3e.test fts3expr.test fts3expr2.test
++ fts3e.test fts3expr.test fts3expr2.test
+ fts3expr3.test
+- fts3near.test fts3query.test fts3shared.test fts3snippet.test
++ fts3near.test fts3query.test fts3snippet.test
+ fts3sort.test
+- fts3fault.test fts3malloc.test fts3matchinfo.test
++ fts3malloc.test fts3matchinfo.test
+ fts3aux1.test fts3comp1.test fts3auto.test
+ fts4aa.test fts4content.test
+- fts3conf.test fts3prefix.test fts3fault2.test fts3corrupt.test
++ fts3conf.test fts3prefix.test fts3corrupt.test
+ fts3corrupt2.test fts3first.test fts4langid.test fts4merge.test
+ fts4check.test fts4unicode.test fts4noti.test
+ fts3varint.test
+@@ -537,6 +542,29 @@
+ vacuum.test view.test where.test
+ }
+
++# Run tests appropriate to the BDB SQL API using UTF-16 databases.
++#
++test_suite "bdb-utf16" -description {
++ Run tests using UTF-16 databases
++} -presql {
++ pragma encoding = 'UTF-16'
++} -files {
++ alter.test alter3.test
++ auth.test bind.test blob.test collate1.test
++ collate2.test collate3.test collate4.test collate6.test
++ date.test delete.test expr.test fkey1.test
++ index.test insert2.test insert.test interrupt.test in.test
++ intpkey.test join2.test join.test lastinsert.test
++ laststmtchanges.test limit.test main.test
++ memdb.test minmax.test misc2.test misc3.test notnull.test
++ null.test quote.test rowid.test select1.test select2.test
++ select3.test select4.test select6.test sort.test
++ subselect.test tableapi.test table.test temptable.test
++ trace.test trigger1.test trigger2.test trigger3.test
++ trigger4.test types2.test types.test unique.test update.test
++ view.test where.test
++}
++
+ # Run some tests in exclusive locking mode.
+ #
+ test_suite "exclusive" -description {
diff --git a/lang/sql/adapter/sqlite-patches/33_vdbe_assert.patch b/lang/sql/adapter/sqlite-patches/33_vdbe_assert.patch
new file mode 100644
index 00000000..0b8c901e
--- /dev/null
+++ b/lang/sql/adapter/sqlite-patches/33_vdbe_assert.patch
@@ -0,0 +1,27 @@
+--- src/vdbe.c
++++ src/vdbe.c
+@@ -2327,7 +2327,9 @@
+ assert( rc==SQLITE_OK ); /* DataSize() cannot fail */
+ pC->aRow = sqlite3BtreeDataFetch(pCrsr, &avail);
+ }
+- assert( avail<=65536 ); /* Maximum page size is 64KiB */
++ /* The BDB version can return data items larger than the largest page.
++ ** assert( avail<=65536 );
++ */
+ if( pC->payloadSize <= (u32)avail ){
+ pC->szRow = pC->payloadSize;
+ }else{
+@@ -3296,9 +3298,10 @@
+ assert( OPFLAG_BULKCSR==BTREE_BULKLOAD );
+ sqlite3BtreeCursorHints(pCur->pCursor, (pOp->p5 & OPFLAG_BULKCSR));
+
+- /* Since it performs no memory allocation or IO, the only value that
+- ** sqlite3BtreeCursor() may return is SQLITE_OK. */
+- assert( rc==SQLITE_OK );
++ /* The BDB version of sqlite3BtreeCursor() performs disk i/o and memory
++ ** allocations and so may return an error, so this assert is not valid.
++ ** assert( rc==SQLITE_OK );
++ */
+
+ /* Set the VdbeCursor.isTable variable. Previous versions of
+ ** SQLite used to check if the root-page flags were sane at this point