/ Check-in [c727601e]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Fix a compiler warning in shell.c. Updates to comments in trigger.c.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c727601eecd85a26dbd4fc36823d77bec34da3c3
User & Date: drh 2010-02-15 15:47:18
Context
2010-02-15
16:54
When creating a trigger on a main database table when there is a TEMP table with the same name, make sure the trigger is bound to the main table. Ticket [985771e11612]. check-in: ec914af3 user: drh tags: trunk
15:47
Fix a compiler warning in shell.c. Updates to comments in trigger.c. check-in: c727601e user: drh tags: trunk
15:17
Fix a typo in the documentation for the OP_OpenPseudo opcode. check-in: 9acfb069 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/shell.c.

  1849   1849           zSql = zLeftover;
  1850   1850           while( isspace(zSql[0]) ) zSql++;
  1851   1851           continue;
  1852   1852         }
  1853   1853   
  1854   1854         /* echo the sql statement if echo on */
  1855   1855         if( pArg->echoOn ){
  1856         -        char *zStmtSql = sqlite3_sql(pStmt);
         1856  +        const char *zStmtSql = sqlite3_sql(pStmt);
  1857   1857           fprintf(pArg->out,"%s\n", zStmtSql ? zStmtSql : zSql);
  1858   1858         }
  1859   1859   
  1860   1860         /* perform the first step.  this will tell us if we
  1861   1861         ** have a result set or not and how wide it is.
  1862   1862         */
  1863   1863         rc = sqlite3_step(pStmt);

Changes to src/trigger.c.

   250    250   ** in order to complete the process of building the trigger.
   251    251   */
   252    252   void sqlite3FinishTrigger(
   253    253     Parse *pParse,          /* Parser context */
   254    254     TriggerStep *pStepList, /* The triggered program */
   255    255     Token *pAll             /* Token that describes the complete CREATE TRIGGER */
   256    256   ){
   257         -  Trigger *pTrig = pParse->pNewTrigger;    /* Trigger being finished */
   258         -  char *zName;                             /* Name of trigger */
   259         -  sqlite3 *db = pParse->db;                /* The database */
   260         -  DbFixer sFix;
   261         -  int iDb;                                 /* Database containing the trigger */
   262         -  Token nameToken;           /* Trigger name for error reporting */
          257  +  Trigger *pTrig = pParse->pNewTrigger;   /* Trigger being finished */
          258  +  char *zName;                            /* Name of trigger */
          259  +  sqlite3 *db = pParse->db;               /* The database */
          260  +  DbFixer sFix;                           /* Fixer object */
          261  +  int iDb;                                /* Database containing the trigger */
          262  +  Token nameToken;                        /* Trigger name for error reporting */
   263    263   
   264    264     pTrig = pParse->pNewTrigger;
   265    265     pParse->pNewTrigger = 0;
   266    266     if( NEVER(pParse->nErr) || !pTrig ) goto triggerfinish_cleanup;
   267    267     zName = pTrig->zName;
   268    268     iDb = sqlite3SchemaToIndex(pParse->db, pTrig->pSchema);
   269    269     pTrig->step_list = pStepList;
................................................................................
   274    274     nameToken.z = pTrig->zName;
   275    275     nameToken.n = sqlite3Strlen30(nameToken.z);
   276    276     if( sqlite3FixInit(&sFix, pParse, iDb, "trigger", &nameToken) 
   277    277             && sqlite3FixTriggerStep(&sFix, pTrig->step_list) ){
   278    278       goto triggerfinish_cleanup;
   279    279     }
   280    280   
   281         -  /* if we are not initializing, and this trigger is not on a TEMP table, 
          281  +  /* if we are not initializing,
   282    282     ** build the sqlite_master entry
   283    283     */
   284    284     if( !db->init.busy ){
   285    285       Vdbe *v;
   286    286       char *z;
   287    287   
   288    288       /* Make an entry in the sqlite_master table */