-C http://www.sqlite.org/cvstrac/tktview?tn=2219\n\nWhen\screating\sfts\stables\sin\san\sattached\sdatabase,\sthe\sbacking\stables\nare\screated\sin\sdatabase\s'main'.\s\sThis\schange\spropagates\sthe\nappropriate\sdatabase\sname\sto\sthe\sroutines\swhich\sbuild\ssql\sstatements.\n\nNote\sthat\sI\spropagate\sthe\sdatabase\sname\sand\stable\sname\sseparately.\s\sI\nbriefly\sconsidered\sjust\smaking\sthe\stable\sname\sbe\s"db.table",\sbut\sit\ndidn't\sfit\sso\swell\sin\sthe\smodel\sused\sto\sstore\sthe\stable\sname\sand\sother\ninformation,\sand\shaving\sthe\sdb\sname\spassed\sseparately\sseemed\sa\sbit\nmore\stransparent.\s(CVS\s3631)
-D 2007-02-07T01:01:17
+C Change\sthe\scoding\sof\sPRAGMA\scount_changes\sso\sthat\sit\suses\smemory\scells\nof\sthe\sVM\srather\sthan\sthe\sstack,\sto\savoid\sproblems\swith\sleftovers\son\sthe\nstack\sinterfering\swith\sother\soperations.\s\sTicket\s#2217.\s(CVS\s3632)
+D 2007-02-07T01:06:53
F Makefile.in 7fa74bf4359aa899da5586e394d17735f221315f
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
F src/callback.c 31d22b4919c7645cbcbb1591ce2453e8c677c558
F src/complete.c 7d1a44be8f37de125fcafd3d3a018690b3799675
F src/date.c 393c73fc027597e008dcd81454544659e978b05c
-F src/delete.c 804384761144fe1a5035b99f4bd7d706976831bd
+F src/delete.c 151d08386bf9c9e7f92f6b9106c71efec2def184
F src/experimental.c 1b2d1a6cd62ecc39610e97670332ca073c50792b
F src/expr.c 8cf28815fd3207ca99b5d755b1c8b662c263b29b
F src/func.c b7e1e220a6795ecae7649815145ea5f8644dfa5f
F src/test_tclvar.c 315e77c17f128ff8c06b38c08617fd07c825a95b
F src/tokenize.c bb1732ef2b6fc2143f93ff28a45d3dcb04c1d396
F src/trigger.c 8c55d31876013ed4e97ee7ce24478fbe00db49bb
-F src/update.c 951f95ef044cf6d28557c48dc35cb0711a0b9129
+F src/update.c bdfcf3600f129bd5f06094781ab41cd7b7f5ab25
F src/utf.c 67ecb1032bc0b42c105e88d65ef9d9f626eb0e1f
F src/util.c 91d4cb189476906639ae611927d939691d1365f6
F src/vacuum.c b4569b08aaa5afb141af3f76d0315745db4e9e4b
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
-P ecb1f2fd7b96797459287eaab95693ae17ec2079
-R 1584b834a23f13b852b265197c23db47
-U shess
-Z 3a97d1cfa72fc8326e11ebbeaf0b1200
+P 283385d20724f0144f38de89bd179715ee5e738b
+R 5393121f9f6ea7c588d140b3d91538be
+U drh
+Z f104f701ef9aaf65b7572ce40741f8c1
-283385d20724f0144f38de89bd179715ee5e738b
\ No newline at end of file
+2bd4b62a20219f939ac2ac22440dc7fc0449f766
\ No newline at end of file
** This file contains C code routines that are called by the parser
** in order to generate code for DELETE FROM statements.
**
-** $Id: delete.c,v 1.127 2006/06/19 03:05:10 danielk1977 Exp $
+** $Id: delete.c,v 1.128 2007/02/07 01:06:53 drh Exp $
*/
#include "sqliteInt.h"
AuthContext sContext; /* Authorization context */
int oldIdx = -1; /* Cursor for the OLD table of AFTER triggers */
NameContext sNC; /* Name context to resolve expressions in */
- int iDb;
+ int iDb; /* Database number */
+ int memCnt = 0; /* Memory cell used for change counting */
#ifndef SQLITE_OMIT_TRIGGER
int isView; /* True if attempting to delete from a view */
** we are counting rows.
*/
if( db->flags & SQLITE_CountRows ){
- sqlite3VdbeAddOp(v, OP_Integer, 0, 0);
+ memCnt = pParse->nMem++;
+ sqlite3VdbeAddOp(v, OP_MemInt, 0, memCnt);
}
/* Special case: A DELETE without a WHERE clause deletes everything.
sqlite3OpenTable(pParse, iCur, iDb, pTab, OP_OpenRead);
}
sqlite3VdbeAddOp(v, OP_Rewind, iCur, sqlite3VdbeCurrentAddr(v)+2);
- addr2 = sqlite3VdbeAddOp(v, OP_AddImm, 1, 0);
+ addr2 = sqlite3VdbeAddOp(v, OP_MemIncr, 1, memCnt);
sqlite3VdbeAddOp(v, OP_Next, iCur, addr2);
sqlite3VdbeResolveLabel(v, endOfLoop);
sqlite3VdbeAddOp(v, OP_Close, iCur, 0);
sqlite3VdbeAddOp(v, IsVirtual(pTab) ? OP_VRowid : OP_Rowid, iCur, 0);
sqlite3VdbeAddOp(v, OP_FifoWrite, 0, 0);
if( db->flags & SQLITE_CountRows ){
- sqlite3VdbeAddOp(v, OP_AddImm, 1, 0);
+ sqlite3VdbeAddOp(v, OP_MemIncr, 1, memCnt);
}
/* End the database scan loop.
** invoke the callback function.
*/
if( db->flags & SQLITE_CountRows && pParse->nested==0 && !pParse->trigStack ){
+ sqlite3VdbeAddOp(v, OP_MemLoad, memCnt, 0);
sqlite3VdbeAddOp(v, OP_Callback, 1, 0);
sqlite3VdbeSetNumCols(v, 1);
sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "rows deleted", P3_STATIC);
** This file contains C code routines that are called by the parser
** to handle UPDATE statements.
**
-** $Id: update.c,v 1.133 2006/06/27 13:20:21 drh Exp $
+** $Id: update.c,v 1.134 2007/02/07 01:06:53 drh Exp $
*/
#include "sqliteInt.h"
AuthContext sContext; /* The authorization context */
NameContext sNC; /* The name-context to resolve expressions in */
int iDb; /* Database containing the table being updated */
+ int memCnt = 0; /* Memory cell used for counting rows changed */
#ifndef SQLITE_OMIT_TRIGGER
int isView; /* Trying to update a view */
/* Initialize the count of updated rows
*/
if( db->flags & SQLITE_CountRows && !pParse->trigStack ){
- sqlite3VdbeAddOp(v, OP_Integer, 0, 0);
+ memCnt = pParse->nMem++;
+ sqlite3VdbeAddOp(v, OP_MemInt, 0, memCnt);
}
if( triggers_exist ){
/* Increment the row counter
*/
if( db->flags & SQLITE_CountRows && !pParse->trigStack){
- sqlite3VdbeAddOp(v, OP_AddImm, 1, 0);
+ sqlite3VdbeAddOp(v, OP_MemIncr, 1, memCnt);
}
/* If there are triggers, close all the cursors after each iteration
** invoke the callback function.
*/
if( db->flags & SQLITE_CountRows && !pParse->trigStack && pParse->nested==0 ){
+ sqlite3VdbeAddOp(v, OP_MemLoad, memCnt, 0);
sqlite3VdbeAddOp(v, OP_Callback, 1, 0);
sqlite3VdbeSetNumCols(v, 1);
sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "rows updated", P3_STATIC);