diff --git a/manifest b/manifest index ebe1deba28..1c194ac946 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C :-)\s(CVS\s35) -D 2000-06-02T01:36:16 +C :-)\s(CVS\s36) +D 2000-06-02T01:51:20 F COPYRIGHT 74a8a6531a42e124df07ab5599aad63870fa0bd4 F Makefile.in 7ac2fef265940d93a544cb454efa836451559a71 F README 6b5960603c7f8bf42fc022b4b6436f242f238dbb @@ -7,22 +7,22 @@ F configure 00a5b5c82147a576fa6e82d7c1b0d55c321d6d2c x F configure.in 6ccfd5fc80517f7cfe605a7fc7e0f62d962a233c F doc/lemon.html e233a3e97a779c7a87e1bc4528c664a58e49dd47 F src/build.c f56c47f08c2f01fd640abb920c5da6b6614fbf3f -F src/dbbe.c a6ae5ac878b9b18ff82345b56917085cc0ab4cbd +F src/dbbe.c a217499fb539c5b5db99f1d37c20276b6f0d60a8 F src/dbbe.h a8a46f71238e0f09f3ec08fd9d1c8c7f4cdc49bf F src/delete.c e11433c14ed5cc8553cba14296b3baa3c23054bc F src/expr.c 91970700e3e39b2b725b028c166f588a5bb0c038 F src/insert.c 5d713f4a05cef76a188207aa986776e02349ba70 -F src/main.c 9567f6f44102e5c8a8c5ca834727f29690ac2f79 +F src/main.c 9123ef6567b6a5255643040b0832b9d70ae2b4ed F src/parse.y 16322c46ec117082ef745715f7a4761f2491a0b2 -F src/select.c 25cada7cb2b0b4973b3e17c81ba1b1c887829f71 +F src/select.c ce21eb2db2c621c097f03c21ff8d18804fb9897d F src/shell.c 9a42923e9c8ec1654dd1ef1aa113eca26dcf30db -F src/sqlite.h 91e551b1ec455a981fa935f19c32abc93867e382 -F src/sqliteInt.h 447a156c3b77378b34c8668d668002674db55205 +F src/sqlite.h 58da0a8590133777b741f9836beaef3d58f40268 +F src/sqliteInt.h fe26be33f20aea88378301998b2f5c308005bf4c F src/tclsqlite.c 10c00c460246cfba375b768c90b22bfe3c774c8f F src/tokenize.c 15c229fee77325334c6814652e429b0930eba6c1 F src/update.c 1f7284e00921352c3ae699fb60f2c2fbf8098212 F src/util.c da47fe65efa6ff4c5e663cc7c832964bd599c0d2 -F src/vdbe.c 01e8a9e274d959ce72cc8c5a43ed144e781a6352 +F src/vdbe.c a92f66fa70d1df99ff29795fe8f18e9ea51f8f4c F src/vdbe.h ab574c91c6328c5795f68b84074fbcf860eae70e F src/where.c bed9a8360cbfbf712bdc397c8e22216a5e5f9800 F test/all.test 66a8a5b8291a472157944edcdce51a320ebd1f35 @@ -45,7 +45,7 @@ F www/c_interface.tcl f875864edf7974157d1c257ca08de854660882a5 F www/changes.tcl 37f4906f0b03f2160d2b2e4ed3cedb0b91d253cb F www/index.tcl 001f8c8c4edbe20e25c508005a12f2f265f84c9c F www/sqlite.tcl 2a0056dd6d78839636176b770d9f37d12e66660e -P 52338f4ab5990fefc61f615cd65c3a724b365199 -R 19c8832b6eed992164ced278747bfec1 +P a57ecd606c8caa67db240d1a4bc46c0a590fde0c +R 565c3c2b5d29c5df35ef5486eca899a0 U drh -Z b10b3802981476d18ecff528a847002c +Z e4f014f9c30a1cd8b033307faacb4b20 diff --git a/manifest.uuid b/manifest.uuid index e1c72a16cd..4318437ebe 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a57ecd606c8caa67db240d1a4bc46c0a590fde0c \ No newline at end of file +d3c31defbaf25f470d0977c39325890ab8bad054 \ No newline at end of file diff --git a/src/dbbe.c b/src/dbbe.c index 1f7765a217..86001ca4b0 100644 --- a/src/dbbe.c +++ b/src/dbbe.c @@ -30,7 +30,7 @@ ** relatively simple to convert to a different database such ** as NDBM, SDBM, or BerkeleyDB. ** -** $Id: dbbe.c,v 1.8 2000/06/02 01:36:16 drh Exp $ +** $Id: dbbe.c,v 1.9 2000/06/02 01:51:20 drh Exp $ */ #include "sqliteInt.h" #include @@ -297,7 +297,13 @@ int sqliteDbbeOpenTable( pFile->pNext = pBe->pOpen; pBe->pOpen = pFile; if( pFile->dbf==0 ){ - rc = SQLITE_BUSY; + if( !writeable && access(zFile,0) ){ + rc = SQLITE_OK; + }else if( access(zFile,W_OK|R_OK) ){ + rc = SQLITE_PERM; + }else{ + rc = SQLITE_BUSY; + } } }else{ sqliteFree(zFile); diff --git a/src/main.c b/src/main.c index 430ebdd4f7..c035302b29 100644 --- a/src/main.c +++ b/src/main.c @@ -26,7 +26,7 @@ ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** -** $Id: main.c,v 1.4 2000/06/02 01:36:16 drh Exp $ +** $Id: main.c,v 1.5 2000/06/02 01:51:20 drh Exp $ */ #include "sqliteInt.h" @@ -100,7 +100,7 @@ static int sqliteInit(sqlite *db, char **pzErrMsg){ ** database scheme. */ static VdbeOp initProg[] = { - { OP_Open, 0, 1, MASTER_NAME}, + { OP_Open, 0, 0, MASTER_NAME}, { OP_Next, 0, 8, 0}, /* 1 */ { OP_Field, 0, 0, 0}, { OP_String, 0, 0, "table"}, diff --git a/src/select.c b/src/select.c index 52e4d30d8d..f0a1e94b0b 100644 --- a/src/select.c +++ b/src/select.c @@ -24,7 +24,7 @@ ** This file contains C code routines that are called by the parser ** to handle SELECT statements. ** -** $Id: select.c,v 1.3 2000/05/31 20:00:52 drh Exp $ +** $Id: select.c,v 1.4 2000/06/02 01:51:20 drh Exp $ */ #include "sqliteInt.h" @@ -198,7 +198,7 @@ void sqliteSelect( */ if( distinct ){ distinct = pTabList->nId*2+1; - sqliteVdbeAddOp(v, OP_Open, distinct, 0, 0, 0); + sqliteVdbeAddOp(v, OP_Open, distinct, 1, 0, 0); } pWInfo = sqliteWhereBegin(pParse, pTabList, pWhere, 0); if( pWInfo==0 ) goto select_cleanup; diff --git a/src/sqlite.h b/src/sqlite.h index 164ed11e14..e8cc2ad541 100644 --- a/src/sqlite.h +++ b/src/sqlite.h @@ -24,7 +24,7 @@ ** This header file defines the interface that the sqlite library ** presents to client programs. ** -** @(#) $Id: sqlite.h,v 1.2 2000/06/02 01:17:38 drh Exp $ +** @(#) $Id: sqlite.h,v 1.3 2000/06/02 01:51:20 drh Exp $ */ #ifndef _SQLITE_H_ #define _SQLITE_H_ @@ -115,9 +115,12 @@ int sqlite_exec( #define SQLITE_OK 0 /* Successful result */ #define SQLITE_INTERNAL 1 /* An internal logic error in SQLite */ #define SQLITE_ERROR 2 /* SQL error or missing database */ -#define SQLITE_ABORT 3 /* Callback routine requested an abort */ -#define SQLITE_BUSY 4 /* One or more database files are locked */ -#define SQLITE_NOMEM 5 /* A malloc() failed */ +#define SQLITE_PERM 3 /* Access permission denied */ +#define SQLITE_ABORT 4 /* Callback routine requested an abort */ +#define SQLITE_BUSY 5 /* One or more database files are locked */ +#define SQLITE_NOMEM 6 /* A malloc() failed */ +#define SQLITE_READONLY 7 /* Attempt to write a readonly database */ + /* This function returns true if the given input string comprises diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 5fa1917e4c..4bd1f46ca6 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -23,7 +23,7 @@ ************************************************************************* ** Internal interface definitions for SQLite. ** -** @(#) $Id: sqliteInt.h,v 1.8 2000/06/02 01:17:38 drh Exp $ +** @(#) $Id: sqliteInt.h,v 1.9 2000/06/02 01:51:20 drh Exp $ */ #include "sqlite.h" #include "dbbe.h" @@ -103,13 +103,6 @@ struct sqlite { #define SQLITE_VdbeTrace 0x00000001 #define SQLITE_Initialized 0x00000002 -/* -** Values for SQLITE_OK, SQLITE_ERROR, etc are defined in sqlite.h. -** The following are several new return codes that are used internally -** only. Take care that these values do not overlap. -*/ -#define SQLITE_READONLY 6 /* Table already opened as read-only */ - /* ** Each table is represented in memory by ** an instance of the following structure diff --git a/src/vdbe.c b/src/vdbe.c index 132649961a..bb28801580 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -41,7 +41,7 @@ ** But other routines are also provided to help in building up ** a program instruction by instruction. ** -** $Id: vdbe.c,v 1.8 2000/06/02 01:36:16 drh Exp $ +** $Id: vdbe.c,v 1.9 2000/06/02 01:51:20 drh Exp $ */ #include "sqliteInt.h" @@ -1328,6 +1328,11 @@ int sqliteVdbeExec( sqliteSetString(pzErrMsg,"table ", pOp->p3, " is locked", 0); break; } + case SQLITE_PERM: { + sqliteSetString(pzErrMsg, pOp->p2 ? "write" : "read", + " permission denied for table ", pOp->p3, 0); + break; + } case SQLITE_READONLY: { sqliteSetString(pzErrMsg,"table ", pOp->p3, " is already opened for reading", 0);