aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2003-08-16 12:37:51 +0000
committerdrh <drh@noemail.net>2003-08-16 12:37:51 +0000
commit9b1b01bb76aa488da169d4ced1403bb723326e81 (patch)
treeefc477607b55adcce0830817a4414eb8addab64e /src
parent8e18bac7937eb448fa4169ee08f6989500ae3b88 (diff)
downloadsqlite-9b1b01bb76aa488da169d4ced1403bb723326e81.tar.gz
sqlite-9b1b01bb76aa488da169d4ced1403bb723326e81.zip
Do not delete tables with the same name when dropping triggers.
Ticket #430. (CVS 1074) FossilOrigin-Name: ef58f163b08d13f8e9b69459bd83e0bf9d5b404b
Diffstat (limited to 'src')
-rw-r--r--src/trigger.c11
-rw-r--r--src/vdbe.c4
2 files changed, 8 insertions, 7 deletions
diff --git a/src/trigger.c b/src/trigger.c
index 97891b2cb..7e90de877 100644
--- a/src/trigger.c
+++ b/src/trigger.c
@@ -450,14 +450,15 @@ void sqliteDropTriggerPtr(Parse *pParse, Trigger *pTrigger, int nested){
if( pTable!=0 && !nested && (v = sqliteGetVdbe(pParse))!=0 ){
int base;
static VdbeOp dropTrigger[] = {
- { OP_Rewind, 0, ADDR(8), 0},
+ { OP_Rewind, 0, ADDR(9), 0},
{ OP_String, 0, 0, 0}, /* 1 */
- { OP_MemStore, 1, 1, 0},
- { OP_MemLoad, 1, 0, 0}, /* 3 */
{ OP_Column, 0, 1, 0},
- { OP_Ne, 0, ADDR(7), 0},
+ { OP_Ne, 0, ADDR(8), 0},
+ { OP_String, 0, 0, "trigger"},
+ { OP_Column, 0, 0, 0},
+ { OP_Ne, 0, ADDR(8), 0},
{ OP_Delete, 0, 0, 0},
- { OP_Next, 0, ADDR(3), 0}, /* 7 */
+ { OP_Next, 0, ADDR(1), 0}, /* 8 */
};
sqliteBeginWriteOperation(pParse, 0, 0);
diff --git a/src/vdbe.c b/src/vdbe.c
index d6739dddb..3ea8f213e 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -36,7 +36,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.235 2003/07/27 17:16:07 drh Exp $
+** $Id: vdbe.c,v 1.236 2003/08/16 12:37:52 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -1845,7 +1845,7 @@ case OP_Pull: {
tz = zStack[from];
Deephemeralize(p, to);
for(i=from; i<to; i++){
- Deephemeralize(p, i);
+ Deephemeralize(p, i+1);
aStack[i] = aStack[i+1];
assert( (aStack[i].flags & STK_Ephem)==0 );
if( aStack[i].flags & (STK_Dyn|STK_Static) ){