]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Bug fix associated with OP_SetNumColumns in insert.c. Also changed a
authordrh <drh@noemail.net>
Thu, 20 May 2004 02:42:16 +0000 (02:42 +0000)
committerdrh <drh@noemail.net>
Thu, 20 May 2004 02:42:16 +0000 (02:42 +0000)
variable name in OP_Column. (CVS 1413)

FossilOrigin-Name: bf2181f13fdad72d8c90eccc2d29034178181731

manifest
manifest.uuid
src/insert.c
src/vdbe.c

index 56f396e2c0c2a1fcb2f0e9209e6f41a186539c43..6f2ed0175506a8e5f5470f42a9e240891b68ae08 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C VACUUM\sworks\sagain.\s(CVS\s1412)
-D 2004-05-20T02:01:27
+C Bug\sfix\sassociated\swith\sOP_SetNumColumns\sin\sinsert.c.\s\sAlso\schanged\sa\nvariable\sname\sin\sOP_Column.\s(CVS\s1413)
+D 2004-05-20T02:42:16
 F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a
 F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
 F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
@@ -35,7 +35,7 @@ F src/expr.c 34fceec0ae7d9108d6cf98b0685d3d2afa962728
 F src/func.c cfbb7096efb58e2857e3b312a8958a12774b625a
 F src/hash.c 440c2f8cb373ee1b4e13a0988489c7cd95d55b6f
 F src/hash.h 762d95f1e567664d1eafc1687de755626be962fb
-F src/insert.c 0ee4c4039fede2b9ab594c4d2db24c9b22e0fbc5
+F src/insert.c 04865f0a8a5cbc81eab7ca7406498d5356ef0763
 F src/main.c 2bfbddaea0a1db592967f4b0844473a24adce2fe
 F src/md5.c 8e39fdae6d8776b87558e91dcc94740c9b635a9c
 F src/os.c ddcda92f7fd71b4513c57c1ec797917f206d504e
@@ -63,7 +63,7 @@ F src/update.c 1f6687f8d1085f896a24c0fa13d802223ed55539
 F src/utf.c 72a9843000985d11100e711e0ef06ff4b8946057
 F src/util.c 35d20bd8d467861747262d12b87045d937781d93
 F src/vacuum.c c134702e023db8778e6be59ac0ea7b02315b5476
-F src/vdbe.c 973ffe763e40b0a5c993d5f5632de58a37c411db
+F src/vdbe.c fe412966e48948b680a5bc25796e6e9727174b4b
 F src/vdbe.h 314e9c07db73a42a6ba91ab7539e27652fc88870
 F src/vdbeInt.h 97b95c622ea467d39879ae97d07732ebb4891b76
 F src/vdbeaux.c 0039a786c6d1c1eeff36f50ad2c528de70e11b26
@@ -193,7 +193,7 @@ F www/sqlite.tcl 3c83b08cf9f18aa2d69453ff441a36c40e431604
 F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da
 F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1
 F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
-P 46b0942239dde9982abaaa7f77d5cf8375eb4209
-R edbaa540380795e64aea48f7af64d6d8
+P c4e1d02ffded1421c09b0c8e45954e69f3583297
+R 00efca936dc0d4e7252b5e6e6ac01b8b
 U drh
-Z f1811767ec20f90795abc445172ab0b2
+Z f146143edcb95dd51e33c2460fa9add3
index bac4c49a7b538e7aba3f47250dc527e4c60df165..43db35abeb5cfb896476ed614b9fb77cb84bd4b4 100644 (file)
@@ -1 +1 @@
-c4e1d02ffded1421c09b0c8e45954e69f3583297
\ No newline at end of file
+bf2181f13fdad72d8c90eccc2d29034178181731
\ No newline at end of file
index 52096a8e5ec7cc8308771e309c1e02c4cef37441..d105ad19529e616d250fc808c23616c28d580684 100644 (file)
@@ -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.103 2004/05/19 14:56:56 drh Exp $
+** $Id: insert.c,v 1.104 2004/05/20 02:42:16 drh Exp $
 */
 #include "sqliteInt.h"
 
@@ -307,7 +307,7 @@ void sqlite3Insert(
       */
       sqlite3VdbeChangeP2(v, iInitCode, sqlite3VdbeCurrentAddr(v));
       sqlite3VdbeAddOp(v, OP_OpenTemp, srcTab, 0);
-      sqlite3VdbeAddOp(v, OP_SetNumColumns, srcTab, pTab->nCol);
+      sqlite3VdbeAddOp(v, OP_SetNumColumns, srcTab, nColumn);
       sqlite3VdbeAddOp(v, OP_Goto, 0, iSelectLoop);
       sqlite3VdbeResolveLabel(v, iCleanup);
     }else{
index be4b20d8ba8c3cc92877da34981bb915d23646e4..03096403d8f9bca969ee1f319841c74a7a86c22b 100644 (file)
@@ -43,7 +43,7 @@
 ** in this file for details.  If in doubt, do not deviate from existing
 ** commenting and indentation practices when changing or adding code.
 **
-** $Id: vdbe.c,v 1.306 2004/05/20 01:12:35 danielk1977 Exp $
+** $Id: vdbe.c,v 1.307 2004/05/20 02:42:17 drh Exp $
 */
 #include "sqliteInt.h"
 #include "os.h"
@@ -500,6 +500,13 @@ static void applyAffinity(Mem *pRec, char affinity){
   }
 }
 
+/*
+** Move data out of a btree key or data field and into a Mem structure.
+** The data or key is taken from the entry that pCur is currently pointing
+** to.  offset and amt determine what portion of the data or key to retrieve.
+** key is true to get the key or false to get data.  The result is written
+** into the pMem element.
+*/
 static int getBtreeMem(
   BtCursor *pCur,   /* Cursor pointing at record to retrieve. */
   int offset,       /* Offset from the start of data to return bytes from. */
@@ -1972,8 +1979,8 @@ case OP_Column: {
   int nn;
 
   char *zData;       
-  Mem zMem;
-  zMem.flags = 0;
+  Mem sMem;
+  sMem.flags = 0;
 
   assert( i<p->nCursor );
   pTos++;
@@ -2087,11 +2094,11 @@ case OP_Column: {
         max_space = payloadSize;
       }
 
-      rc = getBtreeMem(pCrsr, 0, max_space, pC->keyAsData, &zMem);
+      rc = getBtreeMem(pCrsr, 0, max_space, pC->keyAsData, &sMem);
       if( rc!=SQLITE_OK ){
         goto abort_due_to_error;
       }
-      zData = zMem.z;
+      zData = sMem.z;
     }
 
     /* Read all the serial types for the record.  At the end of this block
@@ -2103,8 +2110,8 @@ case OP_Column: {
     pC->nHeader = offset;
     pC->cacheValid = 1;
 
-    Release(&zMem);
-    zMem.flags = 0;
+    Release(&sMem);
+    sMem.flags = 0;
   }
 
   /* Compute the offset from the beginning of the record to the beginning
@@ -2119,12 +2126,12 @@ case OP_Column: {
     zData = &zRec[offset];
   }else{
     len = sqlite3VdbeSerialTypeLen(pC->aType[p2]);
-    getBtreeMem(pCrsr, offset, len, pC->keyAsData, &zMem);
-    zData = zMem.z;
+    getBtreeMem(pCrsr, offset, len, pC->keyAsData, &sMem);
+    zData = sMem.z;
   }
   sqlite3VdbeSerialGet(zData, pC->aType[p2], pTos);
 
-  Release(&zMem);
+  Release(&sMem);
   break;
 }