Fossil SCM
Update to the latest SQLite trunk version. (This is for testing SQLite, not for Fossil's benefit.)
Commit
59169e4d161379f78cc57d43a586a7b63779fb31
Parent
a30da54fee82943…
2 files changed
+11
-5
+1
-1
+11
-5
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -657,11 +657,11 @@ | ||
| 657 | 657 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 658 | 658 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 659 | 659 | */ |
| 660 | 660 | #define SQLITE_VERSION "3.7.12" |
| 661 | 661 | #define SQLITE_VERSION_NUMBER 3007012 |
| 662 | -#define SQLITE_SOURCE_ID "2012-04-24 13:14:49 dfce8569765614462a3952d1761c10d579984665" | |
| 662 | +#define SQLITE_SOURCE_ID "2012-05-01 14:21:57 bfa61e781cb442be641486e7e55a1518e888d830" | |
| 663 | 663 | |
| 664 | 664 | /* |
| 665 | 665 | ** CAPI3REF: Run-Time Library Version Numbers |
| 666 | 666 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 667 | 667 | ** |
| @@ -41583,11 +41583,11 @@ | ||
| 41583 | 41583 | ** They will never be read by any client. So remove them from the pDirty |
| 41584 | 41584 | ** list here. */ |
| 41585 | 41585 | PgHdr *p; |
| 41586 | 41586 | PgHdr **ppNext = &pList; |
| 41587 | 41587 | nList = 0; |
| 41588 | - for(p=pList; (*ppNext = p); p=p->pDirty){ | |
| 41588 | + for(p=pList; (*ppNext = p)!=0; p=p->pDirty){ | |
| 41589 | 41589 | if( p->pgno<=nTruncate ){ |
| 41590 | 41590 | ppNext = &p->pDirty; |
| 41591 | 41591 | nList++; |
| 41592 | 41592 | } |
| 41593 | 41593 | } |
| @@ -74273,11 +74273,11 @@ | ||
| 74273 | 74273 | NameContext *pNC, /* The name context of the SELECT statement */ |
| 74274 | 74274 | Select *pSelect, /* The SELECT statement holding pOrderBy */ |
| 74275 | 74275 | ExprList *pOrderBy, /* An ORDER BY or GROUP BY clause to resolve */ |
| 74276 | 74276 | const char *zType /* Either "ORDER" or "GROUP", as appropriate */ |
| 74277 | 74277 | ){ |
| 74278 | - int i; /* Loop counter */ | |
| 74278 | + int i, j; /* Loop counters */ | |
| 74279 | 74279 | int iCol; /* Column number */ |
| 74280 | 74280 | struct ExprList_item *pItem; /* A term of the ORDER BY clause */ |
| 74281 | 74281 | Parse *pParse; /* Parsing context */ |
| 74282 | 74282 | int nResult; /* Number of terms in the result set */ |
| 74283 | 74283 | |
| @@ -74309,10 +74309,15 @@ | ||
| 74309 | 74309 | |
| 74310 | 74310 | /* Otherwise, treat the ORDER BY term as an ordinary expression */ |
| 74311 | 74311 | pItem->iOrderByCol = 0; |
| 74312 | 74312 | if( sqlite3ResolveExprNames(pNC, pE) ){ |
| 74313 | 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 | 74321 | return sqlite3ResolveOrderGroupBy(pParse, pSelect, pOrderBy, zType); |
| 74317 | 74322 | } |
| 74318 | 74323 | |
| @@ -102256,11 +102261,11 @@ | ||
| 102256 | 102261 | Table *pTab, |
| 102257 | 102262 | Module *pMod, |
| 102258 | 102263 | int (*xConstruct)(sqlite3*,void*,int,const char*const*,sqlite3_vtab**,char**), |
| 102259 | 102264 | char **pzErr |
| 102260 | 102265 | ){ |
| 102261 | - VtabCtx sCtx; | |
| 102266 | + VtabCtx sCtx, *pPriorCtx; | |
| 102262 | 102267 | VTable *pVTable; |
| 102263 | 102268 | int rc; |
| 102264 | 102269 | const char *const*azArg = (const char *const*)pTab->azModuleArg; |
| 102265 | 102270 | int nArg = pTab->nModuleArg; |
| 102266 | 102271 | char *zErr = 0; |
| @@ -102281,13 +102286,14 @@ | ||
| 102281 | 102286 | /* Invoke the virtual table constructor */ |
| 102282 | 102287 | assert( &db->pVtabCtx ); |
| 102283 | 102288 | assert( xConstruct ); |
| 102284 | 102289 | sCtx.pTab = pTab; |
| 102285 | 102290 | sCtx.pVTable = pVTable; |
| 102291 | + pPriorCtx = db->pVtabCtx; | |
| 102286 | 102292 | db->pVtabCtx = &sCtx; |
| 102287 | 102293 | rc = xConstruct(db, pMod->pAux, nArg, azArg, &pVTable->pVtab, &zErr); |
| 102288 | - db->pVtabCtx = 0; | |
| 102294 | + db->pVtabCtx = pPriorCtx; | |
| 102289 | 102295 | if( rc==SQLITE_NOMEM ) db->mallocFailed = 1; |
| 102290 | 102296 | |
| 102291 | 102297 | if( SQLITE_OK!=rc ){ |
| 102292 | 102298 | if( zErr==0 ){ |
| 102293 | 102299 | *pzErr = sqlite3MPrintf(db, "vtable constructor failed: %s", zModuleName); |
| 102294 | 102300 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -657,11 +657,11 @@ | |
| 657 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 658 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 659 | */ |
| 660 | #define SQLITE_VERSION "3.7.12" |
| 661 | #define SQLITE_VERSION_NUMBER 3007012 |
| 662 | #define SQLITE_SOURCE_ID "2012-04-24 13:14:49 dfce8569765614462a3952d1761c10d579984665" |
| 663 | |
| 664 | /* |
| 665 | ** CAPI3REF: Run-Time Library Version Numbers |
| 666 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 667 | ** |
| @@ -41583,11 +41583,11 @@ | |
| 41583 | ** They will never be read by any client. So remove them from the pDirty |
| 41584 | ** list here. */ |
| 41585 | PgHdr *p; |
| 41586 | PgHdr **ppNext = &pList; |
| 41587 | nList = 0; |
| 41588 | for(p=pList; (*ppNext = p); p=p->pDirty){ |
| 41589 | if( p->pgno<=nTruncate ){ |
| 41590 | ppNext = &p->pDirty; |
| 41591 | nList++; |
| 41592 | } |
| 41593 | } |
| @@ -74273,11 +74273,11 @@ | |
| 74273 | NameContext *pNC, /* The name context of the SELECT statement */ |
| 74274 | Select *pSelect, /* The SELECT statement holding pOrderBy */ |
| 74275 | ExprList *pOrderBy, /* An ORDER BY or GROUP BY clause to resolve */ |
| 74276 | const char *zType /* Either "ORDER" or "GROUP", as appropriate */ |
| 74277 | ){ |
| 74278 | int i; /* Loop counter */ |
| 74279 | int iCol; /* Column number */ |
| 74280 | struct ExprList_item *pItem; /* A term of the ORDER BY clause */ |
| 74281 | Parse *pParse; /* Parsing context */ |
| 74282 | int nResult; /* Number of terms in the result set */ |
| 74283 | |
| @@ -74309,10 +74309,15 @@ | |
| 74309 | |
| 74310 | /* Otherwise, treat the ORDER BY term as an ordinary expression */ |
| 74311 | pItem->iOrderByCol = 0; |
| 74312 | if( sqlite3ResolveExprNames(pNC, pE) ){ |
| 74313 | return 1; |
| 74314 | } |
| 74315 | } |
| 74316 | return sqlite3ResolveOrderGroupBy(pParse, pSelect, pOrderBy, zType); |
| 74317 | } |
| 74318 | |
| @@ -102256,11 +102261,11 @@ | |
| 102256 | Table *pTab, |
| 102257 | Module *pMod, |
| 102258 | int (*xConstruct)(sqlite3*,void*,int,const char*const*,sqlite3_vtab**,char**), |
| 102259 | char **pzErr |
| 102260 | ){ |
| 102261 | VtabCtx sCtx; |
| 102262 | VTable *pVTable; |
| 102263 | int rc; |
| 102264 | const char *const*azArg = (const char *const*)pTab->azModuleArg; |
| 102265 | int nArg = pTab->nModuleArg; |
| 102266 | char *zErr = 0; |
| @@ -102281,13 +102286,14 @@ | |
| 102281 | /* Invoke the virtual table constructor */ |
| 102282 | assert( &db->pVtabCtx ); |
| 102283 | assert( xConstruct ); |
| 102284 | sCtx.pTab = pTab; |
| 102285 | sCtx.pVTable = pVTable; |
| 102286 | db->pVtabCtx = &sCtx; |
| 102287 | rc = xConstruct(db, pMod->pAux, nArg, azArg, &pVTable->pVtab, &zErr); |
| 102288 | db->pVtabCtx = 0; |
| 102289 | if( rc==SQLITE_NOMEM ) db->mallocFailed = 1; |
| 102290 | |
| 102291 | if( SQLITE_OK!=rc ){ |
| 102292 | if( zErr==0 ){ |
| 102293 | *pzErr = sqlite3MPrintf(db, "vtable constructor failed: %s", zModuleName); |
| 102294 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -657,11 +657,11 @@ | |
| 657 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 658 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 659 | */ |
| 660 | #define SQLITE_VERSION "3.7.12" |
| 661 | #define SQLITE_VERSION_NUMBER 3007012 |
| 662 | #define SQLITE_SOURCE_ID "2012-05-01 14:21:57 bfa61e781cb442be641486e7e55a1518e888d830" |
| 663 | |
| 664 | /* |
| 665 | ** CAPI3REF: Run-Time Library Version Numbers |
| 666 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 667 | ** |
| @@ -41583,11 +41583,11 @@ | |
| 41583 | ** They will never be read by any client. So remove them from the pDirty |
| 41584 | ** list here. */ |
| 41585 | PgHdr *p; |
| 41586 | PgHdr **ppNext = &pList; |
| 41587 | nList = 0; |
| 41588 | for(p=pList; (*ppNext = p)!=0; p=p->pDirty){ |
| 41589 | if( p->pgno<=nTruncate ){ |
| 41590 | ppNext = &p->pDirty; |
| 41591 | nList++; |
| 41592 | } |
| 41593 | } |
| @@ -74273,11 +74273,11 @@ | |
| 74273 | NameContext *pNC, /* The name context of the SELECT statement */ |
| 74274 | Select *pSelect, /* The SELECT statement holding pOrderBy */ |
| 74275 | ExprList *pOrderBy, /* An ORDER BY or GROUP BY clause to resolve */ |
| 74276 | const char *zType /* Either "ORDER" or "GROUP", as appropriate */ |
| 74277 | ){ |
| 74278 | int i, j; /* Loop counters */ |
| 74279 | int iCol; /* Column number */ |
| 74280 | struct ExprList_item *pItem; /* A term of the ORDER BY clause */ |
| 74281 | Parse *pParse; /* Parsing context */ |
| 74282 | int nResult; /* Number of terms in the result set */ |
| 74283 | |
| @@ -74309,10 +74309,15 @@ | |
| 74309 | |
| 74310 | /* Otherwise, treat the ORDER BY term as an ordinary expression */ |
| 74311 | pItem->iOrderByCol = 0; |
| 74312 | if( sqlite3ResolveExprNames(pNC, pE) ){ |
| 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 | } |
| 74319 | } |
| 74320 | } |
| 74321 | return sqlite3ResolveOrderGroupBy(pParse, pSelect, pOrderBy, zType); |
| 74322 | } |
| 74323 | |
| @@ -102256,11 +102261,11 @@ | |
| 102261 | Table *pTab, |
| 102262 | Module *pMod, |
| 102263 | int (*xConstruct)(sqlite3*,void*,int,const char*const*,sqlite3_vtab**,char**), |
| 102264 | char **pzErr |
| 102265 | ){ |
| 102266 | VtabCtx sCtx, *pPriorCtx; |
| 102267 | VTable *pVTable; |
| 102268 | int rc; |
| 102269 | const char *const*azArg = (const char *const*)pTab->azModuleArg; |
| 102270 | int nArg = pTab->nModuleArg; |
| 102271 | char *zErr = 0; |
| @@ -102281,13 +102286,14 @@ | |
| 102286 | /* Invoke the virtual table constructor */ |
| 102287 | assert( &db->pVtabCtx ); |
| 102288 | assert( xConstruct ); |
| 102289 | sCtx.pTab = pTab; |
| 102290 | sCtx.pVTable = pVTable; |
| 102291 | pPriorCtx = db->pVtabCtx; |
| 102292 | db->pVtabCtx = &sCtx; |
| 102293 | rc = xConstruct(db, pMod->pAux, nArg, azArg, &pVTable->pVtab, &zErr); |
| 102294 | db->pVtabCtx = pPriorCtx; |
| 102295 | if( rc==SQLITE_NOMEM ) db->mallocFailed = 1; |
| 102296 | |
| 102297 | if( SQLITE_OK!=rc ){ |
| 102298 | if( zErr==0 ){ |
| 102299 | *pzErr = sqlite3MPrintf(db, "vtable constructor failed: %s", zModuleName); |
| 102300 |
+1
-1
| --- src/sqlite3.h | ||
| +++ src/sqlite3.h | ||
| @@ -107,11 +107,11 @@ | ||
| 107 | 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | 109 | */ |
| 110 | 110 | #define SQLITE_VERSION "3.7.12" |
| 111 | 111 | #define SQLITE_VERSION_NUMBER 3007012 |
| 112 | -#define SQLITE_SOURCE_ID "2012-04-24 13:14:49 dfce8569765614462a3952d1761c10d579984665" | |
| 112 | +#define SQLITE_SOURCE_ID "2012-05-01 14:21:57 bfa61e781cb442be641486e7e55a1518e888d830" | |
| 113 | 113 | |
| 114 | 114 | /* |
| 115 | 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | 117 | ** |
| 118 | 118 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -107,11 +107,11 @@ | |
| 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | */ |
| 110 | #define SQLITE_VERSION "3.7.12" |
| 111 | #define SQLITE_VERSION_NUMBER 3007012 |
| 112 | #define SQLITE_SOURCE_ID "2012-04-24 13:14:49 dfce8569765614462a3952d1761c10d579984665" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| 118 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -107,11 +107,11 @@ | |
| 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | */ |
| 110 | #define SQLITE_VERSION "3.7.12" |
| 111 | #define SQLITE_VERSION_NUMBER 3007012 |
| 112 | #define SQLITE_SOURCE_ID "2012-05-01 14:21:57 bfa61e781cb442be641486e7e55a1518e888d830" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| 118 |