/ Check-in [3111b43e]
Login

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

Overview
Comment:Add the sqlite3_clear_bindings() API to the loadable extension interface. Ticket #2135. (CVS 3752)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3111b43ec333f3342f9609bf441160040f3d1501
User & Date: drh 2007-03-29 18:46:01
Context
2007-03-29
20:13
Fix to token destructors in Lemon. This does not impact SQLite. Ticket #2175. (CVS 3753) check-in: 6195af49 user: drh tags: trunk
18:46
Add the sqlite3_clear_bindings() API to the loadable extension interface. Ticket #2135. (CVS 3752) check-in: 3111b43e user: drh tags: trunk
18:41
Buffer updates per-transaction rather than per-update. If lots of updates happen within a single transaction, there was a lot of wasted encode/decode overhead due to segment merges. This code buffers updates in memory and writes out larger level-0 segments. It only works when documents are presented in ascending order by docid. Comparing a test set running 100 documents per transaction, the total runtime is cut almost in half. (CVS 3751) check-in: 0229cba6 user: shess tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/loadext.c.

   231    231     sqlite3_overload_function,
   232    232   
   233    233     /*
   234    234     ** Added after 3.3.13
   235    235     */
   236    236     sqlite3_prepare_v2,
   237    237     sqlite3_prepare16_v2,
          238  +  sqlite3_clear_bindings,
   238    239   };
   239    240   
   240    241   /*
   241    242   ** Attempt to load an SQLite extension library contained in the file
   242    243   ** zFile.  The entry point is zProc.  zProc may be 0 in which case a
   243    244   ** default entry point name (sqlite3_extension_init) is used.  Use
   244    245   ** 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.9 2007/03/25 19:08:47 drh Exp $
           18  +** @(#) $Id: sqlite3ext.h,v 1.10 2007/03/29 18:46:01 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   
................................................................................
   138    138     sqlite_int64  (*value_int64)(sqlite3_value*);
   139    139     int  (*value_numeric_type)(sqlite3_value*);
   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         -  char * (*vmprintf)(const char*,va_list);
          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  +  int (*prepare_v2)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
          148  +  int (*prepare16_v2)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
          149  +  int (*clear_bindings)(sqlite3_stmt*);
   149    150   };
   150    151   
   151    152   /*
   152    153   ** The following macros redefine the API routines so that they are
   153    154   ** redirected throught the global sqlite3_api structure.
   154    155   **
   155    156   ** This header file is also used by the loadext.c source file
................................................................................
   274    275   #define sqlite3_value_text             sqlite3_api->value_text
   275    276   #define sqlite3_value_text16           sqlite3_api->value_text16
   276    277   #define sqlite3_value_text16be         sqlite3_api->value_text16be
   277    278   #define sqlite3_value_text16le         sqlite3_api->value_text16le
   278    279   #define sqlite3_value_type             sqlite3_api->value_type
   279    280   #define sqlite3_vmprintf               sqlite3_api->vmprintf
   280    281   #define sqlite3_overload_function      sqlite3_api->overload_function
          282  +#define sqlite3_prepare_v2             sqlite3_api->prepare_v2
          283  +#define sqlite3_prepare16_v2           sqlite3_api->prepare16_v2
          284  +#define sqlite3_clear_bindings         sqlite3_api->clear_bindings
   281    285   #endif /* SQLITE_CORE */
   282    286   
   283    287   #define SQLITE_EXTENSION_INIT1     const sqlite3_api_routines *sqlite3_api;
   284    288   #define SQLITE_EXTENSION_INIT2(v)  sqlite3_api = v;
   285    289   
   286    290   #endif /* _SQLITE3EXT_H_ */