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/manifest b/manifest
index eb2afb9..a888437 100644
--- a/manifest
+++ b/manifest
@@ -1,8 +1,8 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-C Remove\s"const"\sfrom\sparameter\sof\ssqlite3BtreeFactory()\sto\savoid\sa\scompiler\nwarning.
-D 2009-11-04T13:30:02
+C Recover\san\sophaned\sbranch\sthat\sresulted\sfrom\ssome\sill-advised\s"shunning".\nThis\scheck-in\sshould\sbe\sidentical\sto\s[bd443f39a9]\sexcept\sthat\sit\sshould\nbe\son\sthe\strunk.
+D 2009-11-05T18:46:03
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in a77dfde96ad86aafd3f71651a4333a104debe86a
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -151,7 +151,7 @@
 F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5
 F src/os_unix.c a4b4ea928ce31ed34cb8f90ed36a35df19312fad
 F src/os_win.c 5ffab20249a61e0625f869efe157fa009747039b
-F src/pager.c 729f73feeb33355ae1f0982a74f112ce190c74aa
+F src/pager.c 36e29a1056457305d3afc5a8f81f7d9bf27dd70d
 F src/pager.h 11852d044c86cf5a9d6e34171fb0c4fcf1f6265f
 F src/parse.y 0204f0dfe8974dc2a0d46eb9ab98a433a1f963d6
 F src/pcache.c c92ffd4f3e1279b3766854c6d18b5bf4aac0d1fa
@@ -165,10 +165,10 @@
 F src/rowset.c c64dafba1f9fd876836c8db8682966b9d197eb1f
 F src/select.c cbe366a0ce114856e66f5daf0f848d7c48a88298
 F src/shell.c f66531a57fff927f95c98d99c28237d88e400c86
-F src/sqlite.h.in 9106176cf206c36f01f8b761ba62671818bbe6ff
+F src/sqlite.h.in 4464e9772122f0447305d425e04d122b6f1bffec
 F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17
-F src/sqliteInt.h 67a9ae42527204726d8eb7a58cdb238d659a82fa
-F src/sqliteLimit.h 38b2fffcd01faeaeaadea71b2b47695a81580c8b
+F src/sqliteInt.h 55d26b83d16107804693982028c8b3a075f5a836
+F src/sqliteLimit.h 285dd7140722adfa9998b9393314eaaf50215c27
 F src/status.c 237b193efae0cf6ac3f0817a208de6c6c6ef6d76
 F src/table.c cc86ad3d6ad54df7c63a3e807b5783c90411a08d
 F src/tclsqlite.c c2c4047177213baf485d4401c7dbb30a3c2ba322
@@ -214,7 +214,7 @@
 F src/vdbeapi.c 44b5f387459d5faa158aa8d3a26967f0c8596efd
 F src/vdbeaux.c 0fac44db16b5dc116eb1cacbe619033cb09569c3
 F src/vdbeblob.c 9bfaeab22e261a6a7b6df04e7faaf7d6dfdbef5a
-F src/vdbemem.c 7055a2941a7802094f4704cedc7a28cc88a23749
+F src/vdbemem.c e86a65cb779eaae34710a6ffc0e76c9f7c1107be
 F src/vtab.c 3e54fe39374e5feb8b174de32a90e7a21966025d
 F src/walker.c 1edca756275f158b80f20eb6f104c8d3fcc96a04
 F src/where.c fac37876e09e005e52cdfcf896090b6f5ebbf25b
@@ -764,14 +764,14 @@
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 24a4d520d540d92b611abc4eb57dc6da9be4eac6
-R a2178242a921307d19fbc8b7d2eec4f0
+P eb7a544fe49d1626bacecfe53ddc03fe082e3243
+R c637d844ce67664e51752e29538bdaf8
 U drh
-Z a8d4aa9309aed4b69860cd88128a4708
+Z 8f4c0080b7919755fbda5ad097f0669b
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.6 (GNU/Linux)
 
-iD8DBQFK8YHdoxKgR168RlERAs0DAJ447A8mNmnCD0zy/gACLgqIHsmF8QCfYMHu
-do95dSeuDXCMLnSZQtGGeQE=
-=FnZg
+iD8DBQFK8x1uoxKgR168RlERAuoNAJ9GWKls+NAdOdJELmZAftlGi0dLXgCeMJzv
+wVD4wzQxZqdtkqp/9IhpEQI=
+=DLAB
 -----END PGP SIGNATURE-----
diff --git a/manifest.uuid b/manifest.uuid
index d60694a..f55e973 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-eb7a544fe49d1626bacecfe53ddc03fe082e3243
\ No newline at end of file
+38eaf1ab6e05161e6dc7cd69e942aeca16548c45
\ No newline at end of file
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 ){