Fossil SCM

Upgrade SQLite to version 3.6.14.1.

drh 2009-05-18 18:54 trunk
Commit 3b76c0474e3386aa77394521f6ccfccc03746288
2 files changed +34 -21 +1 -1
+34 -21
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
11
/******************************************************************************
22
** This file is an amalgamation of many separate C source files from SQLite
3
-** version 3.6.14. By combining all the individual C code files into this
3
+** version 3.6.14.1. By combining all the individual C code files into this
44
** single large file, the entire code can be compiled as a one translation
55
** unit. This allows many compilers to do optimizations that would not be
66
** possible if the files were compiled separately. Performance improvements
77
** of 5% are more are commonly seen when SQLite is compiled as a single
88
** translation unit.
@@ -15,11 +15,11 @@
1515
** needed if you want a wrapper to interface SQLite with your choice of
1616
** programming language. The code for the "sqlite3" command-line shell
1717
** is also in a separate file. This file contains only code for the core
1818
** SQLite library.
1919
**
20
-** This amalgamation was generated on 2009-05-07 00:36:11 UTC.
20
+** This amalgamation was generated on 2009-05-18 17:12:46 UTC.
2121
*/
2222
#define SQLITE_CORE 1
2323
#define SQLITE_AMALGAMATION 1
2424
#ifndef SQLITE_PRIVATE
2525
# define SQLITE_PRIVATE static
@@ -599,11 +599,11 @@
599599
**
600600
** See also: [sqlite3_libversion()] and [sqlite3_libversion_number()].
601601
**
602602
** Requirements: [H10011] [H10014]
603603
*/
604
-#define SQLITE_VERSION "3.6.14"
604
+#define SQLITE_VERSION "3.6.14.1"
605605
#define SQLITE_VERSION_NUMBER 3006014
606606
607607
/*
608608
** CAPI3REF: Run-Time Library Version Numbers {H10020} <S60100>
609609
** KEYWORDS: sqlite3_version
@@ -29091,11 +29091,11 @@
2909129091
** sqlite3_pcache interface). It also contains part of the implementation
2909229092
** of the SQLITE_CONFIG_PAGECACHE and sqlite3_release_memory() features.
2909329093
** If the default page cache implementation is overriden, then neither of
2909429094
** these two features are available.
2909529095
**
29096
-** @(#) $Id: pcache1.c,v 1.11 2009/04/14 18:44:39 aswift Exp $
29096
+** @(#) $Id: pcache1.c,v 1.11.2.1 2009/05/18 16:14:25 drh Exp $
2909729097
*/
2909829098
2909929099
2910029100
typedef struct PCache1 PCache1;
2910129101
typedef struct PgHdr1 PgHdr1;
@@ -29434,25 +29434,29 @@
2943429434
*/
2943529435
static void pcache1TruncateUnsafe(
2943629436
PCache1 *pCache,
2943729437
unsigned int iLimit
2943829438
){
29439
+ TESTONLY( int nPage = 0; ) /* Used to assert pCache->nPage is correct */
2943929440
unsigned int h;
2944029441
assert( sqlite3_mutex_held(pcache1.mutex) );
2944129442
for(h=0; h<pCache->nHash; h++){
2944229443
PgHdr1 **pp = &pCache->apHash[h];
2944329444
PgHdr1 *pPage;
2944429445
while( (pPage = *pp)!=0 ){
2944529446
if( pPage->iKey>=iLimit ){
29446
- pcache1PinPage(pPage);
29447
+ pCache->nPage--;
2944729448
*pp = pPage->pNext;
29449
+ pcache1PinPage(pPage);
2944829450
pcache1FreePage(pPage);
2944929451
}else{
2945029452
pp = &pPage->pNext;
29453
+ TESTONLY( nPage++ );
2945129454
}
2945229455
}
2945329456
}
29457
+ assert( pCache->nPage==nPage );
2945429458
}
2945529459
2945629460
/******************************************************************************/
2945729461
/******** sqlite3_pcache Methods **********************************************/
2945829462
@@ -30273,11 +30277,11 @@
3027330277
** is separate from the database file. The pager also implements file
3027430278
** locking to prevent two processes from writing the same database
3027530279
** file simultaneously, or one process from reading the database while
3027630280
** another is writing.
3027730281
**
30278
-** @(#) $Id: pager.c,v 1.586 2009/05/06 18:57:10 shane Exp $
30282
+** @(#) $Id: pager.c,v 1.586.2.1 2009/05/18 17:11:31 drh Exp $
3027930283
*/
3028030284
#ifndef SQLITE_OMIT_DISKIO
3028130285
3028230286
/*
3028330287
** Macros for troubleshooting. Normally turned off
@@ -33876,11 +33880,11 @@
3387633880
assert( (pPager->state==PAGER_SHARED)
3387733881
|| (pPager->exclusiveMode && pPager->state>PAGER_SHARED)
3387833882
);
3387933883
}
3388033884
33881
- if( sqlite3PcachePagecount(pPager->pPCache)>0 ){
33885
+ if( pPager->pBackup || sqlite3PcachePagecount(pPager->pPCache)>0 ){
3388233886
/* The shared-lock has just been acquired on the database file
3388333887
** and there are already pages in the cache (from a previous
3388433888
** read or write transaction). Check to see if the database
3388533889
** has been modified. If the database has changed, flush the
3388633890
** cache.
@@ -44238,11 +44242,11 @@
4423844242
**
4423944243
*************************************************************************
4424044244
** This file contains the implementation of the sqlite3_backup_XXX()
4424144245
** API functions and the related features.
4424244246
**
44243
-** $Id: backup.c,v 1.13 2009/03/16 13:19:36 danielk1977 Exp $
44247
+** $Id: backup.c,v 1.13.2.1 2009/05/18 17:11:31 drh Exp $
4424444248
*/
4424544249
4424644250
/* Macro to find the minimum of two numeric values.
4424744251
*/
4424844252
#ifndef MIN
@@ -44268,10 +44272,11 @@
4426844272
** read by calls to backup_remaining() and backup_pagecount().
4426944273
*/
4427044274
Pgno nRemaining; /* Number of pages left to copy */
4427144275
Pgno nPagecount; /* Total number of pages to copy */
4427244276
44277
+ int isAttached; /* True once backup has been registered with pager */
4427344278
sqlite3_backup *pNext; /* Next backup associated with source pager */
4427444279
};
4427544280
4427644281
/*
4427744282
** THREAD SAFETY NOTES:
@@ -44381,10 +44386,11 @@
4438144386
p->pSrc = findBtree(pDestDb, pSrcDb, zSrcDb);
4438244387
p->pDest = findBtree(pDestDb, pDestDb, zDestDb);
4438344388
p->pDestDb = pDestDb;
4438444389
p->pSrcDb = pSrcDb;
4438544390
p->iNext = 1;
44391
+ p->isAttached = 0;
4438644392
4438744393
if( 0==p->pSrc || 0==p->pDest ){
4438844394
/* One (or both) of the named databases did not exist. An error has
4438944395
** already been written into the pDestDb handle. All that is left
4439044396
** to do here is free the sqlite3_backup structure.
@@ -44391,22 +44397,11 @@
4439144397
*/
4439244398
sqlite3_free(p);
4439344399
p = 0;
4439444400
}
4439544401
}
44396
-
44397
- /* If everything has gone as planned, attach the backup object to the
44398
- ** source pager. The source pager calls BackupUpdate() and BackupRestart()
44399
- ** to notify this module if the source file is modified mid-backup.
44400
- */
4440144402
if( p ){
44402
- sqlite3_backup **pp; /* Pointer to head of pagers backup list */
44403
- sqlite3BtreeEnter(p->pSrc);
44404
- pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc));
44405
- p->pNext = *pp;
44406
- *pp = p;
44407
- sqlite3BtreeLeave(p->pSrc);
4440844403
p->pSrc->nBackup++;
4440944404
}
4441044405
4441144406
sqlite3_mutex_leave(pDestDb->mutex);
4441244407
sqlite3_mutex_leave(pSrcDb->mutex);
@@ -44494,10 +44489,23 @@
4449444489
if( rc==SQLITE_OK && iCurrent>iSize ){
4449544490
rc = sqlite3OsTruncate(pFile, iSize);
4449644491
}
4449744492
return rc;
4449844493
}
44494
+
44495
+/*
44496
+** Register this backup object with the associated source pager for
44497
+** callbacks when pages are changed or the cache invalidated.
44498
+*/
44499
+static void attachBackupObject(sqlite3_backup *p){
44500
+ sqlite3_backup **pp;
44501
+ assert( sqlite3BtreeHoldsMutex(p->pSrc) );
44502
+ pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc));
44503
+ p->pNext = *pp;
44504
+ *pp = p;
44505
+ p->isAttached = 1;
44506
+}
4449944507
4450044508
/*
4450144509
** Copy nPage pages from the source b-tree to the destination.
4450244510
*/
4450344511
SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){
@@ -44564,10 +44572,12 @@
4456444572
if( rc==SQLITE_OK ){
4456544573
p->nPagecount = nSrcPage;
4456644574
p->nRemaining = nSrcPage+1-p->iNext;
4456744575
if( p->iNext>(Pgno)nSrcPage ){
4456844576
rc = SQLITE_DONE;
44577
+ }else if( !p->isAttached ){
44578
+ attachBackupObject(p);
4456944579
}
4457044580
}
4457144581
4457244582
if( rc==SQLITE_DONE ){
4457344583
const int nSrcPagesize = sqlite3BtreeGetPageSize(p->pSrc);
@@ -44696,16 +44706,18 @@
4469644706
sqlite3_mutex_enter(p->pDestDb->mutex);
4469744707
}
4469844708
4469944709
/* Detach this backup from the source pager. */
4470044710
if( p->pDestDb ){
44711
+ p->pSrc->nBackup--;
44712
+ }
44713
+ if( p->isAttached ){
4470144714
pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc));
4470244715
while( *pp!=p ){
4470344716
pp = &(*pp)->pNext;
4470444717
}
4470544718
*pp = p->pNext;
44706
- p->pSrc->nBackup--;
4470744719
}
4470844720
4470944721
/* If a transaction is still open on the Btree, roll it back. */
4471044722
sqlite3BtreeRollback(p->pDest);
4471144723
@@ -49984,11 +49996,11 @@
4998449996
** documentation, headers files, or other derived files. The formatting
4998549997
** of the code in this file is, therefore, important. See other comments
4998649998
** in this file for details. If in doubt, do not deviate from existing
4998749999
** commenting and indentation practices when changing or adding code.
4998850000
**
49989
-** $Id: vdbe.c,v 1.842 2009/05/06 18:57:10 shane Exp $
50001
+** $Id: vdbe.c,v 1.842.2.1 2009/05/18 16:14:25 drh Exp $
4999050002
*/
4999150003
4999250004
/*
4999350005
** The following global variable is incremented every time a cursor
4999450006
** moves, either by the OP_SeekXX, OP_Next, or OP_Prev opcodes. The test
@@ -50706,10 +50718,11 @@
5070650718
assert( pOp->p2>0 );
5070750719
assert( pOp->p2<=p->nMem );
5070850720
pOut = &p->aMem[pOp->p2];
5070950721
sqlite3VdbeMemReleaseExternal(pOut);
5071050722
pOut->flags = MEM_Null;
50723
+ pOut->n = 0;
5071150724
}else
5071250725
5071350726
/* Do common setup for opcodes marked with one of the following
5071450727
** combinations of properties.
5071550728
**
5071650729
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
1 /******************************************************************************
2 ** This file is an amalgamation of many separate C source files from SQLite
3 ** version 3.6.14. By combining all the individual C code files into this
4 ** single large file, the entire code can be compiled as a one translation
5 ** unit. This allows many compilers to do optimizations that would not be
6 ** possible if the files were compiled separately. Performance improvements
7 ** of 5% are more are commonly seen when SQLite is compiled as a single
8 ** translation unit.
@@ -15,11 +15,11 @@
15 ** needed if you want a wrapper to interface SQLite with your choice of
16 ** programming language. The code for the "sqlite3" command-line shell
17 ** is also in a separate file. This file contains only code for the core
18 ** SQLite library.
19 **
20 ** This amalgamation was generated on 2009-05-07 00:36:11 UTC.
21 */
22 #define SQLITE_CORE 1
23 #define SQLITE_AMALGAMATION 1
24 #ifndef SQLITE_PRIVATE
25 # define SQLITE_PRIVATE static
@@ -599,11 +599,11 @@
599 **
600 ** See also: [sqlite3_libversion()] and [sqlite3_libversion_number()].
601 **
602 ** Requirements: [H10011] [H10014]
603 */
604 #define SQLITE_VERSION "3.6.14"
605 #define SQLITE_VERSION_NUMBER 3006014
606
607 /*
608 ** CAPI3REF: Run-Time Library Version Numbers {H10020} <S60100>
609 ** KEYWORDS: sqlite3_version
@@ -29091,11 +29091,11 @@
29091 ** sqlite3_pcache interface). It also contains part of the implementation
29092 ** of the SQLITE_CONFIG_PAGECACHE and sqlite3_release_memory() features.
29093 ** If the default page cache implementation is overriden, then neither of
29094 ** these two features are available.
29095 **
29096 ** @(#) $Id: pcache1.c,v 1.11 2009/04/14 18:44:39 aswift Exp $
29097 */
29098
29099
29100 typedef struct PCache1 PCache1;
29101 typedef struct PgHdr1 PgHdr1;
@@ -29434,25 +29434,29 @@
29434 */
29435 static void pcache1TruncateUnsafe(
29436 PCache1 *pCache,
29437 unsigned int iLimit
29438 ){
 
29439 unsigned int h;
29440 assert( sqlite3_mutex_held(pcache1.mutex) );
29441 for(h=0; h<pCache->nHash; h++){
29442 PgHdr1 **pp = &pCache->apHash[h];
29443 PgHdr1 *pPage;
29444 while( (pPage = *pp)!=0 ){
29445 if( pPage->iKey>=iLimit ){
29446 pcache1PinPage(pPage);
29447 *pp = pPage->pNext;
 
29448 pcache1FreePage(pPage);
29449 }else{
29450 pp = &pPage->pNext;
 
29451 }
29452 }
29453 }
 
29454 }
29455
29456 /******************************************************************************/
29457 /******** sqlite3_pcache Methods **********************************************/
29458
@@ -30273,11 +30277,11 @@
30273 ** is separate from the database file. The pager also implements file
30274 ** locking to prevent two processes from writing the same database
30275 ** file simultaneously, or one process from reading the database while
30276 ** another is writing.
30277 **
30278 ** @(#) $Id: pager.c,v 1.586 2009/05/06 18:57:10 shane Exp $
30279 */
30280 #ifndef SQLITE_OMIT_DISKIO
30281
30282 /*
30283 ** Macros for troubleshooting. Normally turned off
@@ -33876,11 +33880,11 @@
33876 assert( (pPager->state==PAGER_SHARED)
33877 || (pPager->exclusiveMode && pPager->state>PAGER_SHARED)
33878 );
33879 }
33880
33881 if( sqlite3PcachePagecount(pPager->pPCache)>0 ){
33882 /* The shared-lock has just been acquired on the database file
33883 ** and there are already pages in the cache (from a previous
33884 ** read or write transaction). Check to see if the database
33885 ** has been modified. If the database has changed, flush the
33886 ** cache.
@@ -44238,11 +44242,11 @@
44238 **
44239 *************************************************************************
44240 ** This file contains the implementation of the sqlite3_backup_XXX()
44241 ** API functions and the related features.
44242 **
44243 ** $Id: backup.c,v 1.13 2009/03/16 13:19:36 danielk1977 Exp $
44244 */
44245
44246 /* Macro to find the minimum of two numeric values.
44247 */
44248 #ifndef MIN
@@ -44268,10 +44272,11 @@
44268 ** read by calls to backup_remaining() and backup_pagecount().
44269 */
44270 Pgno nRemaining; /* Number of pages left to copy */
44271 Pgno nPagecount; /* Total number of pages to copy */
44272
 
44273 sqlite3_backup *pNext; /* Next backup associated with source pager */
44274 };
44275
44276 /*
44277 ** THREAD SAFETY NOTES:
@@ -44381,10 +44386,11 @@
44381 p->pSrc = findBtree(pDestDb, pSrcDb, zSrcDb);
44382 p->pDest = findBtree(pDestDb, pDestDb, zDestDb);
44383 p->pDestDb = pDestDb;
44384 p->pSrcDb = pSrcDb;
44385 p->iNext = 1;
 
44386
44387 if( 0==p->pSrc || 0==p->pDest ){
44388 /* One (or both) of the named databases did not exist. An error has
44389 ** already been written into the pDestDb handle. All that is left
44390 ** to do here is free the sqlite3_backup structure.
@@ -44391,22 +44397,11 @@
44391 */
44392 sqlite3_free(p);
44393 p = 0;
44394 }
44395 }
44396
44397 /* If everything has gone as planned, attach the backup object to the
44398 ** source pager. The source pager calls BackupUpdate() and BackupRestart()
44399 ** to notify this module if the source file is modified mid-backup.
44400 */
44401 if( p ){
44402 sqlite3_backup **pp; /* Pointer to head of pagers backup list */
44403 sqlite3BtreeEnter(p->pSrc);
44404 pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc));
44405 p->pNext = *pp;
44406 *pp = p;
44407 sqlite3BtreeLeave(p->pSrc);
44408 p->pSrc->nBackup++;
44409 }
44410
44411 sqlite3_mutex_leave(pDestDb->mutex);
44412 sqlite3_mutex_leave(pSrcDb->mutex);
@@ -44494,10 +44489,23 @@
44494 if( rc==SQLITE_OK && iCurrent>iSize ){
44495 rc = sqlite3OsTruncate(pFile, iSize);
44496 }
44497 return rc;
44498 }
 
 
 
 
 
 
 
 
 
 
 
 
 
