-C A\svdbe\sstack\selement\smight\shave\sa\sstring\svalue\seven\safter\sa\scall\sto\nIntegerify().\s\sTicket\s#641.\s(CVS\s1283)
-D 2004-03-03T01:51:25
+C Correct\sduplicate\stracing\sof\sSQL\sstatements.\s(CVS\s1284)
+D 2004-03-04T19:09:20
F Makefile.in afc6c0377773421633e592347097ad036eef6aeb
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
F src/hash.c 9b56ef3b291e25168f630d5643a4264ec011c70e
F src/hash.h 3247573ab95b9dd90bcca0307a75d9a16da1ccc7
F src/insert.c c0485ee2d1b99322894e2d1e0b576fd05ed75616
-F src/main.c 2956e9332241ff9e62c25f370d0615a9981e6d8f
+F src/main.c 8e1b406d661c6475cc27d4b2b9422d1d2ab94cf7
F src/md5.c fe4f9c9c6f71dfc26af8da63e4d04489b1430565
F src/os.c afcc304d13b0d28755984aa1636e66370210d3e3
F src/os.h 250a3789be609adfee5c5aa20137ce8683276f24
F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da
F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1
F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
-P 5aaa2939baa972231def086ed5f9d9ba63302532
-R d722781e30098df56cdb3e08d2d9a7bf
-U drh
-Z b4ad96d33af4159614ecafeca0eb02b2
+P 3cac4b7b526d6c5dbf394009b534707bcb65b0da
+R 0b806b4fc15359bff501f8bfa4b713b2
+U rdc
+Z 6400d4c7cfcdcdab8fe7e7a7838b1180
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
-** $Id: main.c,v 1.161 2004/02/25 22:51:06 rdc Exp $
+** $Id: main.c,v 1.162 2004/03/04 19:09:20 rdc Exp $
*/
#include "sqliteInt.h"
#include "os.h"
if( db->pVdbe==0 ){ db->nChange = 0; }
memset(&sParse, 0, sizeof(sParse));
sParse.db = db;
- if( db->xTrace ) db->xTrace(db->pTraceArg, zSql);
sqliteRunParser(&sParse, zSql, pzErrMsg);
+ if( db->xTrace ){
+ /* Trace only the statment that was compiled.
+ ** Make a copy of that part of the SQL string since zSQL is const
+ ** and we must pass a zero terminated string to the trace function
+ ** The copy is unnecessary if the tail pointer is pointing at the
+ ** beginnig or end of the SQL string.
+ */
+ if( sParse.zTail && sParse.zTail!=zSql && *sParse.zTail ){
+ char *tmpSql = sqliteStrNDup(zSql, sParse.zTail - zSql);
+ if( tmpSql ){
+ db->xTrace(db->pTraceArg, tmpSql);
+ free(tmpSql);
+ }else{
+ /* If a memory error occurred during the copy,
+ ** trace entire SQL string and fall through to the
+ ** sqlite_malloc_failed test to report the error.
+ */
+ db->xTrace(db->pTraceArg, zSql);
+ }
+ }else{
+ db->xTrace(db->pTraceArg, zSql);
+ }
+ }
if( sqlite_malloc_failed ){
sqliteSetString(pzErrMsg, "out of memory", (char*)0);
sParse.rc = SQLITE_NOMEM;