Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix an memory allocation error revealed by malloc3.test. (CVS 3733) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
0f7fdb022ca7c94f7d264192e18b6e2b |
User & Date: | drh 2007-03-28 01:59:34.000 |
Context
2007-03-28
| ||
13:07 | Update comments in sqlite3.h. No changes to code. (CVS 3734) (check-in: 1c2656fdf6 user: drh tags: trunk) | |
01:59 | Fix an memory allocation error revealed by malloc3.test. (CVS 3733) (check-in: 0f7fdb022c user: drh tags: trunk) | |
2007-03-27
| ||
22:24 | The SQLITE_ENABLE_LOAD_EXTENSION macro enables the load_extension() SQL function by default without having to invoke sqlite3_enable_load_extension() first. (CVS 3732) (check-in: 113aab2cdf user: drh tags: trunk) | |
Changes
Changes to src/pager.c.
︙ | |||
14 15 16 17 18 19 20 | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | - + | ** The pager is used to access a database disk file. It implements ** atomic commit and rollback through the use of a journal file that ** is separate from the database file. The pager also implements file ** locking to prevent two processes from writing the same database ** file simultaneously, or one process from reading the database while ** another is writing. ** |
︙ | |||
3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 | 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 | + + + | } rc = sqlite3OsOpenExclusive(pPager->zJournal, &pPager->jfd, pPager->tempFile); pPager->journalOff = 0; pPager->setMaster = 0; pPager->journalHdr = 0; if( rc!=SQLITE_OK ){ if( rc==SQLITE_NOMEM ){ sqlite3OsDelete(pPager->zJournal); } goto failed_to_open_journal; } sqlite3OsSetFullSync(pPager->jfd, pPager->full_fsync); sqlite3OsSetFullSync(pPager->fd, pPager->full_fsync); sqlite3OsOpenDirectory(pPager->jfd, pPager->zDirectory); pPager->journalOpen = 1; pPager->journalStarted = 0; |
︙ | |||
3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 | 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 | + + + - + + | } } return rc; failed_to_open_journal: sqliteFree(pPager->aInJournal); pPager->aInJournal = 0; #if 0 if( rc==SQLITE_NOMEM ){ /* If this was a malloc() failure, then we will not be closing the pager ** file. So delete any journal file we may have just created. Otherwise, ** the system will get confused, we have a read-lock on the file and a ** mysterious journal has appeared in the filesystem. */ /* sqlite3OsDelete(pPager->zJournal); */ }else{ /* If we reset the pager here, we will delete pages out from under ** various cursors and will ultimately segfault. */ |
︙ |
Changes to test/malloc3.test.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | - + | # #*********************************************************************** # # This file contains tests to ensure that the library handles malloc() failures # correctly. The emphasis of these tests are the _prepare(), _step() and # _finalize() calls. # |
︙ | |||
523 524 525 526 527 528 529 | 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 | - - - - | error "Uneven number of arguments to TEST" } for {set i 0} {$i < $pcstart} {incr i} { set k2 [lindex $arglist [expr 2 * $i]] set v2 [lindex $arglist [expr 2 * $i + 1]] set ac [sqlite3_get_autocommit $::DB] ;# Auto-Commit |
︙ | |||
603 604 605 606 607 608 609 | 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 | - - - - - | incr iFail if {$nac && !$ac} { if {![lindex $v 0]} { error "Statement \"[lindex $v 1]\" caused a rollback" } |