Lines Matching refs:v

98   Vdbe *v;              /* Generate code into this virtual machine */  in sqliteInsert()  local
160 v = sqliteGetVdbe(pParse); in sqliteInsert()
161 if( v==0 ) goto insert_cleanup; in sqliteInsert()
181 iInitCode = sqliteVdbeAddOp(v, OP_Goto, 0, 0); in sqliteInsert()
182 iSelectLoop = sqliteVdbeCurrentAddr(v); in sqliteInsert()
183 iInsertBlock = sqliteVdbeMakeLabel(v); in sqliteInsert()
186 iCleanup = sqliteVdbeMakeLabel(v); in sqliteInsert()
187 sqliteVdbeAddOp(v, OP_Goto, 0, iCleanup); in sqliteInsert()
202 int addr = sqliteVdbeFindOp(v, OP_OpenRead, pTab->tnum); in sqliteInsert()
205 VdbeOp *pOp = sqliteVdbeGetOp(v, addr-2); in sqliteInsert()
217 sqliteVdbeResolveLabel(v, iInsertBlock); in sqliteInsert()
218 sqliteVdbeAddOp(v, OP_MakeRecord, nColumn, 0); in sqliteInsert()
219 sqliteVdbeAddOp(v, OP_NewRecno, srcTab, 0); in sqliteInsert()
220 sqliteVdbeAddOp(v, OP_Pull, 1, 0); in sqliteInsert()
221 sqliteVdbeAddOp(v, OP_PutIntKey, srcTab, 0); in sqliteInsert()
222 sqliteVdbeAddOp(v, OP_Return, 0, 0); in sqliteInsert()
228 sqliteVdbeChangeP2(v, iInitCode, sqliteVdbeCurrentAddr(v)); in sqliteInsert()
229 sqliteVdbeAddOp(v, OP_OpenTemp, srcTab, 0); in sqliteInsert()
230 sqliteVdbeAddOp(v, OP_Goto, 0, iSelectLoop); in sqliteInsert()
231 sqliteVdbeResolveLabel(v, iCleanup); in sqliteInsert()
233 sqliteVdbeChangeP2(v, iInitCode, sqliteVdbeCurrentAddr(v)); in sqliteInsert()
319 sqliteVdbeAddOp(v, OP_OpenPseudo, newIdx, 0); in sqliteInsert()
326 sqliteVdbeAddOp(v, OP_Integer, 0, 0); in sqliteInsert()
327 sqliteVdbeAddOp(v, OP_MemStore, iCntMem, 1); in sqliteInsert()
343 iBreak = sqliteVdbeMakeLabel(v); in sqliteInsert()
344 sqliteVdbeAddOp(v, OP_Rewind, srcTab, iBreak); in sqliteInsert()
345 iCont = sqliteVdbeCurrentAddr(v); in sqliteInsert()
347 sqliteVdbeAddOp(v, OP_Goto, 0, iSelectLoop); in sqliteInsert()
348 sqliteVdbeResolveLabel(v, iInsertBlock); in sqliteInsert()
353 endOfLoop = sqliteVdbeMakeLabel(v); in sqliteInsert()
363 sqliteVdbeAddOp(v, OP_Integer, -1, 0); in sqliteInsert()
365 sqliteVdbeAddOp(v, OP_Column, srcTab, keyColumn); in sqliteInsert()
367 sqliteVdbeAddOp(v, OP_Dup, nColumn - keyColumn - 1, 1); in sqliteInsert()
370 sqliteVdbeAddOp(v, OP_NotNull, -1, sqliteVdbeCurrentAddr(v)+3); in sqliteInsert()
371 sqliteVdbeAddOp(v, OP_Pop, 1, 0); in sqliteInsert()
372 sqliteVdbeAddOp(v, OP_Integer, -1, 0); in sqliteInsert()
373 sqliteVdbeAddOp(v, OP_MustBeInt, 0, 0); in sqliteInsert()
387 sqliteVdbeOp3(v, OP_String, 0, 0, pTab->aCol[i].zDflt, P3_STATIC); in sqliteInsert()
389 sqliteVdbeAddOp(v, OP_Column, srcTab, j); in sqliteInsert()
391 sqliteVdbeAddOp(v, OP_Dup, nColumn-j-1, 1); in sqliteInsert()
396 sqliteVdbeAddOp(v, OP_MakeRecord, pTab->nCol, 0); in sqliteInsert()
397 sqliteVdbeAddOp(v, OP_PutIntKey, newIdx, 0); in sqliteInsert()
423 sqliteVdbeAddOp(v, OP_Column, srcTab, keyColumn); in sqliteInsert()
425 sqliteVdbeAddOp(v, OP_Dup, nColumn - keyColumn - 1, 1); in sqliteInsert()
432 sqliteVdbeAddOp(v, OP_NotNull, -1, sqliteVdbeCurrentAddr(v)+3); in sqliteInsert()
433 sqliteVdbeAddOp(v, OP_Pop, 1, 0); in sqliteInsert()
434 sqliteVdbeAddOp(v, OP_NewRecno, base, 0); in sqliteInsert()
435 sqliteVdbeAddOp(v, OP_MustBeInt, 0, 0); in sqliteInsert()
437 sqliteVdbeAddOp(v, OP_NewRecno, base, 0); in sqliteInsert()
449 sqliteVdbeAddOp(v, OP_String, 0, 0); in sqliteInsert()
460 sqliteVdbeOp3(v, OP_String, 0, 0, pTab->aCol[i].zDflt, P3_STATIC); in sqliteInsert()
462 sqliteVdbeAddOp(v, OP_Column, srcTab, j); in sqliteInsert()
464 sqliteVdbeAddOp(v, OP_Dup, i+nColumn-j, 1); in sqliteInsert()
482 sqliteVdbeAddOp(v, OP_MemIncr, iCntMem, 0); in sqliteInsert()
488 sqliteVdbeAddOp(v, OP_Close, base, 0); in sqliteInsert()
490 sqliteVdbeAddOp(v, OP_Close, idx+base, 0); in sqliteInsert()
503 sqliteVdbeResolveLabel(v, endOfLoop); in sqliteInsert()
505 sqliteVdbeAddOp(v, OP_Next, srcTab, iCont); in sqliteInsert()
506 sqliteVdbeResolveLabel(v, iBreak); in sqliteInsert()
507 sqliteVdbeAddOp(v, OP_Close, srcTab, 0); in sqliteInsert()
509 sqliteVdbeAddOp(v, OP_Pop, nColumn, 0); in sqliteInsert()
510 sqliteVdbeAddOp(v, OP_Return, 0, 0); in sqliteInsert()
511 sqliteVdbeResolveLabel(v, iCleanup); in sqliteInsert()
516 sqliteVdbeAddOp(v, OP_Close, base, 0); in sqliteInsert()
518 sqliteVdbeAddOp(v, OP_Close, idx+base, 0); in sqliteInsert()
522 sqliteVdbeAddOp(v, OP_SetCounts, 0, 0); in sqliteInsert()
529 sqliteVdbeOp3(v, OP_ColumnName, 0, 1, "rows inserted", P3_STATIC); in sqliteInsert()
530 sqliteVdbeAddOp(v, OP_MemLoad, iCntMem, 0); in sqliteInsert()
531 sqliteVdbeAddOp(v, OP_Callback, 1, 0); in sqliteInsert()
631 Vdbe *v; in sqliteGenerateConstraintChecks() local
643 v = sqliteGetVdbe(pParse); in sqliteGenerateConstraintChecks()
644 assert( v!=0 ); in sqliteGenerateConstraintChecks()
666 sqliteVdbeAddOp(v, OP_Dup, nCol-1-i, 1); in sqliteGenerateConstraintChecks()
667 addr = sqliteVdbeAddOp(v, OP_NotNull, 1, 0); in sqliteGenerateConstraintChecks()
673 sqliteVdbeAddOp(v, OP_Halt, SQLITE_CONSTRAINT, onError); in sqliteGenerateConstraintChecks()
676 sqliteVdbeChangeP3(v, -1, zMsg, P3_DYNAMIC); in sqliteGenerateConstraintChecks()
680 sqliteVdbeAddOp(v, OP_Pop, nCol+1+hasTwoRecnos, 0); in sqliteGenerateConstraintChecks()
681 sqliteVdbeAddOp(v, OP_Goto, 0, ignoreDest); in sqliteGenerateConstraintChecks()
685 sqliteVdbeOp3(v, OP_String, 0, 0, pTab->aCol[i].zDflt, P3_STATIC); in sqliteGenerateConstraintChecks()
686 sqliteVdbeAddOp(v, OP_Push, nCol-i, 0); in sqliteGenerateConstraintChecks()
691 sqliteVdbeChangeP2(v, addr, sqliteVdbeCurrentAddr(v)); in sqliteGenerateConstraintChecks()
713 sqliteVdbeAddOp(v, OP_Dup, nCol+1, 1); in sqliteGenerateConstraintChecks()
714 sqliteVdbeAddOp(v, OP_Dup, nCol+1, 1); in sqliteGenerateConstraintChecks()
715 jumpInst1 = sqliteVdbeAddOp(v, OP_Eq, 0, 0); in sqliteGenerateConstraintChecks()
717 sqliteVdbeAddOp(v, OP_Dup, nCol, 1); in sqliteGenerateConstraintChecks()
718 jumpInst2 = sqliteVdbeAddOp(v, OP_NotExists, base, 0); in sqliteGenerateConstraintChecks()
727 sqliteVdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, onError, in sqliteGenerateConstraintChecks()
732 sqliteGenerateRowIndexDelete(pParse->db, v, pTab, base, 0); in sqliteGenerateConstraintChecks()
734 sqliteVdbeAddOp(v, OP_Dup, nCol+hasTwoRecnos, 1); in sqliteGenerateConstraintChecks()
735 sqliteVdbeAddOp(v, OP_MoveTo, base, 0); in sqliteGenerateConstraintChecks()
742 sqliteVdbeAddOp(v, OP_Pop, nCol+1+hasTwoRecnos, 0); in sqliteGenerateConstraintChecks()
743 sqliteVdbeAddOp(v, OP_Goto, 0, ignoreDest); in sqliteGenerateConstraintChecks()
747 contAddr = sqliteVdbeCurrentAddr(v); in sqliteGenerateConstraintChecks()
748 sqliteVdbeChangeP2(v, jumpInst2, contAddr); in sqliteGenerateConstraintChecks()
750 sqliteVdbeChangeP2(v, jumpInst1, contAddr); in sqliteGenerateConstraintChecks()
751 sqliteVdbeAddOp(v, OP_Dup, nCol+1, 1); in sqliteGenerateConstraintChecks()
752 sqliteVdbeAddOp(v, OP_MoveTo, base, 0); in sqliteGenerateConstraintChecks()
766 sqliteVdbeAddOp(v, OP_Dup, nCol+extra, 1); in sqliteGenerateConstraintChecks()
770 sqliteVdbeAddOp(v, OP_Dup, i+extra+nCol+1, 1); in sqliteGenerateConstraintChecks()
772 sqliteVdbeAddOp(v, OP_Dup, i+extra+nCol-idx, 1); in sqliteGenerateConstraintChecks()
775 jumpInst1 = sqliteVdbeAddOp(v, OP_MakeIdxKey, pIdx->nColumn, 0); in sqliteGenerateConstraintChecks()
776 if( pParse->db->file_format>=4 ) sqliteAddIdxKeyType(v, pIdx); in sqliteGenerateConstraintChecks()
795 sqliteVdbeAddOp(v, OP_Dup, extra+nCol+1+hasTwoRecnos, 1); in sqliteGenerateConstraintChecks()
796 jumpInst2 = sqliteVdbeAddOp(v, OP_IsUnique, base+iCur+1, 0); in sqliteGenerateConstraintChecks()
825 sqliteVdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, onError, zErrMsg, 0); in sqliteGenerateConstraintChecks()
830 sqliteVdbeAddOp(v, OP_Pop, nCol+extra+3+hasTwoRecnos, 0); in sqliteGenerateConstraintChecks()
831 sqliteVdbeAddOp(v, OP_Goto, 0, ignoreDest); in sqliteGenerateConstraintChecks()
835 sqliteGenerateRowDelete(pParse->db, v, pTab, base, 0); in sqliteGenerateConstraintChecks()
837 sqliteVdbeAddOp(v, OP_Dup, nCol+extra+1+hasTwoRecnos, 1); in sqliteGenerateConstraintChecks()
838 sqliteVdbeAddOp(v, OP_MoveTo, base, 0); in sqliteGenerateConstraintChecks()
845 contAddr = sqliteVdbeCurrentAddr(v); in sqliteGenerateConstraintChecks()
847 sqliteVdbeChangeP2(v, jumpInst1, contAddr); in sqliteGenerateConstraintChecks()
849 sqliteVdbeChangeP2(v, jumpInst2, contAddr); in sqliteGenerateConstraintChecks()
873 Vdbe *v; in sqliteCompleteInsertion() local
877 v = sqliteGetVdbe(pParse); in sqliteCompleteInsertion()
878 assert( v!=0 ); in sqliteCompleteInsertion()
883 sqliteVdbeAddOp(v, OP_IdxPut, base+i+1, 0); in sqliteCompleteInsertion()
885 sqliteVdbeAddOp(v, OP_MakeRecord, pTab->nCol, 0); in sqliteCompleteInsertion()
887 sqliteVdbeAddOp(v, OP_Dup, 1, 0); in sqliteCompleteInsertion()
888 sqliteVdbeAddOp(v, OP_Dup, 1, 0); in sqliteCompleteInsertion()
889 sqliteVdbeAddOp(v, OP_PutIntKey, newIdx, 0); in sqliteCompleteInsertion()
891 sqliteVdbeAddOp(v, OP_PutIntKey, base, in sqliteCompleteInsertion()
895 sqliteVdbeAddOp(v, OP_Pop, 1, 0); in sqliteCompleteInsertion()
910 Vdbe *v = sqliteGetVdbe(pParse); in sqliteOpenTableAndIndices() local
911 assert( v!=0 ); in sqliteOpenTableAndIndices()
912 sqliteVdbeAddOp(v, OP_Integer, pTab->iDb, 0); in sqliteOpenTableAndIndices()
913 sqliteVdbeOp3(v, OP_OpenWrite, base, pTab->tnum, pTab->zName, P3_STATIC); in sqliteOpenTableAndIndices()
915 sqliteVdbeAddOp(v, OP_Integer, pIdx->iDb, 0); in sqliteOpenTableAndIndices()
916 sqliteVdbeOp3(v, OP_OpenWrite, i+base, pIdx->tnum, pIdx->zName, P3_STATIC); in sqliteOpenTableAndIndices()