Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix a case in where.c where a crash can follow a malloc failure. Also modify test code in test8.c to check a return code that was being dropped (causing a test in vtab_err.test to fail). (CVS 6567) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
9664e2b6c69271a7ca55af7812a18677 |
User & Date: | danielk1977 2009-04-29 11:50:54.000 |
Context
2009-04-29
| ||
14:33 | Update the documentation on the sqlite3_changes() and sqlite3_total_changes() functions. (CVS 6568) (check-in: 58c7bdb21c user: drh tags: trunk) | |
11:50 | Fix a case in where.c where a crash can follow a malloc failure. Also modify test code in test8.c to check a return code that was being dropped (causing a test in vtab_err.test to fail). (CVS 6567) (check-in: 9664e2b6c6 user: danielk1977 tags: trunk) | |
11:31 | Add a version of cellSizePtr() that is faster than using sqlite3BtreeParseCellPtr(). This speeds up balance_nonroot(). (CVS 6566) (check-in: e8f7f7b787 user: danielk1977 tags: trunk) | |
Changes
Changes to src/test8.c.
︙ | ︙ | |||
9 10 11 12 13 14 15 | ** May you share freely, never taking more than you give. ** ************************************************************************* ** Code for testing the virtual table interfaces. This code ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** | | | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ** May you share freely, never taking more than you give. ** ************************************************************************* ** Code for testing the virtual table interfaces. This code ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** ** $Id: test8.c,v 1.78 2009/04/29 11:50:54 danielk1977 Exp $ */ #include "sqliteInt.h" #include "tcl.h" #include <stdlib.h> #include <string.h> #ifndef SQLITE_OMIT_VIRTUALTABLE |
︙ | ︙ | |||
691 692 693 694 695 696 697 | /* Prepare the SQL statement created by echoBestIndex and bind the ** runtime parameters passed to this function to it. */ rc = sqlite3_prepare(db, idxStr, -1, &pCur->pStmt, 0); assert( pCur->pStmt || rc!=SQLITE_OK ); for(i=0; rc==SQLITE_OK && i<argc; i++){ | | | 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 | /* Prepare the SQL statement created by echoBestIndex and bind the ** runtime parameters passed to this function to it. */ rc = sqlite3_prepare(db, idxStr, -1, &pCur->pStmt, 0); assert( pCur->pStmt || rc!=SQLITE_OK ); for(i=0; rc==SQLITE_OK && i<argc; i++){ rc = sqlite3_bind_value(pCur->pStmt, i+1, argv[i]); } /* If everything was successful, advance to the first row of the scan */ if( rc==SQLITE_OK ){ rc = echoNext(pVtabCursor); } |
︙ | ︙ |
Changes to src/where.c.
︙ | ︙ | |||
12 13 14 15 16 17 18 | ** This module contains C code that generates VDBE code used to process ** the WHERE clause of SQL statements. This module is responsible for ** generating the code that loops through a table looking for applicable ** rows. Indices are selected and used to speed the search when doing ** so is applicable. Because this module is responsible for selecting ** indices, you might also think of this module as the "query optimizer". ** | | | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ** This module contains C code that generates VDBE code used to process ** the WHERE clause of SQL statements. This module is responsible for ** generating the code that loops through a table looking for applicable ** rows. Indices are selected and used to speed the search when doing ** so is applicable. Because this module is responsible for selecting ** indices, you might also think of this module as the "query optimizer". ** ** $Id: where.c,v 1.391 2009/04/29 11:50:54 danielk1977 Exp $ */ #include "sqliteInt.h" /* ** Trace output macros */ #if defined(SQLITE_TEST) || defined(SQLITE_DEBUG) |
︙ | ︙ | |||
1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 | Table *pTab = pSrc->pTab; sqlite3_index_info *pIdxInfo; struct sqlite3_index_constraint *pIdxCons; struct sqlite3_index_constraint_usage *pUsage; WhereTerm *pTerm; int i, j; int nOrderBy; /* If the sqlite3_index_info structure has not been previously ** allocated and initialized, then allocate and initialize it now. */ pIdxInfo = *ppIdxInfo; if( pIdxInfo==0 ){ *ppIdxInfo = pIdxInfo = allocateIndexInfo(pParse, pWC, pSrc, pOrderBy); | > > > > > > | 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 | Table *pTab = pSrc->pTab; sqlite3_index_info *pIdxInfo; struct sqlite3_index_constraint *pIdxCons; struct sqlite3_index_constraint_usage *pUsage; WhereTerm *pTerm; int i, j; int nOrderBy; /* Make sure wsFlags is initialized to some sane value. Otherwise, if the ** malloc in allocateIndexInfo() fails and this function returns leaving ** wsFlags in an uninitialized state, the caller may behave unpredictably. */ pCost->plan.wsFlags = WHERE_VIRTUALTABLE; /* If the sqlite3_index_info structure has not been previously ** allocated and initialized, then allocate and initialize it now. */ pIdxInfo = *ppIdxInfo; if( pIdxInfo==0 ){ *ppIdxInfo = pIdxInfo = allocateIndexInfo(pParse, pWC, pSrc, pOrderBy); |
︙ | ︙ | |||
1826 1827 1828 1829 1830 1831 1832 | ** is defined. */ if( (SQLITE_BIG_DBL/((double)2))<pIdxInfo->estimatedCost ){ pCost->rCost = (SQLITE_BIG_DBL/((double)2)); }else{ pCost->rCost = pIdxInfo->estimatedCost; } | < | 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 | ** is defined. */ if( (SQLITE_BIG_DBL/((double)2))<pIdxInfo->estimatedCost ){ pCost->rCost = (SQLITE_BIG_DBL/((double)2)); }else{ pCost->rCost = pIdxInfo->estimatedCost; } pCost->plan.u.pVtabIdx = pIdxInfo; if( pIdxInfo && pIdxInfo->orderByConsumed ){ pCost->plan.wsFlags |= WHERE_ORDERBY; } pCost->plan.nEq = 0; pIdxInfo->nOrderBy = nOrderBy; |
︙ | ︙ |