44499
44500 /*
44501 ** Copy nPage pages from the source b-tree to the destination.
44502 */
44503 SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){
@@ -44564,10 +44572,12 @@
44564 if( rc==SQLITE_OK ){
44565 p->nPagecount = nSrcPage;
44566 p->nRemaining = nSrcPage+1-p->iNext;
44567 if( p->iNext>(Pgno)nSrcPage ){
44568 rc = SQLITE_DONE;
 
 
44569 }
44570 }
44571
44572 if( rc==SQLITE_DONE ){
44573 const int nSrcPagesize = sqlite3BtreeGetPageSize(p->pSrc);
@@ -44696,16 +44706,18 @@
44696 sqlite3_mutex_enter(p->pDestDb->mutex);
44697 }
44698
44699 /* Detach this backup from the source pager. */
44700 if( p->pDestDb ){
 
 
 
44701 pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc));
44702 while( *pp!=p ){
44703 pp = &(*pp)->pNext;
44704 }
44705 *pp = p->pNext;
44706 p->pSrc->nBackup--;
44707 }
44708
44709 /* If a transaction is still open on the Btree, roll it back. */
44710 sqlite3BtreeRollback(p->pDest);
44711
@@ -49984,11 +49996,11 @@
49984 ** documentation, headers files, or other derived files. The formatting
49985 ** of the code in this file is, therefore, important. See other comments
49986 ** in this file for details. If in doubt, do not deviate from existing
49987 ** commenting and indentation practices when changing or adding code.
49988 **
49989 ** $Id: vdbe.c,v 1.842 2009/05/06 18:57:10 shane Exp $
49990 */
49991
49992 /*
49993 ** The following global variable is incremented every time a cursor
49994 ** moves, either by the OP_SeekXX, OP_Next, or OP_Prev opcodes. The test
@@ -50706,10 +50718,11 @@
50706 assert( pOp->p2>0 );
50707 assert( pOp->p2<=p->nMem );
50708 pOut = &p->aMem[pOp->p2];
50709 sqlite3VdbeMemReleaseExternal(pOut);
50710 pOut->flags = MEM_Null;
 
50711 }else
50712
50713 /* Do common setup for opcodes marked with one of the following
50714 ** combinations of properties.
50715 **
50716
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
1 /******************************************************************************
2 ** This file is an amalgamation of many separate C source files from SQLite
3 ** version 3.6.14.1. By combining all the individual C code files into this
4 ** single large file, the entire code can be compiled as a one translation
5 ** unit. This allows many compilers to do optimizations that would not be
6 ** possible if the files were compiled separately. Performance improvements
7 ** of 5% are more are commonly seen when SQLite is compiled as a single
8 ** translation unit.
@@ -15,11 +15,11 @@
15 ** needed if you want a wrapper to interface SQLite with your choice of
16 ** programming language. The code for the "sqlite3" command-line shell
17 ** is also in a separate file. This file contains only code for the core
18 ** SQLite library.
19 **
20 ** This amalgamation was generated on 2009-05-18 17:12:46 UTC.
21 */
22 #define SQLITE_CORE 1
23 #define SQLITE_AMALGAMATION 1
24 #ifndef SQLITE_PRIVATE
25 # define SQLITE_PRIVATE static
@@ -599,11 +599,11 @@
599 **
600 ** See also: [sqlite3_libversion()] and [sqlite3_libversion_number()].
601 **
602 ** Requirements: [H10011] [H10014]
603 */
604 #define SQLITE_VERSION "3.6.14.1"
605 #define SQLITE_VERSION_NUMBER 3006014
606
607 /*
608 ** CAPI3REF: Run-Time Library Version Numbers {H10020} <S60100>
609 ** KEYWORDS: sqlite3_version
@@ -29091,11 +29091,11 @@
29091 ** sqlite3_pcache interface). It also contains part of the implementation
29092 ** of the SQLITE_CONFIG_PAGECACHE and sqlite3_release_memory() features.
29093 ** If the default page cache implementation is overriden, then neither of
29094 ** these two features are available.
29095 **
29096 ** @(#) $Id: pcache1.c,v 1.11.2.1 2009/05/18 16:14:25 drh Exp $
29097 */
29098
29099
29100 typedef struct PCache1 PCache1;
29101 typedef struct PgHdr1 PgHdr1;
@@ -29434,25 +29434,29 @@
29434 */
29435 static void pcache1TruncateUnsafe(
29436 PCache1 *pCache,
29437 unsigned int iLimit
29438 ){
29439 TESTONLY( int nPage = 0; ) /* Used to assert pCache->nPage is correct */
29440 unsigned int h;
29441 assert( sqlite3_mutex_held(pcache1.mutex) );
29442 for(h=0; h<pCache->nHash; h++){
29443 PgHdr1 **pp = &pCache->apHash[h];
29444 PgHdr1 *pPage;
29445 while( (pPage = *pp)!=0 ){
29446 if( pPage->iKey>=iLimit ){
29447 pCache->nPage--;
29448 *pp = pPage->pNext;
29449 pcache1PinPage(pPage);
29450 pcache1FreePage(pPage);
29451 }else{
29452 pp = &pPage->pNext;
29453 TESTONLY( nPage++ );
29454 }
29455 }
29456 }
29457 assert( pCache->nPage==nPage );
29458 }
29459
29460 /******************************************************************************/
29461 /******** sqlite3_pcache Methods **********************************************/
29462
@@ -30273,11 +30277,11 @@
30277 ** is separate from the database file. The pager also implements file
30278 ** locking to prevent two processes from writing the same database
30279 ** file simultaneously, or one process from reading the database while
30280 ** another is writing.
30281 **
30282 ** @(#) $Id: pager.c,v 1.586.2.1 2009/05/18 17:11:31 drh Exp $
30283 */
30284 #ifndef SQLITE_OMIT_DISKIO
30285
30286 /*
30287 ** Macros for troubleshooting. Normally turned off
@@ -33876,11 +33880,11 @@
33880 assert( (pPager->state==PAGER_SHARED)
33881 || (pPager->exclusiveMode && pPager->state>PAGER_SHARED)
33882 );
33883 }
33884
33885 if( pPager->pBackup || sqlite3PcachePagecount(pPager->pPCache)>0 ){
33886 /* The shared-lock has just been acquired on the database file
33887 ** and there are already pages in the cache (from a previous
33888 ** read or write transaction). Check to see if the database
33889 ** has been modified. If the database has changed, flush the
33890 ** cache.
@@ -44238,11 +44242,11 @@
44242 **
44243 *************************************************************************
44244 ** This file contains the implementation of the sqlite3_backup_XXX()
44245 ** API functions and the related features.
44246 **
44247 ** $Id: backup.c,v 1.13.2.1 2009/05/18 17:11:31 drh Exp $
44248 */
44249
44250 /* Macro to find the minimum of two numeric values.
44251 */
44252 #ifndef MIN
@@ -44268,10 +44272,11 @@
44272 ** read by calls to backup_remaining() and backup_pagecount().
44273 */
44274 Pgno nRemaining; /* Number of pages left to copy */
44275 Pgno nPagecount; /* Total number of pages to copy */
44276
44277 int isAttached; /* True once backup has been registered with pager */
44278 sqlite3_backup *pNext; /* Next backup associated with source pager */
44279 };
44280
44281 /*
44282 ** THREAD SAFETY NOTES:
@@ -44381,10 +44386,11 @@
44386 p->pSrc = findBtree(pDestDb, pSrcDb, zSrcDb);
44387 p->pDest = findBtree(pDestDb, pDestDb, zDestDb);
44388 p->pDestDb = pDestDb;
44389 p->pSrcDb = pSrcDb;
44390 p->iNext = 1;
44391 p->isAttached = 0;
44392
44393 if( 0==p->pSrc || 0==p->pDest ){
44394 /* One (or both) of the named databases did not exist. An error has
44395 ** already been written into the pDestDb handle. All that is left
44396 ** to do here is free the sqlite3_backup structure.
@@ -44391,22 +44397,11 @@
44397 */
44398 sqlite3_free(p);
44399 p = 0;
44400 }
44401 }
 
 
 
 
 
