/ Check-in [ba3711ac]
Login

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

Overview
Comment:Added SQLITE_OMIT_DEPRECATED compile time option to leave out deprecated functions. Updated test scripts to skip tests of deprecated functions if they are compiled out. (CVS 5808)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ba3711acee6f4659bbf133a23d8f9f37e14d0f38
User & Date: shane 2008-10-12 00:27:53
Context
2008-10-12
01:49
Add gcov compile options to link line when GCOV option enabled. (CVS 5809) check-in: 3ddda111 user: shane tags: trunk
00:27
Added SQLITE_OMIT_DEPRECATED compile time option to leave out deprecated functions. Updated test scripts to skip tests of deprecated functions if they are compiled out. (CVS 5808) check-in: ba3711ac user: shane tags: trunk
2008-10-11
18:11
Add macros tests so that the compiler always recognizes that x86_64 is little endian. (CVS 5807) check-in: b201e709 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/loadext.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 code used to dynamically load extensions into
    13     13   ** the SQLite library.
    14     14   **
    15         -** $Id: loadext.c,v 1.55 2008/10/07 15:25:48 drh Exp $
           15  +** $Id: loadext.c,v 1.56 2008/10/12 00:27:53 shane Exp $
    16     16   */
    17     17   
    18     18   #ifndef SQLITE_CORE
    19     19     #define SQLITE_CORE 1  /* Disable the API redefinition in sqlite3ext.h */
    20     20   #endif
    21     21   #include "sqlite3ext.h"
    22     22   #include "sqliteInt.h"
