Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix some segfaults that could have occurred after a malloc() failure. (CVS 1661) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
80151e728101c3cd5a8cf36cca2bfa66 |
User & Date: | drh 2004-06-22 13:22:40.000 |
Context
2004-06-22
| ||
13:23 | Fix error introduced during merge of main.mk. (CVS 1662) (check-in: eef6da38d5 user: danielk1977 tags: trunk) | |
13:22 | Fix some segfaults that could have occurred after a malloc() failure. (CVS 1661) (check-in: 80151e7281 user: drh tags: trunk) | |
13:12 | Add crash.test script. (CVS 1660) (check-in: 64a6d80517 user: danielk1977 tags: trunk) | |
Changes
Changes to src/build.c.
︙ | ︙ | |||
19 20 21 22 23 24 25 | ** DROP INDEX ** creating ID lists ** BEGIN TRANSACTION ** COMMIT ** ROLLBACK ** PRAGMA ** | | | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ** DROP INDEX ** creating ID lists ** BEGIN TRANSACTION ** COMMIT ** ROLLBACK ** PRAGMA ** ** $Id: build.c,v 1.232 2004/06/22 13:22:40 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> /* ** This routine is called when a new SQL statement is beginning to ** be parsed. Check to see if the schema for the database needs |
︙ | ︙ | |||
117 118 119 120 121 122 123 124 125 126 127 128 129 130 | ** ** See also sqlite3LocateTable(). */ Table *sqlite3FindTable(sqlite *db, const char *zName, const char *zDatabase){ Table *p = 0; int i; int rc = sqlite3ReadSchema(db, 0); for(i=0; rc==SQLITE_OK && i<db->nDb; i++){ int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ if( zDatabase!=0 && sqlite3StrICmp(zDatabase, db->aDb[j].zName) ) continue; p = sqlite3HashFind(&db->aDb[j].tblHash, zName, strlen(zName)+1); if( p ) break; } return p; | > | 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | ** ** See also sqlite3LocateTable(). */ Table *sqlite3FindTable(sqlite *db, const char *zName, const char *zDatabase){ Table *p = 0; int i; int rc = sqlite3ReadSchema(db, 0); assert( zName!=0 ); for(i=0; rc==SQLITE_OK && i<db->nDb; i++){ int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ if( zDatabase!=0 && sqlite3StrICmp(zDatabase, db->aDb[j].zName) ) continue; p = sqlite3HashFind(&db->aDb[j].tblHash, zName, strlen(zName)+1); if( p ) break; } return p; |
︙ | ︙ |
Changes to src/trigger.c.
︙ | ︙ | |||
75 76 77 78 79 80 81 | } /* If the trigger name was unqualified, and the table is a temp table, ** then set iDb to 1 to create the trigger in the temporary database. ** If sqlite3SrcListLookup() returns 0, indicating the table does not ** exist, the error is caught by the block below. */ | | | 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | } /* If the trigger name was unqualified, and the table is a temp table, ** then set iDb to 1 to create the trigger in the temporary database. ** If sqlite3SrcListLookup() returns 0, indicating the table does not ** exist, the error is caught by the block below. */ if( !pTableName || sqlite3_malloc_failed ) goto trigger_cleanup; pTab = sqlite3SrcListLookup(pParse, pTableName); if( pName2->n==0 && pTab && pTab->iDb==1 ){ iDb = 1; } /* Ensure the table name matches database name and that the table exists */ if( sqlite3_malloc_failed ) goto trigger_cleanup; |
︙ | ︙ |
Changes to src/vdbe.c.
︙ | ︙ | |||
39 40 41 42 43 44 45 | ** ** Various scripts scan this source file in order to generate HTML ** documentation, headers files, or other derived files. The formatting ** of the code in this file is, therefore, important. See other comments ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. ** | | | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | ** ** Various scripts scan this source file in order to generate HTML ** documentation, headers files, or other derived files. The formatting ** of the code in this file is, therefore, important. See other comments ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. ** ** $Id: vdbe.c,v 1.386 2004/06/22 13:22:41 drh Exp $ */ #include "sqliteInt.h" #include "os.h" #include <ctype.h> #include "vdbeInt.h" /* |
︙ | ︙ | |||
182 183 184 185 186 187 188 | pElem->aMem[i].flags = MEM_Null; } p->pCurrent = pElem; return 0; } /* | < < < < < < < < < < < < < < | 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | pElem->aMem[i].flags = MEM_Null; } p->pCurrent = pElem; return 0; } /* ** Store a pointer to the AggElem currently in focus in *ppElem. Return ** SQLITE_OK if successful, otherwise an error-code. */ static int AggInFocus(Agg *p, AggElem **ppElem){ int rc; int res; |
︙ | ︙ | |||
4219 4220 4221 4222 4223 4224 4225 | ** OP_AggFocus. */ case OP_AggReset: { assert( !pOp->p3 || pOp->p3type==P3_KEYINFO ); if( pOp->p1 ){ rc = sqlite3VdbeAggReset(0, &p->agg, (KeyInfo *)pOp->p3); p->agg.nMem = pOp->p2; /* Agg.nMem is used by AggInsert() */ | | | 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 | ** OP_AggFocus. */ case OP_AggReset: { assert( !pOp->p3 || pOp->p3type==P3_KEYINFO ); if( pOp->p1 ){ rc = sqlite3VdbeAggReset(0, &p->agg, (KeyInfo *)pOp->p3); p->agg.nMem = pOp->p2; /* Agg.nMem is used by AggInsert() */ rc = AggInsert(&p->agg, 0, 0); }else{ rc = sqlite3VdbeAggReset(db, &p->agg, (KeyInfo *)pOp->p3); p->agg.nMem = pOp->p2; } if( rc!=SQLITE_OK ){ goto abort_due_to_error; } |
︙ | ︙ |
Changes to src/vdbeaux.c.
︙ | ︙ | |||
675 676 677 678 679 680 681 | ** Free all resources allociated with AggElem pElem, an element of ** aggregate pAgg. */ void freeAggElem(AggElem *pElem, Agg *pAgg){ int i; for(i=0; i<pAgg->nMem; i++){ Mem *pMem = &pElem->aMem[i]; | | | 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 | ** Free all resources allociated with AggElem pElem, an element of ** aggregate pAgg. */ void freeAggElem(AggElem *pElem, Agg *pAgg){ int i; for(i=0; i<pAgg->nMem; i++){ Mem *pMem = &pElem->aMem[i]; if( pAgg->apFunc && pAgg->apFunc[i] && (pMem->flags & MEM_AggCtx)!=0 ){ sqlite3_context ctx; ctx.pFunc = pAgg->apFunc[i]; ctx.s.flags = MEM_Null; ctx.pAgg = pMem->z; ctx.cnt = pMem->i; ctx.isStep = 0; ctx.isError = 0; |
︙ | ︙ |