/ Check-in [c0bba77a]
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:Mark an branch in alter.c as always false. Only run the assert() on the sqlite3_aggregate_count() function in func.c if the SQLITE_OMIT_DEPRECATED compile-time option is off. (CVS 6508)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c0bba77ae619e709f3fb068526073a4a83cf33b6
User & Date: drh 2009-04-15 13:39:48
Context
2009-04-15
14:36
Fix access violation on WinCE platforms. Ticket #3804. (CVS 6509) check-in: e203ad40 user: shane tags: trunk
13:39
Mark an branch in alter.c as always false. Only run the assert() on the sqlite3_aggregate_count() function in func.c if the SQLITE_OMIT_DEPRECATED compile-time option is off. (CVS 6508) check-in: c0bba77a user: drh tags: trunk
13:07
Disable the temptrigger.test test script when shared cache is disabled. Ticket #3801. (CVS 6507) check-in: feedbce8 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/alter.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains C code routines that used to generate VDBE code
    13     13   ** that implements the ALTER TABLE command.
    14     14   **
    15         -** $Id: alter.c,v 1.55 2009/03/24 15:08:10 drh Exp $
           15  +** $Id: alter.c,v 1.56 2009/04/15 13:39:48 drh Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   
    19     19   /*
    20     20   ** The code in this file only exists if we are not omitting the
    21     21   ** ALTER TABLE logic from the build.
    22     22   */
................................................................................
   221    221     char *zWhere;
   222    222     int iDb;                   /* Index of database containing pTab */
   223    223   #ifndef SQLITE_OMIT_TRIGGER
   224    224     Trigger *pTrig;
   225    225   #endif
   226    226   
   227    227     v = sqlite3GetVdbe(pParse);
   228         -  if( !v ) return;
          228  +  if( NEVER(v==0) ) return;
   229    229     assert( sqlite3BtreeHoldsAllMutexes(pParse->db) );
   230    230     iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
   231    231     assert( iDb>=0 );
   232    232   
   233    233   #ifndef SQLITE_OMIT_TRIGGER
   234    234     /* Drop any table triggers from the internal schema. */
   235    235     for(pTrig=sqlite3TriggerList(pParse, pTab); pTrig; pTrig=pTrig->pNext){

Changes to src/func.c.

    12     12   ** This file contains the C functions that implement various SQL
    13     13   ** functions of SQLite.  
    14     14   **
    15     15   ** There is only one exported symbol in this file - the function
    16     16   ** sqliteRegisterBuildinFunctions() found at the bottom of the file.
    17     17   ** All other code has file scope.
    18     18   **
    19         -** $Id: func.c,v 1.231 2009/04/08 23:04:14 drh Exp $
           19  +** $Id: func.c,v 1.232 2009/04/15 13:39:48 drh Exp $
    20     20   */
    21     21   #include "sqliteInt.h"
    22     22   #include <stdlib.h>
    23     23   #include <assert.h>
    24     24   #include "vdbeInt.h"
    25     25   
    26     26   /*
................................................................................
  1175   1175   static void countStep(sqlite3_context *context, int argc, sqlite3_value **argv){
  1176   1176     CountCtx *p;
  1177   1177     p = sqlite3_aggregate_context(context, sizeof(*p));
  1178   1178     if( (argc==0 || SQLITE_NULL!=sqlite3_value_type(argv[0])) && p ){
  1179   1179       p->n++;
  1180   1180     }
  1181   1181   
         1182  +#ifndef SQLITE_OMIT_DEPRECATED
  1182   1183     /* The sqlite3_aggregate_count() function is deprecated.  But just to make
  1183   1184     ** sure it still operates correctly, verify that its count agrees with our 
  1184   1185     ** internal count when using count(*) and when the total count can be
  1185   1186     ** expressed as a 32-bit integer. */
  1186   1187     assert( argc==1 || p==0 || p->n>0x7fffffff
  1187   1188             || p->n==sqlite3_aggregate_count(context) );
         1189  +#endif
  1188   1190   }   
  1189   1191   static void countFinalize(sqlite3_context *context){
  1190   1192     CountCtx *p;
  1191   1193     p = sqlite3_aggregate_context(context, 0);
  1192   1194     sqlite3_result_int64(context, p ? p->n : 0);
  1193   1195   }
  1194   1196