................................................................................
   120    120   ** sqlite3_libversion_number() to make sure that the API they
   121    121   ** intend to use is supported by the library.  Extensions should
   122    122   ** also check to make sure that the pointer to the function is
   123    123   ** not NULL before calling it.
   124    124   */
   125    125   static const sqlite3_api_routines sqlite3Apis = {
   126    126     sqlite3_aggregate_context,
          127  +#ifndef SQLITE_OMIT_DEPRECATED
   127    128     sqlite3_aggregate_count,
          129  +#else
          130  +  0,
          131  +#endif
   128    132     sqlite3_bind_blob,
   129    133     sqlite3_bind_double,
   130    134     sqlite3_bind_int,
   131    135     sqlite3_bind_int64,
   132    136     sqlite3_bind_null,
   133    137     sqlite3_bind_parameter_count,
   134    138     sqlite3_bind_parameter_index,
................................................................................
   175    179     sqlite3_db_handle,
   176    180     sqlite3_declare_vtab,
   177    181     sqlite3_enable_shared_cache,
   178    182     sqlite3_errcode,
   179    183     sqlite3_errmsg,
   180    184     sqlite3_errmsg16,
   181    185     sqlite3_exec,
          186  +#ifndef SQLITE_OMIT_DEPRECATED
   182    187     sqlite3_expired,
          188  +#else
          189  +  0,
          190  +#endif
   183    191     sqlite3_finalize,
   184    192     sqlite3_free,
   185    193     sqlite3_free_table,
   186    194     sqlite3_get_autocommit,
   187    195     sqlite3_get_auxdata,
   188    196     sqlite3_get_table,
   189    197     0,     /* Was sqlite3_global_recover(), but that function is deprecated */
................................................................................
   215    223     sqlite3_result_value,
   216    224     sqlite3_rollback_hook,
   217    225     sqlite3_set_authorizer,
   218    226     sqlite3_set_auxdata,
   219    227     sqlite3_snprintf,
   220    228     sqlite3_step,
   221    229     sqlite3_table_column_metadata,
          230  +#ifndef SQLITE_OMIT_DEPRECATED
   222    231     sqlite3_thread_cleanup,
          232  +#else
          233  +  0,
          234  +#endif
   223    235     sqlite3_total_changes,
   224    236     sqlite3_trace,
          237  +#ifndef SQLITE_OMIT_DEPRECATED
   225    238     sqlite3_transfer_bindings,
          239  +#else
          240  +  0,
          241  +#endif
   226    242     sqlite3_update_hook,
   227    243     sqlite3_user_data,
   228    244     sqlite3_value_blob,
   229    245     sqlite3_value_bytes,
   230    246     sqlite3_value_bytes16,
   231    247     sqlite3_value_double,
   232    248     sqlite3_value_int,

Changes to src/main.c.

    10     10   **
    11     11   *************************************************************************
    12     12   ** Main file for the SQLite library.  The routines in this file
    13     13   ** implement the programmer interface to the library.  Routines in
    14     14   ** other files are for internal use by SQLite and should not be
    15     15   ** accessed by users of the library.
    16     16   **
    17         -** $Id: main.c,v 1.507 2008/10/11 15:38:30 drh Exp $
           17  +** $Id: main.c,v 1.508 2008/10/12 00:27:53 shane Exp $
    18     18   */
    19     19   #include "sqliteInt.h"
    20     20   #include <ctype.h>
    21     21   
    22     22   #ifdef SQLITE_ENABLE_FTS3
    23     23   # include "fts3.h"
    24     24   #endif
................................................................................
  1798   1798     db->pCollNeededArg = pCollNeededArg;
  1799   1799     sqlite3_mutex_leave(db->mutex);
  1800   1800     return SQLITE_OK;
  1801   1801   }
  1802   1802   #endif /* SQLITE_OMIT_UTF16 */
  1803   1803   
  1804   1804   #ifndef SQLITE_OMIT_GLOBALRECOVER
         1805  +#ifndef SQLITE_OMIT_DEPRECATED
  1805   1806   /*
  1806   1807   ** This function is now an anachronism. It used to be used to recover from a
  1807   1808   ** malloc() failure, but SQLite now does this automatically.
  1808   1809   */
  1809   1810   int sqlite3_global_recover(void){
  1810   1811     return SQLITE_OK;
  1811   1812   }
         1813  +#endif
  1812   1814   #endif
  1813   1815   
  1814   1816   /*
  1815   1817   ** Test to see whether or not the database connection is in autocommit
  1816   1818   ** mode.  Return TRUE if it is and FALSE if not.  Autocommit mode is on
  1817   1819   ** by default.  Autocommit is disabled by a BEGIN statement and reenabled
  1818   1820   ** by the next COMMIT or ROLLBACK.
................................................................................
  1830   1832   ** corruption is first detected.
  1831   1833   */
  1832   1834   int sqlite3Corrupt(void){
  1833   1835     return SQLITE_CORRUPT;
  1834   1836   }
  1835   1837   #endif
  1836   1838   
         1839  +#ifndef SQLITE_OMIT_DEPRECATED
  1837   1840   /*
  1838   1841   ** This is a convenience routine that makes sure that all thread-specific
  1839   1842   ** data for this thread has been deallocated.
  1840   1843   **
  1841   1844   ** SQLite no longer uses thread-specific data so this routine is now a
  1842   1845   ** no-op.  It is retained for historical compatibility.
  1843   1846   */
  1844   1847   void sqlite3_thread_cleanup(void){
  1845   1848   }
         1849  +#endif
  1846   1850   
  1847   1851   /*
  1848   1852   ** Return meta information about a specific column of a database table.
  1849   1853   ** See comment in sqlite3.h (sqlite.h.in) for details.
  1850   1854   */
  1851   1855   #ifdef SQLITE_ENABLE_COLUMN_METADATA
  1852   1856   int sqlite3_table_column_metadata(

Changes to src/malloc.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   **
    13     13   ** Memory allocation functions used throughout sqlite.
    14     14   **
    15         -** $Id: malloc.c,v 1.44 2008/10/11 17:35:16 drh Exp $
           15  +** $Id: malloc.c,v 1.45 2008/10/12 00:27:53 shane Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   #include <stdarg.h>
    19     19   #include <ctype.h>
    20     20   
    21     21   /*
    22     22   ** This routine runs when the memory allocator sees that the
................................................................................
   192    192     mem0.alarmCallback = xCallback;
   193    193     mem0.alarmArg = pArg;
   194    194     mem0.alarmThreshold = iThreshold;
   195    195     sqlite3_mutex_leave(mem0.mutex);
   196    196     return SQLITE_OK;
   197    197   }
   198    198   
          199  +#ifndef SQLITE_OMIT_DEPRECATED
   199    200   /*
   200    201   ** Deprecated external interface.  Internal/core SQLite code
   201    202   ** should call sqlite3MemoryAlarm.
   202    203   */
   203    204   int sqlite3_memory_alarm(
   204    205     void(*xCallback)(void *pArg, sqlite3_int64 used,int N),
   205    206     void *pArg,
   206    207     sqlite3_int64 iThreshold
   207    208   ){
   208    209     return sqlite3MemoryAlarm(xCallback, pArg, iThreshold);
   209    210   }
          211  +#endif
   210    212   
   211    213   /*
   212    214   ** Trigger the alarm 
   213    215   */
   214    216   static void sqlite3MallocAlarm(int nByte){
   215    217     void (*xCallback)(void*,sqlite3_int64,int);
   216    218     sqlite3_int64 nowUsed;

Changes to src/sqlite.h.in.

    26     26   ** on how SQLite interfaces are suppose to operate.
    27     27   **
    28     28   ** The name of this file under configuration management is "sqlite.h.in".
    29     29   ** The makefile makes some minor changes to this file (such as inserting
    30     30   ** the version number) and changes its name to "sqlite3.h" as
    31     31   ** part of the build process.
    32     32   **
    33         -** @(#) $Id: sqlite.h.in,v 1.403 2008/10/10 23:48:26 drh Exp $
           33  +** @(#) $Id: sqlite.h.in,v 1.404 2008/10/12 00:27:54 shane Exp $
    34     34   */
    35     35   #ifndef _SQLITE3_H_
    36     36   #define _SQLITE3_H_
    37     37   #include <stdarg.h>     /* Needed for the definition of va_list */
    38     38   
    39     39   /*
    40     40   ** Make sure we can call this stuff from C++.
................................................................................
  4121   4121   **
  4122   4122   ** These functions are [deprecated].  In order to maintain
  4123   4123   ** backwards compatibility with older code, these functions continue 
  4124   4124   ** to be supported.  However, new applications should avoid
  4125   4125   ** the use of these functions.  To help encourage people to avoid
  4126   4126   ** using these functions, we are not going to tell you want they do.
  4127   4127   */
         4128  +#ifndef SQLITE_OMIT_DEPRECATED
  4128   4129   SQLITE_DEPRECATED int sqlite3_aggregate_count(sqlite3_context*);
  4129   4130   SQLITE_DEPRECATED int sqlite3_expired(sqlite3_stmt*);
  4130   4131   SQLITE_DEPRECATED int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
  4131   4132   SQLITE_DEPRECATED int sqlite3_global_recover(void);
  4132   4133   SQLITE_DEPRECATED void sqlite3_thread_cleanup(void);
  4133   4134   SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),void*,sqlite3_int64);
         4135  +#endif
  4134   4136   
  4135   4137   /*
  4136   4138   ** CAPI3REF: Obtaining SQL Function Parameter Values {H15100} <S20200>
  4137   4139   **
  4138   4140   ** The C-language implementation of SQL functions and aggregates uses
  4139   4141   ** this set of interface routines to access the parameter values on
  4140   4142   ** the function or aggregate.

Changes to src/sqlite3ext.h.

    11     11   *************************************************************************
    12     12   ** This header file defines the SQLite interface for use by
    13     13   ** shared libraries that want to be imported as extensions into
    14     14   ** an SQLite instance.  Shared libraries that intend to be loaded
    15     15   ** as extensions by SQLite should #include this file instead of 
    16     16   ** sqlite3.h.
    17     17   **
    18         -** @(#) $Id: sqlite3ext.h,v 1.24 2008/06/30 15:09:29 danielk1977 Exp $
           18  +** @(#) $Id: sqlite3ext.h,v 1.25 2008/10/12 00:27:54 shane Exp $
    19     19   */
    20     20   #ifndef _SQLITE3EXT_H_
    21     21   #define _SQLITE3EXT_H_
    22     22   #include "sqlite3.h"
    23     23   
    24     24   typedef struct sqlite3_api_routines sqlite3_api_routines;
    25     25   
................................................................................
   204    204   ** it can get access to the sqlite3_api_routines structure
   205    205   ** definition.  But the main library does not want to redefine
   206    206   ** the API.  So the redefinition macros are only valid if the
   207    207   ** SQLITE_CORE macros is undefined.
   208    208   */
   209    209   #ifndef SQLITE_CORE
   210    210   #define sqlite3_aggregate_context      sqlite3_api->aggregate_context
          211  +#ifndef SQLITE_OMIT_DEPRECATED
   211    212   #define sqlite3_aggregate_count        sqlite3_api->aggregate_count
          213  +#endif
   212    214   #define sqlite3_bind_blob              sqlite3_api->bind_blob
   213    215   #define sqlite3_bind_double            sqlite3_api->bind_double
   214    216   #define sqlite3_bind_int               sqlite3_api->bind_int
   215    217   #define sqlite3_bind_int64             sqlite3_api->bind_int64
   216    218   #define sqlite3_bind_null              sqlite3_api->bind_null
   217    219   #define sqlite3_bind_parameter_count   sqlite3_api->bind_parameter_count
   218    220   #define sqlite3_bind_parameter_index   sqlite3_api->bind_parameter_index
................................................................................
   260    262   #define sqlite3_db_handle              sqlite3_api->db_handle
   261    263   #define sqlite3_declare_vtab           sqlite3_api->declare_vtab
   262    264   #define sqlite3_enable_shared_cache    sqlite3_api->enable_shared_cache
   263    265   #define sqlite3_errcode                sqlite3_api->errcode
   264    266   #define sqlite3_errmsg                 sqlite3_api->errmsg
   265    267   #define sqlite3_errmsg16               sqlite3_api->errmsg16
   266    268   #define sqlite3_exec                   sqlite3_api->exec
          269  +#ifndef SQLITE_OMIT_DEPRECATED
   267    270   #define sqlite3_expired                sqlite3_api->expired
          271  +#endif
   268    272   #define sqlite3_finalize               sqlite3_api->finalize
   269    273   #define sqlite3_free                   sqlite3_api->free
   270    274   #define sqlite3_free_table             sqlite3_api->free_table
   271    275   #define sqlite3_get_autocommit         sqlite3_api->get_autocommit
   272    276   #define sqlite3_get_auxdata            sqlite3_api->get_auxdata
   273    277   #define sqlite3_get_table              sqlite3_api->get_table
          278  +#ifndef SQLITE_OMIT_DEPRECATED
   274    279   #define sqlite3_global_recover         sqlite3_api->global_recover
          280  +#endif
   275    281   #define sqlite3_interrupt              sqlite3_api->interruptx
   276    282   #define sqlite3_last_insert_rowid      sqlite3_api->last_insert_rowid
   277    283   #define sqlite3_libversion             sqlite3_api->libversion
   278    284   #define sqlite3_libversion_number      sqlite3_api->libversion_number
   279    285   #define sqlite3_malloc                 sqlite3_api->malloc
   280    286   #define sqlite3_mprintf                sqlite3_api->mprintf
   281    287   #define sqlite3_open                   sqlite3_api->open
................................................................................
   305    311   #define sqlite3_set_auxdata            sqlite3_api->set_auxdata
   306    312   #define sqlite3_snprintf               sqlite3_api->snprintf
   307    313   #define sqlite3_step                   sqlite3_api->step
   308    314   #define sqlite3_table_column_metadata  sqlite3_api->table_column_metadata
   309    315   #define sqlite3_thread_cleanup         sqlite3_api->thread_cleanup
   310    316   #define sqlite3_total_changes          sqlite3_api->total_changes
   311    317   #define sqlite3_trace                  sqlite3_api->trace
          318  +#ifndef SQLITE_OMIT_DEPRECATED
   312    319   #define sqlite3_transfer_bindings      sqlite3_api->transfer_bindings
          320  +#endif
   313    321   #define sqlite3_update_hook            sqlite3_api->update_hook
   314    322   #define sqlite3_user_data              sqlite3_api->user_data
   315    323   #define sqlite3_value_blob             sqlite3_api->value_blob
   316    324   #define sqlite3_value_bytes            sqlite3_api->value_bytes
   317    325   #define sqlite3_value_bytes16          sqlite3_api->value_bytes16
   318    326   #define sqlite3_value_double           sqlite3_api->value_double
   319    327   #define sqlite3_value_int              sqlite3_api->value_int

Changes to src/test1.c.

     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** Code for testing all sorts of SQLite interfaces.  This code
    13     13   ** is not included in the SQLite library.  It is used for automated
    14     14   ** testing of the SQLite library.
    15     15   **
    16         -** $Id: test1.c,v 1.327 2008/10/07 23:46:38 drh Exp $
           16  +** $Id: test1.c,v 1.328 2008/10/12 00:27:54 shane Exp $
    17     17   */
    18     18   #include "sqliteInt.h"
    19     19   #include "tcl.h"
    20     20   #include <stdlib.h>
    21     21   #include <string.h>
    22     22   
    23     23   /*
................................................................................
  1035   1035   static void legacyCountStep(
  1036   1036     sqlite3_context *context,
  1037   1037     int argc,
  1038   1038     sqlite3_value **argv
  1039   1039   ){
  1040   1040     /* no-op */
  1041   1041   }
         1042  +
         1043  +#ifndef SQLITE_OMIT_DEPRECATED
  1042   1044   static void legacyCountFinalize(sqlite3_context *context){
  1043   1045     sqlite3_result_int(context, sqlite3_aggregate_count(context));
  1044   1046   }
         1047  +#endif
  1045   1048   
  1046   1049   /*
  1047   1050   ** Usage:  sqlite3_create_aggregate DB
  1048   1051   **
  1049   1052   ** Call the sqlite3_create_function API on the given database in order
  1050   1053   ** to create a function named "x_count".  This function is similar
  1051   1054   ** to the built-in count() function, with a few special quirks
................................................................................
  1078   1081     if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR;
  1079   1082     rc = sqlite3_create_function(db, "x_count", 0, SQLITE_UTF8, 0, 0,
  1080   1083         t1CountStep,t1CountFinalize);
  1081   1084     if( rc==SQLITE_OK ){
  1082   1085       rc = sqlite3_create_function(db, "x_count", 1, SQLITE_UTF8, 0, 0,
  1083   1086           t1CountStep,t1CountFinalize);
  1084   1087     }
         1088  +#ifndef SQLITE_OMIT_DEPRECATED
  1085   1089     if( rc==SQLITE_OK ){
  1086   1090       rc = sqlite3_create_function(db, "legacy_count", 0, SQLITE_ANY, 0, 0,
  1087   1091           legacyCountStep, legacyCountFinalize
  1088   1092       );
  1089   1093     }
         1094  +#endif
  1090   1095     if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR;
  1091   1096     Tcl_SetResult(interp, (char *)t1ErrorName(rc), 0);
  1092   1097     return TCL_OK;
  1093   1098   }
  1094   1099   
  1095   1100   
  1096   1101   /*
................................................................................
  2030   2035   */
  2031   2036   static int test_expired(
  2032   2037     void * clientData,
  2033   2038     Tcl_Interp *interp,
  2034   2039     int objc,
  2035   2040     Tcl_Obj *CONST objv[]
  2036   2041   ){
         2042  +#ifndef SQLITE_OMIT_DEPRECATED
  2037   2043     sqlite3_stmt *pStmt;
  2038   2044     if( objc!=2 ){
  2039   2045       Tcl_AppendResult(interp, "wrong # args: should be \"",
  2040   2046           Tcl_GetStringFromObj(objv[0], 0), " <STMT>", 0);
  2041   2047       return TCL_ERROR;
  2042   2048     }
  2043   2049     if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
  2044   2050     Tcl_SetObjResult(interp, Tcl_NewBooleanObj(sqlite3_expired(pStmt)));
         2051  +#endif
  2045   2052     return TCL_OK;
  2046   2053   }
  2047   2054   
  2048   2055   /*
  2049   2056   ** Usage:  sqlite3_transfer_bindings FROMSTMT TOSTMT
  2050   2057   **
  2051   2058   ** Transfer all bindings from FROMSTMT over to TOSTMT
................................................................................
  2052   2059   */
  2053   2060   static int test_transfer_bind(
  2054   2061     void * clientData,
  2055   2062     Tcl_Interp *interp,
  2056   2063     int objc,
  2057   2064     Tcl_Obj *CONST objv[]
  2058   2065   ){
         2066  +#ifndef SQLITE_OMIT_DEPRECATED
  2059   2067     sqlite3_stmt *pStmt1, *pStmt2;
  2060   2068     if( objc!=3 ){
  2061   2069       Tcl_AppendResult(interp, "wrong # args: should be \"",
  2062   2070           Tcl_GetStringFromObj(objv[0], 0), " FROM-STMT TO-STMT", 0);
  2063   2071       return TCL_ERROR;
  2064   2072     }
  2065   2073     if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt1)) return TCL_ERROR;
  2066   2074     if( getStmtPointer(interp, Tcl_GetString(objv[2]), &pStmt2)) return TCL_ERROR;
  2067   2075     Tcl_SetObjResult(interp, 
  2068   2076        Tcl_NewIntObj(sqlite3_transfer_bindings(pStmt1,pStmt2)));
         2077  +#endif
  2069   2078     return TCL_OK;
  2070   2079   }
  2071   2080   
  2072   2081   /*
  2073   2082   ** Usage:  sqlite3_changes DB
  2074   2083   **
  2075   2084   ** Return the number of changes made to the database by the last SQL
................................................................................
  3752   3761   static int test_global_recover(
  3753   3762     void * clientData,
  3754   3763     Tcl_Interp *interp,
  3755   3764     int objc,
  3756   3765     Tcl_Obj *CONST objv[]
  3757   3766   ){
  3758   3767   #ifndef SQLITE_OMIT_GLOBALRECOVER
         3768  +#ifndef SQLITE_OMIT_DEPRECATED
  3759   3769     int rc;
  3760   3770     if( objc!=1 ){
  3761   3771       Tcl_WrongNumArgs(interp, 1, objv, "");
  3762   3772       return TCL_ERROR;
  3763   3773     }
  3764   3774     rc = sqlite3_global_recover();
  3765   3775     Tcl_SetResult(interp, (char *)t1ErrorName(rc), TCL_STATIC);
         3776  +#endif
  3766   3777   #endif
  3767   3778     return TCL_OK;
  3768   3779   }
  3769   3780   
  3770   3781   /*
  3771   3782   ** Usage: sqlite3_column_text STMT column
  3772   3783   **
................................................................................
  4135   4146   */
  4136   4147   static int test_thread_cleanup(
  4137   4148     void * clientData,
  4138   4149     Tcl_Interp *interp,
  4139   4150     int objc,
  4140   4151     Tcl_Obj *CONST objv[]
  4141   4152   ){
         4153  +#ifndef SQLITE_OMIT_DEPRECATED
  4142   4154     sqlite3_thread_cleanup();
         4155  +#endif
  4143   4156     return TCL_OK;
  4144   4157   }
  4145         -
  4146   4158   
  4147   4159   /*
  4148   4160   ** Usage:   sqlite3_pager_refcounts  DB
  4149   4161   **
  4150   4162   ** Return a list of numbers which are the PagerRefcount for all
  4151   4163   ** pagers on each database connection.
  4152   4164   */

