establish default sqlcipher log level and target upon first activation
[sqlcipher.git] / src / test4.c
blob2043a338309ef98586035f60ac6107a6efcb38ec
1 /*
2 ** 2003 December 18
3 **
4 ** The author disclaims copyright to this source code. In place of
5 ** a legal notice, here is a blessing:
6 **
7 ** May you do good and not evil.
8 ** May you find forgiveness for yourself and forgive others.
9 ** May you share freely, never taking more than you give.
11 *************************************************************************
12 ** Code for testing the SQLite library in a multithreaded environment.
14 #include "sqliteInt.h"
15 #if defined(INCLUDE_SQLITE_TCL_H)
16 # include "sqlite_tcl.h"
17 #else
18 # include "tcl.h"
19 #endif
20 #if SQLITE_OS_UNIX && SQLITE_THREADSAFE
21 #include <stdlib.h>
22 #include <string.h>
23 #include <pthread.h>
24 #include <sched.h>
25 #include <ctype.h>
27 extern const char *sqlite3ErrName(int);
30 ** Each thread is controlled by an instance of the following
31 ** structure.
33 typedef struct Thread Thread;
34 struct Thread {
35 /* The first group of fields are writable by the leader and read-only
36 ** to the thread. */
37 char *zFilename; /* Name of database file */
38 void (*xOp)(Thread*); /* next operation to do */
39 char *zArg; /* argument usable by xOp */
40 int opnum; /* Operation number */
41 int busy; /* True if this thread is in use */
43 /* The next group of fields are writable by the thread but read-only to the
44 ** leader. */
45 int completed; /* Number of operations completed */
46 sqlite3 *db; /* Open database */
47 sqlite3_stmt *pStmt; /* Pending operation */
48 char *zErr; /* operation error */
49 char *zStaticErr; /* Static error message */
50 int rc; /* operation return code */
51 int argc; /* number of columns in result */
52 const char *argv[100]; /* result columns */
53 const char *colv[100]; /* result column names */
57 ** There can be as many as 26 threads running at once. Each is named
58 ** by a capital letter: A, B, C, ..., Y, Z.
60 #define N_THREAD 26
61 static Thread threadset[N_THREAD];
63 static void test_barrier(){
64 sqlite3_mutex *pMutex = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_APP1);
65 sqlite3_mutex_enter(pMutex);
66 sqlite3_mutex_leave(pMutex);
70 ** The main loop for a thread. Threads use busy waiting.
72 static void *test_thread_main(void *pArg){
73 Thread *p = (Thread*)pArg;
74 if( p->db ){
75 sqlite3_close(p->db);
77 sqlite3_open(p->zFilename, &p->db);
78 if( SQLITE_OK!=sqlite3_errcode(p->db) ){
79 p->zErr = strdup(sqlite3_errmsg(p->db));
80 sqlite3_close(p->db);
81 p->db = 0;
83 p->pStmt = 0;
84 test_barrier();
85 p->completed = 1;
86 while( p->opnum<=p->completed ) sched_yield();
87 test_barrier();
88 while( p->xOp ){
89 if( p->zErr && p->zErr!=p->zStaticErr ){
90 sqlite3_free(p->zErr);
91 p->zErr = 0;
93 (*p->xOp)(p);
94 test_barrier();
95 p->completed++;
96 while( p->opnum<=p->completed ) sched_yield();
97 test_barrier();
99 if( p->pStmt ){
100 sqlite3_finalize(p->pStmt);
101 p->pStmt = 0;
103 if( p->db ){
104 sqlite3_close(p->db);
105 p->db = 0;
107 if( p->zErr && p->zErr!=p->zStaticErr ){
108 sqlite3_free(p->zErr);
109 p->zErr = 0;
111 test_barrier();
112 p->completed++;
113 #ifndef SQLITE_OMIT_DEPRECATED
114 sqlite3_thread_cleanup();
115 #endif
116 return 0;
120 ** Get a thread ID which is an upper case letter. Return the index.
121 ** If the argument is not a valid thread ID put an error message in
122 ** the interpreter and return -1.
124 static int parse_thread_id(Tcl_Interp *interp, const char *zArg){
125 if( zArg==0 || zArg[0]==0 || zArg[1]!=0 || !isupper((unsigned char)zArg[0]) ){
126 Tcl_AppendResult(interp, "thread ID must be an upper case letter", 0);
127 return -1;
129 return zArg[0] - 'A';
133 ** Usage: thread_create NAME FILENAME
135 ** NAME should be an upper case letter. Start the thread running with
136 ** an open connection to the given database.
138 static int SQLITE_TCLAPI tcl_thread_create(
139 void *NotUsed,
140 Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
141 int argc, /* Number of arguments */
142 const char **argv /* Text of each argument */
144 int i;
145 pthread_t x;
146 int rc;
148 if( argc!=3 ){
149 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
150 " ID FILENAME", 0);
151 return TCL_ERROR;
153 i = parse_thread_id(interp, argv[1]);
154 if( i<0 ) return TCL_ERROR;
155 if( threadset[i].busy ){
156 Tcl_AppendResult(interp, "thread ", argv[1], " is already running", 0);
157 return TCL_ERROR;
159 threadset[i].busy = 1;
160 sqlite3_free(threadset[i].zFilename);
161 threadset[i].zFilename = sqlite3_mprintf("%s", argv[2]);
162 threadset[i].opnum = 1;
163 threadset[i].completed = 0;
164 rc = pthread_create(&x, 0, test_thread_main, &threadset[i]);
165 if( rc ){
166 Tcl_AppendResult(interp, "failed to create the thread", 0);
167 sqlite3_free(threadset[i].zFilename);
168 threadset[i].busy = 0;
169 return TCL_ERROR;
171 pthread_detach(x);
172 return TCL_OK;
176 ** Wait for a thread to reach its idle state.
178 static void test_thread_wait(Thread *p){
179 test_barrier();
180 while( p->opnum>p->completed ) sched_yield();
181 test_barrier();
185 ** Usage: thread_wait ID
187 ** Wait on thread ID to reach its idle state.
189 static int SQLITE_TCLAPI tcl_thread_wait(
190 void *NotUsed,
191 Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
192 int argc, /* Number of arguments */
193 const char **argv /* Text of each argument */
195 int i;
197 if( argc!=2 ){
198 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
199 " ID", 0);
200 return TCL_ERROR;
202 i = parse_thread_id(interp, argv[1]);
203 if( i<0 ) return TCL_ERROR;
204 if( !threadset[i].busy ){
205 Tcl_AppendResult(interp, "no such thread", 0);
206 return TCL_ERROR;
208 test_thread_wait(&threadset[i]);
209 return TCL_OK;
213 ** Stop a thread.
215 static void test_stop_thread(Thread *p){
216 test_thread_wait(p);
217 p->xOp = 0;
218 p->opnum++;
219 test_thread_wait(p);
220 sqlite3_free(p->zArg);
221 p->zArg = 0;
222 sqlite3_free(p->zFilename);
223 p->zFilename = 0;
224 p->busy = 0;
228 ** Usage: thread_halt ID
230 ** Cause a thread to shut itself down. Wait for the shutdown to be
231 ** completed. If ID is "*" then stop all threads.
233 static int SQLITE_TCLAPI tcl_thread_halt(
234 void *NotUsed,
235 Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
236 int argc, /* Number of arguments */
237 const char **argv /* Text of each argument */
239 int i;
241 if( argc!=2 ){
242 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
243 " ID", 0);
244 return TCL_ERROR;
246 if( argv[1][0]=='*' && argv[1][1]==0 ){
247 for(i=0; i<N_THREAD; i++){
248 if( threadset[i].busy ) test_stop_thread(&threadset[i]);
250 }else{
251 i = parse_thread_id(interp, argv[1]);
252 if( i<0 ) return TCL_ERROR;
253 if( !threadset[i].busy ){
254 Tcl_AppendResult(interp, "no such thread", 0);
255 return TCL_ERROR;
257 test_stop_thread(&threadset[i]);
259 return TCL_OK;
263 ** Usage: thread_argc ID
265 ** Wait on the most recent thread_step to complete, then return the
266 ** number of columns in the result set.
268 static int SQLITE_TCLAPI tcl_thread_argc(
269 void *NotUsed,
270 Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
271 int argc, /* Number of arguments */
272 const char **argv /* Text of each argument */
274 int i;
275 char zBuf[100];
277 if( argc!=2 ){
278 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
279 " ID", 0);
280 return TCL_ERROR;
282 i = parse_thread_id(interp, argv[1]);
283 if( i<0 ) return TCL_ERROR;
284 if( !threadset[i].busy ){
285 Tcl_AppendResult(interp, "no such thread", 0);
286 return TCL_ERROR;
288 test_thread_wait(&threadset[i]);
289 sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", threadset[i].argc);
290 Tcl_AppendResult(interp, zBuf, 0);
291 return TCL_OK;
295 ** Usage: thread_argv ID N
297 ** Wait on the most recent thread_step to complete, then return the
298 ** value of the N-th columns in the result set.
300 static int SQLITE_TCLAPI tcl_thread_argv(
301 void *NotUsed,
302 Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
303 int argc, /* Number of arguments */
304 const char **argv /* Text of each argument */
306 int i;
307 int n;
309 if( argc!=3 ){
310 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
311 " ID N", 0);
312 return TCL_ERROR;
314 i = parse_thread_id(interp, argv[1]);
315 if( i<0 ) return TCL_ERROR;
316 if( !threadset[i].busy ){
317 Tcl_AppendResult(interp, "no such thread", 0);
318 return TCL_ERROR;
320 if( Tcl_GetInt(interp, argv[2], &n) ) return TCL_ERROR;
321 test_thread_wait(&threadset[i]);
322 if( n<0 || n>=threadset[i].argc ){
323 Tcl_AppendResult(interp, "column number out of range", 0);
324 return TCL_ERROR;
326 Tcl_AppendResult(interp, threadset[i].argv[n], 0);
327 return TCL_OK;
331 ** Usage: thread_colname ID N
333 ** Wait on the most recent thread_step to complete, then return the
334 ** name of the N-th columns in the result set.
336 static int SQLITE_TCLAPI tcl_thread_colname(
337 void *NotUsed,
338 Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
339 int argc, /* Number of arguments */
340 const char **argv /* Text of each argument */
342 int i;
343 int n;
345 if( argc!=3 ){
346 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
347 " ID N", 0);
348 return TCL_ERROR;
350 i = parse_thread_id(interp, argv[1]);
351 if( i<0 ) return TCL_ERROR;
352 if( !threadset[i].busy ){
353 Tcl_AppendResult(interp, "no such thread", 0);
354 return TCL_ERROR;
356 if( Tcl_GetInt(interp, argv[2], &n) ) return TCL_ERROR;
357 test_thread_wait(&threadset[i]);
358 if( n<0 || n>=threadset[i].argc ){
359 Tcl_AppendResult(interp, "column number out of range", 0);
360 return TCL_ERROR;
362 Tcl_AppendResult(interp, threadset[i].colv[n], 0);
363 return TCL_OK;
367 ** Usage: thread_result ID
369 ** Wait on the most recent operation to complete, then return the
370 ** result code from that operation.
372 static int SQLITE_TCLAPI tcl_thread_result(
373 void *NotUsed,
374 Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
375 int argc, /* Number of arguments */
376 const char **argv /* Text of each argument */
378 int i;
379 const char *zName;
381 if( argc!=2 ){
382 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
383 " ID", 0);
384 return TCL_ERROR;
386 i = parse_thread_id(interp, argv[1]);
387 if( i<0 ) return TCL_ERROR;
388 if( !threadset[i].busy ){
389 Tcl_AppendResult(interp, "no such thread", 0);
390 return TCL_ERROR;
392 test_thread_wait(&threadset[i]);
393 zName = sqlite3ErrName(threadset[i].rc);
394 Tcl_AppendResult(interp, zName, 0);
395 return TCL_OK;
399 ** Usage: thread_error ID
401 ** Wait on the most recent operation to complete, then return the
402 ** error string.
404 static int SQLITE_TCLAPI tcl_thread_error(
405 void *NotUsed,
406 Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
407 int argc, /* Number of arguments */
408 const char **argv /* Text of each argument */
410 int i;
412 if( argc!=2 ){
413 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
414 " ID", 0);
415 return TCL_ERROR;
417 i = parse_thread_id(interp, argv[1]);
418 if( i<0 ) return TCL_ERROR;
419 if( !threadset[i].busy ){
420 Tcl_AppendResult(interp, "no such thread", 0);
421 return TCL_ERROR;
423 test_thread_wait(&threadset[i]);
424 Tcl_AppendResult(interp, threadset[i].zErr, 0);
425 return TCL_OK;
429 ** This procedure runs in the thread to compile an SQL statement.
431 static void do_compile(Thread *p){
432 if( p->db==0 ){
433 p->zErr = p->zStaticErr = "no database is open";
434 p->rc = SQLITE_ERROR;
435 return;
437 if( p->pStmt ){
438 sqlite3_finalize(p->pStmt);
439 p->pStmt = 0;
441 p->rc = sqlite3_prepare(p->db, p->zArg, -1, &p->pStmt, 0);
445 ** Usage: thread_compile ID SQL
447 ** Compile a new virtual machine.
449 static int SQLITE_TCLAPI tcl_thread_compile(
450 void *NotUsed,
451 Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
452 int argc, /* Number of arguments */
453 const char **argv /* Text of each argument */
455 int i;
456 if( argc!=3 ){
457 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
458 " ID SQL", 0);
459 return TCL_ERROR;
461 i = parse_thread_id(interp, argv[1]);
462 if( i<0 ) return TCL_ERROR;
463 if( !threadset[i].busy ){
464 Tcl_AppendResult(interp, "no such thread", 0);
465 return TCL_ERROR;
467 test_thread_wait(&threadset[i]);
468 threadset[i].xOp = do_compile;
469 sqlite3_free(threadset[i].zArg);
470 threadset[i].zArg = sqlite3_mprintf("%s", argv[2]);
471 test_barrier();
472 threadset[i].opnum++;
473 return TCL_OK;
477 ** This procedure runs in the thread to step the virtual machine.
479 static void do_step(Thread *p){
480 int i;
481 if( p->pStmt==0 ){
482 p->zErr = p->zStaticErr = "no virtual machine available";
483 p->rc = SQLITE_ERROR;
484 return;
486 p->rc = sqlite3_step(p->pStmt);
487 if( p->rc==SQLITE_ROW ){
488 p->argc = sqlite3_column_count(p->pStmt);
489 for(i=0; i<sqlite3_data_count(p->pStmt); i++){
490 p->argv[i] = (char*)sqlite3_column_text(p->pStmt, i);
492 for(i=0; i<p->argc; i++){
493 p->colv[i] = sqlite3_column_name(p->pStmt, i);
499 ** Usage: thread_step ID
501 ** Advance the virtual machine by one step
503 static int SQLITE_TCLAPI tcl_thread_step(
504 void *NotUsed,
505 Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
506 int argc, /* Number of arguments */
507 const char **argv /* Text of each argument */
509 int i;
510 if( argc!=2 ){
511 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
512 " IDL", 0);
513 return TCL_ERROR;
515 i = parse_thread_id(interp, argv[1]);
516 if( i<0 ) return TCL_ERROR;
517 if( !threadset[i].busy ){
518 Tcl_AppendResult(interp, "no such thread", 0);
519 return TCL_ERROR;
521 test_thread_wait(&threadset[i]);
522 threadset[i].xOp = do_step;
523 test_barrier();
524 threadset[i].opnum++;
525 return TCL_OK;
529 ** This procedure runs in the thread to finalize a virtual machine.
531 static void do_finalize(Thread *p){
532 if( p->pStmt==0 ){
533 p->zErr = p->zStaticErr = "no virtual machine available";
534 p->rc = SQLITE_ERROR;
535 return;
537 p->rc = sqlite3_finalize(p->pStmt);
538 p->pStmt = 0;
542 ** Usage: thread_finalize ID
544 ** Finalize the virtual machine.
546 static int SQLITE_TCLAPI tcl_thread_finalize(
547 void *NotUsed,
548 Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
549 int argc, /* Number of arguments */
550 const char **argv /* Text of each argument */
552 int i;
553 if( argc!=2 ){
554 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
555 " IDL", 0);
556 return TCL_ERROR;
558 i = parse_thread_id(interp, argv[1]);
559 if( i<0 ) return TCL_ERROR;
560 if( !threadset[i].busy ){
561 Tcl_AppendResult(interp, "no such thread", 0);
562 return TCL_ERROR;
564 test_thread_wait(&threadset[i]);
565 threadset[i].xOp = do_finalize;
566 sqlite3_free(threadset[i].zArg);
567 threadset[i].zArg = 0;
568 test_barrier();
569 threadset[i].opnum++;
570 return TCL_OK;
574 ** Usage: thread_swap ID ID
576 ** Interchange the sqlite* pointer between two threads.
578 static int SQLITE_TCLAPI tcl_thread_swap(
579 void *NotUsed,
580 Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
581 int argc, /* Number of arguments */
582 const char **argv /* Text of each argument */
584 int i, j;
585 sqlite3 *temp;
586 if( argc!=3 ){
587 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
588 " ID1 ID2", 0);
589 return TCL_ERROR;
591 i = parse_thread_id(interp, argv[1]);
592 if( i<0 ) return TCL_ERROR;
593 if( !threadset[i].busy ){
594 Tcl_AppendResult(interp, "no such thread", 0);
595 return TCL_ERROR;
597 test_thread_wait(&threadset[i]);
598 j = parse_thread_id(interp, argv[2]);
599 if( j<0 ) return TCL_ERROR;
600 if( !threadset[j].busy ){
601 Tcl_AppendResult(interp, "no such thread", 0);
602 return TCL_ERROR;
604 test_thread_wait(&threadset[j]);
605 temp = threadset[i].db;
606 threadset[i].db = threadset[j].db;
607 threadset[j].db = temp;
608 return TCL_OK;
612 ** Usage: thread_db_get ID
614 ** Return the database connection pointer for the given thread. Then
615 ** remove the pointer from the thread itself. Afterwards, the thread
616 ** can be stopped and the connection can be used by the main thread.
618 static int SQLITE_TCLAPI tcl_thread_db_get(
619 void *NotUsed,
620 Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
621 int argc, /* Number of arguments */
622 const char **argv /* Text of each argument */
624 int i;
625 char zBuf[100];
626 extern int sqlite3TestMakePointerStr(Tcl_Interp*, char*, void*);
627 if( argc!=2 ){
628 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
629 " ID", 0);
630 return TCL_ERROR;
632 i = parse_thread_id(interp, argv[1]);
633 if( i<0 ) return TCL_ERROR;
634 if( !threadset[i].busy ){
635 Tcl_AppendResult(interp, "no such thread", 0);
636 return TCL_ERROR;
638 test_thread_wait(&threadset[i]);
639 sqlite3TestMakePointerStr(interp, zBuf, threadset[i].db);
640 threadset[i].db = 0;
641 Tcl_AppendResult(interp, zBuf, (char*)0);
642 return TCL_OK;
646 ** Usage: thread_db_put ID DB
649 static int SQLITE_TCLAPI tcl_thread_db_put(
650 void *NotUsed,
651 Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
652 int argc, /* Number of arguments */
653 const char **argv /* Text of each argument */
655 int i;
656 extern int sqlite3TestMakePointerStr(Tcl_Interp*, char*, void*);
657 extern void *sqlite3TestTextToPtr(const char *);
658 if( argc!=3 ){
659 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
660 " ID DB", 0);
661 return TCL_ERROR;
663 i = parse_thread_id(interp, argv[1]);
664 if( i<0 ) return TCL_ERROR;
665 if( !threadset[i].busy ){
666 Tcl_AppendResult(interp, "no such thread", 0);
667 return TCL_ERROR;
669 test_thread_wait(&threadset[i]);
670 assert( !threadset[i].db );
671 threadset[i].db = (sqlite3*)sqlite3TestTextToPtr(argv[2]);
672 return TCL_OK;
676 ** Usage: thread_stmt_get ID
678 ** Return the database stmt pointer for the given thread. Then
679 ** remove the pointer from the thread itself.
681 static int SQLITE_TCLAPI tcl_thread_stmt_get(
682 void *NotUsed,
683 Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
684 int argc, /* Number of arguments */
685 const char **argv /* Text of each argument */
687 int i;
688 char zBuf[100];
689 extern int sqlite3TestMakePointerStr(Tcl_Interp*, char*, void*);
690 if( argc!=2 ){
691 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
692 " ID", 0);
693 return TCL_ERROR;
695 i = parse_thread_id(interp, argv[1]);
696 if( i<0 ) return TCL_ERROR;
697 if( !threadset[i].busy ){
698 Tcl_AppendResult(interp, "no such thread", 0);
699 return TCL_ERROR;
701 test_thread_wait(&threadset[i]);
702 sqlite3TestMakePointerStr(interp, zBuf, threadset[i].pStmt);
703 threadset[i].pStmt = 0;
704 Tcl_AppendResult(interp, zBuf, (char*)0);
705 return TCL_OK;
709 ** Register commands with the TCL interpreter.
711 int Sqlitetest4_Init(Tcl_Interp *interp){
712 static struct {
713 char *zName;
714 Tcl_CmdProc *xProc;
715 } aCmd[] = {
716 { "thread_create", (Tcl_CmdProc*)tcl_thread_create },
717 { "thread_wait", (Tcl_CmdProc*)tcl_thread_wait },
718 { "thread_halt", (Tcl_CmdProc*)tcl_thread_halt },
719 { "thread_argc", (Tcl_CmdProc*)tcl_thread_argc },
720 { "thread_argv", (Tcl_CmdProc*)tcl_thread_argv },
721 { "thread_colname", (Tcl_CmdProc*)tcl_thread_colname },
722 { "thread_result", (Tcl_CmdProc*)tcl_thread_result },
723 { "thread_error", (Tcl_CmdProc*)tcl_thread_error },
724 { "thread_compile", (Tcl_CmdProc*)tcl_thread_compile },
725 { "thread_step", (Tcl_CmdProc*)tcl_thread_step },
726 { "thread_finalize", (Tcl_CmdProc*)tcl_thread_finalize },
727 { "thread_swap", (Tcl_CmdProc*)tcl_thread_swap },
728 { "thread_db_get", (Tcl_CmdProc*)tcl_thread_db_get },
729 { "thread_db_put", (Tcl_CmdProc*)tcl_thread_db_put },
730 { "thread_stmt_get", (Tcl_CmdProc*)tcl_thread_stmt_get },
732 int i;
734 for(i=0; i<sizeof(aCmd)/sizeof(aCmd[0]); i++){
735 Tcl_CreateCommand(interp, aCmd[i].zName, aCmd[i].xProc, 0, 0);
737 return TCL_OK;
739 #else
740 int Sqlitetest4_Init(Tcl_Interp *interp){ return TCL_OK; }
741 #endif /* SQLITE_OS_UNIX */