diff --git a/manifest b/manifest index 1eb554fbc4..a58a3c5e26 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Change\sthe\sname\sof\sthe\sinclude\sfile\sto\s"sqlite3.h".\s\sThe\snames\sof\sthe\sshell\ncommand\sand\sstatic\slibrary\sbecome\s"sqlite3"\sand\s"libsqlite3.a".\s(CVS\s1510) -D 2004-05-31T18:23:08 +C Change\sall\sSQLITE3\spreprocessor\smacros\sto\sSQLITE.\s\sDocumentation\supdates.\s(CVS\s1511) +D 2004-05-31T18:51:58 F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906 F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd @@ -26,17 +26,17 @@ F src/attach.c c315c58cb16fd6e913b3bfa6412aedecb4567fa5 F src/auth.c 5c2f0bea4729c98c2be3b69d6b466fc51448fe79 F src/btree.c 652efb14a17ba26759f73ca167f7d1e5d6651eb3 F src/btree.h 1e2beb41b4b4a4fc41da67cb4692614938066f2f -F src/build.c 2f791d1d52778b9a2ec251465215ca480a966f36 -F src/date.c 0eb922af5c5f5e2455f8dc2f98023ed3e04a857e +F src/build.c 13985630bf6b3db4c7e7d4c9476bb94495b7d5fa +F src/date.c 8e6fa3173386fb29fdef012ee08a853c1e9908b2 F src/delete.c 72f8febf6170cda830f509c8f9dffbed3df3596c F src/encode.c a876af473d1d636faa3dca51c7571f2e007eea37 F src/expr.c 5145de7d25a4b960a4afdb754a9e88b60cce0405 -F src/func.c 1fe0763675eb38b6e3992d3edfbec2271798b658 +F src/func.c 3b87e2e8b9aaa3a6d36b2c9616e7f404be38a667 F src/hash.c 440c2f8cb373ee1b4e13a0988489c7cd95d55b6f F src/hash.h 762d95f1e567664d1eafc1687de755626be962fb F src/insert.c 4268d9e3959cc845ea243fb4ec7507269404dad9 F src/legacy.c ad23746f15f67e34577621b1875f639c94839e1f -F src/main.c 9bb9578c15db0205616fcf474885b83aba53d910 +F src/main.c b4aed6c790ecae05a345c684e178aa88dccd274b F src/md5.c 4302e84ae516c616bb079c4e6d038c0addb33481 F src/os.h ab42f4a7c4c716f26b988e759b6e12085a3bfc67 F src/os_common.h 744286a27de55c52f1b18921e8d17abbf7fafc0f @@ -54,27 +54,27 @@ F src/printf.c ef750e8e2398ca7e8b58be991075f08c6a7f0e53 F src/random.c eff68e3f257e05e81eae6c4d50a51eb88beb4ff3 F src/select.c 0297717eb7331604687c2e29c147d3a311359df1 F src/shell.c b71bdc3586c1c254941a236f3461615fd032eab1 -F src/sqlite.h.in edc6408c7f53c2104f781a76b926036e17018ec9 -F src/sqliteInt.h de20432992233b394a7fc80458f03d7cb7138bc5 +F src/sqlite.h.in 88b6f09398c9e5b4d2dd7420597e0d6490a81b1f +F src/sqliteInt.h 950104baea45ee81c9113e3c41b5e9f30def9eaa F src/table.c af14284fa36c8d41f6829e3f2819dce07d3e2de2 -F src/tclsqlite.c b314f12760547e4ef090e055f1298f70627450d3 -F src/test1.c 32934478366531503d634968db414df17cb38238 +F src/tclsqlite.c 8146beb4ade50cd83d3bf7a41c8ebddb9840e967 +F src/test1.c 187992df6d835d1d713dd154c6ea4a6929302378 F src/test2.c 6195a1ca2c8d0d2d93644e86da3289b403486872 F src/test3.c 86117b74ec7353d76f5cd85c144c7cda23a7e11b F src/test4.c 34848a9fd31aa65857b20a8bfc03aff77d8c3426 -F src/test5.c 9a1f15133f6955f067c5246e564723b5f23ff221 -F src/tokenize.c 50a87c7414de54a008427c9fed22e4e86efb6844 +F src/test5.c a894fbfa8a7dcdc2cbc0c38c11149cc5c8252cea +F src/tokenize.c b68758abaccd8882c48209b7a54db975f17d498a F src/trigger.c 04b2c310d0d056b213609cab6df5fff03d5eaf88 F src/update.c 259f06e7b22c684b2d3dda54a18185892d6e9573 -F src/utf.c f8604999a54483533ac20a63879074f01b0df384 +F src/utf.c c18b4e66bd13872b7199444addaa04785ff1b80a F src/util.c 3b647719c0bece41491300b605cff96a7a26f03a F src/vacuum.c c91acc316127411980982938d050b299d42b81ef -F src/vdbe.c fdb990a681d39872047fec65fffaedb7225e7420 +F src/vdbe.c bff63e4fe25a1378bfb6e577fbba3291a4e3625a F src/vdbe.h e73f890e0f2a6c42b183d7d6937947930fe4fdeb -F src/vdbeInt.h 51d37798ba7bc5f2f767db0e3dbae31156ae9ff3 -F src/vdbeapi.c d43d36efeaf709bae71b743aaaee430e0b29cd1e -F src/vdbeaux.c a6af136bc6928eb6656d0198ae1dfcc313f37c23 -F src/vdbemem.c 627d714c347f6af8092cc48ae1c06fd774a1ad9c +F src/vdbeInt.h 5d357541db688b21ce05a88b3ea4d9a1fb09f232 +F src/vdbeapi.c 77d2e681a992ef189032cd9c1b7bf922f01ebe3e +F src/vdbeaux.c a422970213a2fe9b0048df756fc81f20939eeada +F src/vdbemem.c 5d029d83bc60eaf9c45837fcbc0b03348ec95d7a F src/where.c 444a7c3a8b1eb7bba072e489af628555d21d92a4 F test/all.test 569a92a8ee88f5300c057cc4a8f50fbbc69a3242 F test/attach.test 5f7e21fce56e3055de15a86c58fa3d8ab74f5243 @@ -184,14 +184,14 @@ F www/arch2.fig 613b5ac63511109064c2f93c5754ee662219937d F www/arch2.gif 49c6bb36160f03ca2b89eaa5bfb1f560c7d68ee7 F www/audit.tcl 90e09d580f79c7efec0c7d6f447b7ec5c2dce5c0 F www/c_interface.tcl 2176519fc2bd2d2cf6fe74fd806fc2d8362de2c8 -F www/capi3.tcl 79fec496d95e87420c40e4058f2685a6df2f93c7 +F www/capi3.tcl 2825f418f5c5d8376d0e83474796363db1d9e875 F www/changes.tcl 9d562205db584d26b358ebe93fb58039feefd1b8 F www/common.tcl f786e6be86fb2627ceb30e770e9efa83b9c67a3a F www/conflict.tcl fb8a2ba83746c7fdfd9e52fa7f6aaf5c422b8246 F www/copyright-release.html 294e011760c439c44951a6bfecd4c81a1ae359e8 F www/copyright-release.pdf cfca3558fc97095e57c6117d08f1f5b80d95125a F www/copyright.tcl 82c9670c7ddb0311912ab7fe24703f33c531066c -F www/datatype3.tcl 3dcc0baaccc7d3bc28e12a3acc45f5ab7f723ca2 +F www/datatype3.tcl ddfc758410109cb6a9bd617836b9334a7ddbd929 F www/datatypes.tcl 566004b81c36877397ddbe6e1907aae6065f6b41 F www/docs.tcl 5ea8a84edd33030879725fca85905899c89c7075 F www/download.tcl 8c84f15695c92cb01486930055fdf5192995f474 @@ -212,7 +212,7 @@ F www/support.tcl 67682848d6ddd283370451dc3da2e56cded9fc9a F www/tclsqlite.tcl 19191cf2a1010eaeff74c51d83fd5f5a4d899075 F www/vdbe.tcl 59288db1ac5c0616296b26dce071c36cb611dfe9 F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4 -P 2005bfdad03ac2aa70a82ba7ff9b2f469d129367 -R 783e591d80614a85072d6745be4be04f +P 4c37b6d2b78e88e2a9dfed4d764caeb0f626f92e +R 89ae3d2c6e5f559c1b737a98efcaeabb U drh -Z bb28014f004f9d7fe5e7794b01035f95 +Z b0d4078bb2a2022230156e75979ba4b4 diff --git a/manifest.uuid b/manifest.uuid index 977601f304..526bff5b6d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -4c37b6d2b78e88e2a9dfed4d764caeb0f626f92e \ No newline at end of file +adf7e29ff60dc559f64832fadb09f0b9decc0e76 \ No newline at end of file diff --git a/src/build.c b/src/build.c index 74e0a8a900..48cc1f5968 100644 --- a/src/build.c +++ b/src/build.c @@ -23,7 +23,7 @@ ** ROLLBACK ** PRAGMA ** -** $Id: build.c,v 1.204 2004/05/31 11:51:45 danielk1977 Exp $ +** $Id: build.c,v 1.205 2004/05/31 18:51:58 drh Exp $ */ #include "sqliteInt.h" #include @@ -886,6 +886,9 @@ char sqlite3AffinityType(const char *zType, int nType){ {"BLOB", 4, SQLITE_AFF_NONE}, }; + if( nType==0 ){ + return SQLITE_AFF_NONE; + } for(i=0; i #include @@ -42,9 +42,9 @@ static void minmaxFunc( mask = (int)sqlite3_user_data(context); assert( mask==-1 || mask==0 ); iBest = 0; - if( sqlite3_value_type(argv[0])==SQLITE3_NULL ) return; + if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return; for(i=1; i=0 ){ iBest = i; } @@ -62,11 +62,11 @@ static void typeofFunc( ){ const char *z = 0; switch( sqlite3_value_type(argv[0]) ){ - case SQLITE3_NULL: z = "null"; break; - case SQLITE3_INTEGER: z = "integer"; break; - case SQLITE3_TEXT: z = "text"; break; - case SQLITE3_FLOAT: z = "real"; break; - case SQLITE3_BLOB: z = "blob"; break; + case SQLITE_NULL: z = "null"; break; + case SQLITE_INTEGER: z = "integer"; break; + case SQLITE_TEXT: z = "text"; break; + case SQLITE_FLOAT: z = "real"; break; + case SQLITE_BLOB: z = "blob"; break; } sqlite3_result_text(context, z, -1, 0); } @@ -83,13 +83,13 @@ static void lengthFunc( assert( argc==1 ); switch( sqlite3_value_type(argv[0]) ){ - case SQLITE3_BLOB: - case SQLITE3_INTEGER: - case SQLITE3_FLOAT: { + case SQLITE_BLOB: + case SQLITE_INTEGER: + case SQLITE_FLOAT: { sqlite3_result_int(context, sqlite3_value_bytes(argv[0])); break; } - case SQLITE3_TEXT: { + case SQLITE_TEXT: { const char *z = sqlite3_value_text(argv[0]); for(len=0; *z; z++){ if( (0xc0&*z)!=0x80 ) len++; } sqlite3_result_int(context, len); @@ -108,13 +108,13 @@ static void lengthFunc( static void absFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ assert( argc==1 ); switch( sqlite3_value_type(argv[0]) ){ - case SQLITE3_INTEGER: { + case SQLITE_INTEGER: { i64 iVal = sqlite3_value_int64(argv[0]); if( iVal<0 ) iVal = iVal * -1; sqlite3_result_int64(context, iVal); break; } - case SQLITE3_NULL: { + case SQLITE_NULL: { sqlite3_result_null(context); break; } @@ -179,12 +179,12 @@ static void roundFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ char zBuf[100]; assert( argc==1 || argc==2 ); if( argc==2 ){ - if( SQLITE3_NULL==sqlite3_value_type(argv[1]) ) return; + if( SQLITE_NULL==sqlite3_value_type(argv[1]) ) return; n = sqlite3_value_int(argv[1]); if( n>30 ) n = 30; if( n<0 ) n = 0; } - if( SQLITE3_NULL==sqlite3_value_type(argv[0]) ) return; + if( SQLITE_NULL==sqlite3_value_type(argv[0]) ) return; r = sqlite3_value_double(argv[0]); sprintf(zBuf,"%.*f",n,r); sqlite3_result_text(context, zBuf, -1, 1); @@ -196,7 +196,7 @@ static void roundFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ static void upperFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ char *z; int i; - if( argc<1 || SQLITE3_NULL==sqlite3_value_type(argv[0]) ) return; + if( argc<1 || SQLITE_NULL==sqlite3_value_type(argv[0]) ) return; z = sqliteMalloc(sqlite3_value_bytes(argv[0])+1); if( z==0 ) return; strcpy(z, sqlite3_value_text(argv[0])); @@ -209,7 +209,7 @@ static void upperFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ static void lowerFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ char *z; int i; - if( argc<1 || SQLITE3_NULL==sqlite3_value_type(argv[0]) ) return; + if( argc<1 || SQLITE_NULL==sqlite3_value_type(argv[0]) ) return; z = sqliteMalloc(sqlite3_value_bytes(argv[0])+1); if( z==0 ) return; strcpy(z, sqlite3_value_text(argv[0])); @@ -232,7 +232,7 @@ static void ifnullFunc( ){ int i; for(i=0; isum += sqlite3_value_double(argv[0]); p->cnt++; } @@ -575,7 +575,7 @@ struct CountCtx { static void countStep(sqlite3_context *context, int argc, sqlite3_value **argv){ CountCtx *p; p = sqlite3_aggregate_context(context, sizeof(*p)); - if( (argc==0 || SQLITE3_NULL!=sqlite3_value_type(argv[0])) && p ){ + if( (argc==0 || SQLITE_NULL!=sqlite3_value_type(argv[0])) && p ){ p->n++; } } @@ -604,7 +604,7 @@ static void minmaxStep(sqlite3_context *context, int argc, sqlite3_value **argv) Mem *pArg = (Mem *)argv[0]; Mem *pBest = (Mem *)sqlite3_aggregate_context(context, sizeof(*pBest)); - if( SQLITE3_NULL==sqlite3_value_type(argv[0]) ) return; + if( SQLITE_NULL==sqlite3_value_type(argv[0]) ) return; if( pBest->flags ){ /* This step function is used for both the min() and max() aggregates, diff --git a/src/main.c b/src/main.c index 9909206064..02a4391412 100644 --- a/src/main.c +++ b/src/main.c @@ -14,7 +14,7 @@ ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** -** $Id: main.c,v 1.198 2004/05/31 08:55:34 danielk1977 Exp $ +** $Id: main.c,v 1.199 2004/05/31 18:51:58 drh Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -30,8 +30,8 @@ typedef struct { } InitData; /* -** The following constant value is used by the SQLITE3_BIGENDIAN and -** SQLITE3_LITTLEENDIAN macros. +** The following constant value is used by the SQLITE_BIGENDIAN and +** SQLITE_LITTLEENDIAN macros. */ const int sqlite3one = 1; @@ -692,7 +692,7 @@ int sqlite3_create_function16( ){ int rc; char *zFunctionName8; - zFunctionName8 = sqlite3utf16to8(zFunctionName, -1, SQLITE3_BIGENDIAN); + zFunctionName8 = sqlite3utf16to8(zFunctionName, -1, SQLITE_BIGENDIAN); if( !zFunctionName8 ){ return SQLITE_NOMEM; } @@ -819,7 +819,7 @@ const void *sqlite3_errmsg16(sqlite3 *db){ }; static char *outOfMemLe = &outOfMemBe[1]; - if( SQLITE3_BIGENDIAN ){ + if( SQLITE_BIGENDIAN ){ return (void *)outOfMemBe; }else{ return (void *)outOfMemLe; @@ -827,7 +827,7 @@ const void *sqlite3_errmsg16(sqlite3 *db){ } if( !db->zErrMsg16 ){ char const *zErr8 = sqlite3_errmsg(db); - if( SQLITE3_BIGENDIAN ){ + if( SQLITE_BIGENDIAN ){ db->zErrMsg16 = sqlite3utf8to16be(zErr8, -1); }else{ db->zErrMsg16 = sqlite3utf8to16le(zErr8, -1); @@ -960,7 +960,7 @@ int sqlite3_prepare16( char const *zTail8 = 0; int rc; - zSql8 = sqlite3utf16to8(zSql, nBytes, SQLITE3_BIGENDIAN); + zSql8 = sqlite3utf16to8(zSql, nBytes, SQLITE_BIGENDIAN); if( !zSql8 ){ sqlite3Error(db, SQLITE_NOMEM, 0); return SQLITE_NOMEM; @@ -1090,7 +1090,7 @@ int sqlite3_open16( assert( ppDb ); - zFilename8 = sqlite3utf16to8(zFilename, -1, SQLITE3_BIGENDIAN); + zFilename8 = sqlite3utf16to8(zFilename, -1, SQLITE_BIGENDIAN); if( !zFilename8 ){ *ppDb = 0; return SQLITE_NOMEM; @@ -1098,7 +1098,7 @@ int sqlite3_open16( /* FIX ME: Also need to translate the option strings */ - if( SQLITE3_BIGENDIAN ){ + if( SQLITE_BIGENDIAN ){ rc = openDatabase(zFilename8, ppDb, options, TEXT_Utf16be); }else{ rc = openDatabase(zFilename8, ppDb, options, TEXT_Utf16le); diff --git a/src/sqlite.h.in b/src/sqlite.h.in index 1131e4cfbb..9edb00456f 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -12,7 +12,7 @@ ** This header file defines the interface that the SQLite library ** presents to client programs. ** -** @(#) $Id: sqlite.h.in,v 1.85 2004/05/27 23:56:16 danielk1977 Exp $ +** @(#) $Id: sqlite.h.in,v 1.86 2004/05/31 18:51:58 drh Exp $ */ #ifndef _SQLITE_H_ #define _SQLITE_H_ @@ -768,11 +768,11 @@ int sqlite3_data_count(sqlite3_stmt *pStmt); ** Values are stored in the database in one of the following fundamental ** types. */ -#define SQLITE3_INTEGER 1 -#define SQLITE3_FLOAT 2 -#define SQLITE3_TEXT 3 -#define SQLITE3_BLOB 4 -#define SQLITE3_NULL 5 +#define SQLITE_INTEGER 1 +#define SQLITE_FLOAT 2 +#define SQLITE_TEXT 3 +#define SQLITE_BLOB 4 +#define SQLITE_NULL 5 /* ** The next group of routines returns information about the information diff --git a/src/sqliteInt.h b/src/sqliteInt.h index c0ef83e150..da78ae8282 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -11,7 +11,7 @@ ************************************************************************* ** Internal interface definitions for SQLite. ** -** @(#) $Id: sqliteInt.h,v 1.264 2004/05/31 18:23:09 drh Exp $ +** @(#) $Id: sqliteInt.h,v 1.265 2004/05/31 18:51:58 drh Exp $ */ #include "config.h" #include "sqlite3.h" @@ -134,8 +134,8 @@ typedef unsigned INTPTR_TYPE uptr; /* Big enough to hold a pointer */ ** evaluated at runtime. */ extern const int sqlite3one; -#define SQLITE3_BIGENDIAN (*(char *)(&sqlite3one)==0) -#define SQLITE3_LITTLEENDIAN (*(char *)(&sqlite3one)==1) +#define SQLITE_BIGENDIAN (*(char *)(&sqlite3one)==0) +#define SQLITE_LITTLEENDIAN (*(char *)(&sqlite3one)==1) /* ** Defer sourcing vdbe.h until after the "u8" typedef is defined. @@ -324,7 +324,7 @@ struct Db { #define TEXT_Utf8 1 #define TEXT_Utf16le 2 #define TEXT_Utf16be 3 -#define TEXT_Utf16 (SQLITE3_BIGENDIAN?TEXT_Utf16be:TEXT_Utf16le) +#define TEXT_Utf16 (SQLITE_BIGENDIAN?TEXT_Utf16be:TEXT_Utf16le) /* ** Each database is an instance of the following structure. diff --git a/src/tclsqlite.c b/src/tclsqlite.c index c446710a73..cfdb4da66b 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -11,7 +11,7 @@ ************************************************************************* ** A TCL Interface to SQLite ** -** $Id: tclsqlite.c,v 1.76 2004/05/29 02:37:19 danielk1977 Exp $ +** $Id: tclsqlite.c,v 1.77 2004/05/31 18:51:58 drh Exp $ */ #ifndef NO_TCL /* Omit this whole file if TCL is unavailable */ @@ -213,7 +213,7 @@ static void tclSqlFunc(sqlite3_context *context, int argc, sqlite3_value **argv) Tcl_DStringInit(&cmd); Tcl_DStringAppend(&cmd, p->zScript, -1); for(i=0; in++; } } @@ -1399,19 +1399,19 @@ static int test_column_type( tp = sqlite3_column_type(pStmt, col); switch( tp ){ - case SQLITE3_INTEGER: + case SQLITE_INTEGER: Tcl_SetResult(interp, "INTEGER", TCL_STATIC); break; - case SQLITE3_NULL: + case SQLITE_NULL: Tcl_SetResult(interp, "NULL", TCL_STATIC); break; - case SQLITE3_FLOAT: + case SQLITE_FLOAT: Tcl_SetResult(interp, "FLOAT", TCL_STATIC); break; - case SQLITE3_TEXT: + case SQLITE_TEXT: Tcl_SetResult(interp, "TEXT", TCL_STATIC); break; - case SQLITE3_BLOB: + case SQLITE_BLOB: Tcl_SetResult(interp, "BLOB", TCL_STATIC); break; default: diff --git a/src/test5.c b/src/test5.c index f42840169c..4409e94475 100644 --- a/src/test5.c +++ b/src/test5.c @@ -15,10 +15,10 @@ ** is used for testing the SQLite routines for converting between ** the various supported unicode encodings. ** -** $Id: test5.c,v 1.5 2004/05/22 03:05:34 danielk1977 Exp $ +** $Id: test5.c,v 1.6 2004/05/31 18:51:58 drh Exp $ */ #include "sqliteInt.h" -#include "os.h" /* to get SQLITE3_BIGENDIAN */ +#include "os.h" /* to get SQLITE_BIGENDIAN */ #include "tcl.h" #include #include @@ -167,7 +167,7 @@ static int sqlite_utf16to8( } in = Tcl_GetByteArrayFromObj(objv[1], 0); - out = sqlite3utf16to8(in, -1, SQLITE3_BIGENDIAN); + out = sqlite3utf16to8(in, -1, SQLITE_BIGENDIAN); res = Tcl_NewByteArrayObj(out, strlen(out)+1); sqliteFree(out); @@ -221,6 +221,3 @@ int Sqlitetest5_Init(Tcl_Interp *interp){ return TCL_OK; } - - - diff --git a/src/tokenize.c b/src/tokenize.c index 35ee9251f8..37d7b9f539 100644 --- a/src/tokenize.c +++ b/src/tokenize.c @@ -15,7 +15,7 @@ ** individual tokens and sends those tokens one-by-one over to the ** parser for analysis. ** -** $Id: tokenize.c,v 1.74 2004/05/27 23:56:16 danielk1977 Exp $ +** $Id: tokenize.c,v 1.75 2004/05/31 18:51:58 drh Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -702,10 +702,9 @@ int sqlite3_complete(const char *zSql){ */ int sqlite3_complete16(const void *zSql){ int rc; - char *zSql8 = sqlite3utf16to8(zSql, -1, SQLITE3_BIGENDIAN); + char *zSql8 = sqlite3utf16to8(zSql, -1, SQLITE_BIGENDIAN); if( !zSql8 ) return 0; rc = sqlite3_complete(zSql8); sqliteFree(zSql8); return rc; } - diff --git a/src/utf.c b/src/utf.c index 72944c8120..5b5507823a 100644 --- a/src/utf.c +++ b/src/utf.c @@ -12,7 +12,7 @@ ** This file contains routines used to translate between UTF-8, ** UTF-16, UTF-16BE, and UTF-16LE. ** -** $Id: utf.c,v 1.14 2004/05/29 02:44:02 danielk1977 Exp $ +** $Id: utf.c,v 1.15 2004/05/31 18:51:58 drh Exp $ ** ** Notes on UTF-8: ** @@ -62,9 +62,9 @@ struct UtfString { /* TODO: Implement this macro in os.h. It should be 1 on big-endian ** machines, and 0 on little-endian. */ -#define SQLITE3_NATIVE_BIGENDIAN 0 +#define SQLITE_NATIVE_BIGENDIAN 0 -#if SQLITE3_NATIVE_BIGENDIAN == 1 +#if SQLITE_NATIVE_BIGENDIAN == 1 #define BOM_BIGENDIAN 0x0000FFFE #define BOM_LITTLEENDIAN 0x0000FEFF #else @@ -523,7 +523,7 @@ static void utf16to16(void *pData, int N, int big_endian){ inout.n = sqlite3utf16ByteLen(inout.pZ, -1); } - if( readUtf16Bom(&inout, SQLITE3_BIGENDIAN)!=big_endian ){ + if( readUtf16Bom(&inout, SQLITE_BIGENDIAN)!=big_endian ){ /* swab(&inout.pZ[inout.c], inout.pZ, inout.n-inout.c); */ int i; for(i=0; i<(inout.n-inout.c); i += 2){ diff --git a/src/vdbe.c b/src/vdbe.c index 390924b5d6..1698584fe0 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -43,7 +43,7 @@ ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. ** -** $Id: vdbe.c,v 1.352 2004/05/31 10:01:35 danielk1977 Exp $ +** $Id: vdbe.c,v 1.353 2004/05/31 18:51:58 drh Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -138,18 +138,18 @@ int sqlite3_interrupt_count = 0; static void _storeTypeInfo(Mem *pMem){ int flags = pMem->flags; if( flags & MEM_Null ){ - pMem->type = SQLITE3_NULL; + pMem->type = SQLITE_NULL; } else if( flags & MEM_Int ){ - pMem->type = SQLITE3_INTEGER; + pMem->type = SQLITE_INTEGER; } else if( flags & MEM_Real ){ - pMem->type = SQLITE3_FLOAT; + pMem->type = SQLITE_FLOAT; } else if( flags & MEM_Str ){ - pMem->type = SQLITE3_TEXT; + pMem->type = SQLITE_TEXT; }else{ - pMem->type = SQLITE3_BLOB; + pMem->type = SQLITE_BLOB; } } diff --git a/src/vdbeInt.h b/src/vdbeInt.h index a7f0dbf752..a0a57dcc2b 100644 --- a/src/vdbeInt.h +++ b/src/vdbeInt.h @@ -124,8 +124,8 @@ struct Sorter { ** ** Each value has a manifest type. The manifest type of the value stored ** in a Mem struct is returned by the MemType(Mem*) macro. The type is -** one of SQLITE3_NULL, SQLITE3_INTEGER, SQLITE3_REAL, SQLITE3_TEXT or -** SQLITE3_BLOB. +** one of SQLITE_NULL, SQLITE_INTEGER, SQLITE_REAL, SQLITE_TEXT or +** SQLITE_BLOB. */ struct Mem { i64 i; /* Integer value */ diff --git a/src/vdbeapi.c b/src/vdbeapi.c index 56388fd715..6c685985ec 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -497,7 +497,7 @@ int sqlite3_bind_text16( zData = (void *)(((u8 *)zData) + 2); nData -= 2; }else{ - txt_enc = SQLITE3_BIGENDIAN?TEXT_Utf16be:TEXT_Utf16le; + txt_enc = SQLITE_BIGENDIAN?TEXT_Utf16be:TEXT_Utf16le; } rc = sqlite3VdbeMemSetStr(pVar, zData, nData, txt_enc, eCopy); if( rc ){ diff --git a/src/vdbeaux.c b/src/vdbeaux.c index ad4207b35e..20e2016c3e 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -571,30 +571,30 @@ int sqlite3VdbeList( Op *pOp = &p->aOp[i]; Mem *pMem = p->aStack; pMem->flags = MEM_Int; - pMem->type = SQLITE3_INTEGER; + pMem->type = SQLITE_INTEGER; pMem->i = i; /* Program counter */ pMem++; pMem->flags = MEM_Static|MEM_Str|MEM_Term; pMem->z = sqlite3OpcodeNames[pOp->opcode]; /* Opcode */ pMem->n = strlen(pMem->z); - pMem->type = SQLITE3_TEXT; + pMem->type = SQLITE_TEXT; pMem->enc = TEXT_Utf8; pMem++; pMem->flags = MEM_Int; pMem->i = pOp->p1; /* P1 */ - pMem->type = SQLITE3_INTEGER; + pMem->type = SQLITE_INTEGER; pMem++; pMem->flags = MEM_Int; pMem->i = pOp->p2; /* P2 */ - pMem->type = SQLITE3_INTEGER; + pMem->type = SQLITE_INTEGER; pMem++; pMem->flags = MEM_Short|MEM_Str|MEM_Term; /* P3 */ pMem->z = displayP3(pOp, pMem->zShort, sizeof(pMem->zShort)); - pMem->type = SQLITE3_TEXT; + pMem->type = SQLITE_TEXT; pMem->enc = TEXT_Utf8; p->nResColumn = 5; diff --git a/src/vdbemem.c b/src/vdbemem.c index fbc3ef7b71..eaa3b7d59b 100644 --- a/src/vdbemem.c +++ b/src/vdbemem.c @@ -179,7 +179,7 @@ int sqlite3VdbeMemStringify(Mem *pMem, int enc){ ** FIX ME: It would be better if sqlite3_snprintf() could do UTF-16. */ u8 *z = pMem->zShort; - if( fg & MEM_Real || (pMem->type==SQLITE3_FLOAT) ){ + if( fg & MEM_Real || (pMem->type==SQLITE_FLOAT) ){ sqlite3_snprintf(NBFS, z, "%.15g", pMem->r); }else{ assert( fg & MEM_Int ); @@ -236,7 +236,7 @@ int sqlite3VdbeMemIntegerify(Mem *pMem){ int sqlite3VdbeMemRealify(Mem *pMem){ if( pMem->flags & MEM_Real ){ /* Do nothing */ - }else if( (pMem->flags & MEM_Int) && pMem->type!=SQLITE3_TEXT ){ + }else if( (pMem->flags & MEM_Int) && pMem->type!=SQLITE_TEXT ){ pMem->r = pMem->i; }else if( pMem->flags & (MEM_Str|MEM_Blob) ){ if( sqlite3VdbeChangeEncoding(pMem, TEXT_Utf8) @@ -258,7 +258,7 @@ int sqlite3VdbeMemRealify(Mem *pMem){ void sqlite3VdbeMemSetNull(Mem *pMem){ releaseMem(pMem); pMem->flags = MEM_Null; - pMem->type = SQLITE3_NULL; + pMem->type = SQLITE_NULL; } /* @@ -269,7 +269,7 @@ void sqlite3VdbeMemSetInt64(Mem *pMem, i64 val){ releaseMem(pMem); pMem->i = val; pMem->flags = MEM_Int; - pMem->type = SQLITE3_INTEGER; + pMem->type = SQLITE_INTEGER; } /* @@ -280,7 +280,7 @@ void sqlite3VdbeMemSetDouble(Mem *pMem, double val){ releaseMem(pMem); pMem->r = val; pMem->flags = MEM_Real; - pMem->type = SQLITE3_FLOAT; + pMem->type = SQLITE_FLOAT; } /* @@ -310,7 +310,7 @@ int sqlite3VdbeMemSetStr( releaseMem(pMem); if( !z ){ pMem->flags = MEM_Null; - pMem->type = SQLITE3_NULL; + pMem->type = SQLITE_NULL; return SQLITE_OK; } @@ -321,7 +321,7 @@ int sqlite3VdbeMemSetStr( pMem->flags = MEM_Static; } pMem->enc = enc; - pMem->type = enc==0 ? SQLITE3_BLOB : SQLITE3_TEXT; + pMem->type = enc==0 ? SQLITE_BLOB : SQLITE_TEXT; pMem->n = n; switch( enc ){ case 0: @@ -491,7 +491,7 @@ int sqlite3VdbeMemFromBtree( } pMem->z = zData; pMem->enc = 0; - pMem->type = SQLITE3_BLOB; + pMem->type = SQLITE_BLOB; if( key ){ rc = sqlite3BtreeKey(pCur, offset, amt, zData); diff --git a/www/capi3.tcl b/www/capi3.tcl index 8407c0dd75..4a6546af50 100644 --- a/www/capi3.tcl +++ b/www/capi3.tcl @@ -1,4 +1,4 @@ -set rcsid {$Id: capi3.tcl,v 1.1 2004/05/31 18:22:26 drh Exp $} +set rcsid {$Id: capi3.tcl,v 1.2 2004/05/31 18:51:59 drh Exp $} source common.tcl header {C/C++ Interface For SQLite Version 3} puts { @@ -89,6 +89,40 @@ sqlite3_errmsg() except that it returns the error message represented as UTF-16 in host native byte order.

