diff options
author | drh <drh@noemail.net> | 2019-10-18 12:52:08 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2019-10-18 12:52:08 +0000 |
commit | 6df9c4b990059e43845f60752ae18565ddb7d702 (patch) | |
tree | 403206e7c77a0cf927c246f7490aed038388530b /src/expr.c | |
parent | 01ef55e0f55e3dd49f4d70177e6e03e540a1eae5 (diff) | |
download | sqlite-6df9c4b990059e43845f60752ae18565ddb7d702.tar.gz sqlite-6df9c4b990059e43845f60752ae18565ddb7d702.zip |
Claw back some performance from the sqlite3ExprGetColumnOfTable() routine.
FossilOrigin-Name: e8426acb94179ff49549aced6ea3c26c49ba4761c2f414fa1772d6a031edc79d
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/expr.c b/src/expr.c index c026c9583..41ffe716e 100644 --- a/src/expr.c +++ b/src/expr.c @@ -3365,7 +3365,7 @@ void sqlite3ExprCodeLoadIndexColumn( sqlite3ExprCodeCopy(pParse, pIdx->aColExpr->a[iIdxCol].pExpr, regOut); pParse->iSelfTab = 0; }else{ - sqlite3ExprCodeGetColumnOfTable(pParse, pIdx->pTable, iTabCur, + sqlite3ExprCodeGetColumnOfTable(pParse->pVdbe, pIdx->pTable, iTabCur, iTabCol, regOut); } } @@ -3374,13 +3374,12 @@ void sqlite3ExprCodeLoadIndexColumn( ** Generate code to extract the value of the iCol-th column of a table. */ void sqlite3ExprCodeGetColumnOfTable( - Parse *pParse, /* Parsing context */ + Vdbe *v, /* Parsing context */ Table *pTab, /* The table containing the value */ int iTabCur, /* The table cursor. Or the PK cursor for WITHOUT ROWID */ int iCol, /* Index of the column to extract */ int regOut /* Extract the value into this register */ ){ - Vdbe *v = pParse->pVdbe; Column *pCol; assert( v!=0 ); if( pTab==0 ){ @@ -3397,6 +3396,7 @@ void sqlite3ExprCodeGetColumnOfTable( x = iCol; #ifndef SQLITE_OMIT_GENERATED_COLUMNS }else if( (pCol = &pTab->aCol[iCol])->colFlags & COLFLAG_VIRTUAL ){ + Parse *pParse = sqlite3VdbeParser(v); if( pCol->colFlags & COLFLAG_BUSY ){ sqlite3ErrorMsg(pParse, "generated column loop on \"%s\"", pCol->zName); }else{ @@ -3417,8 +3417,6 @@ void sqlite3ExprCodeGetColumnOfTable( op = OP_Column; } sqlite3VdbeAddOp3(v, op, iTabCur, x, regOut); - } - if( iCol>=0 ){ sqlite3ColumnDefault(v, pTab, iCol, regOut); } } @@ -3439,7 +3437,7 @@ int sqlite3ExprCodeGetColumn( u8 p5 /* P5 value for OP_Column + FLAGS */ ){ assert( pParse->pVdbe!=0 ); - sqlite3ExprCodeGetColumnOfTable(pParse, pTab, iTable, iColumn, iReg); + sqlite3ExprCodeGetColumnOfTable(pParse->pVdbe, pTab, iTable, iColumn, iReg); if( p5 ){ sqlite3VdbeChangeP5(pParse->pVdbe, p5); } |