Modifications and bugfixes so that the test suite passes with the TCL statement cache turned on. (CVS 2271)

FossilOrigin-Name: d5233e0747789dea04d35a8350b408321d23a64d
diff --git a/src/main.c b/src/main.c
index e2ffd31..9ab3d75 100644
--- a/src/main.c
+++ b/src/main.c
@@ -14,7 +14,7 @@
 ** other files are for internal use by SQLite and should not be
 ** accessed by users of the library.
 **
-** $Id: main.c,v 1.273 2005/01/21 08:13:15 danielk1977 Exp $
+** $Id: main.c,v 1.274 2005/01/24 10:25:59 danielk1977 Exp $
 */
 #include "sqliteInt.h"
 #include "os.h"
@@ -1287,6 +1287,14 @@
     );
     return SQLITE_ERROR;
   }
+
+  /* If removing a collation sequence, then set the expired flag for
+  ** all precompiled statements.
+  */
+  if( !xCompare ){
+    sqlite3ExpirePreparedStatements(db);
+  }
+
   pColl = sqlite3FindCollSeq(db, (u8)enc, zName, strlen(zName), 1);
   if( 0==pColl ){
    rc = SQLITE_NOMEM;