The unified diff between revisions [83b5270b..] and [5587f68e..] is displayed below. It can also be downloaded as a raw diff.

This diff has been restricted to the following files: 'sqlite/insert.c'

#
#
# patch "sqlite/insert.c"
#  from [8c0868a975fe37366ed92e1b976853be96284607]
#    to [484c73bc1309f283a31baa0e114f3ee980536397]
#
============================================================
--- sqlite/insert.c	8c0868a975fe37366ed92e1b976853be96284607
+++ sqlite/insert.c	484c73bc1309f283a31baa0e114f3ee980536397
@@ -12,7 +12,7 @@
 ** This file contains C code routines that are called by the parser
 ** to handle INSERT statements in SQLite.
 **
-** $Id: insert.c,v 1.139 2005/06/12 21:35:52 drh Exp $
+** $Id: insert.c,v 1.142 2005/07/21 18:23:20 drh Exp $
 */
 #include "sqliteInt.h"

@@ -373,7 +373,7 @@ void sqlite3Insert(
       ** back up and execute the SELECT code above.
       */
       sqlite3VdbeChangeP2(v, iInitCode, sqlite3VdbeCurrentAddr(v));
-      sqlite3VdbeAddOp(v, OP_OpenTemp, srcTab, 0);
+      sqlite3VdbeAddOp(v, OP_OpenVirtual, srcTab, 0);
       sqlite3VdbeAddOp(v, OP_SetNumColumns, srcTab, nColumn);
       sqlite3VdbeAddOp(v, OP_Goto, 0, iSelectLoop);
       sqlite3VdbeResolveLabel(v, iCleanup);
@@ -949,7 +949,7 @@ void sqlite3GenerateConstraintChecks(
         sqlite3VdbeAddOp(v, OP_Dup, i+extra+nCol-idx, 1);
       }
     }
-    jumpInst1 = sqlite3VdbeAddOp(v, OP_MakeRecord, pIdx->nColumn, (1<<24));
+    jumpInst1 = sqlite3VdbeAddOp(v, OP_MakeIdxRec, pIdx->nColumn, 0);
     sqlite3IndexAffinityStr(v, pIdx);

     /* Find out what action to take in case there is an indexing conflict */
@@ -1019,9 +1019,8 @@ void sqlite3GenerateConstraintChecks(
       }
     }
     contAddr = sqlite3VdbeCurrentAddr(v);
-    assert( contAddr<(1<<24) );
 #if NULL_DISTINCT_FOR_UNIQUE
-    sqlite3VdbeChangeP2(v, jumpInst1, contAddr | (1<<24));
+    sqlite3VdbeChangeP2(v, jumpInst1, contAddr);
 #endif
     sqlite3VdbeChangeP2(v, jumpInst2, contAddr);
   }
@@ -1097,11 +1096,12 @@ void sqlite3OpenTableAndIndices(
   Vdbe *v = sqlite3GetVdbe(pParse);
   assert( v!=0 );
   sqlite3VdbeAddOp(v, OP_Integer, pTab->iDb, 0);
+  VdbeComment((v, "# %s", pTab->zName));
   sqlite3VdbeAddOp(v, op, base, pTab->tnum);
-  VdbeComment((v, "# %s", pTab->zName));
   sqlite3VdbeAddOp(v, OP_SetNumColumns, base, pTab->nCol);
   for(i=1, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
     sqlite3VdbeAddOp(v, OP_Integer, pIdx->iDb, 0);
+    VdbeComment((v, "# %s", pIdx->zName));
     sqlite3VdbeOp3(v, op, i+base, pIdx->tnum,
                    (char*)&pIdx->keyInfo, P3_KEYINFO);
   }