Skip to content

Commit

Permalink
Alternative fix for the double-initialization of type and collating s…
Browse files Browse the repository at this point in the history
…equence

problem that leaves the estimated table size intact.
  • Loading branch information
D. Richard Hipp committed Apr 21, 2015
1 parent 110486a commit 3189823
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/select.c
Original file line number Diff line number Diff line change
Expand Up @@ -1700,14 +1700,14 @@ static void selectAddColumnTypeAndCollation(
a = pSelect->pEList->a;
for(i=0, pCol=pTab->aCol; i<pTab->nCol; i++, pCol++){
p = a[i].pExpr;
if( pCol->zType ) break;
if( pCol->zColl ) break;
pCol->zType = sqlite3DbStrDup(db, columnType(&sNC, p,0,0,0, &pCol->szEst));
if( pCol->zType==0 ){
pCol->zType = sqlite3DbStrDup(db, columnType(&sNC, p,0,0,0, &pCol->szEst));
}
szAll += pCol->szEst;
pCol->affinity = sqlite3ExprAffinity(p);
if( pCol->affinity==0 ) pCol->affinity = SQLITE_AFF_NONE;
pColl = sqlite3ExprCollSeq(pParse, p);
if( pColl ){
if( pColl && pCol->zColl==0 ){
pCol->zColl = sqlite3DbStrDup(db, pColl->zName);
}
}
Expand Down

0 comments on commit 3189823

Please sign in to comment.