/ Check-in [523ff779]
Login

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

Overview
Comment:Remove an unused branch in the FK logic.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dropViewNoStat
Files: files | file ages | folders
SHA3-256:523ff77925f1da361cf31e3fc82bcb1708ed356a2391430ab14ef620c9bf2327
User & Date: drh 2018-07-22 00:45:11
Context
2018-07-27
22:55
When doing a DROP VIEW do not try to delete entries from the sqlite_stat1 table as there are none. check-in: 7efdba2b user: drh tags: trunk
2018-07-22
00:45
Remove an unused branch in the FK logic. Closed-Leaf check-in: 523ff779 user: drh tags: dropViewNoStat
2018-07-20
20:56
When dropping a view, skip trying to delete from 'sqlite_stat*'. check-in: 2f5be3a2 user: mistachkin tags: dropViewNoStat
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/fkey.c.

   706    706   **
   707    707   ** then the equivalent of "DELETE FROM <tbl>" is executed before dropping
   708    708   ** the table from the database. Triggers are disabled while running this
   709    709   ** DELETE, but foreign key actions are not.
   710    710   */
   711    711   void sqlite3FkDropTable(Parse *pParse, SrcList *pName, Table *pTab){
   712    712     sqlite3 *db = pParse->db;
   713         -  if( (db->flags&SQLITE_ForeignKeys) && !IsVirtual(pTab) && !pTab->pSelect ){
          713  +  if( (db->flags&SQLITE_ForeignKeys) && !IsVirtual(pTab) ){
   714    714       int iSkip = 0;
   715    715       Vdbe *v = sqlite3GetVdbe(pParse);
   716    716   
   717    717       assert( v );                  /* VDBE has already been allocated */
          718  +    assert( pTab->pSelect==0 );   /* Not a view */
   718    719       if( sqlite3FkReferences(pTab)==0 ){
   719    720         /* Search for a deferred foreign key constraint for which this table
   720    721         ** is the child table. If one cannot be found, return without 
   721    722         ** generating any VDBE code. If one can be found, then jump over
   722    723         ** the entire DELETE if there are no outstanding deferred constraints
   723    724         ** when this statement is run.  */
   724    725         FKey *p;