Claw back some performance from the sqlite3ExprGetColumnOfTable() routine.
FossilOrigin-Name: e8426acb94179ff49549aced6ea3c26c49ba4761c2f414fa1772d6a031edc79d
diff --git a/src/expr.c b/src/expr.c
index c026c95..41ffe71 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -3365,7 +3365,7 @@
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 @@
** 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 @@
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 @@
op = OP_Column;
}
sqlite3VdbeAddOp3(v, op, iTabCur, x, regOut);
- }
- if( iCol>=0 ){
sqlite3ColumnDefault(v, pTab, iCol, regOut);
}
}
@@ -3439,7 +3437,7 @@
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);
}