+

+The error codes for SQLite version 3 are unchanged from version2. +They are as follows: +

+ +
+#define SQLITE_OK           0   /* Successful result */
+#define SQLITE_ERROR        1   /* SQL error or missing database */
+#define SQLITE_INTERNAL     2   /* An internal logic error in SQLite */
+#define SQLITE_PERM         3   /* Access permission denied */
+#define SQLITE_ABORT        4   /* Callback routine requested an abort */
+#define SQLITE_BUSY         5   /* The database file is locked */
+#define SQLITE_LOCKED       6   /* A table in the database is locked */
+#define SQLITE_NOMEM        7   /* A malloc() failed */
+#define SQLITE_READONLY     8   /* Attempt to write a readonly database */
+#define SQLITE_INTERRUPT    9   /* Operation terminated by sqlite_interrupt() */
+#define SQLITE_IOERR       10   /* Some kind of disk I/O error occurred */
+#define SQLITE_CORRUPT     11   /* The database disk image is malformed */
+#define SQLITE_NOTFOUND    12   /* (Internal Only) Table or record not found */
+#define SQLITE_FULL        13   /* Insertion failed because database is full */
+#define SQLITE_CANTOPEN    14   /* Unable to open the database file */
+#define SQLITE_PROTOCOL    15   /* Database lock protocol error */
+#define SQLITE_EMPTY       16   /* (Internal Only) Database table is empty */
+#define SQLITE_SCHEMA      17   /* The database schema changed */
+#define SQLITE_TOOBIG      18   /* Too much data for one row of a table */
+#define SQLITE_CONSTRAINT  19   /* Abort due to contraint violation */
+#define SQLITE_MISMATCH    20   /* Data type mismatch */
+#define SQLITE_MISUSE      21   /* Library used incorrectly */
+#define SQLITE_NOLFS       22   /* Uses OS features not supported on host */
+#define SQLITE_AUTH        23   /* Authorization denied */
+#define SQLITE_ROW         100  /* sqlite_step() has another row ready */
+#define SQLITE_DONE        101  /* sqlite_step() has finished executing */
+
+

