📄 tests
字号:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test055 Basic cursor operations. This test checks basic cursor operations. There are N different scenarios to tests: 1. (no dups) Set cursor, retrieve current. 2. (no dups) Set cursor, retrieve next. 3. (no dups) Set cursor, retrieve prev.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test056 Cursor maintenance during deletes. Check if deleting a key when a cursor is on a duplicate of that key works.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test057 Cursor maintenance during key deletes. Check if we handle the case where we delete a key with the cursor on it and then add the same key. The cursor should not get the new item returned, but the item shouldn't disappear. Run test tests, one where the overwriting put is done with a put and one where it's done with a cursor put.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test058 Verify that deleting and reading duplicates results in correct ordering.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test059 Cursor ops work with a partial length of 0. Make sure that we handle retrieves of zero-length data items correctly. The following ops, should allow a partial data retrieve of 0-length. db_get db_cget FIRST, NEXT, LAST, PREV, CURRENT, SET, SET_RANGE=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test060 Test of the DB_EXCL flag to DB->open(). 1) Attempt to open and create a nonexistent database; verify success. 2) Attempt to reopen it; verify failure.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test061 Test of txn abort and commit for in-memory databases. a) Put + abort: verify absence of data b) Put + commit: verify presence of data c) Overwrite + abort: verify that data is unchanged d) Overwrite + commit: verify that data has changed e) Delete + abort: verify that data is still present f) Delete + commit: verify that data has been deleted=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test062 Test of partial puts (using DB_CURRENT) onto duplicate pages. Insert the first 200 words into the dictionary 200 times each with self as key and <random letter>:self as data. Use partial puts to append self again to data; verify correctness.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test063 Test of the DB_RDONLY flag to DB->open Attempt to both DB->put and DBC->c_put into a database that has been opened DB_RDONLY, and check for failure.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test064 Test of DB->get_type Create a database of type specified by method. Make sure DB->get_type returns the right thing with both a normal and DB_UNKNOWN open.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test065 Test of DB->stat(DB_FASTSTAT)=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test066 Test of cursor overwrites of DB_CURRENT w/ duplicates. Make sure a cursor put to DB_CURRENT acts as an overwrite in a database with duplicates.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test067 Test of DB_CURRENT partial puts onto almost empty duplicate pages, with and without DB_DUP_SORT. Test of DB_CURRENT partial puts on almost-empty duplicate pages. This test was written to address the following issue, #2 in the list of issues relating to bug #0820: 2. DBcursor->put, DB_CURRENT flag, off-page duplicates, hash and btree: In Btree, the DB_CURRENT overwrite of off-page duplicate records first deletes the record and then puts the new one -- this could be a problem if the removal of the record causes a reverse split. Suggested solution is to acquire a cursor to lock down the current record, put a new record after that record, and then delete using the held cursor. It also tests the following, #5 in the same list of issues: 5. DBcursor->put, DB_AFTER/DB_BEFORE/DB_CURRENT flags, DB_DBT_PARTIAL set, duplicate comparison routine specified. The partial change does not change how data items sort, but the record to be put isn't built yet, and that record supplied is the one that's checked for ordering compatibility.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test068 Test of DB_BEFORE and DB_AFTER with partial puts. Make sure DB_BEFORE and DB_AFTER work properly with partial puts, and check that they return EINVAL if DB_DUPSORT is set or if DB_DUP is not.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test069 Test of DB_CURRENT partial puts without duplicates-- test067 w/ small ndups to ensure that partial puts to DB_CURRENT work correctly in the absence of duplicate pages.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test070 Test of DB_CONSUME (Four consumers, 1000 items.) Fork off six processes, four consumers and two producers. The producers will each put 20000 records into a queue; the consumers will each get 10000. Then, verify that no record was lost or retrieved twice.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test071 Test of DB_CONSUME (One consumer, 10000 items.) This is DB Test 70, with one consumer, one producers, and 10000 items.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test072 Test of cursor stability when duplicates are moved off-page.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test073 Test of cursor stability on duplicate pages. Does the following: a. Initialize things by DB->putting ndups dups and setting a reference cursor to point to each. b. c_put ndups dups (and correspondingly expanding the set of reference cursors) after the last one, making sure after each step that all the reference cursors still point to the right item. c. Ditto, but before the first one. d. Ditto, but after each one in sequence first to last. e. Ditto, but after each one in sequence from last to first. occur relative to the new datum) f. Ditto for the two sequence tests, only doing a DBC->c_put(DB_CURRENT) of a larger datum instead of adding a new one.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test074 Test of DB_NEXT_NODUP.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test075 Test of DB->rename(). (formerly test of DB_TRUNCATE cached page invalidation [#1487])=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test076 Test creation of many small databases in a single environment. [#1528].=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test077 Test of DB_GET_RECNO [#1206].=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test078 Test of DBC->c_count(). [#303]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test079 Test of deletes in large trees. (test006 w/ sm. pagesize). Check that delete operations work in large btrees. 10000 entries and a pagesize of 512 push this out to a four-level btree, with a small fraction of the entries going on overflow pages.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test080 Test of DB->remove()=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test081 Test off-page duplicates and overflow pages together with very large keys (key/data as file contents).=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test082 Test of DB_PREV_NODUP (uses test074).=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test083 Test of DB->key_range.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test084 Basic sanity test (test001) with large (64K) pages.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test085 Test of cursor behavior when a cursor is pointing to a deleted btree key which then has duplicates added. [#2473]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test086 Test of cursor stability across btree splits/rsplits with subtransaction aborts (a variant of test048). [#2373]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test087 Test of cursor stability when converting to and modifying off-page duplicate pages with subtransaction aborts. [#2373] Does the following: a. Initialize things by DB->putting ndups dups and setting a reference cursor to point to each. Do each put twice, first aborting, then committing, so we're sure to abort the move to off-page dups at some point. b. c_put ndups dups (and correspondingly expanding the set of reference cursors) after the last one, making sure after each step that all the reference cursors still point to the right item. c. Ditto, but before the first one. d. Ditto, but after each one in sequence first to last. e. Ditto, but after each one in sequence from last to first. occur relative to the new datum) f. Ditto for the two sequence tests, only doing a DBC->c_put(DB_CURRENT) of a larger datum instead of adding a new one.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test088 Test of cursor stability across btree splits with very deep trees (a variant of test048). [#2514]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test089 Concurrent Data Store test (CDB) Enhanced CDB testing to test off-page dups, cursor dups and cursor operations like c_del then c_get.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test090 Test for functionality near the end of the queue using test001.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test091 Test of DB_CONSUME_WAIT.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test092 Test of DB_DIRTY_READ [#3395] We set up a database with nentries in it. We then open the database read-only twice. One with dirty read and one without. We open the database for writing and update some entries in it. Then read those new entries via db->get (clean and dirty), and via cursors (clean and dirty).=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test093 Test using set_bt_compare. Use the first 10,000 entries from the dictionary. Insert each with self as key and data; retrieve each. After all are entered, retrieve all; compare output to original. Close file, reopen, do retrieve and re-verify.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test094 Test using set_dup_compare. Use the first 10,000 entries from the dictionary. Insert each with self as key and data; retrieve each. After all are entered, retrieve all; compare output to original. Close file, reopen, do retrieve and re-verify.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test095 Bulk get test. [#2934]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test096 Db->truncate test.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test097 Open up a large set of database files simultaneously. Adjust for local file descriptor resource limits. Then use the first 1000 entries from the dictionary. Insert each with self as key and a fixed, medium length data string; retrieve each. After all are entered, retrieve all; compare output to original.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test098 Test of DB_GET_RECNO and secondary indices. Open a primary and a secondary, and do a normal cursor get followed by a get_recno. (This is a smoke test for "Bug #1" in [#5811].)=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test099 Test of DB->get and DBC->c_get with set_recno and get_recno. Populate a small btree -recnum database. After all are entered, retrieve each using -recno with DB->get. Open a cursor and do the same for DBC->c_get with set_recno. Verify that set_recno sets the record number position properly. Verify that get_recno returns the correct record numbers.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test100 Test for functionality near the end of the queue using test025 (DB_APPEND).=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=test101 Test for functionality near the end of the queue using test070 (DB_CONSUME).=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=txn001 Begin, commit, abort testing.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=txn002 Verify that read-only transactions do not write log records.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=txn003 Test abort/commit/prepare of txns with outstanding child txns.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=txn004 Test of wraparound txnids (txn001)=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=txn005 Test transaction ID wraparound and recovery.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=txn008 Test of wraparound txnids (txn002)=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=txn009 Test of wraparound txnids (txn003)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -