/ Check-in [f02ba56d]
Login

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

Overview
Comment:Add the sqlite3_prepare_v2 and sqlite3_prepare16_v2 APIs to the loadable extension interface. (CVS 3713)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:f02ba56d5c6bbd57682a6bb57e9f92021dfb066e
User & Date: drh 2007-03-25 19:08:47
Context
2007-03-26
08:05
Some fixes and test cases for exclusive access mode. (CVS 3714) check-in: 899e6070 user: danielk1977 tags: trunk
2007-03-25
19:08
Add the sqlite3_prepare_v2 and sqlite3_prepare16_v2 APIs to the loadable extension interface. (CVS 3713) check-in: f02ba56d user: drh tags: trunk
2007-03-24
16:45
Changes for exclusive access mode. There are still some bugs. (CVS 3712) check-in: b6c70037 user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/loadext.c.

   225    225     ** of the APIs above provided that the pointer is not NULL.  But
   226    226     ** before calling APIs that follow, extension should check the
   227    227     ** sqlite3_libversion_number() to make sure they are dealing with
   228    228     ** a library that is new enough to support that API.
   229    229     *************************************************************************
   230    230     */
   231    231     sqlite3_overload_function,
          232  +
          233  +  /*
          234  +  ** Added after 3.3.13
          235  +  */
          236  +  sqlite3_prepare_v2,
          237  +  sqlite3_prepare16_v2,
   232    238   };
   233    239   
   234    240   /*
   235    241   ** Attempt to load an SQLite extension library contained in the file
   236    242   ** zFile.  The entry point is zProc.  zProc may be 0 in which case a
   237    243   ** default entry point name (sqlite3_extension_init) is used.  Use
   238    244   ** of the default name is recommended.

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.8 2007/01/09 14:37:18 drh Exp $
           18  +** @(#) $Id: sqlite3ext.h,v 1.9 2007/03/25 19:08:47 drh 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   
................................................................................
   140    140     const unsigned char * (*value_text)(sqlite3_value*);
   141    141     const void * (*value_text16)(sqlite3_value*);
   142    142     const void * (*value_text16be)(sqlite3_value*);
   143    143     const void * (*value_text16le)(sqlite3_value*);
   144    144     int  (*value_type)(sqlite3_value*);
   145    145     char * (*vmprintf)(const char*,va_list);
   146    146     int (*overload_function)(sqlite3*, const char *zFuncName, int nArg);
          147  +  int  (*prepare_v2)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
          148  +  int  (*prepare16_v2)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
   147    149   };
   148    150   
   149    151   /*
   150    152   ** The following macros redefine the API routines so that they are
   151    153   ** redirected throught the global sqlite3_api structure.
   152    154   **
   153    155   ** This header file is also used by the loadext.c source file
................................................................................
   228    230   #define sqlite3_libversion_number      sqlite3_api->libversion_number
   229    231   #define sqlite3_malloc                 sqlite3_api->malloc
   230    232   #define sqlite3_mprintf                sqlite3_api->mprintf
   231    233   #define sqlite3_open                   sqlite3_api->open
   232    234   #define sqlite3_open16                 sqlite3_api->open16
   233    235   #define sqlite3_prepare                sqlite3_api->prepare
   234    236   #define sqlite3_prepare16              sqlite3_api->prepare16
          237  +#define sqlite3_prepare_v2             sqlite3_api->prepare_v2
          238  +#define sqlite3_prepare16_v2           sqlite3_api->prepare16_v2
   235    239   #define sqlite3_profile                sqlite3_api->profile
   236    240   #define sqlite3_progress_handler       sqlite3_api->progress_handler
   237    241   #define sqlite3_realloc                sqlite3_api->realloc
   238    242   #define sqlite3_reset                  sqlite3_api->reset
   239    243   #define sqlite3_result_blob            sqlite3_api->result_blob
   240    244   #define sqlite3_result_double          sqlite3_api->result_double
   241    245   #define sqlite3_result_error           sqlite3_api->result_error

Changes to test/tester.tcl.

     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 some common TCL routines used for regression
    12     12   # testing the SQLite library
    13     13   #
    14         -# $Id: tester.tcl,v 1.75 2007/03/17 10:26:59 danielk1977 Exp $
           14  +# $Id: tester.tcl,v 1.76 2007/03/25 19:08:47 drh Exp $
    15     15   
    16     16   # Make sure tclsqlite3 was compiled correctly.  Abort now with an
    17     17   # error message if not.
    18     18   #
    19     19   if {[sqlite3 -tcl-uses-utf]} {
    20     20     if {"\u1234"=="u1234"} {
    21     21       puts stderr "***** BUILD PROBLEM *****"
................................................................................
   478    478   
   479    479       set ::sqlite_io_error_pending 0
   480    480       if {[info exists ::ioerropts(-cleanup)]} {
   481    481         catch $::ioerropts(-cleanup)
   482    482       }
   483    483     }
   484    484     set ::sqlite_io_error_pending 0
          485  +  set ::sqlite_io_error_persist 0
   485    486     unset ::ioerropts
   486    487   }
   487    488   
   488    489   # Return a checksum based on the contents of database 'db'.
   489    490   #
   490    491   proc cksum {{db db}} {
   491    492     set txt [$db eval {