diff --git a/manifest b/manifest index 1c46a851c2..961e684e99 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Tests\sin\slock.test\sno\sconform\sto\sthe\snew\slocking\sscheme.\s(CVS\s1557) -D 2004-06-10T01:08:06 +C Add\sthe\svdbe_listing\sand\ssql_trace\spragmas\sused\sfor\sdebugging.\s(CVS\s1558) +D 2004-06-10T01:30:59 F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457 F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd @@ -37,7 +37,7 @@ F src/hash.c 440c2f8cb373ee1b4e13a0988489c7cd95d55b6f F src/hash.h 762d95f1e567664d1eafc1687de755626be962fb F src/insert.c 4268d9e3959cc845ea243fb4ec7507269404dad9 F src/legacy.c ad23746f15f67e34577621b1875f639c94839e1f -F src/main.c 185b7bbac8bbc341b7b6028625c569a651a7fdd6 +F src/main.c 6f1c01a587f1037f47bd8926dfa3246c0d04d196 F src/md5.c 4302e84ae516c616bb079c4e6d038c0addb33481 F src/os.h 23c69c5084e71b5fe199ff1c4e35a4aded0f1380 F src/os_common.h 6393ac67a3a7b4aea19ff17529980ecf77eb2348 @@ -47,16 +47,16 @@ F src/os_unix.c 1d6f3d1a87d4aa0e4490bcc47b3f0ff9b2e37e7a F src/os_unix.h 1cd6133cf66dea704b8646b70b2dfdcbdd9b3738 F src/os_win.c 6b8f9fcc683bb888e07fc485372803baa68faadb F src/os_win.h 004eec47b1780fcaf07420ddc2072294b698d48c -F src/pager.c d1202ce02f7033e08e84c270106fbe688dcf42cd +F src/pager.c 70a372bd83fcd79846a49f3d9266d2773442cc82 F src/pager.h ca8f293e1d623a7c628a1c5e0c6cf43d5bbb80bf F src/parse.y 097438674976355a10cf177bd97326c548820b86 -F src/pragma.c 3251628662963f30a95133b19d59e4bc08226c76 +F src/pragma.c 6ab13748a415bf8e8f2dd79e5f713fbe72dfd3f4 F src/printf.c 63b15f1ea9fe3daa066bb7430fd20d4a2d717dc8 F src/random.c eff68e3f257e05e81eae6c4d50a51eb88beb4ff3 F src/select.c 1f8355e702f109f6771f82a9bfe7aac4c82cbaf2 F src/shell.c ca519519dcbbc582f6d88f7d0e7583b857fd3469 F src/sqlite.h.in 6ad05abc7fd72da74691e1eb45f0eff4117eba4e -F src/sqliteInt.h 52b73ec6ebd5fe342cc15007771c63ccaf767cbe +F src/sqliteInt.h 88bcc2967b7c62f9a74d866e504847bba01a27e7 F src/table.c af14284fa36c8d41f6829e3f2819dce07d3e2de2 F src/tclsqlite.c f5c5116720baefb7de5d6acf18baedf1e42756cc F src/test1.c f78d6ac0675bc5db48dac9c5379c965bdadb9113 @@ -74,7 +74,7 @@ F src/vdbe.c 90e0e6bdbdf9b77c66f2500374b5784d30c323fa F src/vdbe.h 46f74444a213129bc4b5ce40124dd8ed613b0cde F src/vdbeInt.h d41605853332bdbd600d7ecd60e1f54bbaea174e F src/vdbeapi.c 4ac95766b0515538037a7aec172ed26142f97cf9 -F src/vdbeaux.c ca11b43529a6cd7c5c848d1a0562cca15f1e7308 +F src/vdbeaux.c 6f5b26a6b4d9c9f0f99a9f75dce9460e5a90542e F src/vdbemem.c 04502b81039f9a2b1c9a096e894eecf6d4877508 F src/where.c 32578882a245f8ac3303c5cea4664cd51fc73891 F test/all.test 569a92a8ee88f5300c057cc4a8f50fbbc69a3242 @@ -158,7 +158,7 @@ F test/threadtest2.c d94ca4114fd1504f7e0ae724bcd83d4b40931d86 F test/trans.test 4a26c6fa3639202c334521954c17d8abe8a1c8e8 F test/trigger1.test 99b7cd9a568ac60aa04bbc3b9db9575ffa97709a F test/trigger2.test 0767ab30cb5a2c8402c8524f3d566b410b6f5263 -F test/trigger3.test a95ccace88291449f5eae7139ec438a42f90654d +F test/trigger3.test 895301736db4f0f111815f43502d9bdb150cc722 F test/trigger4.test 542afce45774e8f8e1130b96b8675f414d6e4bd8 F test/types.test 6c49e574970866558365a025b44c9fd8a162ef0d F test/types2.test 5d725fcb68dbd032c6d4950d568d75fa33872687 @@ -218,7 +218,7 @@ F www/support.tcl 1801397edd271cc39a2aadd54e701184b5181248 F www/tclsqlite.tcl 19191cf2a1010eaeff74c51d83fd5f5a4d899075 F www/vdbe.tcl 59288db1ac5c0616296b26dce071c36cb611dfe9 F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4 -P 3b78ffe0b5dfa20e5c638d85ed400afda8a9f948 -R c24b45928c08ef79b943729c16fbee09 +P a60afd04c5296020e5e72c4d35063fd1e6f90e9e +R ef21e9b582fc0857d2dbfc2cd3336d42 U drh -Z d26763f7e9e7e34a6d973c83f7a82c78 +Z feb0030425bea46368b7928207633687 diff --git a/manifest.uuid b/manifest.uuid index 177b4179a5..b9e31303d9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a60afd04c5296020e5e72c4d35063fd1e6f90e9e \ No newline at end of file +28c3cc088018833f507535b8d227232776cff204 \ No newline at end of file diff --git a/src/main.c b/src/main.c index 2e15479d12..118b388df4 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.211 2004/06/10 00:29:09 drh Exp $ +** $Id: main.c,v 1.212 2004/06/10 01:30:59 drh Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -931,6 +931,16 @@ int sqlite3_prepare( } } + /* Print a copy of SQL as it is executed if the SQL_TRACE pragma is turned + ** on in debugging mode. + */ +#ifdef SQLITE_DEBUG + if( (db->flags & SQLITE_SqlTrace)!=0 && sParse.zTail && sParse.zTail!=zSql ){ + sqlite3DebugPrintf("SQL-trace: %.*s\n", sParse.zTail - zSql, zSql); + } +#endif /* SQLITE_DEBUG */ + + if( sqlite3_malloc_failed ){ rc = SQLITE_NOMEM; sqlite3RollbackAll(db); diff --git a/src/pager.c b/src/pager.c index e9269f8130..7a26114789 100644 --- a/src/pager.c +++ b/src/pager.c @@ -18,7 +18,7 @@ ** file simultaneously, or one process from reading the database while ** another is writing. ** -** @(#) $Id: pager.c,v 1.118 2004/06/10 00:51:44 drh Exp $ +** @(#) $Id: pager.c,v 1.119 2004/06/10 01:30:59 drh Exp $ */ #include "os.h" /* Must be first to enable large file support */ #include "sqliteInt.h" @@ -29,13 +29,13 @@ /* ** Macros for troubleshooting. Normally turned off */ -#if 0 +#if 1 static Pager *mainPager = 0; #define SET_PAGER(X) if( mainPager==0 ) mainPager = (X) #define CLR_PAGER(X) if( mainPager==(X) ) mainPager = 0 -#define TRACE1(X) if( pPager==mainPager ) fprintf(stderr,X) -#define TRACE2(X,Y) if( pPager==mainPager ) fprintf(stderr,X,Y) -#define TRACE3(X,Y,Z) if( pPager==mainPager ) fprintf(stderr,X,Y,Z) +#define TRACE1(X) if( pPager==mainPager ) sqlite3DebugPrintf(X) +#define TRACE2(X,Y) if( pPager==mainPager ) sqlite3DebugPrintf(X,Y) +#define TRACE3(X,Y,Z) if( pPager==mainPager ) sqlite3DebugPrintf(X,Y,Z) #else #define SET_PAGER(X) #define CLR_PAGER(X) diff --git a/src/pragma.c b/src/pragma.c index 9a6eac16a0..05a1d034df 100644 --- a/src/pragma.c +++ b/src/pragma.c @@ -11,7 +11,7 @@ ************************************************************************* ** This file contains code used to implement the PRAGMA command. ** -** $Id: pragma.c,v 1.40 2004/06/09 14:17:21 drh Exp $ +** $Id: pragma.c,v 1.41 2004/06/10 01:30:59 drh Exp $ */ #include "sqliteInt.h" #include @@ -122,6 +122,8 @@ static int flagPragma(Parse *pParse, const char *zLeft, const char *zRight){ int mask; /* Mask for the db->flags value */ } aPragma[] = { { "vdbe_trace", SQLITE_VdbeTrace }, + { "sql_trace", SQLITE_SqlTrace }, + { "vdbe_listing", SQLITE_VdbeListing }, { "full_column_names", SQLITE_FullColNames }, { "short_column_names", SQLITE_ShortColNames }, { "count_changes", SQLITE_CountRows }, diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 18fa040718..37dd9c749e 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -11,7 +11,7 @@ ************************************************************************* ** Internal interface definitions for SQLite. ** -** @(#) $Id: sqliteInt.h,v 1.277 2004/06/10 00:29:10 drh Exp $ +** @(#) $Id: sqliteInt.h,v 1.278 2004/06/10 01:30:59 drh Exp $ */ #include "config.h" #include "sqlite3.h" @@ -444,6 +444,8 @@ struct sqlite { /* the count using a callback. */ #define SQLITE_NullCallback 0x00000100 /* Invoke the callback once if the */ /* result set is empty */ +#define SQLITE_SqlTrace 0x00000200 /* Debug print SQL as it executes */ +#define SQLITE_VdbeListing 0x00000400 /* Debug listings of VDBE programs */ /* ** Possible values for the sqlite.magic field. diff --git a/src/vdbeaux.c b/src/vdbeaux.c index f16a990128..598b0c6b51 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -654,7 +654,9 @@ void sqlite3VdbeMakeReady( sqlite3HashInit(&p->agg.hash, SQLITE_HASH_BINARY, 0); p->agg.pSearch = 0; #ifdef SQLITE_DEBUG - if( sqlite3OsFileExists("vdbe_explain") ){ + if( (p->db->flags & SQLITE_VdbeListing)!=0 + || sqlite3OsFileExists("vdbe_explain") + ){ int i; printf("VDBE Program Listing:\n"); for(i=0; inOp; i++){ diff --git a/test/trigger3.test b/test/trigger3.test index a83c6343e7..2e196f4cd6 100644 --- a/test/trigger3.test +++ b/test/trigger3.test @@ -10,8 +10,15 @@ # This file tests the RAISE() function. # + set testdir [file dirname $argv0] source $testdir/tester.tcl +set sqlite_os_trace 1 +execsql { + PRAGMA vdbe_listing=on; + PRAGMA sql_trace=on; + PRAGMA vdbe_trace=on; +} # Test that we can cause ROLLBACK, FAIL and ABORT correctly # catchsql { DROP TABLE tbl; } @@ -45,6 +52,7 @@ do_test trigger3-1.2 { do_test trigger3-1.3 { execsql {SELECT * FROM tbl} } {} +exit # FAIL do_test trigger3-2.1 {