diff options
author | drh <drh@noemail.net> | 2007-02-24 13:53:05 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2007-02-24 13:53:05 +0000 |
commit | dd73521bc26ccd24bc8652f672c74c2fcdc6f0f4 (patch) | |
tree | 5cb02f1e43c04897fdfe02f7cb0190634c501835 /src/insert.c | |
parent | 8103b7d2b7fa06f42494cb8d22c75e67d4acd4cb (diff) | |
download | sqlite-dd73521bc26ccd24bc8652f672c74c2fcdc6f0f4.tar.gz sqlite-dd73521bc26ccd24bc8652f672c74c2fcdc6f0f4.zip |
Additional tests and some improvements to the INSERT transfer
optimization. More testing is needed. (CVS 3661)
FossilOrigin-Name: 830985814345f71ba2def3c206e36aabe9e1ee7c
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++; |