Disable external merge source when SQLITE_TEMP_STORE==3. Add documentation
to the OP_OpenSorter opcode.
FossilOrigin-Name: 5a690486811379cea40c6ed48b2902f421234832
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index bcf6a59..c97499b 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -367,6 +367,14 @@
#endif
/*
+** If all temporary storage is in-memory, then omit the external merge-sort
+** logic since it is superfluous.
+*/
+#if SQLITE_TEMP_STORE==3 && !defined(SQLITE_OMIT_MERGE_SORT)
+# define SQLITE_OMIT_MERGE_SORT
+#endif
+
+/*
** GCC does not define the offsetof() macro so we'll have to do it
** ourselves.
*/