sqlite4VdbeAddOp3(v, OP_Null, 0, regNew, regNew+pTab->nCol-1);
for(i=0; i<pTab->nCol; i++){
j = aXRef[i];
if( j>=0 ){
sqlite4ExprCode(pParse, pChanges->a[j].pExpr, regNew+i);
}else if( 0==(tmask&TRIGGER_BEFORE) || i>31 || (newmask&(1<<i)) ){
/* This branch loads the value of a column that will not be changed
** into a register. This is done if there are no BEFORE triggers, or
** if there are one or more BEFORE triggers that use this value via
** a new.* reference in a trigger program.
*/
testcase( i==31 );
testcase( i==32 );
sqlite4VdbeAddOp3(v, OP_Column, iCur+iPk, i, regNew+i);
sqlite4ColumnDefault(v, pTab, i, regNew+i);
}
}
if( bImplicitPk ){
sqlite4VdbeAddOp2(v, OP_Rowid, iCur+iPk, regNew-1);
}
/* Fire any BEFORE UPDATE triggers. This happens before constraints are
................................................................................
/* If it did not delete it, the row-trigger may still have modified
** some of the columns of the row being updated. Load the values for
** all columns not modified by the update statement into their
** registers in case this has happened.
*/
for(i=0; i<pTab->nCol; i++){
if( aXRef[i]<0 ){
sqlite4VdbeAddOp3(v, OP_Column, iCur+iPk, i, regNew+i);
sqlite4ColumnDefault(v, pTab, i, regNew+i);
}
}
}
if( !isView ){
int j1; /* Address of jump instruction */

sqlite4VdbeAddOp3(v, OP_Null, 0, regNew, regNew+pTab->nCol-1);
for(i=0; i<pTab->nCol; i++){
j = aXRef[i];
if( j>=0 ){
sqlite4ExprCode(pParse, pChanges->a[j].pExpr, regNew+i);
}else if( 0==(tmask&TRIGGER_BEFORE) || i>31 || (newmask&(1<<i)) ){
/* This branch loads the value of a column that will not be changed
** into a register. This is done if there are no BEFORE triggers, or
** if there are one or more BEFORE triggers that use this value via
** a new.* reference in a trigger program.
*/
testcase( i==31 );
testcase( i==32 );
sqlite4ExprCodeGetColumnOfTable(v, pTab, iCur+iPk, i, regNew+i);
}
}
if( bImplicitPk ){
sqlite4VdbeAddOp2(v, OP_Rowid, iCur+iPk, regNew-1);
}
/* Fire any BEFORE UPDATE triggers. This happens before constraints are
................................................................................
/* If it did not delete it, the row-trigger may still have modified
** some of the columns of the row being updated. Load the values for
** all columns not modified by the update statement into their
** registers in case this has happened.
*/
for(i=0; i<pTab->nCol; i++){
if( aXRef[i]<0 ){
sqlite4ExprCodeGetColumnOfTable(v, pTab, iCur+iPk, i, regNew+i);
}
}
}
if( !isView ){
int j1; /* Address of jump instruction */