/ Check-in [82dd61fc]
Login

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

Overview
Comment:Sync the database file after a rollback. This is a cherrypick merge of check-in [b21b911f23].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | branch-3.6.22
Files: files | file ages | folders
SHA1: 82dd61fccff3e4c77e060e5734cd4b4e2eeb7c32
User & Date: drh 2010-03-22 23:55:10
Context
2010-03-22
23:55
Sync the database file after a rollback. This is a cherrypick merge of check-in [b21b911f23]. Leaf check-in: 82dd61fc user: drh tags: branch-3.6.22
2010-03-03
22:40
Modify the sqlite3_log() interface and implementation so that it never uses dynamic memory allocation - to avoid deadlocking when called while holding the memory allocator mutex. Cherry-pick merge of [28d1bc98d6]. check-in: 6f368b54 user: drh tags: branch-3.6.22
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/pager.c.

2014
2015
2016
2017
2018
2019
2020



2021
2022
2023
2024
2025
2026
2027
  */
  pPager->changeCountDone = pPager->tempFile;

  if( rc==SQLITE_OK ){
    zMaster = pPager->pTmpSpace;
    rc = readMasterJournal(pPager->jfd, zMaster, pPager->pVfs->mxPathname+1);
    testcase( rc!=SQLITE_OK );



  }
  if( rc==SQLITE_OK ){
    rc = pager_end_transaction(pPager, zMaster[0]!='\0');
    testcase( rc!=SQLITE_OK );
  }
  if( rc==SQLITE_OK && zMaster[0] && res ){
    /* If there was a master journal and this routine will return success,







>
>
>







2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
  */
  pPager->changeCountDone = pPager->tempFile;

  if( rc==SQLITE_OK ){
    zMaster = pPager->pTmpSpace;
    rc = readMasterJournal(pPager->jfd, zMaster, pPager->pVfs->mxPathname+1);
    testcase( rc!=SQLITE_OK );
  }
  if( rc==SQLITE_OK && pPager->noSync==0 && pPager->state>=PAGER_EXCLUSIVE ){
    rc = sqlite3OsSync(pPager->fd, pPager->sync_flags);
  }
  if( rc==SQLITE_OK ){
    rc = pager_end_transaction(pPager, zMaster[0]!='\0');
    testcase( rc!=SQLITE_OK );
  }
  if( rc==SQLITE_OK && zMaster[0] && res ){
    /* If there was a master journal and this routine will return success,

Changes to test/crash8.test.

335
336
337
338
339
340
341
342


























343
  } {def}

  do_test crash8-4.10 {
    file delete $zMasterJournal
    execsql { SELECT b FROM main.ab WHERE a = 0 }
  } {jkl}
}



























finish_test








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
  } {def}

  do_test crash8-4.10 {
    file delete $zMasterJournal
    execsql { SELECT b FROM main.ab WHERE a = 0 }
  } {jkl}
}

catch { db close }
file delete -force test.db test.db-journal
sqlite3 db test.db

do_test crash8-5.1 {
  execsql {
    CREATE TABLE t1(x PRIMARY KEY);
    INSERT INTO t1 VALUES(randomblob(900));
    INSERT INTO t1 SELECT randomblob(900) FROM t1;
    INSERT INTO t1 SELECT randomblob(900) FROM t1;
    INSERT INTO t1 SELECT randomblob(900) FROM t1;
    INSERT INTO t1 SELECT randomblob(900) FROM t1;
    INSERT INTO t1 SELECT randomblob(900) FROM t1;
    INSERT INTO t1 SELECT randomblob(900) FROM t1;          /* 64 */
  }
  crashsql -file test.db -delay 1 {
    PRAGMA cache_size = 10;
    BEGIN;
      UPDATE t1 SET x = randomblob(900);
    ROLLBACK;
    INSERT INTO t1 VALUES(randomblob(900));
  }
  execsql { PRAGMA integrity_check }
} {ok}


finish_test