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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user