| Index: third_party/sqlite/src/src/test_func.c
|
| diff --git a/third_party/sqlite/src/src/test_func.c b/third_party/sqlite/src/src/test_func.c
|
| index 63cf18e3f7639e585792f05260503894d092eb70..c7860fe8877c4bdc3611a1df4c79968f5812ddbe 100644
|
| --- a/third_party/sqlite/src/src/test_func.c
|
| +++ b/third_party/sqlite/src/src/test_func.c
|
| @@ -13,7 +13,11 @@
|
| ** implements new SQL functions used by the test scripts.
|
| */
|
| #include "sqlite3.h"
|
| -#include "tcl.h"
|
| +#if defined(INCLUDE_SQLITE_TCL_H)
|
| +# include "sqlite_tcl.h"
|
| +#else
|
| +# include "tcl.h"
|
| +#endif
|
| #include <stdlib.h>
|
| #include <string.h>
|
| #include <assert.h>
|
| @@ -21,7 +25,6 @@
|
| #include "sqliteInt.h"
|
| #include "vdbeInt.h"
|
|
|
| -
|
| /*
|
| ** Allocate nByte bytes of space using sqlite3_malloc(). If the
|
| ** allocation fails, call sqlite3_result_error_nomem() to notify
|
| @@ -152,7 +155,7 @@ static void test_destructor_count(
|
| ** arguments. It returns the text value returned by the sqlite3_errmsg16()
|
| ** API function.
|
| */
|
| -#ifndef SQLITE_OMIT_BUILTIN_TEST
|
| +#ifndef SQLITE_UNTESTABLE
|
| void sqlite3BeginBenignMalloc(void);
|
| void sqlite3EndBenignMalloc(void);
|
| #else
|
| @@ -166,9 +169,7 @@ static void test_agg_errmsg16_final(sqlite3_context *ctx){
|
| const void *z;
|
| sqlite3 * db = sqlite3_context_db_handle(ctx);
|
| sqlite3_aggregate_context(ctx, 2048);
|
| - sqlite3BeginBenignMalloc();
|
| z = sqlite3_errmsg16(db);
|
| - sqlite3EndBenignMalloc();
|
| sqlite3_result_text16(ctx, z, -1, SQLITE_TRANSIENT);
|
| #endif
|
| }
|
| @@ -642,7 +643,11 @@ static void test_setsubtype(
|
| sqlite3_result_subtype(context, (unsigned int)sqlite3_value_int(argv[1]));
|
| }
|
|
|
| -static int registerTestFunctions(sqlite3 *db){
|
| +static int registerTestFunctions(
|
| + sqlite3 *db,
|
| + char **pzErrMsg,
|
| + const sqlite3_api_routines *pThunk
|
| +){
|
| static const struct {
|
| char *zName;
|
| signed char nArg;
|
| @@ -691,16 +696,16 @@ static int registerTestFunctions(sqlite3 *db){
|
| ** the standard set of test functions to be loaded into each new
|
| ** database connection.
|
| */
|
| -static int autoinstall_test_funcs(
|
| +static int SQLITE_TCLAPI autoinstall_test_funcs(
|
| void * clientData,
|
| Tcl_Interp *interp,
|
| int objc,
|
| Tcl_Obj *CONST objv[]
|
| ){
|
| - extern int Md5_Register(sqlite3*);
|
| - int rc = sqlite3_auto_extension((void*)registerTestFunctions);
|
| + extern int Md5_Register(sqlite3 *, char **, const sqlite3_api_routines *);
|
| + int rc = sqlite3_auto_extension((void(*)(void))registerTestFunctions);
|
| if( rc==SQLITE_OK ){
|
| - rc = sqlite3_auto_extension((void*)Md5_Register);
|
| + rc = sqlite3_auto_extension((void(*)(void))Md5_Register);
|
| }
|
| Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
|
| return TCL_OK;
|
| @@ -719,7 +724,7 @@ static void tFinal(sqlite3_context *a){}
|
| ** Make various calls to sqlite3_create_function that do not have valid
|
| ** parameters. Verify that the error condition is detected and reported.
|
| */
|
| -static int abuse_create_function(
|
| +static int SQLITE_TCLAPI abuse_create_function(
|
| void * clientData,
|
| Tcl_Interp *interp,
|
| int objc,
|
| @@ -785,6 +790,7 @@ abuse_err:
|
| return TCL_ERROR;
|
| }
|
|
|
| +
|
| /*
|
| ** Register commands with the TCL interpreter.
|
| */
|
| @@ -797,13 +803,13 @@ int Sqlitetest_func_Init(Tcl_Interp *interp){
|
| { "abuse_create_function", abuse_create_function },
|
| };
|
| int i;
|
| - extern int Md5_Register(sqlite3*);
|
| + extern int Md5_Register(sqlite3 *, char **, const sqlite3_api_routines *);
|
|
|
| for(i=0; i<sizeof(aObjCmd)/sizeof(aObjCmd[0]); i++){
|
| Tcl_CreateObjCommand(interp, aObjCmd[i].zName, aObjCmd[i].xProc, 0, 0);
|
| }
|
| sqlite3_initialize();
|
| - sqlite3_auto_extension((void*)registerTestFunctions);
|
| - sqlite3_auto_extension((void*)Md5_Register);
|
| + sqlite3_auto_extension((void(*)(void))registerTestFunctions);
|
| + sqlite3_auto_extension((void(*)(void))Md5_Register);
|
| return TCL_OK;
|
| }
|
|
|