44402 if( p ){
 
 
 
 
 
 
44403 p->pSrc->nBackup++;
44404 }
44405
44406 sqlite3_mutex_leave(pDestDb->mutex);
44407 sqlite3_mutex_leave(pSrcDb->mutex);
@@ -44494,10 +44489,23 @@
44489 if( rc==SQLITE_OK && iCurrent>iSize ){
44490 rc = sqlite3OsTruncate(pFile, iSize);
44491 }
44492 return rc;
44493 }
44494
44495 /*
44496 ** Register this backup object with the associated source pager for
44497 ** callbacks when pages are changed or the cache invalidated.
44498 */
44499 static void attachBackupObject(sqlite3_backup *p){
44500 sqlite3_backup **pp;
44501 assert( sqlite3BtreeHoldsMutex(p->pSrc) );
44502 pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc));
44503 p->pNext = *pp;
44504 *pp = p;
44505 p->isAttached = 1;
44506 }
44507
44508 /*
44509 ** Copy nPage pages from the source b-tree to the destination.
44510 */
44511 SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){
@@ -44564,10 +44572,12 @@
44572 if( rc==SQLITE_OK ){
44573 p->nPagecount = nSrcPage;
44574 p->nRemaining = nSrcPage+1-p->iNext;
44575 if( p->iNext>(Pgno)nSrcPage ){
44576 rc = SQLITE_DONE;
44577 }else if( !p->isAttached ){
44578 attachBackupObject(p);
44579 }
44580 }
44581
44582 if( rc==SQLITE_DONE ){
44583 const int nSrcPagesize = sqlite3BtreeGetPageSize(p->pSrc);
@@ -44696,16 +44706,18 @@
44706 sqlite3_mutex_enter(p->pDestDb->mutex);
44707 }
44708
44709 /* Detach this backup from the source pager. */
44710 if( p->pDestDb ){
44711 p->pSrc->nBackup--;
44712 }
44713 if( p->isAttached ){
44714 pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc));
44715 while( *pp!=p ){
44716 pp = &(*pp)->pNext;
44717 }
44718 *pp = p->pNext;
 
