Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| SHA1 Hash: | 59169e4d161379f78cc57d43a586a7b63779fb31 |
|---|---|
| Date: | 2012-05-04 23:14:15 |
| User: | drh |
| Comment: | Update to the latest SQLite trunk version. (This is for testing SQLite, not for Fossil's benefit.) |
Tags And Properties
- branch=trunk inherited from [bf1c21ba16]
- sym-trunk inherited from [bf1c21ba16]
Changes
Changes to src/sqlite3.c
655 ** 655 ** 656 ** See also: [sqlite3_libversion()], 656 ** See also: [sqlite3_libversion()], 657 ** [sqlite3_libversion_number()], [sqlite3_sourceid()], 657 ** [sqlite3_libversion_number()], [sqlite3_sourceid()], 658 ** [sqlite_version()] and [sqlite_source_id()]. 658 ** [sqlite_version()] and [sqlite_source_id()]. 659 */ 659 */ 660 #define SQLITE_VERSION "3.7.12" 660 #define SQLITE_VERSION "3.7.12" 661 #define SQLITE_VERSION_NUMBER 3007012 661 #define SQLITE_VERSION_NUMBER 3007012 662 #define SQLITE_SOURCE_ID "2012-04-24 13:14:49 dfce8569765614462a3952d1761c1 | 662 #define SQLITE_SOURCE_ID "2012-05-01 14:21:57 bfa61e781cb442be641486e7e55a1 663 663 664 /* 664 /* 665 ** CAPI3REF: Run-Time Library Version Numbers 665 ** CAPI3REF: Run-Time Library Version Numbers 666 ** KEYWORDS: sqlite3_version, sqlite3_sourceid 666 ** KEYWORDS: sqlite3_version, sqlite3_sourceid 667 ** 667 ** 668 ** These interfaces provide the same information as the [SQLITE_VERSION], 668 ** These interfaces provide the same information as the [SQLITE_VERSION], 669 ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros 669 ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros ................................................................................................................................................................................ 41581 /* If a WAL transaction is being committed, there is no point in writing 41581 /* If a WAL transaction is being committed, there is no point in writing 41582 ** any pages with page numbers greater than nTruncate into the WAL file. 41582 ** any pages with page numbers greater than nTruncate into the WAL file. 41583 ** They will never be read by any client. So remove them from the pDirty 41583 ** They will never be read by any client. So remove them from the pDirty 41584 ** list here. */ 41584 ** list here. */ 41585 PgHdr *p; 41585 PgHdr *p; 41586 PgHdr **ppNext = &pList; 41586 PgHdr **ppNext = &pList; 41587 nList = 0; 41587 nList = 0; 41588 for(p=pList; (*ppNext = p); p=p->pDirty){ | 41588 for(p=pList; (*ppNext = p)!=0; p=p->pDirty){ 41589 if( p->pgno<=nTruncate ){ 41589 if( p->pgno<=nTruncate ){ 41590 ppNext = &p->pDirty; 41590 ppNext = &p->pDirty; 41591 nList++; 41591 nList++; 41592 } 41592 } 41593 } 41593 } 41594 assert( pList ); 41594 assert( pList ); 41595 }else{ 41595 }else{ ................................................................................................................................................................................ 74271 */ 74271 */ 74272 static int resolveOrderGroupBy( 74272 static int resolveOrderGroupBy( 74273 NameContext *pNC, /* The name context of the SELECT statement */ 74273 NameContext *pNC, /* The name context of the SELECT statement */ 74274 Select *pSelect, /* The SELECT statement holding pOrderBy */ 74274 Select *pSelect, /* The SELECT statement holding pOrderBy */ 74275 ExprList *pOrderBy, /* An ORDER BY or GROUP BY clause to resolve */ 74275 ExprList *pOrderBy, /* An ORDER BY or GROUP BY clause to resolve */ 74276 const char *zType /* Either "ORDER" or "GROUP", as appropriate */ 74276 const char *zType /* Either "ORDER" or "GROUP", as appropriate */ 74277 ){ 74277 ){ 74278 int i; /* Loop counter */ | 74278 int i, j; /* Loop counters */ 74279 int iCol; /* Column number */ 74279 int iCol; /* Column number */ 74280 struct ExprList_item *pItem; /* A term of the ORDER BY clause */ 74280 struct ExprList_item *pItem; /* A term of the ORDER BY clause */ 74281 Parse *pParse; /* Parsing context */ 74281 Parse *pParse; /* Parsing context */ 74282 int nResult; /* Number of terms in the result set */ 74282 int nResult; /* Number of terms in the result set */ 74283 74283 74284 if( pOrderBy==0 ) return 0; 74284 if( pOrderBy==0 ) return 0; 74285 nResult = pSelect->pEList->nExpr; 74285 nResult = pSelect->pEList->nExpr; ................................................................................................................................................................................ 74307 continue; 74307 continue; 74308 } 74308 } 74309 74309 74310 /* Otherwise, treat the ORDER BY term as an ordinary expression */ 74310 /* Otherwise, treat the ORDER BY term as an ordinary expression */ 74311 pItem->iOrderByCol = 0; 74311 pItem->iOrderByCol = 0; 74312 if( sqlite3ResolveExprNames(pNC, pE) ){ 74312 if( sqlite3ResolveExprNames(pNC, pE) ){ 74313 return 1; 74313 return 1; > 74314 } > 74315 for(j=0; j<pSelect->pEList->nExpr; j++){ > 74316 if( sqlite3ExprCompare(pE, pSelect->pEList->a[j].pExpr)==0 ){ > 74317 pItem->iOrderByCol = j+1; > 74318 } 74314 } 74319 } 74315 } 74320 } 74316 return sqlite3ResolveOrderGroupBy(pParse, pSelect, pOrderBy, zType); 74321 return sqlite3ResolveOrderGroupBy(pParse, pSelect, pOrderBy, zType); 74317 } 74322 } 74318 74323 74319 /* 74324 /* 74320 ** Resolve names in the SELECT statement p and all of its descendents. 74325 ** Resolve names in the SELECT statement p and all of its descendents. ................................................................................................................................................................................ 102254 static int vtabCallConstructor( 102259 static int vtabCallConstructor( 102255 sqlite3 *db, 102260 sqlite3 *db, 102256 Table *pTab, 102261 Table *pTab, 102257 Module *pMod, 102262 Module *pMod, 102258 int (*xConstruct)(sqlite3*,void*,int,const char*const*,sqlite3_vtab**,char**), 102263 int (*xConstruct)(sqlite3*,void*,int,const char*const*,sqlite3_vtab**,char**), 102259 char **pzErr 102264 char **pzErr 102260 ){ 102265 ){ 102261 VtabCtx sCtx; | 102266 VtabCtx sCtx, *pPriorCtx; 102262 VTable *pVTable; 102267 VTable *pVTable; 102263 int rc; 102268 int rc; 102264 const char *const*azArg = (const char *const*)pTab->azModuleArg; 102269 const char *const*azArg = (const char *const*)pTab->azModuleArg; 102265 int nArg = pTab->nModuleArg; 102270 int nArg = pTab->nModuleArg; 102266 char *zErr = 0; 102271 char *zErr = 0; 102267 char *zModuleName = sqlite3MPrintf(db, "%s", pTab->zName); 102272 char *zModuleName = sqlite3MPrintf(db, "%s", pTab->zName); 102268 102273 ................................................................................................................................................................................ 102279 pVTable->pMod = pMod; 102284 pVTable->pMod = pMod; 102280 102285 102281 /* Invoke the virtual table constructor */ 102286 /* Invoke the virtual table constructor */ 102282 assert( &db->pVtabCtx ); 102287 assert( &db->pVtabCtx ); 102283 assert( xConstruct ); 102288 assert( xConstruct ); 102284 sCtx.pTab = pTab; 102289 sCtx.pTab = pTab; 102285 sCtx.pVTable = pVTable; 102290 sCtx.pVTable = pVTable; > 102291 pPriorCtx = db->pVtabCtx; 102286 db->pVtabCtx = &sCtx; 102292 db->pVtabCtx = &sCtx; 102287 rc = xConstruct(db, pMod->pAux, nArg, azArg, &pVTable->pVtab, &zErr); 102293 rc = xConstruct(db, pMod->pAux, nArg, azArg, &pVTable->pVtab, &zErr); 102288 db->pVtabCtx = 0; | 102294 db->pVtabCtx = pPriorCtx; 102289 if( rc==SQLITE_NOMEM ) db->mallocFailed = 1; 102295 if( rc==SQLITE_NOMEM ) db->mallocFailed = 1; 102290 102296 102291 if( SQLITE_OK!=rc ){ 102297 if( SQLITE_OK!=rc ){ 102292 if( zErr==0 ){ 102298 if( zErr==0 ){ 102293 *pzErr = sqlite3MPrintf(db, "vtable constructor failed: %s", zModuleName); 102299 *pzErr = sqlite3MPrintf(db, "vtable constructor failed: %s", zModuleName); 102294 }else { 102300 }else { 102295 *pzErr = sqlite3MPrintf(db, "%s", zErr); 102301 *pzErr = sqlite3MPrintf(db, "%s", zErr);
Changes to src/sqlite3.h
105 ** 105 ** 106 ** See also: [sqlite3_libversion()], 106 ** See also: [sqlite3_libversion()], 107 ** [sqlite3_libversion_number()], [sqlite3_sourceid()], 107 ** [sqlite3_libversion_number()], [sqlite3_sourceid()], 108 ** [sqlite_version()] and [sqlite_source_id()]. 108 ** [sqlite_version()] and [sqlite_source_id()]. 109 */ 109 */ 110 #define SQLITE_VERSION "3.7.12" 110 #define SQLITE_VERSION "3.7.12" 111 #define SQLITE_VERSION_NUMBER 3007012 111 #define SQLITE_VERSION_NUMBER 3007012 112 #define SQLITE_SOURCE_ID "2012-04-24 13:14:49 dfce8569765614462a3952d1761c1 | 112 #define SQLITE_SOURCE_ID "2012-05-01 14:21:57 bfa61e781cb442be641486e7e55a1 113 113 114 /* 114 /* 115 ** CAPI3REF: Run-Time Library Version Numbers 115 ** CAPI3REF: Run-Time Library Version Numbers 116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid 116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid 117 ** 117 ** 118 ** These interfaces provide the same information as the [SQLITE_VERSION], 118 ** These interfaces provide the same information as the [SQLITE_VERSION], 119 ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros 119 ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros