-C Version\s1.0.29\s(CVS\s474)
-D 2001-04-05T16:50:00
+C Check\sfor\smiscompiled\sTcl\s(CVS\s204)
+D 2001-04-06T16:13:43
F COPYRIGHT 74a8a6531a42e124df07ab5599aad63870fa0bd4
F Makefile.in 25791375ce9f4f5b57d4cab67f0d58d772c96451
F README 51f6a4e7408b34afa5bc1c0485f61b6a4efb6958
-F VERSION fb0fbad3b7a52736cc18ea5fcf1bc6dba7b2c40c
+F VERSION 2670c932365e633f8552540db172fac18bd09b3a
F configure 260d3be664b6d9b4d2d985e66b6dae1ef723c86e x
F configure.in 6940e3f88bf3d28a10c73b06ab99fd3a7e039a61
F doc/lemon.html e233a3e97a779c7a87e1bc4528c664a58e49dd47
F src/ex/sizes.tcl f54bad4a2ac567624be59131a6ee42d71b41a3d7
F src/expr.c 745383609b65d504a2cc04ac4d9389e9c8e2bc80
F src/insert.c 4bc1cab84f7805d560a1417734a532843e30b762
-F src/main.c d52a1c2a7a964acca87880ac925019c383b8e606
+F src/main.c fe5c26620c46770539056525d8a79e3afb6e75e8
F src/pager.h 889c5cf517ad30704e295540793c893ac843fd5f
F src/parse.y 1ba81d3b75f37ca868aa0ab990bb977fd41519eb
F src/printf.c af0dc65c293427272e1949c7807b1d88f10004fd
F src/select.c a6bfdaa92d4614e79bf18129283c5163faa291fc
F src/shell.c c1785b4af18192056adbe894f8626a7e7bdf47aa
F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e
-F src/sqlite.h.in f13156b85c51a6d7d06678bbe69554c90cde1fe2
+F src/sqlite.h.in 182336b2763d15d31ffd9ac1112e6ddd190c02e4
F src/sqliteInt.h 97e2dd488ab433e27eda6e26f4c84a9a2684785c
F src/table.c 5be76051a8ed6f6bfa641f4adc52529efa34fbf9
-F src/tclsqlite.c 82eda60c7ae5cd7b71023a55c5710a74713c313b
+F src/tclsqlite.c 8b30b01d9fb814a5a358dafd697de16d968cb73e
F src/tokenize.c 8fc3936eefad84f1fff19e0892ed0542eb9ac7b3
F src/update.c 8365b3922ea098330d1e20862d6e64911e4e03d0
F src/util.c aec315b834bad444c9e0e90efd9d2eaeeb37c90c
F test/copy.test b77a1214bd7756f2849d5c4fa6e715c0ff0c34eb
F test/dbbe.test a022fe2d983848f786e17ef1fc6809cfd37fb02c
F test/delete.test 50b9b1f06c843d591741dba7869433a105360dbf
-F test/expr.test 1e4822af0213734dd325521a6e25fe38f1fa7f9d
-F test/func.test 11c415efe9d435aa0136edd0b3cb11efe5c3ead7
+F test/expr.test e55eb507744f771b814fdbea14fddb69caa4538a
+F test/func.test ac3def2a673d1042750ae1a4ad1768bb7c7ae90b
F test/in.test ea48016c4fcc479d315932ae2b8568146686ffaf
F test/index.test b189ac11bf8d4fbcf87402f4028c25c8a6d91bb5
F test/insert.test dbd3bd189edb61fddbe66c236694ef23352429f1
F test/subselect.test bf8b251a92fb091973c1c469ce499dc9648a41d5
F test/table.test c1704fead1af27d67850a934d531848ce5bee4a7
F test/tclsqlite.test d2aa55926874783b2401f0146e839f773c6796e1
-F test/tester.tcl c77fd7a4fb1f3812e469be6229ee330baaffc911
+F test/tester.tcl dba25c97cc89f109a9350f12792f17b24202d65f
F test/trans.test 82556605d48f56ad4679e95478d70546a763f26a
F test/update.test 72c0c93310483b86dc904a992220c5b84c7ce100
F test/vacuum.test b95d8119a0a83dc6c4ac63888f8872f06199e065
F www/sqlite.tcl cb0d23d8f061a80543928755ec7775da6e4f362f
F www/tclsqlite.tcl 06f81c401f79a04f2c5ebfb97e7c176225c0aef2
F www/vdbe.tcl 0c8aaa529dd216ccbf7daaabd80985e413d5f9ad
-P b5f994feb44f76782279cdbb1654d340f63e8995
-R 49065187ae08404d71560bc6435e0230
+P 4b3ffa161a09653919a689336784a85b9548c249
+R 712a3306e2a2c79bccc911915e955880
U drh
-Z 13983b7b909cd6705720cd336bde6816
+Z bfdec300c92af1e06bfec59389035a75
-4b3ffa161a09653919a689336784a85b9548c249
\ No newline at end of file
+735d8b5c13b5e2602b37940377fced098be210c1
\ No newline at end of file
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
-** $Id: main.c,v 1.26 2001/04/05 15:57:13 drh Exp $
+** $Id: main.c,v 1.27 2001/04/06 16:13:43 drh Exp $
*/
#include "sqliteInt.h"
#include <unistd.h>
** following global constant always lets us know.
*/
#ifdef SQLITE_UTF8
-char sqlite_encoding[] = "UTF-8";
+const char sqlite_encoding[] = "UTF-8";
#else
-char sqlite_encoding[] = "iso8859";
+const char sqlite_encoding[] = "iso8859";
#endif
/*
** This header file defines the interface that the sqlite library
** presents to client programs.
**
-** @(#) $Id: sqlite.h.in,v 1.11 2001/04/05 15:57:13 drh Exp $
+** @(#) $Id: sqlite.h.in,v 1.12 2001/04/06 16:13:43 drh Exp $
*/
#ifndef _SQLITE_H_
#define _SQLITE_H_
** see. The character encoding makes a difference for the LIKE and GLOB
** operators and for the LENGTH() and SUBSTR() functions.
*/
-extern char sqlite_encoding[];
+extern const char sqlite_encoding[];
/*
** Each open sqlite database is represented by an instance of the
*************************************************************************
** A TCL Interface to SQLite
**
-** $Id: tclsqlite.c,v 1.15 2001/04/05 15:57:13 drh Exp $
+** $Id: tclsqlite.c,v 1.16 2001/04/06 16:13:43 drh Exp $
*/
#ifndef NO_TCL /* Omit this whole file if TCL is unavailable */
**
** The second argument is the name of the directory that contains
** the sqlite database that is to be accessed.
+**
+** For testing purposes, we also support the following:
+**
+** sqlite -encoding
+**
+** Return the encoding used by LIKE and GLOB operators. Choices
+** are UTF-8 and iso8859.
+**
+** sqlite -tcl-uses-utf
+**
+** Return "1" if compiled with a Tcl uses UTF-8. Return "0" if
+** not. Used by tests to make sure the library was compiled
+** correctly.
*/
static int DbMain(void *cd, Tcl_Interp *interp, int argc, char **argv){
int mode;
SqliteDb *p;
char *zErrMsg;
+ if( argc==2 ){
+ if( strcmp(argv[1],"-encoding")==0 ){
+ Tcl_AppendResult(interp,sqlite_encoding,0);
+ return TCL_OK;
+ }
+ if( strcmp(argv[1],"-tcl-uses-utf")==0 ){
+#ifdef TCL_UTF_MAX
+ Tcl_AppendResult(interp,"1",0);
+#else
+ Tcl_AppendResult(interp,"0",0);
+#endif
+ return TCL_OK;
+ }
+ }
if( argc!=3 && argc!=4 ){
Tcl_AppendResult(interp,"wrong # args: should be \"", argv[0],
" HANDLE FILENAME ?MODE?\"", 0);
*/
int Sqlite_Init(Tcl_Interp *interp){
Tcl_CreateCommand(interp, "sqlite", DbMain, 0, 0);
- Tcl_SetVar(interp,"sqlite_encoding",sqlite_encoding,TCL_GLOBAL_ONLY);
Tcl_PkgProvide(interp, "sqlite", "1.0");
return TCL_OK;
}
# This file implements regression tests for SQLite library. The
# focus of this file is testing expressions.
#
-# $Id: expr.test,v 1.12 2001/04/05 15:57:14 drh Exp $
+# $Id: expr.test,v 1.13 2001/04/06 16:13:43 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
# The following tests only work on versions of TCL that support
# Unicode and SQLite configured for UTF-8 support.
#
-if {"\u1234"!="u1234" && $::sqlite_encoding=="UTF-8"} {
+if {"\u1234"!="u1234" && [sqlite -encoding]=="UTF-8"} {
test_expr expr-5.13 "t1='a\u0080c', t2='A_C'" {t1 LIKE t2} 1
test_expr expr-5.14 "t1='a\u07FFc', t2='A_C'" {t1 LIKE t2} 1
test_expr expr-5.15 "t1='a\u0800c', t2='A_C'" {t1 LIKE t2} 1
# Theses tests are for when SQLite assumes iso8859 characters.
#
-if {$::sqlite_encoding=="iso8859"} {
+if {[sqlite -encoding]=="iso8859"} {
catch {encoding system iso8859-1}
test_expr expr-5.50 "t1='a\266c', t2='A_C'" {t1 LIKE t2} 1
test_expr expr-5.51 "t1='a\347', t2='A_'" {t1 LIKE t2} 1
# These tests only work on versions of TCL that support Unicode
#
-if {"\u1234"!="u1234" && $::sqlite_encoding=="UTF-8"} {
+if {"\u1234"!="u1234" && [sqlite -encoding]=="UTF-8"} {
test_expr expr-6.26 "t1='a\u0080c', t2='a?c'" {t1 GLOB t2} 1
test_expr expr-6.27 "t1='a\u07ffc', t2='a?c'" {t1 GLOB t2} 1
test_expr expr-6.28 "t1='a\u0800c', t2='a?c'" {t1 GLOB t2} 1
# Theses tests are for when SQLite assumes iso8859 characters.
#
-if {$::sqlite_encoding=="iso8859"} {
+if {[sqlite -encoding]=="iso8859"} {
catch {encoding system iso8859-1}
test_expr expr-6.50 "t1='a\266c', t2='a?c'" {t1 GLOB t2} 1
test_expr expr-6.51 "t1='a\266', t2='a?'" {t1 GLOB t2} 1
# This file implements regression tests for SQLite library. The
# focus of this file is testing built-in functions.
#
-# $Id: func.test,v 1.2 2001/04/05 15:57:14 drh Exp $
+# $Id: func.test,v 1.3 2001/04/06 16:13:43 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
# Only do the following tests if TCL has UTF-8 capabilities and
# the UTF-8 encoding is turned on in the SQLite library.
#
-if {$::sqlite_encoding=="UTF-8" && "\u1234"!="u1234"} {
+if {[sqlite -encoding]=="UTF-8" && "\u1234"!="u1234"} {
# Put some UTF-8 characters in the database
#
execsql {SELECT substr(t1,-4,3) FROM tbl1 ORDER BY t1}
} "ter ain i\u1234h TF-"
-} ;# End sqlite_encoding==UTF-8 and \u1234!=u1234
+} ;# End [sqlite -encoding]==UTF-8 and \u1234!=u1234
finish_test
# This file implements some common TCL routines used for regression
# testing the SQLite library
#
-# $Id: tester.tcl,v 1.13 2001/04/04 11:48:58 drh Exp $
+# $Id: tester.tcl,v 1.14 2001/04/06 16:13:43 drh Exp $
+
+# Make sure tclsqlite was compiled correctly. Abort now with an
+# error message if not.
+#
+if {[sqlite -tcl-uses-utf]} {
+ if {"\u1234"=="u1234"} {
+ puts stderr "***** BUILD PROBLEM *****"
+ puts stderr "$argv0 was linked against an older version"
+ puts stderr "of TCL that does not support Unicode, but uses a header"
+ puts stderr "file (\"tcl.h\") from a new TCL version that does support"
+ puts stderr "Unicode. This combination causes internal errors."
+ puts stderr "Recompile using a TCL library and header file that match"
+ puts stderr "and try again.\n**************************"
+ exit 1
+ }
+} else {
+ if {"\u1234"!="u1234"} {
+ puts stderr "***** BUILD PROBLEM *****"
+ puts stderr "$argv0 was linked against an newer version"
+ puts stderr "of TCL that supports Unicode, but uses a header file"
+ puts stderr "(\"tcl.h\") from a old TCL version that does not support"
+ puts stderr "Unicode. This combination causes internal errors."
+ puts stderr "Recompile using a TCL library and header file that match"
+ puts stderr "and try again.\n**************************"
+ exit 1
+ }
+}
# Create a test database
#