Changes to src/test4.c.

     7      7   **    May you do good and not evil.
     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   ** Code for testing the the SQLite library in a multithreaded environment.
    13     13   **
    14         -** $Id: test4.c,v 1.23 2008/07/28 19:34:54 drh Exp $
           14  +** $Id: test4.c,v 1.24 2008/10/12 00:27:54 shane Exp $
    15     15   */
    16     16   #include "sqliteInt.h"
    17     17   #include "tcl.h"
    18     18   #if defined(SQLITE_OS_UNIX) && OS_UNIX==1 && SQLITE_THREADSAFE
    19     19   #include <stdlib.h>
    20     20   #include <string.h>
    21     21   #include <pthread.h>
................................................................................
    92     92       p->db = 0;
    93     93     }
    94     94     if( p->zErr && p->zErr!=p->zStaticErr ){
    95     95       sqlite3_free(p->zErr);
    96     96       p->zErr = 0;
    97     97     }
    98     98     p->completed++;
           99  +#ifndef SQLITE_OMIT_DEPRECATED
    99    100     sqlite3_thread_cleanup();
          101  +#endif
   100    102     return 0;
   101    103   }
   102    104   
   103    105   /*
   104    106   ** Get a thread ID which is an upper case letter.  Return the index.
   105    107   ** If the argument is not a valid thread ID put an error message in
   106    108   ** the interpreter and return -1.

Changes to src/test7.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   ** Code for testing the client/server version of the SQLite library.
    13     13   ** Derived from test4.c.
    14     14   **
    15         -** $Id: test7.c,v 1.12 2008/07/28 19:34:54 drh Exp $
           15  +** $Id: test7.c,v 1.13 2008/10/12 00:27:54 shane Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   #include "tcl.h"
    19     19   
    20     20   /*
    21     21   ** This test only works on UNIX with a SQLITE_THREADSAFE build that includes
    22     22   ** the SQLITE_SERVER option.
................................................................................
   114    114       p->db = 0;
   115    115     }
   116    116     if( p->zErr && p->zErr!=p->zStaticErr ){
   117    117       sqlite3_free(p->zErr);
   118    118       p->zErr = 0;
   119    119     }
   120    120     p->completed++;
          121  +#ifndef SQLITE_OMIT_DEPRECATED
   121    122     sqlite3_thread_cleanup();
          123  +#endif
   122    124     return 0;
   123    125   }
   124    126   
   125    127   /*
   126    128   ** Get a thread ID which is an upper case letter.  Return the index.
   127    129   ** If the argument is not a valid thread ID put an error message in
   128    130   ** the interpreter and return -1.

Changes to src/test_config.c.

    12     12   ** 
    13     13   ** This file contains code used for testing the SQLite system.
    14     14   ** None of the code in this file goes into a deliverable build.
    15     15   ** 
    16     16   ** The focus of this file is providing the TCL testing layer
    17     17   ** access to compile-time constants.
    18     18   **
    19         -** $Id: test_config.c,v 1.41 2008/10/11 17:06:04 drh Exp $
           19  +** $Id: test_config.c,v 1.42 2008/10/12 00:27:54 shane Exp $
    20     20   */
    21     21   
    22     22   #include "sqliteLimit.h"
    23     23   
    24     24   #include "sqliteInt.h"
    25     25   #include "tcl.h"
    26     26   #include <stdlib.h>
