Fix the CSE mechanism so that it takes into account column affinity
changes that might be imposed by comparison operators. (CVS 4949)
FossilOrigin-Name: 91cc646e2b0c1d62a1989405cc9384a2c22d98d0
diff --git a/src/insert.c b/src/insert.c
index e075400..3188def 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.234 2008/03/31 23:48:05 drh Exp $
+** $Id: insert.c,v 1.235 2008/04/01 05:07:15 drh Exp $
*/
#include "sqliteInt.h"
@@ -1171,7 +1171,7 @@
sqlite3VdbeAddOp2(v, OP_SCopy, regRowid, regIdx+i);
sqlite3VdbeAddOp3(v, OP_MakeRecord, regIdx, pIdx->nColumn+1, aRegIdx[iCur]);
sqlite3IndexAffinityStr(v, pIdx);
- sqlite3ExprExpireColumnCacheLines(pParse, regIdx, regIdx+pIdx->nColumn);
+ sqlite3ExprCacheAffinityChange(pParse, regIdx, pIdx->nColumn+1);
sqlite3ReleaseTempRange(pParse, regIdx, pIdx->nColumn+1);
/* Find out what action to take in case there is an indexing conflict */
@@ -1286,7 +1286,7 @@
regRec = sqlite3GetTempReg(pParse);
sqlite3VdbeAddOp3(v, OP_MakeRecord, regData, pTab->nCol, regRec);
sqlite3TableAffinityStr(v, pTab);
- sqlite3ExprExpireColumnCacheLines(pParse, regData, regData+pTab->nCol-1);
+ sqlite3ExprCacheAffinityChange(pParse, regData, pTab->nCol);
#ifndef SQLITE_OMIT_TRIGGER
if( newIdx>=0 ){
sqlite3VdbeAddOp3(v, OP_Insert, newIdx, regRec, regRowid);