SQLite

Check-in [3111b43ec3]
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
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3111b43ec333f3342f9609bf441160040f3d1501
User & Date: drh 2007-03-29 18:46:01.000
Context
2007-03-29
20:13
Fix to token destructors in Lemon. This does not impact SQLite. Ticket #2175. (CVS 3753) (check-in: 6195af4982 user: drh tags: trunk)
18:46
Add the sqlite3_clear_bindings() API to the loadable extension interface. Ticket #2135. (CVS 3752) (check-in: 3111b43ec3 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: 0229cba696 user: shess tags: trunk)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to src/loadext.c.
231
232
233
234
235
236
237

238
239
240
241
242
243
244
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245







+







  sqlite3_overload_function,

  /*
  ** Added after 3.3.13
  */
  sqlite3_prepare_v2,
  sqlite3_prepare16_v2,
  sqlite3_clear_bindings,
};

/*
** Attempt to load an SQLite extension library contained in the file
** zFile.  The entry point is zProc.  zProc may be 0 in which case a
** default entry point name (sqlite3_extension_init) is used.  Use
** of the default name is recommended.
Changes to src/sqlite3ext.h.
11
12
13
14
15
16
17
18

19
20
21
22
23
24
25
11
12
13
14
15
16
17

18
19
20
21
22
23
24
25







-
+







*************************************************************************
** This header file defines the SQLite interface for use by
** shared libraries that want to be imported as extensions into
** an SQLite instance.  Shared libraries that intend to be loaded
** as extensions by SQLite should #include this file instead of 
** sqlite3.h.
**
** @(#) $Id: sqlite3ext.h,v 1.9 2007/03/25 19:08:47 drh Exp $
** @(#) $Id: sqlite3ext.h,v 1.10 2007/03/29 18:46:01 drh Exp $
*/
#ifndef _SQLITE3EXT_H_
#define _SQLITE3EXT_H_
#include "sqlite3.h"

typedef struct sqlite3_api_routines sqlite3_api_routines;

138
139
140
141
142
143
144
145

146
147
148



149
150
151
152
153
154
155
138
139
140
141
142
143
144

145
146


147
148
149
150
151
152
153
154
155
156







-
+

-
-
+
+
+







  sqlite_int64  (*value_int64)(sqlite3_value*);
  int  (*value_numeric_type)(sqlite3_value*);
  const unsigned char * (*value_text)(sqlite3_value*);
  const void * (*value_text16)(sqlite3_value*);
  const void * (*value_text16be)(sqlite3_value*);
  const void * (*value_text16le)(sqlite3_value*);
  int  (*value_type)(sqlite3_value*);
  char * (*vmprintf)(const char*,va_list);
  char *(*vmprintf)(const char*,va_list);
  int (*overload_function)(sqlite3*, const char *zFuncName, int nArg);
  int  (*prepare_v2)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
  int  (*prepare16_v2)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
  int (*prepare_v2)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
  int (*prepare16_v2)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
  int (*clear_bindings)(sqlite3_stmt*);
};

/*
** The following macros redefine the API routines so that they are
** redirected throught the global sqlite3_api structure.
**
** This header file is also used by the loadext.c source file
274
275
276
277
278
279
280



281
282
283
284
285
286
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290







+
+
+






#define sqlite3_value_text             sqlite3_api->value_text
#define sqlite3_value_text16           sqlite3_api->value_text16
#define sqlite3_value_text16be         sqlite3_api->value_text16be
#define sqlite3_value_text16le         sqlite3_api->value_text16le
#define sqlite3_value_type             sqlite3_api->value_type
#define sqlite3_vmprintf               sqlite3_api->vmprintf
#define sqlite3_overload_function      sqlite3_api->overload_function
#define sqlite3_prepare_v2             sqlite3_api->prepare_v2
#define sqlite3_prepare16_v2           sqlite3_api->prepare16_v2
#define sqlite3_clear_bindings         sqlite3_api->clear_bindings
#endif /* SQLITE_CORE */

#define SQLITE_EXTENSION_INIT1     const sqlite3_api_routines *sqlite3_api;
#define SQLITE_EXTENSION_INIT2(v)  sqlite3_api = v;

#endif /* _SQLITE3EXT_H_ */