1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-27 08:52:26 +03:00

Improved test coverage on insert.c. (CVS 2210)

FossilOrigin-Name: c772f75166d55192132e732e8a0ddda5926f00f2
This commit is contained in:
drh
2005-01-14 01:22:00 +00:00
parent 3b93bc8cb1
commit d6fe961ef4
4 changed files with 108 additions and 12 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.129 2005/01/10 02:48:49 danielk1977 Exp $
** $Id: insert.c,v 1.130 2005/01/14 01:22:01 drh Exp $
*/
#include "sqliteInt.h"
@@ -496,9 +496,8 @@ void sqlite3Insert(
sqlite3VdbeAddOp(v, OP_Integer, -1, 0);
}else if( useTempTable ){
sqlite3VdbeAddOp(v, OP_Column, srcTab, keyColumn);
}else if( pSelect ){
sqlite3VdbeAddOp(v, OP_Dup, nColumn - keyColumn - 1, 1);
}else{
assert( pSelect==0 ); /* Otherwise useTempTable is true */
sqlite3ExprCode(pParse, pList->a[keyColumn].pExpr);
sqlite3VdbeAddOp(v, OP_NotNull, -1, sqlite3VdbeCurrentAddr(v)+3);
sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
@@ -520,9 +519,8 @@ void sqlite3Insert(
sqlite3ExprCode(pParse, pTab->aCol[i].pDflt);
}else if( useTempTable ){
sqlite3VdbeAddOp(v, OP_Column, srcTab, j);
}else if( pSelect ){
sqlite3VdbeAddOp(v, OP_Dup, nColumn-j-1, 1);
}else{
assert( pSelect==0 ); /* Otherwise useTempTable is true */
sqlite3ExprCodeAndCache(pParse, pList->a[j].pExpr);
}
}