Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Merge latest trunk fixes into this branch. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | ota-update |
Files: | files | file ages | folders |
SHA1: |
5efafef51d146bcba3adc425561bfa1a |
User & Date: | dan 2014-09-15 16:57:10 |
Context
2014-09-15
| ||
19:34 | Remove the experimental sqlite3_transaction_save() and restore() APIs. check-in: 48d201cd user: dan tags: ota-update | |
16:57 | Merge latest trunk fixes into this branch. check-in: 5efafef5 user: dan tags: ota-update | |
16:53 | Fix tool/showwal.c so that it handles WAL files that contain 64KiB pages. check-in: 4060efb6 user: dan tags: trunk | |
15:34 | Merge latest trunk changes with this branch. check-in: 55b8011d user: dan tags: ota-update | |
Changes
Changes to src/vdbesort.c.
597 597 ** mmap), return SQLITE_OK and set *pp to NULL. 598 598 ** 599 599 ** Or, if an error occurs, return an SQLite error code. The final value of 600 600 ** *pp is undefined in this case. 601 601 */ 602 602 static int vdbeSorterMapFile(SortSubtask *pTask, SorterFile *pFile, u8 **pp){ 603 603 int rc = SQLITE_OK; 604 - if( pFile->iEof<=(i64)(pTask->pSorter->db->nMaxSorterMmap) 605 - && pFile->pFd->pMethods->xFetch 606 - ){ 607 - rc = sqlite3OsFetch(pFile->pFd, 0, (int)pFile->iEof, (void**)pp); 608 - testcase( rc!=SQLITE_OK ); 604 + if( pFile->iEof<=(i64)(pTask->pSorter->db->nMaxSorterMmap) ){ 605 + sqlite3_file *pFd = pFile->pFd; 606 + if( pFd->pMethods->iVersion>=3 ){ 607 + rc = sqlite3OsFetch(pFd, 0, (int)pFile->iEof, (void**)pp); 608 + testcase( rc!=SQLITE_OK ); 609 + } 609 610 } 610 611 return rc; 611 612 } 612 613 613 614 /* 614 615 ** Attach PmaReader pReadr to file pFile (if it is not already attached to 615 616 ** that file) and seek it to offset iOff within the file. Return SQLITE_OK ................................................................................ 1121 1122 ** 1122 1123 ** Whether or not the file does end up memory mapped of course depends on 1123 1124 ** the specific VFS implementation. 1124 1125 */ 1125 1126 static void vdbeSorterExtendFile(sqlite3 *db, sqlite3_file *pFd, i64 nByte){ 1126 1127 if( nByte<=(i64)(db->nMaxSorterMmap) ){ 1127 1128 int rc = sqlite3OsTruncate(pFd, nByte); 1128 - if( rc==SQLITE_OK && pFd->pMethods->xFetch ){ 1129 + if( rc==SQLITE_OK && pFd->pMethods->iVersion>=3 ){ 1129 1130 void *p = 0; 1130 1131 sqlite3OsFetch(pFd, 0, (int)nByte, &p); 1131 1132 sqlite3OsUnfetch(pFd, 0, p); 1132 1133 } 1133 1134 } 1134 1135 } 1135 1136 #else
Added test/sort5.test.
1 +# 2014 September 15. 2 +# 3 +# The author disclaims copyright to this source code. In place of 4 +# a legal notice, here is a blessing: 5 +# 6 +# May you do good and not evil. 7 +# May you find forgiveness for yourself and forgive others. 8 +# May you share freely, never taking more than you give. 9 +# 10 +#*********************************************************************** 11 +# This file implements regression tests for SQLite library. 12 +# 13 + 14 +set testdir [file dirname $argv0] 15 +source $testdir/tester.tcl 16 +set testprefix sort5 17 + 18 + 19 +#------------------------------------------------------------------------- 20 +# Verify that sorting works with a version 1 sqlite3_io_methods structure. 21 +# 22 +testvfs tvfs -iversion 1 -default true 23 +reset_db 24 +do_execsql_test 1.0 { 25 + PRAGMA mmap_size = 10000000; 26 + PRAGMA cache_size = 10; 27 + CREATE TABLE t1(a, b); 28 +} {0} 29 + 30 +do_test 1.1 { 31 + execsql BEGIN 32 + for {set i 0} {$i < 2000} {incr i} { 33 + execsql { INSERT INTO t1 VALUES($i, randomblob(2000)) } 34 + } 35 + execsql COMMIT 36 +} {} 37 + 38 +do_execsql_test 1.2 { 39 + CREATE INDEX i1 ON t1(b); 40 +} 41 + 42 +db close 43 +tvfs delete 44 +finish_test 45 +