................................................................................
   208    208   #endif
   209    209   
   210    210   #ifdef SQLITE_OMIT_DECLTYPE
   211    211     Tcl_SetVar2(interp, "sqlite_options", "decltype", "0", TCL_GLOBAL_ONLY);
   212    212   #else
   213    213     Tcl_SetVar2(interp, "sqlite_options", "decltype", "1", TCL_GLOBAL_ONLY);
   214    214   #endif
          215  +
          216  +#ifdef SQLITE_OMIT_DEPRECATED
          217  +  Tcl_SetVar2(interp, "sqlite_options", "deprecated", "0", TCL_GLOBAL_ONLY);
          218  +#else
          219  +  Tcl_SetVar2(interp, "sqlite_options", "deprecated", "1", TCL_GLOBAL_ONLY);
          220  +#endif
   215    221   
   216    222   #ifdef SQLITE_OMIT_DISKIO
   217    223     Tcl_SetVar2(interp, "sqlite_options", "diskio", "0", TCL_GLOBAL_ONLY);
   218    224   #else
   219    225     Tcl_SetVar2(interp, "sqlite_options", "diskio", "1", TCL_GLOBAL_ONLY);
   220    226   #endif
   221    227   

Changes to src/vdbeapi.c.

     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   **
    13     13   ** This file contains code use to implement APIs that are part of the
    14     14   ** VDBE.
    15     15   **
    16         -** $Id: vdbeapi.c,v 1.145 2008/10/07 23:46:38 drh Exp $
           16  +** $Id: vdbeapi.c,v 1.146 2008/10/12 00:27:54 shane Exp $
    17     17   */
    18     18   #include "sqliteInt.h"
    19     19   #include "vdbeInt.h"
    20     20   
    21     21   #if 0 && defined(SQLITE_ENABLE_MEMORY_MANAGEMENT)
    22     22   /*
    23     23   ** The following structure contains pointers to the end points of a
................................................................................
   170    170   #else       /* !SQLITE_ENABLE_MEMORY_MANAGEMENT */
   171    171     #define stmtLruRemove(x)
   172    172     #define stmtLruAdd(x)
   173    173     #define vdbeReprepare(x) sqlite3Reprepare(x)
   174    174   #endif
   175    175   
   176    176   
          177  +#ifndef SQLITE_OMIT_DEPRECATED
   177    178   /*
   178    179   ** Return TRUE (non-zero) of the statement supplied as an argument needs
   179    180   ** to be recompiled.  A statement needs to be recompiled whenever the
   180    181   ** execution environment changes in a way that would alter the program
   181    182   ** that sqlite3_prepare() generates.  For example, if new functions or
   182    183   ** collating sequences are registered or if an authorizer function is
   183    184   ** added or changed.
   184    185   */
   185    186   int sqlite3_expired(sqlite3_stmt *pStmt){
   186    187     Vdbe *p = (Vdbe*)pStmt;
   187    188     return p==0 || p->expired;
   188    189   }
          190  +#endif
   189    191   
   190    192   /*
   191    193   ** The following routine destroys a virtual machine that is created by
   192    194   ** the sqlite3_compile() routine. The integer returned is an SQLITE_
   193    195   ** success/failure code that describes the result of executing the virtual
   194    196   ** machine.
   195    197   **
................................................................................
   691    693   
   692    694   failed:
   693    695     if( xDelete ){
   694    696       xDelete(pAux);
   695    697     }
   696    698   }
   697    699   
          700  +#ifndef SQLITE_OMIT_DEPRECATED
   698    701   /*
   699    702   ** Return the number of times the Step function of a aggregate has been 
   700    703   ** called.
   701    704   **
   702    705   ** This function is deprecated.  Do not use it for new code.  It is
   703    706   ** provide only to avoid breaking legacy code.  New aggregate function
   704    707   ** implementations should keep their own counts within their aggregate
   705    708   ** context.
   706    709   */
   707    710   int sqlite3_aggregate_count(sqlite3_context *p){
   708    711     assert( p && p->pFunc && p->pFunc->xStep );
   709    712     return p->pMem->n;
   710    713   }
          714  +#endif
   711    715   
   712    716   /*
   713    717   ** Return the number of columns in the result set for the statement pStmt.
   714    718   */
   715    719   int sqlite3_column_count(sqlite3_stmt *pStmt){
   716    720     Vdbe *pVm = (Vdbe *)pStmt;
   717    721     return pVm ? pVm->nResColumn : 0;
................................................................................
  1246   1250       sqlite3VdbeMemMove(&pTo->aVar[i], &pFrom->aVar[i]);
  1247   1251     }
  1248   1252     sqlite3_mutex_leave(pTo->db->mutex);
  1249   1253     assert( rc==SQLITE_OK || rc==SQLITE_NOMEM );
  1250   1254     return rc;
  1251   1255   }
  1252   1256   
         1257  +#ifndef SQLITE_OMIT_DEPRECATED
  1253   1258   /*
  1254   1259   ** Deprecated external interface.  Internal/core SQLite code
  1255   1260   ** should call sqlite3TransferBindings.
  1256   1261   */
  1257   1262   int sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
  1258   1263     return sqlite3TransferBindings(pFromStmt, pToStmt);
  1259   1264   }
         1265  +#endif
  1260   1266   
  1261   1267   /*
  1262   1268   ** Return the sqlite3* database handle to which the prepared statement given
  1263   1269   ** in the argument belongs.  This is the same database handle that was
  1264   1270   ** the first argument to the sqlite3_prepare() that was used to create
  1265   1271   ** the statement in the first place.
  1266   1272   */

