1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-19 21:43:15 +03:00

Fix an invalid assert() in where.c. Also a crash that can occur in the EXPLAIN QUERY PLAN code under obscure circumstances.

FossilOrigin-Name: ef192abb82c2fc31135f875d7a19908d67c076b0
This commit is contained in:
dan
2013-08-20 17:14:57 +00:00
parent d0aa2f3afd
commit e934e633a5
4 changed files with 59 additions and 11 deletions

View File

@@ -3029,7 +3029,7 @@ static int codeAllEqualityTerms(
/* Evaluate the equality constraints
*/
assert( pIdx->nColumn>=nEq );
assert( zAff==0 || strlen(zAff)>=nEq );
for(j=0; j<nEq; j++){
int r1;
pTerm = pLoop->aLTerm[j];
@@ -3121,7 +3121,8 @@ static char *explainIndexRange(sqlite3 *db, WhereLoop *pLoop, Table *pTab){
txt.db = db;
sqlite3StrAccumAppend(&txt, " (", 2);
for(i=0; i<nEq; i++){
explainAppendTerm(&txt, i, aCol[aiColumn[i]].zName, "=");
char *z = (i==pIndex->nColumn ) ? "rowid" : aCol[aiColumn[i]].zName;
explainAppendTerm(&txt, i, z, "=");
}
j = i;