OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 31-Jul-2007 09:32:01
Branch: HEAD Handle: 2007073108320000
Modified files:
openpkg-src/sqlite sqlite.patch sqlite.spec
Log:
apply a larger set of upstream fixes we have in the SQLite CVS applied
since 3.4.1
Summary:
Revision Changes Path
1.37 +169 -0 openpkg-src/sqlite/sqlite.patch
1.147 +1 -1 openpkg-src/sqlite/sqlite.spec
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/sqlite/sqlite.patch
============================================================================
$ cvs diff -u -r1.36 -r1.37 sqlite.patch
--- openpkg-src/sqlite/sqlite.patch 21 Jul 2007 08:09:59 -0000 1.36
+++ openpkg-src/sqlite/sqlite.patch 31 Jul 2007 07:32:00 -0000 1.37
@@ -142,3 +142,172 @@
-Libs: -L${libdir} -lsqlite3
+Libs: -L${libdir} -lsqlite3 @LIBS@
Cflags: -I${includedir}
+--- src/vdbe.c 2007/07/21 19:41:46 1.637
++++ src/vdbe.c 2007/07/22 19:10:21 1.638
+@@ -1289,7 +1289,19 @@
+ if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse;
+ (*ctx.pFunc->xFunc)(&ctx, n, apVal);
+ if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse;
+- if( sqlite3MallocFailed() ) goto no_mem;
++ if( sqlite3MallocFailed() ){
++ /* Even though a malloc() has failed, the implementation of the
++ ** user function may have called an sqlite3_result_XXX() function
++ ** to return a value. The following call releases any resources
++ ** associated with such a value.
++ **
++ ** Note: Maybe MemRelease() should be called if sqlite3SafetyOn()
++ ** fails also (the if(...) statement above). But if people are
++ ** misusing sqlite, they have bigger problems than a leaked value.
++ */
++ sqlite3VdbeMemRelease(&ctx.s);
++ goto no_mem;
++ }
+ popStack(&pTos, n);
+
+ /* If any auxilary data functions have been called by this user function,
+@@ -4299,7 +4299,7 @@
+ if( (pTos[-nRoot].flags & MEM_Int)==0 ) break;
+ }
+ assert( nRoot>0 );
+- aRoot = sqliteMallocRaw( sizeof(int*)*(nRoot+1) );
++ aRoot = sqliteMallocRaw( sizeof(int)*(nRoot+1) );
+ if( aRoot==0 ) goto no_mem;
+ j = pOp->p1;
+ assert( j>=0 && j<p->nMem );
+@@ -4306,7 +4306,7 @@
+ pnErr = &p->aMem[j];
+ assert( (pnErr->flags & MEM_Int)!=0 );
+ for(j=0; j<nRoot; j++){
+- aRoot[j] = pTos[-j].u.i;
++ aRoot[j] = (pTos-j)->u.i;
+ }
+ aRoot[j] = 0;
+ popStack(&pTos, nRoot);
+Index: src/btree.c
+--- src/btree.c 2007/06/26 01:04:49 1.392
++++ src/btree.c 2007/07/23 19:26:17 1.393
+@@ -2009,7 +2009,7 @@
+ assert(nFin==0 || pBt->nTrunc==0 || nFin<=pBt->nTrunc);
+ rc = SQLITE_OK;
+ if( pBt->nTrunc ){
+- sqlite3PagerWrite(pBt->pPage1->pDbPage);
++ rc = sqlite3PagerWrite(pBt->pPage1->pDbPage);
+ put4byte(&pBt->pPage1->aData[32], 0);
+ put4byte(&pBt->pPage1->aData[36], 0);
+ pBt->nTrunc = nFin;
+Index: src/insert.c
+--- src/insert.c 2007/06/26 10:38:55 1.187
++++ src/insert.c 2007/07/23 19:39:47 1.188
+@@ -1027,7 +1027,7 @@
+ assert( pParse->ckOffset==nCol );
+ pParse->ckOffset = 0;
+ onError = overrideError!=OE_Default ? overrideError : OE_Abort;
+- if( onError==OE_Ignore || onError==OE_Replace ){
++ if( onError==OE_Ignore ){
+ sqlite3VdbeAddOp(v, OP_Pop, nCol+1+hasTwoRowids, 0);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, ignoreDest);
+ }else{
+Index: src/expr.c
+--- src/expr.c 2007/06/25 16:29:34 1.300
++++ src/expr.c 2007/07/23 22:51:15 1.301
+@@ -1140,11 +1140,17 @@
+ for(j=0; j<pEList->nExpr; j++){
+ char *zAs = pEList->a[j].zName;
+ if( zAs!=0 && sqlite3StrICmp(zAs, zCol)==0 ){
+- Expr *pDup;
++ Expr *pDup, *pOrig;
+ assert( pExpr->pLeft==0 && pExpr->pRight==0 );
+ assert( pExpr->pList==0 );
+ assert( pExpr->pSelect==0 );
+- pDup = sqlite3ExprDup(pEList->a[j].pExpr);
++ pOrig = pEList->a[j].pExpr;
++ if( !pNC->allowAgg && ExprHasProperty(pOrig, EP_Agg) ){
++ sqlite3ErrorMsg(pParse, "misuse of aliased aggregate %s", zAs);
++ sqliteFree(zCol);
++ return 2;
++ }
++ pDup = sqlite3ExprDup(pOrig);
+ if( pExpr->flags & EP_ExpCollate ){
+ pDup->pColl = pExpr->pColl;
+ pDup->flags |= EP_ExpCollate;
+Index: src/func.c
+--- src/func.c 2007/07/23 19:12:42 1.162
++++ src/func.c 2007/07/26 06:50:06 1.163
+@@ -1118,6 +1118,7 @@
+ if( zAux ){
+ zRet[i*2] = '1';
+ if( strcmp(zAux, z) ){
++ free_test_auxdata((void *)zRet);
+ sqlite3_result_error(pCtx, "Auxilary data corruption", -1);
+ return;
+ }
+Index: src/vdbeapi.c
+--- src/vdbeapi.c 2007/07/12 13:18:05 1.94
++++ src/vdbeapi.c 2007/07/26 06:50:06 1.95
+@@ -390,13 +390,13 @@
+ ){
+ struct AuxData *pAuxData;
+ VdbeFunc *pVdbeFunc;
+- if( iArg<0 ) return;
++ if( iArg<0 ) goto failed;
+
+ pVdbeFunc = pCtx->pVdbeFunc;
+ if( !pVdbeFunc || pVdbeFunc->nAux<=iArg ){
+ int nMalloc = sizeof(VdbeFunc) + sizeof(struct AuxData)*iArg;
+ pVdbeFunc = sqliteRealloc(pVdbeFunc, nMalloc);
+- if( !pVdbeFunc ) return;
++ if( !pVdbeFunc ) goto failed;
+ pCtx->pVdbeFunc = pVdbeFunc;
+ memset(&pVdbeFunc->apAux[pVdbeFunc->nAux], 0,
+ sizeof(struct AuxData)*(iArg+1-pVdbeFunc->nAux));
+@@ -410,6 +410,12 @@
+ }
+ pAuxData->pAux = pAux;
+ pAuxData->xDelete = xDelete;
++ return;
++
++failed:
++ if( xDelete ){
++ xDelete(pAux);
++ }
+ }
+
+ /*
+Index: src/where.c
+--- src/where.c 2007/06/11 12:56:15 1.253
++++ src/where.c 2007/07/30 14:40:48 1.254
+@@ -383,10 +383,22 @@
+ /*
+ ** Commute a comparision operator. Expressions of the form "X op Y"
+ ** are converted into "Y op X".
++**
++** If a collation sequence is associated with either the left or right
++** side of the comparison, it remains associated with the same side after
++** the commutation. So "Y collate NOCASE op X" becomes
++** "X collate NOCASE op Y". This is because any collation sequence on
++** the left hand side of a comparison overrides any collation sequence
++** attached to the right. For the same reason the EP_ExpCollate flag
++** is not commuted.
+ */
+ static void exprCommute(Expr *pExpr){
++ u16 expRight = (pExpr->pRight->flags & EP_ExpCollate);
++ u16 expLeft = (pExpr->pLeft->flags & EP_ExpCollate);
+ assert( allowedOp(pExpr->op) && pExpr->op!=TK_IN );
+ SWAP(CollSeq*,pExpr->pRight->pColl,pExpr->pLeft->pColl);
++ pExpr->pRight->flags = (pExpr->pRight->flags & ~EP_ExpCollate) | expLeft;
++ pExpr->pLeft->flags = (pExpr->pLeft->flags & ~EP_ExpCollate) | expRight;
+ SWAP(Expr*,pExpr->pRight,pExpr->pLeft);
+ if( pExpr->op>=TK_GT ){
+ assert( TK_LT==TK_GT+2 );
+Index: src/shell.c
+--- src/shell.c 2007/07/30 18:24:39 1.165
++++ src/shell.c 2007/07/30 20:41:53 1.166
+@@ -1779,7 +1779,7 @@
+ in = fopen(sqliterc,"rb");
+ if( in ){
+ if( stdin_is_interactive ){
+- printf("Loading resources from %s\n",sqliterc);
++ printf("-- Loading resources from %s\n",sqliterc);
+ }
+ process_input(p,in);
+ fclose(in);
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/sqlite/sqlite.spec
============================================================================
$ cvs diff -u -r1.146 -r1.147 sqlite.spec
--- openpkg-src/sqlite/sqlite.spec 21 Jul 2007 07:42:21 -0000 1.146
+++ openpkg-src/sqlite/sqlite.spec 31 Jul 2007 07:32:00 -0000 1.147
@@ -37,7 +37,7 @@
Group: Database
License: PD
Version: %{V_sqlite}
-Release: 20070721
+Release: 20070731
# package options
%option with_utf8 no
@@ .
______________________________________________________________________
OpenPKG http://openpkg.org
CVS Repository Commit List [email protected]