SQLite Forum

bug in src/analyze.c::analyzeOneTable ?
Login

bug in src/analyze.c::analyzeOneTable ?

(1) By anonymous on 2020-05-29 23:18:14 [source]

gcc report issue about

int i;
...
int j, k, regKey;
for(j=0; j<pPk->nKeyCol; j++){
  k = sqlite3TableColumnToIndex(pIdx, pPk->aiColumn[j]);
  assert( k>=0 && k<pIdx->nColumn );
  sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, k, regKey+j);
  VdbeComment((v, "%s.column(%d)", pIdx->zName, i));

The last line looks like mistake, should be j instead of i?

gcc report error about usage of uninitialized i.