mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Always use "(char*)0" to terminate the argument list of sqliteSetString().
This is needed for 64-bit systems that use a 32-bit integer by default. (CVS 1126) FossilOrigin-Name: 656c90387a4a714b4f31040ece9b0e15e30934af
This commit is contained in:
36
manifest
36
manifest
@@ -1,5 +1,5 @@
|
||||
C Use\ssqlite_freemem()\sinstead\sof\sfree()\sin\sthe\sshell.\s\sWindows\sneeds\sthis.\n(Unix\sdoes\snot\scare.)\s\sTicket\s#444.\s(CVS\s1125)
|
||||
D 2003-12-04T20:51:41
|
||||
C Always\suse\s"(char*)0"\sto\sterminate\sthe\sargument\slist\sof\ssqliteSetString().\nThis\sis\sneeded\sfor\s64-bit\ssystems\sthat\suse\sa\s32-bit\sinteger\sby\sdefault.\s(CVS\s1126)
|
||||
D 2003-12-06T21:43:56
|
||||
F Makefile.in 5cb273b7d0e945d47ee8b9ad1c2a04ce79927d2d
|
||||
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
|
||||
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
|
||||
@@ -22,11 +22,11 @@ F spec.template a38492f1c1dd349fc24cb0565e08afc53045304b
|
||||
F sqlite.1 83f4a9d37bdf2b7ef079a82d54eaf2e3509ee6ea
|
||||
F sqlite.pc.in 30552343140c53304c2a658c080fbe810cd09ca2
|
||||
F src/attach.c 9f78b4aaac02a2b09ff108e92cbaee3199e7962a
|
||||
F src/auth.c c8f50d4507e37779d96ff3c55417bc2b612dfed6
|
||||
F src/btree.c ba1cc0c71c3d2742b9a9047832335dc7d3656c45
|
||||
F src/auth.c c59ad0dab501888f8b1fccc25e2f5965d2265116
|
||||
F src/btree.c bcb466c2939582a3a62f577cd8a9e5d637f3698d
|
||||
F src/btree.h 9b7c09f1e64274d7bb74a57bbfc63778f67b1048
|
||||
F src/btree_rb.c 67d154ffb0fac27a4a7eab9118ece6eaafeb49c9
|
||||
F src/build.c fede6bfb79d50483747fa55ae18c35d95db35fe3
|
||||
F src/btree_rb.c e4084b6a12270674b0cd7034655f55e6a2639c78
|
||||
F src/build.c a7493c433de5b552f9535d8fa7ed80aaf135491e
|
||||
F src/copy.c 9e47975ea96751c658bcf1a0c4f0bb7c6ee61e73
|
||||
F src/date.c acb75ff7849ca923837a9d3ef6b2d3e111a32fb0
|
||||
F src/delete.c 0f81e6799c089487615d38e042a2de4d2d6192bc
|
||||
@@ -35,14 +35,14 @@ F src/expr.c d4d8eca6363a6e680361e5d2a934b78e5c7b7fa3
|
||||
F src/func.c 82a749b9a03ae9834a90854464f93e29f902799b
|
||||
F src/hash.c 058f077c1f36f266581aa16f907a3903abf64aa3
|
||||
F src/hash.h cd0433998bc1a3759d244e1637fe5a3c13b53bf8
|
||||
F src/insert.c dc200ae04a36bd36e575272a069e20c528b7fbdf
|
||||
F src/main.c 9422005bb4411cc08c2986fde3278ac5b87068a0
|
||||
F src/insert.c 01f66866f35c986eab4a57373ca689a3255ef2df
|
||||
F src/main.c 3dd3cae00bade294011da5a3cf9ff660a610c545
|
||||
F src/md5.c fe4f9c9c6f71dfc26af8da63e4d04489b1430565
|
||||
F src/os.c 97df440bc71f65e22df5d3d920ce39551c0a5f5a
|
||||
F src/os.c 226d32db1f36f8932b318b1757c8623be6e4244f
|
||||
F src/os.h 729395fefcca4b81ae056aa9ff67b72bb40dd9e0
|
||||
F src/pager.c 62702dff51d50694d039bc210f31990d1fbba2dd
|
||||
F src/pager.h 5da62c83443f26b1792cfd72c96c422f91aadd31
|
||||
F src/parse.y 1c72ca2a1f57df2c6263ea6164ef4cae9dd4f7e7
|
||||
F src/parse.y c65aa6c5508763806ac9734b0589b93480ec7e7a
|
||||
F src/pragma.c cee60f17679210e8acd30d5bdee855716d0c898c
|
||||
F src/printf.c 12e45d482ac8abcc6f786fc99e5bed7dd9a51af0
|
||||
F src/random.c 19e8e00fe0df32a742f115773f57651be327cabe
|
||||
@@ -51,22 +51,22 @@ F src/shell.c 3b067edc098c45caca164bcad1fa79192c3ec5ae
|
||||
F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e
|
||||
F src/sqlite.h.in e6cfff01fafc8a82ce82cd8c932af421dc9adb54
|
||||
F src/sqliteInt.h 882aa33ee2aed7685449b899d917a316b9cc2c44
|
||||
F src/table.c 4301926464d88d2c2c7cd21c3360aa75bf068b95
|
||||
F src/table.c d845cb101b5afc1f7fea083c99e3d2fa7998d895
|
||||
F src/tclsqlite.c 3efac6b5861ac149c41251d4d4c420c94be5ba6a
|
||||
F src/test1.c f9d5816610f7ec4168ab7b098d5207a5708712b6
|
||||
F src/test2.c 5014337d8576b731cce5b5a14bec4f0daf432700
|
||||
F src/test3.c 30985ebdfaf3ee1462a9b0652d3efbdc8d9798f5
|
||||
F src/threadtest.c d641a5219e718e18a1a80a50eb9bb549f451f42e
|
||||
F src/tokenize.c e14db6bfa972a7c449c80788fcdbc0fdc11b17d7
|
||||
F src/tokenize.c d10e7f0b4d8634f6f37237b4e65314e3e5a3a34b
|
||||
F src/trigger.c ce83e017b407d046e909d05373d7f8ee70f9f7f9
|
||||
F src/update.c 24260b4fda00c9726d27699a0561d53c0dccc397
|
||||
F src/util.c cc95dd360fac09a059b2ab98e4c333d1a2308db5
|
||||
F src/vacuum.c e4724eade07e4cf8897060a8cf632dbd92408eeb
|
||||
F src/vdbe.c 0928a242ced0b5d26292f3949fdab26fa4dc327d
|
||||
F src/vdbe.c d61f720a836a7c948356105b87b2512a9484cb3b
|
||||
F src/vdbe.h 3957844e46fea71fd030e78f6a3bd2f7e320fb43
|
||||
F src/vdbeInt.h 2824bf88895b901b3a8c9e44527c67530e1c0dcb
|
||||
F src/vdbeaux.c 31abb8e3e57866913360381947e267a51fed92c6
|
||||
F src/where.c 6bd1d2a9c70af63a6e47b0ab0c181d501b12514f
|
||||
F src/vdbeaux.c 877ae44ab42f43d38e8cd989087627508a4c98dd
|
||||
F src/where.c d01a3506f3c1e3a205028068c8a14d713872c633
|
||||
F test/all.test 569a92a8ee88f5300c057cc4a8f50fbbc69a3242
|
||||
F test/attach.test c26848402e7ac829e043e1fa5e0eb87032e5d81d
|
||||
F test/attach2.test 6f98cc2b929d88dc5f82d95d04e9b89b3b5dead3
|
||||
@@ -176,7 +176,7 @@ F www/speed.tcl 2f6b1155b99d39adb185f900456d1d592c4832b3
|
||||
F www/sqlite.tcl 3c83b08cf9f18aa2d69453ff441a36c40e431604
|
||||
F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da
|
||||
F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1
|
||||
P d48b0b018d47470689cc49f3be4cde50db165454
|
||||
R 482b73398dc156a154a0223f6aa927cb
|
||||
P e5e6a8481b2225e826c8e890ddc44f06759fe72b
|
||||
R 486b33d90c9358024a2965d7fdcc35e3
|
||||
U drh
|
||||
Z 99ab35e0d01247693362a83e91f5f4e3
|
||||
Z 6d642432b480eb97ee7365de7928480a
|
||||
|
@@ -1 +1 @@
|
||||
e5e6a8481b2225e826c8e890ddc44f06759fe72b
|
||||
656c90387a4a714b4f31040ece9b0e15e30934af
|
10
src/auth.c
10
src/auth.c
@@ -14,7 +14,7 @@
|
||||
** systems that do not need this facility may omit it by recompiling
|
||||
** the library with -DSQLITE_OMIT_AUTHORIZATION=1
|
||||
**
|
||||
** $Id: auth.c,v 1.10 2003/05/10 03:36:54 drh Exp $
|
||||
** $Id: auth.c,v 1.11 2003/12/06 21:43:56 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
|
||||
@@ -89,7 +89,7 @@ static void sqliteAuthBadReturnCode(Parse *pParse, int rc){
|
||||
sprintf(zBuf, "(%d)", rc);
|
||||
sqliteSetString(&pParse->zErrMsg, "illegal return value ", zBuf,
|
||||
" from the authorization function - should be SQLITE_OK, "
|
||||
"SQLITE_IGNORE, or SQLITE_DENY", 0);
|
||||
"SQLITE_IGNORE, or SQLITE_DENY", (char*)0);
|
||||
pParse->nErr++;
|
||||
pParse->rc = SQLITE_MISUSE;
|
||||
}
|
||||
@@ -151,10 +151,10 @@ void sqliteAuthRead(
|
||||
}else if( rc==SQLITE_DENY ){
|
||||
if( db->nDb>2 || pExpr->iDb!=0 ){
|
||||
sqliteSetString(&pParse->zErrMsg,"access to ", zDBase, ".",
|
||||
pTab->zName, ".", zCol, " is prohibited", 0);
|
||||
pTab->zName, ".", zCol, " is prohibited", (char*)0);
|
||||
}else{
|
||||
sqliteSetString(&pParse->zErrMsg,"access to ", pTab->zName, ".",
|
||||
zCol, " is prohibited", 0);
|
||||
zCol, " is prohibited", (char*)0);
|
||||
}
|
||||
pParse->nErr++;
|
||||
pParse->rc = SQLITE_AUTH;
|
||||
@@ -184,7 +184,7 @@ int sqliteAuthCheck(
|
||||
}
|
||||
rc = db->xAuth(db->pAuthArg, code, zArg1, zArg2, zArg3, pParse->zAuthContext);
|
||||
if( rc==SQLITE_DENY ){
|
||||
sqliteSetString(&pParse->zErrMsg, "not authorized", 0);
|
||||
sqliteSetString(&pParse->zErrMsg, "not authorized", (char*)0);
|
||||
pParse->rc = SQLITE_AUTH;
|
||||
pParse->nErr++;
|
||||
}else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){
|
||||
|
@@ -9,7 +9,7 @@
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
** $Id: btree.c,v 1.95 2003/06/17 02:57:18 drh Exp $
|
||||
** $Id: btree.c,v 1.96 2003/12/06 21:43:56 drh Exp $
|
||||
**
|
||||
** This file implements a external (disk-based) database using BTrees.
|
||||
** For a detailed discussion of BTrees, refer to
|
||||
@@ -3169,10 +3169,10 @@ static void checkAppendMsg(IntegrityCk *pCheck, char *zMsg1, char *zMsg2){
|
||||
if( pCheck->zErrMsg ){
|
||||
char *zOld = pCheck->zErrMsg;
|
||||
pCheck->zErrMsg = 0;
|
||||
sqliteSetString(&pCheck->zErrMsg, zOld, "\n", zMsg1, zMsg2, 0);
|
||||
sqliteSetString(&pCheck->zErrMsg, zOld, "\n", zMsg1, zMsg2, (char*)0);
|
||||
sqliteFree(zOld);
|
||||
}else{
|
||||
sqliteSetString(&pCheck->zErrMsg, zMsg1, zMsg2, 0);
|
||||
sqliteSetString(&pCheck->zErrMsg, zMsg1, zMsg2, (char*)0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
** $Id: btree_rb.c,v 1.17 2003/10/22 22:15:28 drh Exp $
|
||||
** $Id: btree_rb.c,v 1.18 2003/12/06 21:43:56 drh Exp $
|
||||
**
|
||||
** This file implements an in-core database using Red-Black balanced
|
||||
** binary trees.
|
||||
@@ -265,7 +265,7 @@ static char *append_val(char * orig, char const * val)
|
||||
return sqliteStrDup( val );
|
||||
} else{
|
||||
char * ret = 0;
|
||||
sqliteSetString(&ret, orig, val, 0);
|
||||
sqliteSetString(&ret, orig, val, (char*)0);
|
||||
sqliteFree( orig );
|
||||
return ret;
|
||||
}
|
||||
|
36
src/build.c
36
src/build.c
@@ -23,7 +23,7 @@
|
||||
** ROLLBACK
|
||||
** PRAGMA
|
||||
**
|
||||
** $Id: build.c,v 1.161 2003/11/27 00:48:58 drh Exp $
|
||||
** $Id: build.c,v 1.162 2003/12/06 21:43:56 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include <ctype.h>
|
||||
@@ -494,7 +494,7 @@ void sqliteStartTable(
|
||||
int rc = sqliteBtreeFactory(db, 0, 0, MAX_PAGES, &db->aDb[1].pBt);
|
||||
if( rc!=SQLITE_OK ){
|
||||
sqliteSetString(&pParse->zErrMsg, "unable to open a temporary database "
|
||||
"file for storing temporary tables", 0);
|
||||
"file for storing temporary tables", (char*)0);
|
||||
pParse->nErr++;
|
||||
return;
|
||||
}
|
||||
@@ -528,7 +528,7 @@ void sqliteStartTable(
|
||||
if( (pIdx = sqliteFindIndex(db, zName, 0))!=0 &&
|
||||
(pIdx->iDb==0 || !pParse->initFlag) ){
|
||||
sqliteSetString(&pParse->zErrMsg, "there is already an index named ",
|
||||
zName, 0);
|
||||
zName, (char*)0);
|
||||
sqliteFree(zName);
|
||||
pParse->nErr++;
|
||||
return;
|
||||
@@ -588,7 +588,7 @@ void sqliteAddColumn(Parse *pParse, Token *pName){
|
||||
sqliteDequote(z);
|
||||
for(i=0; i<p->nCol; i++){
|
||||
if( sqliteStrICmp(z, p->aCol[i].zName)==0 ){
|
||||
sqliteSetString(&pParse->zErrMsg, "duplicate column name: ", z, 0);
|
||||
sqliteSetString(&pParse->zErrMsg, "duplicate column name: ", z, (char*)0);
|
||||
pParse->nErr++;
|
||||
sqliteFree(z);
|
||||
return;
|
||||
@@ -709,7 +709,7 @@ void sqliteAddPrimaryKey(Parse *pParse, IdList *pList, int onError){
|
||||
if( pTab==0 ) goto primary_key_exit;
|
||||
if( pTab->hasPrimKey ){
|
||||
sqliteSetString(&pParse->zErrMsg, "table \"", pTab->zName,
|
||||
"\" has more than one primary key", 0);
|
||||
"\" has more than one primary key", (char*)0);
|
||||
pParse->nErr++;
|
||||
goto primary_key_exit;
|
||||
}
|
||||
@@ -1125,7 +1125,7 @@ int sqliteViewGetColumnNames(Parse *pParse, Table *pTable){
|
||||
*/
|
||||
if( pTable->nCol<0 ){
|
||||
sqliteSetString(&pParse->zErrMsg, "view ", pTable->zName,
|
||||
" is circularly defined", 0);
|
||||
" is circularly defined", (char*)0);
|
||||
pParse->nErr++;
|
||||
return 1;
|
||||
}
|
||||
@@ -1269,19 +1269,19 @@ void sqliteDropTable(Parse *pParse, Token *pName, int isView){
|
||||
#endif
|
||||
if( pTable->readOnly ){
|
||||
sqliteSetString(&pParse->zErrMsg, "table ", pTable->zName,
|
||||
" may not be dropped", 0);
|
||||
" may not be dropped", (char*)0);
|
||||
pParse->nErr++;
|
||||
return;
|
||||
}
|
||||
if( isView && pTable->pSelect==0 ){
|
||||
sqliteSetString(&pParse->zErrMsg, "use DROP TABLE to delete table ",
|
||||
pTable->zName, 0);
|
||||
pTable->zName, (char*)0);
|
||||
pParse->nErr++;
|
||||
return;
|
||||
}
|
||||
if( !isView && pTable->pSelect ){
|
||||
sqliteSetString(&pParse->zErrMsg, "use DROP VIEW to delete view ",
|
||||
pTable->zName, 0);
|
||||
pTable->zName, (char*)0);
|
||||
pParse->nErr++;
|
||||
return;
|
||||
}
|
||||
@@ -1436,7 +1436,7 @@ void sqliteCreateForeignKey(
|
||||
}else if( pToCol && pToCol->nId!=pFromCol->nId ){
|
||||
sqliteSetString(&pParse->zErrMsg,
|
||||
"number of columns in foreign key does not match the number of "
|
||||
"columns in the referenced table", 0);
|
||||
"columns in the referenced table", (char*)0);
|
||||
pParse->nErr++;
|
||||
goto fk_end;
|
||||
}else{
|
||||
@@ -1474,7 +1474,7 @@ void sqliteCreateForeignKey(
|
||||
}
|
||||
if( j>=p->nCol ){
|
||||
sqliteSetString(&pParse->zErrMsg, "unknown column \"",
|
||||
pFromCol->a[i].zName, "\" in foreign key definition", 0);
|
||||
pFromCol->a[i].zName, "\" in foreign key definition", (char*)0);
|
||||
pParse->nErr++;
|
||||
goto fk_end;
|
||||
}
|
||||
@@ -1571,18 +1571,18 @@ void sqliteCreateIndex(
|
||||
if( pTab==0 || pParse->nErr ) goto exit_create_index;
|
||||
if( pTab->readOnly ){
|
||||
sqliteSetString(&pParse->zErrMsg, "table ", pTab->zName,
|
||||
" may not be indexed", 0);
|
||||
" may not be indexed", (char*)0);
|
||||
pParse->nErr++;
|
||||
goto exit_create_index;
|
||||
}
|
||||
if( pTab->iDb>=2 && pParse->initFlag==0 ){
|
||||
sqliteSetString(&pParse->zErrMsg, "table ", pTab->zName,
|
||||
" may not have indices added", 0);
|
||||
" may not have indices added", (char*)0);
|
||||
pParse->nErr++;
|
||||
goto exit_create_index;
|
||||
}
|
||||
if( pTab->pSelect ){
|
||||
sqliteSetString(&pParse->zErrMsg, "views may not be indexed", 0);
|
||||
sqliteSetString(&pParse->zErrMsg, "views may not be indexed", (char*)0);
|
||||
pParse->nErr++;
|
||||
goto exit_create_index;
|
||||
}
|
||||
@@ -1608,13 +1608,13 @@ void sqliteCreateIndex(
|
||||
if( zName==0 ) goto exit_create_index;
|
||||
if( (pISameName = sqliteFindIndex(db, zName, 0))!=0 ){
|
||||
sqliteSetString(&pParse->zErrMsg, "index ", zName,
|
||||
" already exists", 0);
|
||||
" already exists", (char*)0);
|
||||
pParse->nErr++;
|
||||
goto exit_create_index;
|
||||
}
|
||||
if( (pTSameName = sqliteFindTable(db, zName, 0))!=0 ){
|
||||
sqliteSetString(&pParse->zErrMsg, "there is already a table named ",
|
||||
zName, 0);
|
||||
zName, (char*)0);
|
||||
pParse->nErr++;
|
||||
goto exit_create_index;
|
||||
}
|
||||
@@ -1625,7 +1625,7 @@ void sqliteCreateIndex(
|
||||
for(pLoop=pTab->pIndex, n=1; pLoop; pLoop=pLoop->pNext, n++){}
|
||||
sprintf(zBuf,"%d)",n);
|
||||
zName = 0;
|
||||
sqliteSetString(&zName, "(", pTab->zName, " autoindex ", zBuf, 0);
|
||||
sqliteSetString(&zName, "(", pTab->zName, " autoindex ", zBuf, (char*)0);
|
||||
if( zName==0 ) goto exit_create_index;
|
||||
}else{
|
||||
zName = sqliteStrNDup(pName->z, pName->n);
|
||||
@@ -1685,7 +1685,7 @@ void sqliteCreateIndex(
|
||||
}
|
||||
if( j>=pTab->nCol ){
|
||||
sqliteSetString(&pParse->zErrMsg, "table ", pTab->zName,
|
||||
" has no column named ", pList->a[i].zName, 0);
|
||||
" has no column named ", pList->a[i].zName, (char*)0);
|
||||
pParse->nErr++;
|
||||
sqliteFree(pIndex);
|
||||
goto exit_create_index;
|
||||
|
@@ -12,7 +12,7 @@
|
||||
** This file contains C code routines that are called by the parser
|
||||
** to handle INSERT statements in SQLite.
|
||||
**
|
||||
** $Id: insert.c,v 1.89 2003/08/05 13:13:38 drh Exp $
|
||||
** $Id: insert.c,v 1.90 2003/12/06 21:43:56 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
|
||||
@@ -688,7 +688,7 @@ void sqliteGenerateConstraintChecks(
|
||||
char *zMsg = 0;
|
||||
sqliteVdbeAddOp(v, OP_Halt, SQLITE_CONSTRAINT, onError);
|
||||
sqliteSetString(&zMsg, pTab->zName, ".", pTab->aCol[i].zName,
|
||||
" may not be NULL", 0);
|
||||
" may not be NULL", (char*)0);
|
||||
sqliteVdbeChangeP3(v, -1, zMsg, P3_DYNAMIC);
|
||||
break;
|
||||
}
|
||||
|
35
src/main.c
35
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.143 2003/10/18 09:37:26 danielk1977 Exp $
|
||||
** $Id: main.c,v 1.144 2003/12/06 21:43:56 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "os.h"
|
||||
@@ -34,7 +34,7 @@ typedef struct {
|
||||
** that the database is corrupt.
|
||||
*/
|
||||
static void corruptSchema(InitData *pData){
|
||||
sqliteSetString(pData->pzErrMsg, "malformed database schema", 0);
|
||||
sqliteSetString(pData->pzErrMsg, "malformed database schema", (char*)0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -150,7 +150,7 @@ int upgrade_3_callback(void *pInit, int argc, char **argv, char **NotUsed){
|
||||
"DROP TABLE sqlite_x;",
|
||||
0, 0, &zErr, argv[0], argv[0], argv[0]);
|
||||
if( zErr ){
|
||||
sqliteSetString(pData->pzErrMsg, zErr, 0);
|
||||
sqliteSetString(pData->pzErrMsg, zErr, (char*)0);
|
||||
sqlite_freemem(zErr);
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ static int sqliteInitOne(sqlite *db, int iDb, char **pzErrMsg){
|
||||
if( db->aDb[iDb].pBt==0 ) return SQLITE_OK;
|
||||
rc = sqliteBtreeCursor(db->aDb[iDb].pBt, 2, 0, &curMain);
|
||||
if( rc ){
|
||||
sqliteSetString(pzErrMsg, sqlite_error_string(rc), 0);
|
||||
sqliteSetString(pzErrMsg, sqlite_error_string(rc), (char*)0);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ static int sqliteInitOne(sqlite *db, int iDb, char **pzErrMsg){
|
||||
*/
|
||||
rc = sqliteBtreeGetMeta(db->aDb[iDb].pBt, meta);
|
||||
if( rc ){
|
||||
sqliteSetString(pzErrMsg, sqlite_error_string(rc), 0);
|
||||
sqliteSetString(pzErrMsg, sqlite_error_string(rc), (char*)0);
|
||||
sqliteBtreeCloseCursor(curMain);
|
||||
return rc;
|
||||
}
|
||||
@@ -306,17 +306,17 @@ static int sqliteInitOne(sqlite *db, int iDb, char **pzErrMsg){
|
||||
db->file_format = 4;
|
||||
}else if( db->file_format>4 ){
|
||||
sqliteBtreeCloseCursor(curMain);
|
||||
sqliteSetString(pzErrMsg, "unsupported file format", 0);
|
||||
sqliteSetString(pzErrMsg, "unsupported file format", (char*)0);
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
}else if( db->file_format!=meta[2] || db->file_format<4 ){
|
||||
assert( db->file_format>=4 );
|
||||
if( meta[2]==0 ){
|
||||
sqliteSetString(pzErrMsg, "cannot attach empty database: ",
|
||||
db->aDb[iDb].zName, 0);
|
||||
db->aDb[iDb].zName, (char*)0);
|
||||
}else{
|
||||
sqliteSetString(pzErrMsg, "incompatible file format in auxiliary "
|
||||
"database: ", db->aDb[iDb].zName, 0);
|
||||
"database: ", db->aDb[iDb].zName, (char*)0);
|
||||
}
|
||||
sqliteBtreeClose(db->aDb[iDb].pBt);
|
||||
db->aDb[iDb].pBt = 0;
|
||||
@@ -341,13 +341,13 @@ static int sqliteInitOne(sqlite *db, int iDb, char **pzErrMsg){
|
||||
char *zSql = 0;
|
||||
sqliteSetString(&zSql,
|
||||
"SELECT type, name, rootpage, sql, ", zDbNum, " FROM \"",
|
||||
db->aDb[iDb].zName, "\".sqlite_master", 0);
|
||||
db->aDb[iDb].zName, "\".sqlite_master", (char*)0);
|
||||
sqliteRunParser(&sParse, zSql, pzErrMsg);
|
||||
sqliteFree(zSql);
|
||||
}
|
||||
sqliteBtreeCloseCursor(curMain);
|
||||
if( sqlite_malloc_failed ){
|
||||
sqliteSetString(pzErrMsg, "out of memory", 0);
|
||||
sqliteSetString(pzErrMsg, "out of memory", (char*)0);
|
||||
sParse.rc = SQLITE_NOMEM;
|
||||
sqliteResetInternalSchema(db, 0);
|
||||
}
|
||||
@@ -448,7 +448,8 @@ sqlite *sqlite_open(const char *zFilename, int mode, char **pzErrMsg){
|
||||
if( rc!=SQLITE_OK ){
|
||||
switch( rc ){
|
||||
default: {
|
||||
sqliteSetString(pzErrMsg, "unable to open database: ", zFilename, 0);
|
||||
sqliteSetString(pzErrMsg, "unable to open database: ",
|
||||
zFilename, (char*)0);
|
||||
}
|
||||
}
|
||||
sqliteFree(db);
|
||||
@@ -501,7 +502,7 @@ sqlite *sqlite_open(const char *zFilename, int mode, char **pzErrMsg){
|
||||
if( rc!=SQLITE_OK ){
|
||||
sqliteSetString(pzErrMsg,
|
||||
"unable to upgrade database to the version 2.6 format",
|
||||
zErr ? ": " : 0, zErr, 0);
|
||||
zErr ? ": " : 0, zErr, (char*)0);
|
||||
sqlite_freemem(zErr);
|
||||
sqliteStrRealloc(pzErrMsg);
|
||||
sqlite_close(db);
|
||||
@@ -514,7 +515,7 @@ sqlite *sqlite_open(const char *zFilename, int mode, char **pzErrMsg){
|
||||
return db;
|
||||
|
||||
no_mem_on_open:
|
||||
sqliteSetString(pzErrMsg, "out of memory", 0);
|
||||
sqliteSetString(pzErrMsg, "out of memory", (char*)0);
|
||||
sqliteStrRealloc(pzErrMsg);
|
||||
return 0;
|
||||
}
|
||||
@@ -617,7 +618,7 @@ static int sqliteMain(
|
||||
}
|
||||
if( db->file_format<3 ){
|
||||
sqliteSafetyOff(db);
|
||||
sqliteSetString(pzErrMsg, "obsolete database file format", 0);
|
||||
sqliteSetString(pzErrMsg, "obsolete database file format", (char*)0);
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
if( db->pVdbe==0 ){ db->nChange = 0; }
|
||||
@@ -629,7 +630,7 @@ static int sqliteMain(
|
||||
if( db->xTrace ) db->xTrace(db->pTraceArg, zSql);
|
||||
sqliteRunParser(&sParse, zSql, pzErrMsg);
|
||||
if( sqlite_malloc_failed ){
|
||||
sqliteSetString(pzErrMsg, "out of memory", 0);
|
||||
sqliteSetString(pzErrMsg, "out of memory", (char*)0);
|
||||
sParse.rc = SQLITE_NOMEM;
|
||||
sqliteRollbackAll(db);
|
||||
sqliteResetInternalSchema(db, 0);
|
||||
@@ -637,7 +638,7 @@ static int sqliteMain(
|
||||
}
|
||||
if( sParse.rc==SQLITE_DONE ) sParse.rc = SQLITE_OK;
|
||||
if( sParse.rc!=SQLITE_OK && pzErrMsg && *pzErrMsg==0 ){
|
||||
sqliteSetString(pzErrMsg, sqlite_error_string(sParse.rc), 0);
|
||||
sqliteSetString(pzErrMsg, sqlite_error_string(sParse.rc), (char*)0);
|
||||
}
|
||||
sqliteStrRealloc(pzErrMsg);
|
||||
if( sParse.rc==SQLITE_SCHEMA ){
|
||||
@@ -654,7 +655,7 @@ static int sqliteMain(
|
||||
exec_misuse:
|
||||
if( pzErrMsg ){
|
||||
*pzErrMsg = 0;
|
||||
sqliteSetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), 0);
|
||||
sqliteSetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), (char*)0);
|
||||
sqliteStrRealloc(pzErrMsg);
|
||||
}
|
||||
return SQLITE_MISUSE;
|
||||
|
12
src/os.c
12
src/os.c
@@ -1564,10 +1564,11 @@ char *sqliteOsFullPathname(const char *zRelative){
|
||||
#if OS_UNIX
|
||||
char *zFull = 0;
|
||||
if( zRelative[0]=='/' ){
|
||||
sqliteSetString(&zFull, zRelative, 0);
|
||||
sqliteSetString(&zFull, zRelative, (char*)0);
|
||||
}else{
|
||||
char zBuf[5000];
|
||||
sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), "/", zRelative, 0);
|
||||
sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), "/", zRelative,
|
||||
(char*)0);
|
||||
}
|
||||
return zFull;
|
||||
#endif
|
||||
@@ -1585,13 +1586,14 @@ char *sqliteOsFullPathname(const char *zRelative){
|
||||
char *zFull = 0;
|
||||
if( zRelative[0]==':' ){
|
||||
char zBuf[_MAX_PATH+1];
|
||||
sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), &(zRelative[1]), 0);
|
||||
sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), &(zRelative[1]),
|
||||
(char*)0);
|
||||
}else{
|
||||
if( strchr(zRelative, ':') ){
|
||||
sqliteSetString(&zFull, zRelative, 0);
|
||||
sqliteSetString(&zFull, zRelative, (char*)0);
|
||||
}else{
|
||||
char zBuf[_MAX_PATH+1];
|
||||
sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), zRelative, 0);
|
||||
sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), zRelative, (char*)0);
|
||||
}
|
||||
}
|
||||
return zFull;
|
||||
|
@@ -14,7 +14,7 @@
|
||||
** the parser. Lemon will also generate a header file containing
|
||||
** numeric codes for all of the tokens.
|
||||
**
|
||||
** @(#) $Id: parse.y,v 1.104 2003/11/27 00:48:58 drh Exp $
|
||||
** @(#) $Id: parse.y,v 1.105 2003/12/06 21:43:56 drh Exp $
|
||||
*/
|
||||
%token_prefix TK_
|
||||
%token_type {Token}
|
||||
@@ -26,7 +26,7 @@
|
||||
sqliteSetNString(&pParse->zErrMsg,
|
||||
"near \"", -1, TOKEN.z, TOKEN.n, "\": syntax error", -1, 0);
|
||||
}else{
|
||||
sqliteSetString(&pParse->zErrMsg, "incomplete SQL statement", 0);
|
||||
sqliteSetString(&pParse->zErrMsg, "incomplete SQL statement", (char*)0);
|
||||
}
|
||||
}
|
||||
pParse->nErr++;
|
||||
|
@@ -85,7 +85,8 @@ static int sqlite_get_table_cb(void *pArg, int nCol, char **argv, char **colv){
|
||||
}
|
||||
}else if( p->nColumn!=nCol ){
|
||||
sqliteSetString(&p->zErrMsg,
|
||||
"sqlite_get_table() called with two or more incompatible queries", 0);
|
||||
"sqlite_get_table() called with two or more incompatible queries",
|
||||
(char*)0);
|
||||
p->rc = SQLITE_ERROR;
|
||||
return 1;
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@
|
||||
** individual tokens and sends those tokens one-by-one over to the
|
||||
** parser for analysis.
|
||||
**
|
||||
** $Id: tokenize.c,v 1.64 2003/09/27 13:39:39 drh Exp $
|
||||
** $Id: tokenize.c,v 1.65 2003/12/06 21:43:56 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "os.h"
|
||||
@@ -413,7 +413,7 @@ int sqliteRunParser(Parse *pParse, const char *zSql, char **pzErrMsg){
|
||||
i = 0;
|
||||
pEngine = sqliteParserAlloc((void*(*)(int))malloc);
|
||||
if( pEngine==0 ){
|
||||
sqliteSetString(pzErrMsg, "out of memory", 0);
|
||||
sqliteSetString(pzErrMsg, "out of memory", (char*)0);
|
||||
return 1;
|
||||
}
|
||||
pParse->sLastToken.dyn = 0;
|
||||
@@ -429,7 +429,7 @@ int sqliteRunParser(Parse *pParse, const char *zSql, char **pzErrMsg){
|
||||
case TK_COMMENT: {
|
||||
if( (db->flags & SQLITE_Interrupt)!=0 ){
|
||||
pParse->rc = SQLITE_INTERRUPT;
|
||||
sqliteSetString(pzErrMsg, "interrupt", 0);
|
||||
sqliteSetString(pzErrMsg, "interrupt", (char*)0);
|
||||
goto abort_parse;
|
||||
}
|
||||
break;
|
||||
@@ -464,7 +464,8 @@ abort_parse:
|
||||
}
|
||||
sqliteParserFree(pEngine, free);
|
||||
if( pParse->rc!=SQLITE_OK && pParse->rc!=SQLITE_DONE && pParse->zErrMsg==0 ){
|
||||
sqliteSetString(&pParse->zErrMsg, sqlite_error_string(pParse->rc), 0);
|
||||
sqliteSetString(&pParse->zErrMsg, sqlite_error_string(pParse->rc),
|
||||
(char*)0);
|
||||
}
|
||||
if( pParse->zErrMsg ){
|
||||
if( pzErrMsg && *pzErrMsg==0 ){
|
||||
|
36
src/vdbe.c
36
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.242 2003/10/18 09:37:26 danielk1977 Exp $
|
||||
** $Id: vdbe.c,v 1.243 2003/12/06 21:43:56 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "os.h"
|
||||
@@ -631,7 +631,7 @@ case OP_Goto: {
|
||||
*/
|
||||
case OP_Gosub: {
|
||||
if( p->returnDepth>=sizeof(p->returnStack)/sizeof(p->returnStack[0]) ){
|
||||
sqliteSetString(&p->zErrMsg, "return address stack overflow", 0);
|
||||
sqliteSetString(&p->zErrMsg, "return address stack overflow", (char*)0);
|
||||
p->rc = SQLITE_INTERNAL;
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
@@ -648,7 +648,7 @@ case OP_Gosub: {
|
||||
*/
|
||||
case OP_Return: {
|
||||
if( p->returnDepth<=0 ){
|
||||
sqliteSetString(&p->zErrMsg, "return address stack underflow", 0);
|
||||
sqliteSetString(&p->zErrMsg, "return address stack underflow", (char*)0);
|
||||
p->rc = SQLITE_INTERNAL;
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
@@ -680,7 +680,7 @@ case OP_Halt: {
|
||||
p->rc = pOp->p1;
|
||||
p->errorAction = pOp->p2;
|
||||
if( pOp->p3 ){
|
||||
sqliteSetString(&p->zErrMsg, pOp->p3, 0);
|
||||
sqliteSetString(&p->zErrMsg, pOp->p3, (char*)0);
|
||||
}
|
||||
return SQLITE_ERROR;
|
||||
}else{
|
||||
@@ -1169,7 +1169,7 @@ case OP_Function: {
|
||||
}
|
||||
if( ctx.isError ){
|
||||
sqliteSetString(&p->zErrMsg,
|
||||
zStack[p->tos] ? zStack[p->tos] : "user function error", 0);
|
||||
zStack[p->tos] ? zStack[p->tos] : "user function error", (char*)0);
|
||||
rc = SQLITE_ERROR;
|
||||
}
|
||||
break;
|
||||
@@ -2229,7 +2229,7 @@ case OP_Transaction: {
|
||||
p->rc = SQLITE_BUSY;
|
||||
return SQLITE_BUSY;
|
||||
}else if( (*db->xBusyCallback)(db->pBusyArg, "", busy++)==0 ){
|
||||
sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), 0);
|
||||
sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), (char*)0);
|
||||
busy = 0;
|
||||
}
|
||||
break;
|
||||
@@ -2367,7 +2367,7 @@ case OP_VerifyCookie: {
|
||||
assert( pOp->p1>=0 && pOp->p1<db->nDb );
|
||||
rc = sqliteBtreeGetMeta(db->aDb[pOp->p1].pBt, aMeta);
|
||||
if( rc==SQLITE_OK && aMeta[1]!=pOp->p2 ){
|
||||
sqliteSetString(&p->zErrMsg, "database schema has changed", 0);
|
||||
sqliteSetString(&p->zErrMsg, "database schema has changed", (char*)0);
|
||||
rc = SQLITE_SCHEMA;
|
||||
}
|
||||
break;
|
||||
@@ -2441,7 +2441,7 @@ case OP_OpenWrite: {
|
||||
p2 = p->aStack[tos].i;
|
||||
POPSTACK;
|
||||
if( p2<2 ){
|
||||
sqliteSetString(&p->zErrMsg, "root page number less than 2", 0);
|
||||
sqliteSetString(&p->zErrMsg, "root page number less than 2", (char*)0);
|
||||
rc = SQLITE_INTERNAL;
|
||||
break;
|
||||
}
|
||||
@@ -2461,7 +2461,7 @@ case OP_OpenWrite: {
|
||||
p->rc = SQLITE_BUSY;
|
||||
return SQLITE_BUSY;
|
||||
}else if( (*db->xBusyCallback)(db->pBusyArg, pOp->p3, ++busy)==0 ){
|
||||
sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), 0);
|
||||
sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), (char*)0);
|
||||
busy = 0;
|
||||
}
|
||||
break;
|
||||
@@ -3444,7 +3444,7 @@ case OP_IdxPut: {
|
||||
){
|
||||
rc = SQLITE_CONSTRAINT;
|
||||
if( pOp->p3 && pOp->p3[0] ){
|
||||
sqliteSetString(&p->zErrMsg, pOp->p3, 0);
|
||||
sqliteSetString(&p->zErrMsg, pOp->p3, (char*)0);
|
||||
}
|
||||
goto abort_due_to_error;
|
||||
}
|
||||
@@ -4057,7 +4057,7 @@ case OP_FileOpen: {
|
||||
p->pFile = fopen(pOp->p3, "r");
|
||||
}
|
||||
if( p->pFile==0 ){
|
||||
sqliteSetString(&p->zErrMsg,"unable to open file: ", pOp->p3, 0);
|
||||
sqliteSetString(&p->zErrMsg,"unable to open file: ", pOp->p3, (char*)0);
|
||||
rc = SQLITE_ERROR;
|
||||
}
|
||||
break;
|
||||
@@ -4655,7 +4655,7 @@ case OP_SetNext: {
|
||||
*/
|
||||
default: {
|
||||
sprintf(zBuf,"%d",pOp->opcode);
|
||||
sqliteSetString(&p->zErrMsg, "unknown opcode ", zBuf, 0);
|
||||
sqliteSetString(&p->zErrMsg, "unknown opcode ", zBuf, (char*)0);
|
||||
rc = SQLITE_INTERNAL;
|
||||
break;
|
||||
}
|
||||
@@ -4687,7 +4687,7 @@ default: {
|
||||
*/
|
||||
#ifndef NDEBUG
|
||||
if( pc<-1 || pc>=p->nOp ){
|
||||
sqliteSetString(&p->zErrMsg, "jump destination out of range", 0);
|
||||
sqliteSetString(&p->zErrMsg, "jump destination out of range", (char*)0);
|
||||
rc = SQLITE_INTERNAL;
|
||||
}
|
||||
if( p->trace && p->tos>=0 ){
|
||||
@@ -4758,7 +4758,7 @@ vdbe_halt:
|
||||
** to fail on a modern VM computer, so this code is untested.
|
||||
*/
|
||||
no_mem:
|
||||
sqliteSetString(&p->zErrMsg, "out of memory", 0);
|
||||
sqliteSetString(&p->zErrMsg, "out of memory", (char*)0);
|
||||
rc = SQLITE_NOMEM;
|
||||
goto vdbe_halt;
|
||||
|
||||
@@ -4773,7 +4773,7 @@ abort_due_to_misuse:
|
||||
*/
|
||||
abort_due_to_error:
|
||||
if( p->zErrMsg==0 ){
|
||||
sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), 0);
|
||||
sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), (char*)0);
|
||||
}
|
||||
goto vdbe_halt;
|
||||
|
||||
@@ -4788,7 +4788,7 @@ abort_due_to_interrupt:
|
||||
}else{
|
||||
rc = SQLITE_INTERRUPT;
|
||||
}
|
||||
sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), 0);
|
||||
sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), (char*)0);
|
||||
goto vdbe_halt;
|
||||
|
||||
/* Jump to here if a operator is encountered that requires more stack
|
||||
@@ -4796,7 +4796,7 @@ abort_due_to_interrupt:
|
||||
*/
|
||||
not_enough_stack:
|
||||
sprintf(zBuf,"%d",pc);
|
||||
sqliteSetString(&p->zErrMsg, "too few operands on stack at ", zBuf, 0);
|
||||
sqliteSetString(&p->zErrMsg, "too few operands on stack at ", zBuf, (char*)0);
|
||||
rc = SQLITE_INTERNAL;
|
||||
goto vdbe_halt;
|
||||
|
||||
@@ -4805,7 +4805,7 @@ not_enough_stack:
|
||||
VERIFY(
|
||||
bad_instruction:
|
||||
sprintf(zBuf,"%d",pc);
|
||||
sqliteSetString(&p->zErrMsg, "illegal operation at ", zBuf, 0);
|
||||
sqliteSetString(&p->zErrMsg, "illegal operation at ", zBuf, (char*)0);
|
||||
rc = SQLITE_INTERNAL;
|
||||
goto vdbe_halt;
|
||||
)
|
||||
|
@@ -515,7 +515,7 @@ int sqliteVdbeList(
|
||||
}else{
|
||||
p->rc = SQLITE_INTERRUPT;
|
||||
}
|
||||
sqliteSetString(&p->zErrMsg, sqlite_error_string(p->rc), 0);
|
||||
sqliteSetString(&p->zErrMsg, sqlite_error_string(p->rc), (char*)0);
|
||||
break;
|
||||
}
|
||||
sprintf(p->zStack[0],"%d",i);
|
||||
@@ -819,7 +819,7 @@ int sqliteVdbeReset(Vdbe *p, char **pzErrMsg){
|
||||
int i;
|
||||
|
||||
if( p->magic!=VDBE_MAGIC_RUN && p->magic!=VDBE_MAGIC_HALT ){
|
||||
sqliteSetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), 0);
|
||||
sqliteSetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), (char*)0);
|
||||
return SQLITE_MISUSE;
|
||||
}
|
||||
if( p->zErrMsg ){
|
||||
@@ -903,7 +903,7 @@ int sqliteVdbeFinalize(Vdbe *p, char **pzErrMsg){
|
||||
sqlite *db;
|
||||
|
||||
if( p->magic!=VDBE_MAGIC_RUN && p->magic!=VDBE_MAGIC_HALT ){
|
||||
sqliteSetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), 0);
|
||||
sqliteSetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), (char*)0);
|
||||
return SQLITE_MISUSE;
|
||||
}
|
||||
db = p->db;
|
||||
|
@@ -12,7 +12,7 @@
|
||||
** This module contains C code that generates VDBE code used to process
|
||||
** the WHERE clause of SQL statements.
|
||||
**
|
||||
** $Id: where.c,v 1.83 2003/09/27 13:39:39 drh Exp $
|
||||
** $Id: where.c,v 1.84 2003/12/06 21:43:56 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
|
||||
@@ -383,7 +383,7 @@ WhereInfo *sqliteWhereBegin(
|
||||
char zBuf[50];
|
||||
sprintf(zBuf, "%d", (int)ARRAYSIZE(aExpr)-1);
|
||||
sqliteSetString(&pParse->zErrMsg, "WHERE clause too complex - no more "
|
||||
"than ", zBuf, " terms allowed", 0);
|
||||
"than ", zBuf, " terms allowed", (char*)0);
|
||||
pParse->nErr++;
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user