/ Check-in [c83ec81d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add code to report an error on a recursive trigger, but leave it commented out - turning it on will likely break a lot of code. (CVS 3152)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:c83ec81d53f756660cafbbdaf9cf92e9e4bab4ad
User & Date: drh 2006-03-25 15:52:20
Context
2006-03-26
01:21
SQLite now always chooses the column names for compound selects using the left-most select. This makes SQLite work like other SQL database, but it also is a change from historical behavior and may break some scripts. Ticket #1721. (CVS 3153) check-in: 80cda9f7 user: drh tags: trunk
2006-03-25
15:52
Add code to report an error on a recursive trigger, but leave it commented out - turning it on will likely break a lot of code. (CVS 3152) check-in: c83ec81d user: drh tags: trunk
14:03
Add a note to the API documentation emphasizing that the filename argument to sqlite3_open() must be UTF-8. Tickets #1713, #1533. (CVS 3151) check-in: b0111f43 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/trigger.c.

594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
...
762
763
764
765
766
767
768







769
770
771
772
773
774
775
  ExprList *pChanges      /* Columns that change in an UPDATE statement */
){
  Trigger *pTrigger = pTab->pTrigger;
  int mask = 0;

  while( pTrigger ){
    if( pTrigger->op==op && checkColumnOverLap(pTrigger->pColumns, pChanges) ){
      TriggerStack *ss;
      ss = pParse->trigStack;
      while( ss && ss->pTrigger!=pTab->pTrigger ){
	ss = ss->pNext;
      }
      if( ss==0 ){
        mask |= pTrigger->tr_tm;
      }
    }
    pTrigger = pTrigger->pNext;
  }
  return mask;
}

/*
................................................................................
      (op!=TK_UPDATE||!p->pColumns||checkColumnOverLap(p->pColumns,pChanges))
    ){
      TriggerStack *pS;      /* Pointer to trigger-stack entry */
      for(pS=pParse->trigStack; pS && p!=pS->pTrigger; pS=pS->pNext){}
      if( !pS ){
        fire_this = 1;
      }







    }
 
    if( fire_this ){
      int endTrigger;
      Expr * whenExpr;
      AuthContext sContext;
      NameContext sNC;







<
<
<
<
<
<
|
<







 







>
>
>
>
>
>
>







594
595
596
597
598
599
600






601

602
603
604
605
606
607
608
...
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
  ExprList *pChanges      /* Columns that change in an UPDATE statement */
){
  Trigger *pTrigger = pTab->pTrigger;
  int mask = 0;

  while( pTrigger ){
    if( pTrigger->op==op && checkColumnOverLap(pTrigger->pColumns, pChanges) ){






      mask |= pTrigger->tr_tm;

    }
    pTrigger = pTrigger->pNext;
  }
  return mask;
}

/*
................................................................................
      (op!=TK_UPDATE||!p->pColumns||checkColumnOverLap(p->pColumns,pChanges))
    ){
      TriggerStack *pS;      /* Pointer to trigger-stack entry */
      for(pS=pParse->trigStack; pS && p!=pS->pTrigger; pS=pS->pNext){}
      if( !pS ){
        fire_this = 1;
      }
#if 0    /* Give no warning for recursive triggers.  Just do not do them */
      else{
        sqlite3ErrorMsg(pParse, "recursive triggers not supported (%s)",
            p->name);
        return SQLITE_ERROR;
      }
#endif
    }
 
    if( fire_this ){
      int endTrigger;
      Expr * whenExpr;
      AuthContext sContext;
      NameContext sNC;