44719 }
44720
44721 /* If a transaction is still open on the Btree, roll it back. */
44722 sqlite3BtreeRollback(p->pDest);
44723
@@ -49984,11 +49996,11 @@
49996 ** documentation, headers files, or other derived files. The formatting
49997 ** of the code in this file is, therefore, important. See other comments
49998 ** in this file for details. If in doubt, do not deviate from existing
49999 ** commenting and indentation practices when changing or adding code.
50000 **
50001 ** $Id: vdbe.c,v 1.842.2.1 2009/05/18 16:14:25 drh Exp $
50002 */
50003
50004 /*
50005 ** The following global variable is incremented every time a cursor
50006 ** moves, either by the OP_SeekXX, OP_Next, or OP_Prev opcodes. The test
@@ -50706,10 +50718,11 @@
50718 assert( pOp->p2>0 );
50719 assert( pOp->p2<=p->nMem );
50720 pOut = &p->aMem[pOp->p2];
50721 sqlite3VdbeMemReleaseExternal(pOut);
50722 pOut->flags = MEM_Null;
50723 pOut->n = 0;
50724 }else
50725
50726 /* Do common setup for opcodes marked with one of the following
50727 ** combinations of properties.
50728 **
50729
+1 -1
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -97,11 +97,11 @@
9797
**
9898
** See also: [sqlite3_libversion()] and [sqlite3_libversion_number()].
9999
**
100100
** Requirements: [H10011] [H10014]
101101
*/
102
-#define SQLITE_VERSION "3.6.14"
102
+#define SQLITE_VERSION "3.6.14.1"
103103
#define SQLITE_VERSION_NUMBER 3006014
104104
105105
/*
106106
** CAPI3REF: Run-Time Library Version Numbers {H10020} <S60100>
107107
** KEYWORDS: sqlite3_version
108108
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -97,11 +97,11 @@
97 **
98 ** See also: [sqlite3_libversion()] and [sqlite3_libversion_number()].
99 **
100 ** Requirements: [H10011] [H10014]
101 */
102 #define SQLITE_VERSION "3.6.14"
103 #define SQLITE_VERSION_NUMBER 3006014
104
105 /*
106 ** CAPI3REF: Run-Time Library Version Numbers {H10020} <S60100>
107 ** KEYWORDS: sqlite3_version
108
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -97,11 +97,11 @@
97 **
98 ** See also: [sqlite3_libversion()] and [sqlite3_libversion_number()].
99 **
100 ** Requirements: [H10011] [H10014]
101 */
102 #define SQLITE_VERSION "3.6.14.1"
103 #define SQLITE_VERSION_NUMBER 3006014
104
105 /*
106 ** CAPI3REF: Run-Time Library Version Numbers {H10020} <S60100>
107 ** KEYWORDS: sqlite3_version
108

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button