Fix a problem with CASTs and the new CSE mechanism. (CVS 4950)

FossilOrigin-Name: e25939fb25ec8bde8500a672ca5be3cbb514ac3a
diff --git a/src/expr.c b/src/expr.c
index 6067aff..ec9f7d5 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -12,7 +12,7 @@
 ** This file contains routines used for analyzing expressions and
 ** for generating VDBE code that evaluates expressions in SQLite.
 **
-** $Id: expr.c,v 1.362 2008/04/01 05:07:15 drh Exp $
+** $Id: expr.c,v 1.363 2008/04/01 12:24:11 drh Exp $
 */
 #include "sqliteInt.h"
 #include <ctype.h>
@@ -2204,6 +2204,7 @@
       assert( to_op==OP_ToInt     || aff!=SQLITE_AFF_INTEGER );
       assert( to_op==OP_ToReal    || aff!=SQLITE_AFF_REAL    );
       sqlite3VdbeAddOp1(v, to_op, inReg);
+      sqlite3ExprCacheAffinityChange(pParse, inReg, 1);
       break;
     }
 #endif /* SQLITE_OMIT_CAST */