Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.
|Comment:||Fix a comment in btree.c (CVS 3702)|
|Downloads:||Tarball | ZIP archive | SQL archive|
|Timelines:||family | ancestors | descendants | both | trunk|
|Files:||files | file ages | folders|
|User & Date:||drh 2007-03-19 11:54:10|
|13:53||Fix some problems with test cases in shared_err.test. Also a real bug causing a segfault after an IO error in pager.c. (CVS 3703) check-in: 9f62ef1e user: danielk1977 tags: trunk|
|11:54||Fix a comment in btree.c (CVS 3702) check-in: 05700c11 user: drh tags: trunk|
|11:25||Changes to support medium sector sizes larger than the database page size. (CVS 3701) check-in: 3a3e8eb2 user: danielk1977 tags: trunk|
Changes to src/btree.c.
5 5 ** a legal notice, here is a blessing: 6 6 ** 7 7 ** May you do good and not evil. 8 8 ** May you find forgiveness for yourself and forgive others. 9 9 ** May you share freely, never taking more than you give. 10 10 ** 11 11 ************************************************************************* 12 -** $Id: btree.c,v 1.339 2007/03/19 11:25:20 danielk1977 Exp $ 12 +** $Id: btree.c,v 1.340 2007/03/19 11:54:10 drh Exp $ 13 13 ** 14 14 ** This file implements a external (disk-based) database using BTrees. 15 15 ** For a detailed discussion of BTrees, refer to 16 16 ** 17 17 ** Donald E. Knuth, THE ART OF COMPUTER PROGRAMMING, Volume 3: 18 18 ** "Sorting And Searching", pages 473-480. Addison-Wesley 19 19 ** Publishing Company, Reading, Massachusetts. ................................................................................ 2645 2645 ** If wrFlag==1, then the cursor can be used for reading or for 2646 2646 ** writing if other conditions for writing are also met. These 2647 2647 ** are the conditions that must be met in order for writing to 2648 2648 ** be allowed: 2649 2649 ** 2650 2650 ** 1: The cursor must have been opened with wrFlag==1 2651 2651 ** 2652 -** 2: No other cursors may be open with wrFlag==0 on the same table 2652 +** 2: Other database connections that share the same pager cache 2653 +** but which are not in the READ_UNCOMMITTED state may not have 2654 +** cursors open with wrFlag==0 on the same table. Otherwise 2655 +** the changes made by this write cursor would be visible to 2656 +** the read cursors in the other database connection. 2653 2657 ** 2654 2658 ** 3: The database must be writable (not on read-only media) 2655 2659 ** 2656 2660 ** 4: There must be an active transaction. 2657 2661 ** 2658 -** Condition 2 warrants further discussion. If any cursor is opened 2659 -** on a table with wrFlag==0, that prevents all other cursors from 2660 -** writing to that table. This is a kind of "read-lock". When a cursor 2661 -** is opened with wrFlag==0 it is guaranteed that the table will not 2662 -** change as long as the cursor is open. This allows the cursor to 2663 -** do a sequential scan of the table without having to worry about 2664 -** entries being inserted or deleted during the scan. Cursors should 2665 -** be opened with wrFlag==0 only if this read-lock property is needed. 2666 -** That is to say, cursors should be opened with wrFlag==0 only if they 2667 -** intend to use the sqlite3BtreeNext() system call. All other cursors 2668 -** should be opened with wrFlag==1 even if they never really intend 2669 -** to write. 2670 -** 2671 2662 ** No checking is done to make sure that page iTable really is the 2672 2663 ** root page of a b-tree. If it is not, then the cursor acquired 2673 2664 ** will not work correctly. 2674 2665 ** 2675 2666 ** The comparison function must be logically the same for every cursor 2676 2667 ** on a particular table. Changing the comparison function will result 2677 2668 ** in incorrect operations. If the comparison function is NULL, a