1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Change the P4_INTARRAY so that always begins with a length integer. Print

the content of the INTARRAY on EXPLAIN output.

FossilOrigin-Name: 6c520d5726e80b4251338c43c405270d150ea81e
This commit is contained in:
drh
2016-01-30 00:45:18 +00:00
parent eaa6cd87e8
commit b17020265b
6 changed files with 39 additions and 19 deletions

View File

@@ -783,11 +783,12 @@ static void codeDeferredSeek(
){
int i;
Table *pTab = pIdx->pTable;
int *ai = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int) * pTab->nCol);
int *ai = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*(pTab->nCol+1));
if( ai ){
ai[0] = pTab->nCol;
for(i=0; i<pIdx->nColumn-1; i++){
assert( pIdx->aiColumn[i]<pTab->nCol );
if( pIdx->aiColumn[i]>=0 ) ai[pIdx->aiColumn[i]] = i+1;
if( pIdx->aiColumn[i]>=0 ) ai[pIdx->aiColumn[i]+1] = i+1;
}
sqlite3VdbeChangeP4(v, -1, (char*)ai, P4_INTARRAY);
}