/ Check-in [bd04756b]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:When opening a temporary file to use in a merge-sort, pass SQLITE_OPEN_TEMP_JOURNAL instead of SQLITE_OPEN_TEMP_DB. This is a better fit, as merge-sort files are written and read sequentially like journal files.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: bd04756b66e343a7bc6c8bbed9e5cff7b9658d01
User & Date: dan 2011-08-15 14:41:01
Context
2011-08-15
15:27
New makefile target "sqlite3-debug.c" builds an amalgamation that include appropriate "#line" macros relating the code back to the original source files. check-in: 26f2da24 user: drh tags: trunk
14:41
When opening a temporary file to use in a merge-sort, pass SQLITE_OPEN_TEMP_JOURNAL instead of SQLITE_OPEN_TEMP_DB. This is a better fit, as merge-sort files are written and read sequentially like journal files. check-in: bd04756b user: dan tags: trunk
2011-08-13
10:47
Fix the header comment on the implementation of the file_control_sizehint_test TCL command in test1.c. check-in: 30919808 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbesort.c.

   359    359   ** Allocate space for a file-handle and open a temporary file. If successful,
   360    360   ** set *ppFile to point to the malloc'd file-handle and return SQLITE_OK.
   361    361   ** Otherwise, set *ppFile to 0 and return an SQLite error code.
   362    362   */
   363    363   static int vdbeSorterOpenTempFile(sqlite3 *db, sqlite3_file **ppFile){
   364    364     int dummy;
   365    365     return sqlite3OsOpenMalloc(db->pVfs, 0, ppFile,
   366         -      SQLITE_OPEN_TEMP_DB   |
   367         -      SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE |
   368         -      SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE, &dummy
          366  +      SQLITE_OPEN_TEMP_JOURNAL |
          367  +      SQLITE_OPEN_READWRITE    | SQLITE_OPEN_CREATE |
          368  +      SQLITE_OPEN_EXCLUSIVE    | SQLITE_OPEN_DELETEONCLOSE, &dummy
   369    369     );
   370    370   }
   371    371   
   372    372   
   373    373   /*
   374    374   ** Write the current contents of the b-tree to a PMA. Return SQLITE_OK
   375    375   ** if successful, or an SQLite error code otherwise.