Recover an ophaned branch that resulted from some ill-advised "shunning".
This check-in should be identical to [bd443f39a9] except that it should
be on the trunk.

FossilOrigin-Name: 38eaf1ab6e05161e6dc7cd69e942aeca16548c45
diff --git a/src/pager.c b/src/pager.c
index 9ab6262..9686eb9 100644
--- a/src/pager.c
+++ b/src/pager.c
@@ -5054,7 +5054,7 @@
   void *pCodec
 ){
   if( pPager->xCodecFree ) pPager->xCodecFree(pPager->pCodec);
-  pPager->xCodec = xCodec;
+  pPager->xCodec = pPager->memDb ? 0 : xCodec;
   pPager->xCodecSizeChng = xCodecSizeChng;
   pPager->xCodecFree = xCodecFree;
   pPager->pCodec = pCodec;
diff --git a/src/sqlite.h.in b/src/sqlite.h.in
index 967986e..b206d01 100644
--- a/src/sqlite.h.in
+++ b/src/sqlite.h.in
@@ -820,7 +820,7 @@
 ** The sqlite3_initialize() routine initializes the
 ** SQLite library.  The sqlite3_shutdown() routine
 ** deallocates any resources that were allocated by sqlite3_initialize().
-** This routines are designed to aid in process initialization and
+** These routines are designed to aid in process initialization and
 ** shutdown on embedded systems.  Workstation applications using
 ** SQLite normally do not need to invoke either of these routines.
 **
@@ -2390,7 +2390,7 @@
 ** In the "v2" interfaces, the prepared statement
 ** that is returned (the [sqlite3_stmt] object) contains a copy of the
 ** original SQL text. This causes the [sqlite3_step()] interface to
-** behave a differently in three ways:
+** behave differently in three ways:
 **
 ** <ol>
 ** <li>
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index b47eba4..24debba 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -1508,7 +1508,7 @@
 ** the option is available (at compile-time).
 */
 #if SQLITE_MAX_VARIABLE_NUMBER<=32767
-typedef i64 ynVar;
+typedef i16 ynVar;
 #else
 typedef int ynVar;
 #endif
diff --git a/src/sqliteLimit.h b/src/sqliteLimit.h
index 77d7858..700420e 100644
--- a/src/sqliteLimit.h
+++ b/src/sqliteLimit.h
@@ -197,9 +197,5 @@
 ** may be executed.
 */
 #ifndef SQLITE_MAX_TRIGGER_DEPTH
-#if defined(SQLITE_SMALL_STACK)
-# define SQLITE_MAX_TRIGGER_DEPTH 10
-#else
 # define SQLITE_MAX_TRIGGER_DEPTH 1000
 #endif
-#endif
diff --git a/src/vdbemem.c b/src/vdbemem.c
index 8348324..e0200d8 100644
--- a/src/vdbemem.c
+++ b/src/vdbemem.c
@@ -1009,7 +1009,7 @@
   }
   op = pExpr->op;
   if( op==TK_REGISTER ){
-    op = pExpr->op2;
+    op = pExpr->op2;  /* This only happens with SQLITE_ENABLE_STAT2 */
   }
 
   if( op==TK_STRING || op==TK_FLOAT || op==TK_INTEGER ){