Fossil SCM
Update the built-in SQLite amalgamation to the latest 3.7.8 beta.
Commit
b54b8e751a1d1dfb1cc5f17732d74f162a6e89f4
Parent
4db5bd1111f21a2…
2 files changed
+19
-11
+1
-1
+19
-11
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -656,11 +656,11 @@ | ||
| 656 | 656 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 657 | 657 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 658 | 658 | */ |
| 659 | 659 | #define SQLITE_VERSION "3.7.8" |
| 660 | 660 | #define SQLITE_VERSION_NUMBER 3007008 |
| 661 | -#define SQLITE_SOURCE_ID "2011-09-16 19:04:03 cf51ef8ab8a610ddf64f66970dd689fe1df405b8" | |
| 661 | +#define SQLITE_SOURCE_ID "2011-09-17 17:29:20 b31a7d7db9040d8eedaf1ecd89ea0033f579d0f1" | |
| 662 | 662 | |
| 663 | 663 | /* |
| 664 | 664 | ** CAPI3REF: Run-Time Library Version Numbers |
| 665 | 665 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 666 | 666 | ** |
| @@ -14537,11 +14537,11 @@ | ||
| 14537 | 14537 | int flags, |
| 14538 | 14538 | int *pOutFlags |
| 14539 | 14539 | ){ |
| 14540 | 14540 | int rc = SQLITE_NOMEM; |
| 14541 | 14541 | sqlite3_file *pFile; |
| 14542 | - pFile = (sqlite3_file *)sqlite3Malloc(pVfs->szOsFile); | |
| 14542 | + pFile = (sqlite3_file *)sqlite3MallocZero(pVfs->szOsFile); | |
| 14543 | 14543 | if( pFile ){ |
| 14544 | 14544 | rc = sqlite3OsOpen(pVfs, zFile, pFile, flags, pOutFlags); |
| 14545 | 14545 | if( rc!=SQLITE_OK ){ |
| 14546 | 14546 | sqlite3_free(pFile); |
| 14547 | 14547 | }else{ |
| @@ -32800,13 +32800,23 @@ | ||
| 32800 | 32800 | |
| 32801 | 32801 | /* |
| 32802 | 32802 | ** Make sure all writes to a particular file are committed to disk. |
| 32803 | 32803 | */ |
| 32804 | 32804 | static int winSync(sqlite3_file *id, int flags){ |
| 32805 | -#if !defined(NDEBUG) || !defined(SQLITE_NO_SYNC) || defined(SQLITE_DEBUG) | |
| 32806 | - winFile *pFile = (winFile*)id; | |
| 32805 | +#ifndef SQLITE_NO_SYNC | |
| 32806 | + /* | |
| 32807 | + ** Used only when SQLITE_NO_SYNC is not defined. | |
| 32808 | + */ | |
| 32807 | 32809 | BOOL rc; |
| 32810 | +#endif | |
| 32811 | +#if !defined(NDEBUG) || !defined(SQLITE_NO_SYNC) || \ | |
| 32812 | + (defined(SQLITE_TEST) && defined(SQLITE_DEBUG)) | |
| 32813 | + /* | |
| 32814 | + ** Used when SQLITE_NO_SYNC is not defined and by the assert() and/or | |
| 32815 | + ** OSTRACE() macros. | |
| 32816 | + */ | |
| 32817 | + winFile *pFile = (winFile*)id; | |
| 32808 | 32818 | #else |
| 32809 | 32819 | UNUSED_PARAMETER(id); |
| 32810 | 32820 | #endif |
| 32811 | 32821 | |
| 32812 | 32822 | assert( pFile ); |
| @@ -74581,15 +74591,14 @@ | ||
| 74581 | 74591 | Parse *pParse, /* Parsing context */ |
| 74582 | 74592 | Expr *pExpr, /* The IN, SELECT, or EXISTS operator */ |
| 74583 | 74593 | int rMayHaveNull, /* Register that records whether NULLs exist in RHS */ |
| 74584 | 74594 | int isRowid /* If true, LHS of IN operator is a rowid */ |
| 74585 | 74595 | ){ |
| 74586 | - int testAddr = 0; /* One-time test address */ | |
| 74596 | + int testAddr = -1; /* One-time test address */ | |
| 74587 | 74597 | int rReg = 0; /* Register storing resulting */ |
| 74588 | 74598 | Vdbe *v = sqlite3GetVdbe(pParse); |
| 74589 | 74599 | if( NEVER(v==0) ) return 0; |
| 74590 | - assert( sqlite3VdbeCurrentAddr(v)>0 ); | |
| 74591 | 74600 | sqlite3ExprCachePush(pParse); |
| 74592 | 74601 | |
| 74593 | 74602 | /* This code must be run in its entirety every time it is encountered |
| 74594 | 74603 | ** if any of the following is true: |
| 74595 | 74604 | ** |
| @@ -74601,17 +74610,16 @@ | ||
| 74601 | 74610 | ** save the results, and reuse the same result on subsequent invocations. |
| 74602 | 74611 | */ |
| 74603 | 74612 | if( !ExprHasAnyProperty(pExpr, EP_VarSelect) && !pParse->pTriggerTab ){ |
| 74604 | 74613 | int mem = ++pParse->nMem; |
| 74605 | 74614 | testAddr = sqlite3VdbeAddOp1(v, OP_Once, mem); |
| 74606 | - assert( testAddr>0 || pParse->db->mallocFailed ); | |
| 74607 | 74615 | } |
| 74608 | 74616 | |
| 74609 | 74617 | #ifndef SQLITE_OMIT_EXPLAIN |
| 74610 | 74618 | if( pParse->explain==2 ){ |
| 74611 | 74619 | char *zMsg = sqlite3MPrintf( |
| 74612 | - pParse->db, "EXECUTE %s%s SUBQUERY %d", testAddr?"":"CORRELATED ", | |
| 74620 | + pParse->db, "EXECUTE %s%s SUBQUERY %d", testAddr>=0?"":"CORRELATED ", | |
| 74613 | 74621 | pExpr->op==TK_IN?"LIST":"SCALAR", pParse->iNextSelectId |
| 74614 | 74622 | ); |
| 74615 | 74623 | sqlite3VdbeAddOp4(v, OP_Explain, pParse->iSelectId, 0, 0, zMsg, P4_DYNAMIC); |
| 74616 | 74624 | } |
| 74617 | 74625 | #endif |
| @@ -74699,13 +74707,13 @@ | ||
| 74699 | 74707 | /* If the expression is not constant then we will need to |
| 74700 | 74708 | ** disable the test that was generated above that makes sure |
| 74701 | 74709 | ** this code only executes once. Because for a non-constant |
| 74702 | 74710 | ** expression we need to rerun this code each time. |
| 74703 | 74711 | */ |
| 74704 | - if( testAddr && !sqlite3ExprIsConstant(pE2) ){ | |
| 74712 | + if( testAddr>=0 && !sqlite3ExprIsConstant(pE2) ){ | |
| 74705 | 74713 | sqlite3VdbeChangeToNoop(v, testAddr); |
| 74706 | - testAddr = 0; | |
| 74714 | + testAddr = -1; | |
| 74707 | 74715 | } |
| 74708 | 74716 | |
| 74709 | 74717 | /* Evaluate the expression and insert it into the temp table */ |
| 74710 | 74718 | if( isRowid && sqlite3ExprIsInteger(pE2, &iValToIns) ){ |
| 74711 | 74719 | sqlite3VdbeAddOp3(v, OP_InsertInt, pExpr->iTable, r2, iValToIns); |
| @@ -74770,11 +74778,11 @@ | ||
| 74770 | 74778 | ExprSetIrreducible(pExpr); |
| 74771 | 74779 | break; |
| 74772 | 74780 | } |
| 74773 | 74781 | } |
| 74774 | 74782 | |
| 74775 | - if( testAddr ){ | |
| 74783 | + if( testAddr>=0 ){ | |
| 74776 | 74784 | sqlite3VdbeJumpHere(v, testAddr); |
| 74777 | 74785 | } |
| 74778 | 74786 | sqlite3ExprCachePop(pParse, 1); |
| 74779 | 74787 | |
| 74780 | 74788 | return rReg; |
| 74781 | 74789 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -656,11 +656,11 @@ | |
| 656 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 657 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 658 | */ |
| 659 | #define SQLITE_VERSION "3.7.8" |
| 660 | #define SQLITE_VERSION_NUMBER 3007008 |
| 661 | #define SQLITE_SOURCE_ID "2011-09-16 19:04:03 cf51ef8ab8a610ddf64f66970dd689fe1df405b8" |
| 662 | |
| 663 | /* |
| 664 | ** CAPI3REF: Run-Time Library Version Numbers |
| 665 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 666 | ** |
| @@ -14537,11 +14537,11 @@ | |
| 14537 | int flags, |
| 14538 | int *pOutFlags |
| 14539 | ){ |
| 14540 | int rc = SQLITE_NOMEM; |
| 14541 | sqlite3_file *pFile; |
| 14542 | pFile = (sqlite3_file *)sqlite3Malloc(pVfs->szOsFile); |
| 14543 | if( pFile ){ |
| 14544 | rc = sqlite3OsOpen(pVfs, zFile, pFile, flags, pOutFlags); |
| 14545 | if( rc!=SQLITE_OK ){ |
| 14546 | sqlite3_free(pFile); |
| 14547 | }else{ |
| @@ -32800,13 +32800,23 @@ | |
| 32800 | |
| 32801 | /* |
| 32802 | ** Make sure all writes to a particular file are committed to disk. |
| 32803 | */ |
| 32804 | static int winSync(sqlite3_file *id, int flags){ |
| 32805 | #if !defined(NDEBUG) || !defined(SQLITE_NO_SYNC) || defined(SQLITE_DEBUG) |
| 32806 | winFile *pFile = (winFile*)id; |
| 32807 | BOOL rc; |
| 32808 | #else |
| 32809 | UNUSED_PARAMETER(id); |
| 32810 | #endif |
| 32811 | |
| 32812 | assert( pFile ); |
| @@ -74581,15 +74591,14 @@ | |
| 74581 | Parse *pParse, /* Parsing context */ |
| 74582 | Expr *pExpr, /* The IN, SELECT, or EXISTS operator */ |
| 74583 | int rMayHaveNull, /* Register that records whether NULLs exist in RHS */ |
| 74584 | int isRowid /* If true, LHS of IN operator is a rowid */ |
| 74585 | ){ |
| 74586 | int testAddr = 0; /* One-time test address */ |
| 74587 | int rReg = 0; /* Register storing resulting */ |
| 74588 | Vdbe *v = sqlite3GetVdbe(pParse); |
| 74589 | if( NEVER(v==0) ) return 0; |
| 74590 | assert( sqlite3VdbeCurrentAddr(v)>0 ); |
| 74591 | sqlite3ExprCachePush(pParse); |
| 74592 | |
| 74593 | /* This code must be run in its entirety every time it is encountered |
| 74594 | ** if any of the following is true: |
| 74595 | ** |
| @@ -74601,17 +74610,16 @@ | |
| 74601 | ** save the results, and reuse the same result on subsequent invocations. |
| 74602 | */ |
| 74603 | if( !ExprHasAnyProperty(pExpr, EP_VarSelect) && !pParse->pTriggerTab ){ |
| 74604 | int mem = ++pParse->nMem; |
| 74605 | testAddr = sqlite3VdbeAddOp1(v, OP_Once, mem); |
| 74606 | assert( testAddr>0 || pParse->db->mallocFailed ); |
| 74607 | } |
| 74608 | |
| 74609 | #ifndef SQLITE_OMIT_EXPLAIN |
| 74610 | if( pParse->explain==2 ){ |
| 74611 | char *zMsg = sqlite3MPrintf( |
| 74612 | pParse->db, "EXECUTE %s%s SUBQUERY %d", testAddr?"":"CORRELATED ", |
| 74613 | pExpr->op==TK_IN?"LIST":"SCALAR", pParse->iNextSelectId |
| 74614 | ); |
| 74615 | sqlite3VdbeAddOp4(v, OP_Explain, pParse->iSelectId, 0, 0, zMsg, P4_DYNAMIC); |
| 74616 | } |
| 74617 | #endif |
| @@ -74699,13 +74707,13 @@ | |
| 74699 | /* If the expression is not constant then we will need to |
| 74700 | ** disable the test that was generated above that makes sure |
| 74701 | ** this code only executes once. Because for a non-constant |
| 74702 | ** expression we need to rerun this code each time. |
| 74703 | */ |
| 74704 | if( testAddr && !sqlite3ExprIsConstant(pE2) ){ |
| 74705 | sqlite3VdbeChangeToNoop(v, testAddr); |
| 74706 | testAddr = 0; |
| 74707 | } |
| 74708 | |
| 74709 | /* Evaluate the expression and insert it into the temp table */ |
| 74710 | if( isRowid && sqlite3ExprIsInteger(pE2, &iValToIns) ){ |
| 74711 | sqlite3VdbeAddOp3(v, OP_InsertInt, pExpr->iTable, r2, iValToIns); |
| @@ -74770,11 +74778,11 @@ | |
| 74770 | ExprSetIrreducible(pExpr); |
| 74771 | break; |
| 74772 | } |
| 74773 | } |
| 74774 | |
| 74775 | if( testAddr ){ |
| 74776 | sqlite3VdbeJumpHere(v, testAddr); |
| 74777 | } |
| 74778 | sqlite3ExprCachePop(pParse, 1); |
| 74779 | |
| 74780 | return rReg; |
| 74781 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -656,11 +656,11 @@ | |
| 656 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 657 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 658 | */ |
| 659 | #define SQLITE_VERSION "3.7.8" |
| 660 | #define SQLITE_VERSION_NUMBER 3007008 |
| 661 | #define SQLITE_SOURCE_ID "2011-09-17 17:29:20 b31a7d7db9040d8eedaf1ecd89ea0033f579d0f1" |
| 662 | |
| 663 | /* |
| 664 | ** CAPI3REF: Run-Time Library Version Numbers |
| 665 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 666 | ** |
| @@ -14537,11 +14537,11 @@ | |
| 14537 | int flags, |
| 14538 | int *pOutFlags |
| 14539 | ){ |
| 14540 | int rc = SQLITE_NOMEM; |
| 14541 | sqlite3_file *pFile; |
| 14542 | pFile = (sqlite3_file *)sqlite3MallocZero(pVfs->szOsFile); |
| 14543 | if( pFile ){ |
| 14544 | rc = sqlite3OsOpen(pVfs, zFile, pFile, flags, pOutFlags); |
| 14545 | if( rc!=SQLITE_OK ){ |
| 14546 | sqlite3_free(pFile); |
| 14547 | }else{ |
| @@ -32800,13 +32800,23 @@ | |
| 32800 | |
| 32801 | /* |
| 32802 | ** Make sure all writes to a particular file are committed to disk. |
| 32803 | */ |
| 32804 | static int winSync(sqlite3_file *id, int flags){ |
| 32805 | #ifndef SQLITE_NO_SYNC |
| 32806 | /* |
| 32807 | ** Used only when SQLITE_NO_SYNC is not defined. |
| 32808 | */ |
| 32809 | BOOL rc; |
| 32810 | #endif |
| 32811 | #if !defined(NDEBUG) || !defined(SQLITE_NO_SYNC) || \ |
| 32812 | (defined(SQLITE_TEST) && defined(SQLITE_DEBUG)) |
| 32813 | /* |
| 32814 | ** Used when SQLITE_NO_SYNC is not defined and by the assert() and/or |
| 32815 | ** OSTRACE() macros. |
| 32816 | */ |
| 32817 | winFile *pFile = (winFile*)id; |
| 32818 | #else |
| 32819 | UNUSED_PARAMETER(id); |
| 32820 | #endif |
| 32821 | |
| 32822 | assert( pFile ); |
| @@ -74581,15 +74591,14 @@ | |
| 74591 | Parse *pParse, /* Parsing context */ |
| 74592 | Expr *pExpr, /* The IN, SELECT, or EXISTS operator */ |
| 74593 | int rMayHaveNull, /* Register that records whether NULLs exist in RHS */ |
| 74594 | int isRowid /* If true, LHS of IN operator is a rowid */ |
| 74595 | ){ |
| 74596 | int testAddr = -1; /* One-time test address */ |
| 74597 | int rReg = 0; /* Register storing resulting */ |
| 74598 | Vdbe *v = sqlite3GetVdbe(pParse); |
| 74599 | if( NEVER(v==0) ) return 0; |
| 74600 | sqlite3ExprCachePush(pParse); |
| 74601 | |
| 74602 | /* This code must be run in its entirety every time it is encountered |
| 74603 | ** if any of the following is true: |
| 74604 | ** |
| @@ -74601,17 +74610,16 @@ | |
| 74610 | ** save the results, and reuse the same result on subsequent invocations. |
| 74611 | */ |
| 74612 | if( !ExprHasAnyProperty(pExpr, EP_VarSelect) && !pParse->pTriggerTab ){ |
| 74613 | int mem = ++pParse->nMem; |
| 74614 | testAddr = sqlite3VdbeAddOp1(v, OP_Once, mem); |
| 74615 | } |
| 74616 | |
| 74617 | #ifndef SQLITE_OMIT_EXPLAIN |
| 74618 | if( pParse->explain==2 ){ |
| 74619 | char *zMsg = sqlite3MPrintf( |
| 74620 | pParse->db, "EXECUTE %s%s SUBQUERY %d", testAddr>=0?"":"CORRELATED ", |
| 74621 | pExpr->op==TK_IN?"LIST":"SCALAR", pParse->iNextSelectId |
| 74622 | ); |
| 74623 | sqlite3VdbeAddOp4(v, OP_Explain, pParse->iSelectId, 0, 0, zMsg, P4_DYNAMIC); |
| 74624 | } |
| 74625 | #endif |
| @@ -74699,13 +74707,13 @@ | |
| 74707 | /* If the expression is not constant then we will need to |
| 74708 | ** disable the test that was generated above that makes sure |
| 74709 | ** this code only executes once. Because for a non-constant |
| 74710 | ** expression we need to rerun this code each time. |
| 74711 | */ |
| 74712 | if( testAddr>=0 && !sqlite3ExprIsConstant(pE2) ){ |
| 74713 | sqlite3VdbeChangeToNoop(v, testAddr); |
| 74714 | testAddr = -1; |
| 74715 | } |
| 74716 | |
| 74717 | /* Evaluate the expression and insert it into the temp table */ |
| 74718 | if( isRowid && sqlite3ExprIsInteger(pE2, &iValToIns) ){ |
| 74719 | sqlite3VdbeAddOp3(v, OP_InsertInt, pExpr->iTable, r2, iValToIns); |
| @@ -74770,11 +74778,11 @@ | |
| 74778 | ExprSetIrreducible(pExpr); |
| 74779 | break; |
| 74780 | } |
| 74781 | } |
| 74782 | |
| 74783 | if( testAddr>=0 ){ |
| 74784 | sqlite3VdbeJumpHere(v, testAddr); |
| 74785 | } |
| 74786 | sqlite3ExprCachePop(pParse, 1); |
| 74787 | |
| 74788 | return rReg; |
| 74789 |
+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.8" |
| 111 | 111 | #define SQLITE_VERSION_NUMBER 3007008 |
| 112 | -#define SQLITE_SOURCE_ID "2011-09-16 19:04:03 cf51ef8ab8a610ddf64f66970dd689fe1df405b8" | |
| 112 | +#define SQLITE_SOURCE_ID "2011-09-17 17:29:20 b31a7d7db9040d8eedaf1ecd89ea0033f579d0f1" | |
| 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.8" |
| 111 | #define SQLITE_VERSION_NUMBER 3007008 |
| 112 | #define SQLITE_SOURCE_ID "2011-09-16 19:04:03 cf51ef8ab8a610ddf64f66970dd689fe1df405b8" |
| 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.8" |
| 111 | #define SQLITE_VERSION_NUMBER 3007008 |
| 112 | #define SQLITE_SOURCE_ID "2011-09-17 17:29:20 b31a7d7db9040d8eedaf1ecd89ea0033f579d0f1" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| 118 |