1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Additional tests and some improvements to the INSERT transfer

optimization.  More testing is needed. (CVS 3661)

FossilOrigin-Name: 830985814345f71ba2def3c206e36aabe9e1ee7c
This commit is contained in:
drh
2007-02-24 13:53:05 +00:00
parent 8103b7d2b7
commit dd73521bc2
6 changed files with 87 additions and 22 deletions

View File

@@ -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++;