2.2 Executing SQL statements

@@ -193,11 +227,11 @@ of these:
 

-   #define SQLITE3_INTEGER  1
-   #define SQLITE3_FLOAT    2
-   #define SQLITE3_TEXT     3
-   #define SQLITE3_BLOB     4
-   #define SQLITE3_NULL     5
+   #define SQLITE_INTEGER  1
+   #define SQLITE_FLOAT    2
+   #define SQLITE_TEXT     3
+   #define SQLITE_BLOB     4
+   #define SQLITE_NULL     5
 

diff --git a/www/datatype3.tcl b/www/datatype3.tcl index 637199c127..260f5064fb 100644 --- a/www/datatype3.tcl +++ b/www/datatype3.tcl @@ -1,4 +1,4 @@ -set rcsid {$Id: datatype3.tcl,v 1.1 2004/05/31 18:22:26 drh Exp $} +set rcsid {$Id: datatype3.tcl,v 1.2 2004/05/31 18:51:59 drh Exp $} source common.tcl header {Datatypes In SQLite Version 3} puts { @@ -123,8 +123,9 @@ of the column, according to the following rules:

column has TEXT affinity. Notice that the type VARCHAR contains the string "CHAR" and is thus assigned TEXT affinity.

-
  • If the datatype contains the string "BLOB" - then the column has affinity NONE.

    +
  • If the datatype for a column + contains the string "BLOB" or if + not datatype is specified then the column has affinity NONE.

  • Otherwise, the affinity is NUMERIC. Notice that a column where no datatype is specified is given affinity NUMERIC.

    @@ -138,10 +139,10 @@ and they are given no affinity.

    CREATE TABLE t1(
    -    t  AFFINITY TEXT,
    -    nu AFFINITY NUMERIC, 
    -    i  AFFINITY INTEGER,
    -    no AFFINITY NONE
    +    t  TEXT,
    +    nu NUMERIC, 
    +    i  INTEGER,
    +    no BLOB
     );
     
     -- Storage classes for the following row:
    @@ -150,7 +151,8 @@ INSERT INTO t1 VALUES('500.0', '500.0', '500.0', '500.0');
     
     -- Storage classes for the following row:
     -- TEXT, REAL, INTEGER, REAL
    -INSERT INTO t1 VALUES(500.0, 500.0, 500.0, 500.0);
    +INSERT INTO t1 VALUES(500.0, 500.0, 500.0, 500.0); +
  • 3. Comparison Expressions

    @@ -201,17 +203,18 @@ SQL scalar expression or literal other than a column value.

    3.1 Comparison Example

    -
    CREATE TABLE t1(
    -    a AFFINITY TEXT,
    -    b AFFINITY NUMERIC,
    -    c AFFINITY NONE
    +
    +CREATE TABLE t1(
    +    a TEXT,
    +    b NUMERIC,
    +    c BLOB
     );
     
     -- Storage classes for the following row:
     -- TEXT, REAL, TEXT
     INSERT INTO t1 VALUES('500', '500', '500');
     
    --- 60 and 40 are converted to “60” and “40” and values are compared as TEXT.
    +-- 60 and 40 are converted to '60' and '40' and values are compared as TEXT.
     SELECT a < 60, a < 40 FROM t1;
     1|0
     
    @@ -219,9 +222,11 @@ SELECT a < 60, a < 40 FROM t1;
     SELECT b < 60, b < 600 FROM t1;
     0|1
     
    --- Both 60 and 600 (storage class NUMERIC) are less than '500' (storage class TEXT).
    +-- Both 60 and 600 (storage class NUMERIC) are less than '500'
    +-- (storage class TEXT).
     SELECT c < 60, c < 600 FROM t1;
    -0|0
    +0|0 +