persistentstorage/sql/SQLite/insert.c
changeset 17 55f2396f6d25
parent 0 08ec8eefde2f
child 45 cc28652e0254
equal deleted inserted replaced
15:3eacc0623088 17:55f2396f6d25
   386   int iDb;              /* Index of database holding TABLE */
   386   int iDb;              /* Index of database holding TABLE */
   387   Db *pDb;              /* The database containing table being inserted into */
   387   Db *pDb;              /* The database containing table being inserted into */
   388   int appendFlag = 0;   /* True if the insert is likely to be an append */
   388   int appendFlag = 0;   /* True if the insert is likely to be an append */
   389 
   389 
   390   /* Register allocations */
   390   /* Register allocations */
   391   int regFromSelect;    /* Base register for data coming from SELECT */
   391   int regFromSelect = 0;/* Base register for data coming from SELECT */
   392   int regAutoinc = 0;   /* Register holding the AUTOINCREMENT counter */
   392   int regAutoinc = 0;   /* Register holding the AUTOINCREMENT counter */
   393   int regRowCount = 0;  /* Memory cell used for the row counter */
   393   int regRowCount = 0;  /* Memory cell used for the row counter */
   394   int regIns;           /* Block of regs holding rowid+data being inserted */
   394   int regIns;           /* Block of regs holding rowid+data being inserted */
   395   int regRowid;         /* registers holding insert rowid */
   395   int regRowid;         /* registers holding insert rowid */
   396   int regData;          /* register holding first column to insert */
   396   int regData;          /* register holding first column to insert */
   397   int regRecord;        /* Holds the assemblied row record */
   397   int regRecord;        /* Holds the assemblied row record */
   398   int regEof;           /* Register recording end of SELECT data */
   398   int regEof = 0;       /* Register recording end of SELECT data */
   399   int *aRegIdx = 0;     /* One register allocated to each index */
   399   int *aRegIdx = 0;     /* One register allocated to each index */
   400 
   400 
   401 
   401 
   402 #ifndef SQLITE_OMIT_TRIGGER
   402 #ifndef SQLITE_OMIT_TRIGGER
   403   int isView;                 /* True if attempting to insert into a view */
   403   int isView;                 /* True if attempting to insert into a view */
  1093 ){
  1093 ){
  1094   int i;
  1094   int i;
  1095   Vdbe *v;
  1095   Vdbe *v;
  1096   int nCol;
  1096   int nCol;
  1097   int onError;
  1097   int onError;
  1098   int j1, j2, j3;     /* Addresses of jump instructions */
  1098   int j1, j3;         /* Addresses of jump instructions */
       
  1099   int j2 = 0;         /* Initialized to placate warning */
  1099   int regData;        /* Register containing first data column */
  1100   int regData;        /* Register containing first data column */
  1100   int iCur;
  1101   int iCur;
  1101   Index *pIdx;
  1102   Index *pIdx;
  1102   int seenReplace = 0;
  1103   int seenReplace = 0;
  1103   int hasTwoRowids = (isUpdate && rowidChng);
  1104   int hasTwoRowids = (isUpdate && rowidChng);