Get the __hidden__ column mechanism working on views with INSTEAD OF triggers.

FossilOrigin-Name: 20c1e9ce75cc0b5f7456379f35a4fe24edd98088
This commit is contained in:
drh
2015-11-18 21:22:02 +00:00
parent ab5a8ee3e4
commit b1daa3f469
3 changed files with 13 additions and 13 deletions
+5 -5
View File
@@ -833,15 +833,14 @@ void sqlite3Insert(
/* Create the new column data
*/
for(i=0; i<pTab->nCol; i++){
if( pColumn==0 ){
j = i;
}else{
for(i=j=0; i<pTab->nCol; i++){
if( pColumn ){
for(j=0; j<pColumn->nId; j++){
if( pColumn->a[j].idx==i ) break;
}
}
if( (!useTempTable && !pList) || (pColumn && j>=pColumn->nId) ){
if( (!useTempTable && !pList) || (pColumn && j>=pColumn->nId)
|| (pColumn==0 && IsHiddenColumn(&pTab->aCol[i])) ){
sqlite3ExprCode(pParse, pTab->aCol[i].pDflt, regCols+i+1);
}else if( useTempTable ){
sqlite3VdbeAddOp3(v, OP_Column, srcTab, j, regCols+i+1);
@@ -849,6 +848,7 @@ void sqlite3Insert(
assert( pSelect==0 ); /* Otherwise useTempTable is true */
sqlite3ExprCodeAndCache(pParse, pList->a[j].pExpr, regCols+i+1);
}
if( pColumn==0 && !IsHiddenColumn(&pTab->aCol[i]) ) j++;
}
/* If this is an INSERT on a view with an INSTEAD OF INSERT trigger,