Changes to test/bindxfer.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this script testing the sqlite_transfer_bindings() API.
    13     13   #
    14         -# $Id: bindxfer.test,v 1.5 2008/03/17 16:23:27 drh Exp $
           14  +# $Id: bindxfer.test,v 1.6 2008/10/12 00:27:54 shane Exp $
    15     15   #
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   
    20     20   proc sqlite_step {stmt VALS COLS} {
    21     21     upvar #0 $VALS vals
................................................................................
    46     46   do_test bindxfer-1.3 {
    47     47     set VM2 [sqlite3_prepare $DB {SELECT ?, ?, ?} -1 TAIL]
    48     48     set TAIL
    49     49   } {}
    50     50   do_test bindxfer-1.4 {
    51     51     sqlite3_bind_parameter_count $VM2
    52     52   } 3
    53         -do_test bindxfer-1.5 {
    54         -  sqlite_bind $VM1 1 one normal
    55         -  set sqlite_static_bind_value two
    56         -  sqlite_bind $VM1 2 {} static
    57         -  sqlite_bind $VM1 3 {} null
    58         -  sqlite3_transfer_bindings $VM1 $VM2
    59         -  sqlite_step $VM1 VALUES COLNAMES
    60         -} SQLITE_ROW
    61         -do_test bindxfer-1.6 {
    62         -  set VALUES
    63         -} {{} {} {}}
    64         -do_test bindxfer-1.7 {
    65         -  sqlite_step $VM2 VALUES COLNAMES
    66         -} SQLITE_ROW
    67         -do_test bindxfer-1.8 {
    68         -  set VALUES
    69         -} {one two {}}
    70         -do_test bindxfer-1.9-misuse {
    71         -  catch {sqlite3_finalize $VM1}
    72         -  catch {sqlite3_finalize $VM2}
    73         -  sqlite3_transfer_bindings $VM1 $VM2
    74         -} 21 ;# SQLITE_MISUSE
    75         -do_test bindxfer-1.10 {
    76         -  set VM1 [sqlite3_prepare $DB {SELECT ?, ?, ?} -1 TAIL]
    77         -  set VM2 [sqlite3_prepare $DB {SELECT ?, ?, ?, ?} -1 TAIL]
    78         -  sqlite3_transfer_bindings $VM1 $VM2
    79         -} 1  ;# SQLITE_ERROR
           53  +ifcapable deprecated {
           54  +  do_test bindxfer-1.5 {
           55  +    sqlite_bind $VM1 1 one normal
           56  +    set sqlite_static_bind_value two
           57  +    sqlite_bind $VM1 2 {} static
           58  +    sqlite_bind $VM1 3 {} null
           59  +    sqlite3_transfer_bindings $VM1 $VM2
           60  +    sqlite_step $VM1 VALUES COLNAMES
           61  +  } SQLITE_ROW
           62  +  do_test bindxfer-1.6 {
           63  +    set VALUES
           64  +  } {{} {} {}}
           65  +  do_test bindxfer-1.7 {
           66  +    sqlite_step $VM2 VALUES COLNAMES
           67  +  } SQLITE_ROW
           68  +  do_test bindxfer-1.8 {
           69  +    set VALUES
           70  +  } {one two {}}
           71  +  do_test bindxfer-1.9-misuse {
           72  +    catch {sqlite3_finalize $VM1}
           73  +    catch {sqlite3_finalize $VM2}
           74  +    sqlite3_transfer_bindings $VM1 $VM2
           75  +  } 21 ;# SQLITE_MISUSE
           76  +  do_test bindxfer-1.10 {
           77  +    set VM1 [sqlite3_prepare $DB {SELECT ?, ?, ?} -1 TAIL]
           78  +    set VM2 [sqlite3_prepare $DB {SELECT ?, ?, ?, ?} -1 TAIL]
           79  +    sqlite3_transfer_bindings $VM1 $VM2
           80  +  } 1  ;# SQLITE_ERROR
           81  +}
    80     82   catch {sqlite3_finalize $VM1}
    81     83   catch {sqlite3_finalize $VM2}
    82     84   
    83     85   
    84     86   finish_test

Changes to test/capi3c.test.

     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  
    12     12   #
    13     13   # This is a copy of the capi3.test file that has been adapted to
    14     14   # test the new sqlite3_prepare_v2 interface.
    15     15   #
    16         -# $Id: capi3c.test,v 1.19 2008/05/05 16:56:35 drh Exp $
           16  +# $Id: capi3c.test,v 1.20 2008/10/12 00:27:54 shane Exp $
    17     17   #
    18     18   
    19     19   set testdir [file dirname $argv0]
    20     20   source $testdir/tester.tcl
    21     21   
    22     22   # Return the UTF-16 representation of the supplied UTF-8 string $str.
    23     23   # If $nt is true, append two 0x00 bytes as a nul terminator.
................................................................................
  1164   1164     sqlite3_reset $STMT
  1165   1165     db eval {DROP TABLE t3}
  1166   1166     sqlite3_step $STMT
  1167   1167   } SQLITE_SCHEMA
  1168   1168   do_test capi3c-19.4.1 {
  1169   1169     sqlite3_errmsg $DB
  1170   1170   } {no such table: t3}
  1171         -do_test capi3c-19.4.2 {
  1172         -  sqlite3_expired $STMT
  1173         -} 1
         1171  +ifcapable deprecated {
         1172  +  do_test capi3c-19.4.2 {
         1173  +    sqlite3_expired $STMT
         1174  +  } 1
         1175  +}
  1174   1176   do_test capi3c-19.4.3 {
  1175   1177     sqlite3_errmsg $DB
  1176   1178   } {no such table: t3}
  1177         -do_test capi3c-19.4.4 {
  1178         -  sqlite3_expired 0
  1179         -} 1
         1179  +ifcapable deprecated {
         1180  +  do_test capi3c-19.4.4 {
         1181  +    sqlite3_expired 0
         1182  +  } 1
         1183  +}
  1180   1184   do_test capi3c-19.5 {
  1181   1185     sqlite3_reset $STMT
  1182   1186     db eval {
  1183   1187        CREATE TABLE t3(x,y);
  1184   1188        INSERT INTO t3 VALUES(1,2);
  1185   1189     }
  1186   1190     sqlite3_step $STMT
  1187   1191   } SQLITE_ROW
  1188         -do_test capi3c-19.5.2 {
  1189         -  sqlite3_expired $STMT
  1190         -} 0
         1192  +ifcapable deprecated {
         1193  +  do_test capi3c-19.5.2 {
         1194  +    sqlite3_expired $STMT
         1195  +  } 0
         1196  +}
  1191   1197   do_test capi3c-19.6 {
  1192   1198     sqlite3_column_int $STMT 1
  1193   1199   } 2
  1194   1200   do_test capi3c-19.99 {
  1195   1201     sqlite3_finalize $STMT
  1196   1202   } SQLITE_OK
  1197   1203   

