diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/expr.c | 15 | ||||
-rw-r--r-- | src/insert.c | 2 | ||||
-rw-r--r-- | src/where.c | 1 |
3 files changed, 12 insertions, 6 deletions
diff --git a/src/expr.c b/src/expr.c index c57a0000d..01e99428f 100644 --- a/src/expr.c +++ b/src/expr.c @@ -3410,10 +3410,12 @@ void sqlite3ExprCodeGetColumnOfTable( return; #endif }else if( !HasRowid(pTab) ){ + testcase( iCol!=sqlite3TableColumnToStorage(pTab, iCol) ); x = sqlite3TableColumnToIndex(sqlite3PrimaryKeyIndex(pTab), iCol); op = OP_Column; }else{ x = sqlite3TableColumnToStorage(pTab,iCol); + testcase( x!=iCol ); op = OP_Column; } sqlite3VdbeAddOp3(v, op, iTabCur, x, regOut); @@ -3584,15 +3586,16 @@ expr_code_doover: Column *pCol; Table *pTab = pExpr->y.pTab; int iSrc; + int iCol = pExpr->iColumn; assert( pTab!=0 ); - assert( pExpr->iColumn>=XN_ROWID ); - assert( pExpr->iColumn<pExpr->y.pTab->nCol ); - if( pExpr->iColumn<0 ){ + assert( iCol>=XN_ROWID ); + assert( iCol<pExpr->y.pTab->nCol ); + if( iCol<0 ){ return -1-pParse->iSelfTab; } - pCol = pTab->aCol + pExpr->iColumn; - iSrc = sqlite3TableColumnToStorage(pTab, pExpr->iColumn) - - pParse->iSelfTab; + pCol = pTab->aCol + iCol; + testcase( iCol!=sqlite3TableColumnToStorage(pTab,iCol) ); + iSrc = sqlite3TableColumnToStorage(pTab, iCol) - pParse->iSelfTab; #ifndef SQLITE_OMIT_GENERATED_COLUMNS if( pCol->colFlags & COLFLAG_GENERATED ){ if( pCol->colFlags & COLFLAG_BUSY ){ diff --git a/src/insert.c b/src/insert.c index 88b8e6ad2..e15e9feed 100644 --- a/src/insert.c +++ b/src/insert.c @@ -1464,6 +1464,7 @@ void sqlite3GenerateConstraintChecks( pParse->iSelfTab = 0; if( onError==OE_Replace ) onError = OE_Abort; }else{ + testcase( i!=sqlite3TableColumnToStorage(pTab, i) ); iReg = sqlite3TableColumnToStorage(pTab, i) + regNewData + 1; } switch( onError ){ @@ -1782,6 +1783,7 @@ void sqlite3GenerateConstraintChecks( VdbeComment((v, "%s column %d", pIdx->zName, i)); #endif }else{ + testcase( sqlite3TableColumnToStorage(pTab, iField)!=iField ); x = sqlite3TableColumnToStorage(pTab, iField) + regNewData + 1; sqlite3VdbeAddOp2(v, OP_SCopy, x, regIdx+i); VdbeComment((v, "%s", pTab->aCol[iField].zName)); diff --git a/src/where.c b/src/where.c index ec2d3847b..dc2b463f2 100644 --- a/src/where.c +++ b/src/where.c @@ -5379,6 +5379,7 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){ x = pPk->aiColumn[x]; assert( x>=0 ); }else{ + testcase( x!=sqlite3StorageColumnToTable(pTab,x) ); x = sqlite3StorageColumnToTable(pTab,x); } x = sqlite3TableColumnToIndex(pIdx, x); |