diff options
Diffstat (limited to 'src/insert.c')
-rw-r--r-- | src/insert.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/insert.c b/src/insert.c index 6823a72cb..84853d980 100644 --- a/src/insert.c +++ b/src/insert.c @@ -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.174 2007/02/24 13:23:52 drh Exp $ +** $Id: insert.c,v 1.175 2007/02/24 13:53:05 drh Exp $ */ #include "sqliteInt.h" @@ -1297,6 +1297,16 @@ static int xferCompatibleIndex(Index *pDest, Index *pSrc){ return 1; } +#ifdef SQLITE_TEST +/* +** The following global variable is incremented whenever the +** transfer optimization is used. This is used for testing +** purposes only - to make sure the transfer optimization really +** is happening when it is suppose to. +*/ +int sqlite3_xferopt_count; +#endif /* SQLITE_TEST */ + /* ** Attempt the transfer optimization on INSERTs of the form ** @@ -1464,6 +1474,9 @@ static int xferOptimization( ** * We can conditionally do the transfer if the destination ** table is empty. */ +#ifdef SQLITE_TEST + sqlite3_xferopt_count++; +#endif iDbSrc = sqlite3SchemaToIndex(pParse->db, pSrc->pSchema); v = sqlite3GetVdbe(pParse); iSrc = pParse->nTab++; |