mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Partial fix for ticket #49. The correct result is computed, but now we have
a memory leak. I'm not sure if the memory leak was pre-existing or a result of this change. (CVS 581) FossilOrigin-Name: 4d27ee411902a197cd72416ca9da9197d3f87f13
This commit is contained in:
@ -12,7 +12,7 @@
|
||||
** This file contains C code routines that are called by the parser
|
||||
** to handle DELETE FROM statements.
|
||||
**
|
||||
** $Id: delete.c,v 1.34 2002/05/21 11:38:11 drh Exp $
|
||||
** $Id: delete.c,v 1.35 2002/05/23 12:50:18 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
|
||||
@ -332,9 +332,11 @@ void sqliteGenerateRowDelete(
|
||||
int base, /* Cursor number for the table */
|
||||
int count /* Increment the row change counter */
|
||||
){
|
||||
sqliteVdbeAddOp(v, OP_MoveTo, base, 0);
|
||||
int addr;
|
||||
addr = sqliteVdbeAddOp(v, OP_NotExists, base, 0);
|
||||
sqliteGenerateRowIndexDelete(v, pTab, base, 0);
|
||||
sqliteVdbeAddOp(v, OP_Delete, base, count);
|
||||
sqliteVdbeChangeP2(v, addr, sqliteVdbeCurrentAddr(v));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -12,7 +12,7 @@
|
||||
** This file contains C code routines that are called by the parser
|
||||
** to handle UPDATE statements.
|
||||
**
|
||||
** $Id: update.c,v 1.40 2002/05/21 11:38:12 drh Exp $
|
||||
** $Id: update.c,v 1.41 2002/05/23 12:50:19 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
|
||||
@ -287,7 +287,7 @@ void sqliteUpdate(
|
||||
addr = sqliteVdbeAddOp(v, OP_ListRead, 0, 0);
|
||||
sqliteVdbeAddOp(v, OP_Dup, 0, 0);
|
||||
}
|
||||
sqliteVdbeAddOp(v, OP_MoveTo, base, 0);
|
||||
sqliteVdbeAddOp(v, OP_NotExists, base, addr);
|
||||
|
||||
/* If the record number will change, push the record number as it
|
||||
** will be after the update. (The old record number is currently
|
||||
|
Reference in New Issue
Block a user