mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Begin the process over converting sqlite_exec() over to use sqlite_compile()
and sqlite_step(). The new sqlite_exec() is still commented out. (CVS 1237) FossilOrigin-Name: b8f2ba7880b761e380b95ae63d8ab721f018443e
This commit is contained in:
12
manifest
12
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Fix\sa\sbug\sin\sthe\squery\sflattener\swhen\strying\sto\sfind\sthe\sdatatype\sof\sthe\nrowid\sof\sa\sview.\s\sAlso\sfix\sa\sproblem\swith\ssqlite_compile()\sand\sauthorization\nfailures.\s(CVS\s1236)
|
C Begin\sthe\sprocess\sover\sconverting\ssqlite_exec()\sover\sto\suse\ssqlite_compile()\nand\ssqlite_step().\s\sThe\snew\ssqlite_exec()\sis\sstill\scommented\sout.\s(CVS\s1237)
|
||||||
D 2004-02-13T16:22:23
|
D 2004-02-13T16:30:10
|
||||||
F Makefile.in cfd75c46b335881999333a9e4b982fa8491f200b
|
F Makefile.in cfd75c46b335881999333a9e4b982fa8491f200b
|
||||||
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
|
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
|
||||||
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
|
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
|
||||||
@@ -36,7 +36,7 @@ F src/func.c cbc5edd10c82a5193b9ca0726873328be445e6c1
|
|||||||
F src/hash.c 9b56ef3b291e25168f630d5643a4264ec011c70e
|
F src/hash.c 9b56ef3b291e25168f630d5643a4264ec011c70e
|
||||||
F src/hash.h 3247573ab95b9dd90bcca0307a75d9a16da1ccc7
|
F src/hash.h 3247573ab95b9dd90bcca0307a75d9a16da1ccc7
|
||||||
F src/insert.c 01f66866f35c986eab4a57373ca689a3255ef2df
|
F src/insert.c 01f66866f35c986eab4a57373ca689a3255ef2df
|
||||||
F src/main.c 3230d9e31e7dd0800d5bd5c9bd59e58a73fdb776
|
F src/main.c cfe8ca913219dbfb45990a5bdac01ad63361a3f3
|
||||||
F src/md5.c fe4f9c9c6f71dfc26af8da63e4d04489b1430565
|
F src/md5.c fe4f9c9c6f71dfc26af8da63e4d04489b1430565
|
||||||
F src/os.c f5fc4954725b2fcd852979f2746085fe8ca27710
|
F src/os.c f5fc4954725b2fcd852979f2746085fe8ca27710
|
||||||
F src/os.h 250a3789be609adfee5c5aa20137ce8683276f24
|
F src/os.h 250a3789be609adfee5c5aa20137ce8683276f24
|
||||||
@@ -184,7 +184,7 @@ F www/sqlite.tcl 3c83b08cf9f18aa2d69453ff441a36c40e431604
|
|||||||
F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da
|
F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da
|
||||||
F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1
|
F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1
|
||||||
F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
|
F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
|
||||||
P 9f149fdc1c6af1c663b91c878ed1903f82f80245
|
P aa0490ccd4a820a707dfb4905e67c01ffb4f758b
|
||||||
R 0a1abd4879d35c7c70d8d469ebb2575b
|
R 3d4312db1b01209de5e7a503534ee386
|
||||||
U drh
|
U drh
|
||||||
Z ccb3ee1ecce4c81620c08fbe0b8c5332
|
Z 4885952f027f0f0cf39c7f995fa7e947
|
||||||
|
@@ -1 +1 @@
|
|||||||
aa0490ccd4a820a707dfb4905e67c01ffb4f758b
|
b8f2ba7880b761e380b95ae63d8ab721f018443e
|
54
src/main.c
54
src/main.c
@@ -14,7 +14,7 @@
|
|||||||
** other files are for internal use by SQLite and should not be
|
** other files are for internal use by SQLite and should not be
|
||||||
** accessed by users of the library.
|
** accessed by users of the library.
|
||||||
**
|
**
|
||||||
** $Id: main.c,v 1.150 2004/02/12 19:01:05 drh Exp $
|
** $Id: main.c,v 1.151 2004/02/13 16:30:10 drh Exp $
|
||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
@@ -681,9 +681,61 @@ int sqlite_exec(
|
|||||||
void *pArg, /* First argument to xCallback() */
|
void *pArg, /* First argument to xCallback() */
|
||||||
char **pzErrMsg /* Write error messages here */
|
char **pzErrMsg /* Write error messages here */
|
||||||
){
|
){
|
||||||
|
#if 1
|
||||||
return sqliteMain(db, zSql, xCallback, pArg, 0, 0, pzErrMsg);
|
return sqliteMain(db, zSql, xCallback, pArg, 0, 0, pzErrMsg);
|
||||||
|
#else
|
||||||
|
int rc;
|
||||||
|
const char *zLeftover;
|
||||||
|
sqlite_vm *pVm;
|
||||||
|
|
||||||
|
if( zSql==0 ) return SQLITE_OK;
|
||||||
|
while( zSql[0] ){
|
||||||
|
int nBusy = 0;
|
||||||
|
rc = sqlite_compile(db, zSql, &zLeftover, &pVm, pzErrMsg);
|
||||||
|
if( rc!=SQLITE_OK ){
|
||||||
|
/* sqlite_finalize(pVm, 0); */
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
while(1){
|
||||||
|
int nArg;
|
||||||
|
char **azArg, **azCol;
|
||||||
|
rc = sqlite_step(pVm, &nArg, &azArg, &azCol);
|
||||||
|
if( rc==SQLITE_ROW ){
|
||||||
|
if( xCallback(pArg, nArg, azArg, azCol) ){
|
||||||
|
sqlite_finalize(pVm, 0);
|
||||||
|
return SQLITE_ABORT;
|
||||||
|
}
|
||||||
|
#if 0
|
||||||
|
}else if( rc==SQLITE_BUSY ){
|
||||||
|
if( db->xBusyCallback==0
|
||||||
|
|| db->xBusyCallback(db->pBusyArg, "", nBusy++)==0 ){
|
||||||
|
sqlite_finalize(pVm, 0);
|
||||||
|
return SQLITE_BUSY;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}else if( rc==SQLITE_SCHEMA ){
|
||||||
|
sqlite_finalize(pVm, 0);
|
||||||
|
break;
|
||||||
|
}else{
|
||||||
|
rc = sqlite_finalize(pVm, pzErrMsg);
|
||||||
|
if( rc==SQLITE_SCHEMA ){
|
||||||
|
sqliteResetInternalSchema(db, 0);
|
||||||
|
/* break; */
|
||||||
|
}
|
||||||
|
if( rc!=SQLITE_OK ){
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
zSql = zLeftover;
|
||||||
|
while( isspace(zSql[0]) ) zSql++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return SQLITE_OK;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Compile a single statement of SQL into a virtual machine. Return one
|
** Compile a single statement of SQL into a virtual machine. Return one
|
||||||
** of the SQLITE_ success/failure codes. Also write an error message into
|
** of the SQLITE_ success/failure codes. Also write an error message into
|
||||||
|
Reference in New Issue
Block a user