Changes to test/func.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is testing built-in functions.
    13     13   #
    14         -# $Id: func.test,v 1.86 2008/08/04 03:51:24 danielk1977 Exp $
           14  +# $Id: func.test,v 1.87 2008/10/12 00:27:54 shane Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   # Create a table to work with.
    20     20   #
    21     21   do_test func-0.0 {
................................................................................
   914    914   } {null}
   915    915   do_test func-22.22 {
   916    916     execsql {SELECT typeof(trim('hello',NULL));}
   917    917   } {null}
   918    918   
   919    919   # This is to test the deprecated sqlite3_aggregate_count() API.
   920    920   #
   921         -do_test func-23.1 {
   922         -  sqlite3_create_aggregate db
   923         -  execsql {
   924         -    SELECT legacy_count() FROM t6;
   925         -  }
   926         -} {3}
          921  +ifcapable deprecated {
          922  +  do_test func-23.1 {
          923  +    sqlite3_create_aggregate db
          924  +    execsql {
          925  +      SELECT legacy_count() FROM t6;
          926  +    }
          927  +  } {3}
          928  +}
   927    929   
   928    930   # The group_concat() function.
   929    931   #
   930    932   do_test func-24.1 {
   931    933     execsql {
   932    934       SELECT group_concat(t1) FROM tbl1
   933    935     }

Changes to test/shared_err.test.

     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12     12   # The focus of the tests in this file are IO errors that occur in a shared
    13     13   # cache context. What happens to connection B if one connection A encounters
    14     14   # an IO-error whilst reading or writing the file-system?
    15     15   #
    16         -# $Id: shared_err.test,v 1.23 2008/09/29 14:12:57 danielk1977 Exp $
           16  +# $Id: shared_err.test,v 1.24 2008/10/12 00:27:54 shane Exp $
    17     17   
    18     18   proc skip {args} {}
    19     19   
    20     20   
    21     21   set testdir [file dirname $argv0]
    22     22   source $testdir/tester.tcl
    23     23   source $testdir/malloc_common.tcl
................................................................................
   358    358   } -cleanup {
   359    359     catch {dbX close}
   360    360     catch {dbY close}
   361    361   }
   362    362   
   363    363   do_malloc_test shared_err-6 -tclbody {
   364    364     catch {db close}
   365         -  sqlite3_thread_cleanup
          365  +  ifcapable deprecated {
          366  +    sqlite3_thread_cleanup
          367  +  }
   366    368     sqlite3_enable_shared_cache 0
   367    369   } -cleanup {
   368    370     sqlite3_enable_shared_cache 1
   369    371   }
   370    372   
   371    373   # As of 3.5.0, sqlite3_enable_shared_cache can be called at
   372    374   # any time and from any thread